• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Button类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.extjs.gxt.ui.client.widget.button.Button的典型用法代码示例。如果您正苦于以下问题:Java Button类的具体用法?Java Button怎么用?Java Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Button类属于com.extjs.gxt.ui.client.widget.button包,在下文中一共展示了Button类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deleteSelected

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
protected void deleteSelected() {
	final List<BaseModel> items = grid.getSelectionModel().getSelectedItems();
	final MessageBox confirm = MessageBox.confirm("Delete", "Delete " + items.size() + " default values", new Listener<WindowEvent>() {

		public void handleEvent(WindowEvent be) {
			 Button btn = be.buttonClicked;  
			 if (btn.getItemId().equals(Dialog.YES)) {
				 // Remove items...
				 for (BaseModel item : items) {
					 store.remove(item);
					 removeModel(item);
				 }
			 }
			 
		}			
	});
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:18,代码来源:MDRTransformDefaultValueTable.java


示例2: performAction

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
@Override
public void performAction(Button button)
{
    MessageBox.confirm(I18nProvider.getMessages().logoutDialogTitle(), I18nProvider.getMessages().logoutDialogMessage(), new Listener<MessageBoxEvent>()
        {

            public void handleEvent(MessageBoxEvent be)
            {
                Button btn = be.getButtonClicked();
                if (btn.getText().equalsIgnoreCase("YES"))
                {
                    Dispatcher.forwardEvent(GeofenceEvents.LOGOUT);
                }
            }
        });
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:17,代码来源:LogoutAction.java


示例3: createFormPanel

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
/**
 * Creates the form panel.
 */
private void createFormPanel()
{
    formPanel = new FormPanel();
    formPanel.setFrame(true);
    formPanel.setHeaderVisible(false);
    formPanel.setAutoHeight(true);

    FieldSet fieldSet = new FieldSet();
    fieldSet.setHeading("Search Management");
    fieldSet.setCheckboxToggle(false);
    fieldSet.setCollapsible(false);

    FormLayout layout = new FormLayout();
    fieldSet.setLayout(layout);

    search = new Button("Search", new SelectionListener<ButtonEvent>()
            {

                @Override
                public void componentSelected(ButtonEvent ce)
                {
                    Dispatcher.forwardEvent(GeofenceEvents.SHOW_SEARCH_USER_WIDGET);
                }
            });

    ButtonBar bar = new ButtonBar();
    bar.setAlignment(HorizontalAlignment.CENTER);

    bar.add(search);

    Button p = new Button("get AOIs");

    Button q = new Button("get Features");

    bar.add(p);
    bar.add(q);

    fieldSet.add(bar);

    formPanel.add(fieldSet);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:45,代码来源:UserSearchComponent.java


示例4: categoryElementToolBar

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
private ToolBar categoryElementToolBar() {
	ToolBar toolbar = new ToolBar();

	name = new TextField<String>();
	name.setAllowBlank(false);
	toolbar.add(name);

	colorField = new ColorField();
	colorField.setAllowBlank(false);
	colorField.setValue("FAAD63");
	colorField.setEditable(true);
	toolbar.add(colorField);

	addCategoryElementButton = new Button(I18N.CONSTANTS.addItem(), IconImageBundle.ICONS.add());
	addCategoryElementButton.disable();

	toolbar.add(addCategoryElementButton);

	deleteCategoryElementButton = new Button(I18N.CONSTANTS.delete(), IconImageBundle.ICONS.delete());

	toolbar.add(deleteCategoryElementButton);
	return toolbar;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:24,代码来源:CategoriesAdminView.java


示例5: importationSchemeModelToolBar

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
private Component importationSchemeModelToolBar() {

		// Add button.
		addImportationSchemeModelButton = new Button(I18N.CONSTANTS.addItem(), IconImageBundle.ICONS.add());

		// Delete button.
		deleteImportationSchemeModelButton = new Button(I18N.CONSTANTS.delete(), IconImageBundle.ICONS.delete());
		deleteImportationSchemeModelButton.disable();
		
		// Building the tool bar.
		final ToolBar toolbar = new ToolBar();
		toolbar.add(addImportationSchemeModelButton);
		toolbar.add(deleteImportationSchemeModelButton);

		return toolbar;

	}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:18,代码来源:ImportationSchemeModelsAdminView.java


示例6: variableFlexibleElementToolBar

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
private Component variableFlexibleElementToolBar() {

		// Add button.
		addVariableFlexibleElementButton = new Button(I18N.CONSTANTS.addItem(), IconImageBundle.ICONS.add());
		addVariableFlexibleElementButton.disable();

		// Delete button.
		deleteVariableFlexibleElementButton = new Button(I18N.CONSTANTS.delete(), IconImageBundle.ICONS.delete());
		deleteVariableFlexibleElementButton.disable();

		// Building the tool bar.
		final ToolBar toolbar = new ToolBar();
		toolbar.add(addVariableFlexibleElementButton);
		toolbar.add(deleteVariableFlexibleElementButton);

		return toolbar;
	}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:18,代码来源:ImportationSchemeModelsAdminView.java


示例7: PasswordAccessAuditDialog

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
public PasswordAccessAuditDialog(Password password)
{
    this.setSize("350", "460");
    this.setHeading(textMessages.passwordAccessAuditLog());
    VBoxLayout boxLayout = new VBoxLayout();
    boxLayout.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
    this.setLayout(boxLayout);
    this.setModal(true);
    this.setResizable(false);
    
    gridStore = new ListStore<PasswordAccessAuditData>();
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    ColumnConfig columnConfigDate = new ColumnConfig(Constants.DATE, textMessages.dateAccessed(), 130);
    columnConfigDate.setDateTimeFormat(DateTimeFormat.getFormat(textMessages.displayDateFormat()));
    configs.add(columnConfigDate);
    ColumnConfig columnConfigUser = new ColumnConfig(Constants.USER, textMessages.userAccessed(), 160);
    configs.add(columnConfigUser);
    
    Grid<PasswordAccessAuditData> grid = new Grid<PasswordAccessAuditData>(gridStore, new ColumnModel(configs));
    grid.setStripeRows(true);
    add(grid);
    grid.setSize("320px", "390px");
    grid.setBorders(true);
    
    Button closeButton = new Button(textMessages.close(), new SelectionListener<ButtonEvent>() {
        @Override
        public void componentSelected(ButtonEvent ce) {
            doClose();
        }
    });
    
    setButtonAlign(HorizontalAlignment.CENTER);
    addButton(closeButton);
    
    loadAccessAuditData(password.getId());
}
 
开发者ID:alfameCom,项目名称:salasanasiilo,代码行数:37,代码来源:PasswordAccessAuditDialog.java


示例8: categoryTypeToolBar

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
/**
 * Build the Category ToolBar
 * 
 * @return ToolBar
 */
private ToolBar categoryTypeToolBar() {
	ToolBar toolbar = new ToolBar();

	categoryIcon = new SimpleComboBox<String>();
	categoryIcon.setFieldLabel(I18N.CONSTANTS.adminCategoryTypeIcon());
	categoryIcon.setWidth(75);
	categoryIcon.setEditable(false);
	categoryIcon.setAllowBlank(false);
	categoryIcon.setTriggerAction(TriggerAction.ALL);
	List<String> values = new ArrayList<String>();
	for (CategoryIcon e : CategoryIcon.values()) {
		values.add(CategoryIcon.getName(e));
	}
	categoryIcon.add(values);

	toolbar.add(categoryIcon);

	categoryName = new TextField<String>();
	categoryName.setFieldLabel(I18N.CONSTANTS.adminCategoryTypeName());
	toolbar.add(categoryName);

	addCategoryTypeButton = new Button(I18N.CONSTANTS.addItem(), IconImageBundle.ICONS.add());
	toolbar.add(addCategoryTypeButton);

	deleteCategoryTypeButton = new Button(I18N.CONSTANTS.delete(), IconImageBundle.ICONS.delete());
	toolbar.add(deleteCategoryTypeButton);

	ImportCategoryTypeButton = new Button(I18N.CONSTANTS.importItem(), IconImageBundle.ICONS.up());

	toolbar.add(ImportCategoryTypeButton);

	return toolbar;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:39,代码来源:CategoriesAdminView.java


示例9: reportSectionToolBar

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
/**
 * build Report Model Sections ToolBar
 * 
 * @return ToolBar
 */
private ToolBar reportSectionToolBar() {

	ToolBar toolbar = new ToolBar();

	addReportSectionButton = new Button(I18N.CONSTANTS.addItem(), IconImageBundle.ICONS.add());
	addReportSectionButton.disable();
	toolbar.add(addReportSectionButton);

	saveReportSectionButton = new Button(I18N.CONSTANTS.save(), IconImageBundle.ICONS.save());
	saveReportSectionButton.disable();
	toolbar.add(saveReportSectionButton);

	return toolbar;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:20,代码来源:ReportModelsAdminView.java


示例10: onButtonPressed

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void onButtonPressed(Button button) {
	if (button.getItemId().equals(OK)) {
		callback.onOk(indicatorLink.getValue());
	}
	hide();
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:11,代码来源:ConfirmPasteDialog.java


示例11: addToolbarButton

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
public void addToolbarButton(final Button button) {

		if (button == null) {
			return;
		}

		toolbar.add(new SeparatorToolItem());
		toolbar.add(button);
	}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:10,代码来源:OrgUnitTreeGrid.java


示例12: doValidate

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
private void doValidate() {
	if (fileName.isValid()) {
		final MessageBox saveInfo = MessageBox.wait("Progress",  
	             "Validate your data, please wait...", "Validate..."); 
		
		final ContentFile file = new ContentFile();
		if (modelRoot != null) {
			file.setPath(modelRoot + "/" + fileName.getValue());
		} else {
			file.setPath(fileName.getValue());
		}
		
		ContentServiceFactory.get().stat(file, new AsyncCallback<ContentData>() {

			public void onFailure(Throwable caught) {
				
			}

			public void onSuccess(final ContentData result) {
				saveInfo.hide();
				boolean isDir = result.get("isDirectory", false);
				if (isDir) {
					MessageBox.alert("Problem", file.getPath() + " is a directory!", null).show();
					return;
				}
				boolean exists = result.get("exists", false);
				if (exists) {
					
					MessageBox.confirm("File exists", "File " + result.getPath() + " exists!<br>Overwrite?", new Listener<WindowEvent>() {  
						public void handleEvent(WindowEvent ce) {
							Dialog dialog = (Dialog) ce.component;  
							Button btn = dialog.getButtonPressed();  
							if (btn.getItemId().equals(Dialog.YES)) {
								doSave(result);
							}
						}
					}); 
					return;
				}
				
				// Save it.
				doSave(result);
			}
		});
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:47,代码来源:CMDBModelSaveWindow.java


示例13: doDelete

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
protected void doDelete(final boolean verify) {
	String message = "Verify deleting your data, please wait...";
	String prgText = "Verifing..."; 
	if (!verify) {
		message = "Deleting your data, please wait...";
		prgText = "Deleting..."; 
	}
	final MessageBox saveInfo = MessageBox.wait("Progress",  
             message, prgText); 
	SaveDeleteRequest req = new SaveDeleteRequest();
	req.setTemplates(templateStore.getModels());
	req.setReferences(referenceStore.getModels());
	req.setVerify(verify);
	ModelServiceFactory.get().delete(CMDBSession.get().getToken(), mdr, req, new AsyncCallback<SaveResponse>() {

		public void onFailure(Throwable caught) {
			saveInfo.close();
			ExceptionErrorDialog.showError("Can't delete!", caught);
		}

		public void onSuccess(SaveResponse result) {
			saveInfo.close();
			if (verify) {
				MessageBox.confirm("Confirm", "Delete " + 
						result.getTemplateCIs() + 
						" templates and " + 
						result.getInstanceCIs() + 
						" instances!" + 
						"<br>Are you sure?", new Listener<WindowEvent>() {
					
					public void handleEvent(WindowEvent ce) {
						Dialog dialog = (Dialog) ce.component;  
						Button btn = dialog.getButtonPressed();  
						if (btn.getItemId().equals(Dialog.YES)) {
							doDelete(false);
						}
					}
				}); 
			} else {
				
				if (result.isFailed()) {
					MessageBox.alert("Can't delete", result.getFailedCause(), null).show();
				} else {
					MessageBox.alert("Model Deleted", "CI's delete." + 
						"<br>" + result.getTemplateCIs() + " Templates deleted" + 
						"<br>" + result.getInstanceCIs() + " Instances deleted", null).show();
				}
			}
		}
	});
	
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:53,代码来源:CMDBModelClearWindow.java


示例14: getRemoveSelection

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
private SelectionListener getRemoveSelection() {
	SelectionListener selection = new SelectionListener<ComponentEvent>() {  
		public void componentSelected(ComponentEvent ce) {

			final MessageBox box = MessageBox.confirm("Delete template " + modelBase.getAlias(), "Are you sure ?", new Listener<WindowEvent>() {  
				public void handleEvent(WindowEvent be) {
					Dialog dialog = (Dialog) be.component;  
					Button btn = dialog.getButtonPressed();  
					if (!btn.getItemId().equals(Dialog.YES)) {
						return;
					}
					List<CIModel> base = new ArrayList<CIModel>();
					List<CIModel> local = new ArrayList<CIModel>();
					base.add(modelBase);
					// Call create.
					final MessageBox deleteInfo = MessageBox.wait("Progress",  
							"Delete, please wait...", "Deleting...");  

					ModelServiceFactory.get().store(mdr, CMDBSession.get().getToken(), local, base, new AsyncCallback<StoreResult>() {

						public void onFailure(Throwable caught) {
							deleteInfo.close();
							ExceptionErrorDialog.showError("Can't Delete", caught);
							//loader.load();
						}

						public void onSuccess(StoreResult result) {
							deleteInfo.close();

							if (result.isRejected()) {
								MessageBox.alert("Delete Failed", result.getRejectCause(), null);
								return;
							}
							
							center.removeAll();
							center.setHeading("");
							// TODO: Check errors on storeResult...
							TreeItem parent = currentTreeItem.getParentItem();
							if (parent == null) {
								browser.reload();
								return;
							}
							if (parent.getModel() instanceof CIModel) {
								browser.reloadChildren((CIModel)parent.getModel());
							}
						}

					});
				}  
			});  
		}
	};
	return(selection);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:55,代码来源:CIModelInternalBrowser.java


示例15: performAction

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
@Override
public void performAction(Button button)
{
    Dispatcher.forwardEvent(GeofenceEvents.SAVE);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:6,代码来源:SaveAction.java


示例16: performAction

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
@Override
public void performAction(Button button)
{
    Dispatcher.forwardEvent(GeofenceEvents.SHOW_UPLOAD_WIDGET);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:6,代码来源:UploadAction.java


示例17: performAction

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
@Override
public void performAction(Button button)
{
    Dispatcher.forwardEvent(GeofenceEvents.DELETE_CONTENT);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:6,代码来源:DeleteContentAction.java


示例18: editRuleButton

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
/**
 * Edits the rule button.
 * 
 * @return the grid cell renderer
 */
private GridCellRenderer<RuleModel> editRuleButton() {
	buttonRendered = new GridCellRenderer<RuleModel>() {

		private boolean init;

		public Object render(final RuleModel model, String property,
				ColumnData config, int rowIndex, int colIndex,
				ListStore<RuleModel> store, final Grid<RuleModel> grid) {

			if (!init) {
				init = true;
				grid.addListener(Events.ColumnResize,
						new Listener<GridEvent<RuleModel>>() {

							public void handleEvent(GridEvent<RuleModel> be) {
								for (int i = 0; i < be.getGrid().getStore()
										.getCount(); i++) {
									if ((be.getGrid().getView()
											.getWidget(i, be.getColIndex()) != null)
											&& (be.getGrid()
													.getView()
													.getWidget(
															i,
															be.getColIndex()) instanceof BoxComponent)) {
										((BoxComponent) be
												.getGrid()
												.getView()
												.getWidget(i,
														be.getColIndex()))
												.setWidth(be.getWidth() - 10);
									}
								}
							}
						});
			}

			// TODO: generalize this!
			Button ruleDetailsButton = new Button("Edit rule");
			ruleDetailsButton.setIcon(Resources.ICONS.table());
			// TODO: add correct tooltip text here!
			ruleDetailsButton.setToolTip("Edit this rule");
			ruleDetailsButton.setEnabled(true);

			ruleDetailsButton.addListener(Events.OnClick,
					new Listener<ButtonEvent>() {

						public void handleEvent(ButtonEvent be) {
							Dispatcher.forwardEvent(
									GeofenceEvents.EDIT_RULE_UPDATE,
									new GridStatus(grid, model));
						}
					});

			return ruleDetailsButton;
		}

	};

	return buttonRendered;
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:66,代码来源:RuleGridWidget.java


示例19: createToolbar

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
/**
 * Creates the toolbar of this component.
 * 
 * @param enabled
 *          <code>true</code> to enable the buttons of this toolbar, <code>false</code> to disable them.
 * @return A new toolbar.
 */
private ToolBar createToolbar(final ListStore<ReportReference> store) {
	final ToolBar toolbar = new ToolBar();

	// Creating buttons
	final Button createReportButton = new Button(I18N.CONSTANTS.reportCreateReport(), IconImageBundle.ICONS.add());

	// "Create" button action
	createReportButton.addSelectionListener(new SelectionListener<ButtonEvent>() {

		@Override
		public void componentSelected(ButtonEvent ce) {
			MessageBox.prompt(I18N.CONSTANTS.reportCreateReport(), I18N.CONSTANTS.reportName(), new Listener<MessageBoxEvent>() {

				@Override
				public void handleEvent(MessageBoxEvent be) {
					if (Dialog.OK.equals(be.getButtonClicked().getItemId())) {
						final String name = be.getValue();

						final HashMap<String, Serializable> properties = new HashMap<String, Serializable>();
						properties.put("name", name);
						properties.put("flexibleElementId", getId());
						properties.put("reportModelId", getModelId());
						properties.put("containerId", currentContainerDTO.getId());
						if (currentContainerDTO instanceof ProjectDTO)
							properties.put("projectId", currentContainerDTO.getId());

						if (currentContainerDTO instanceof OrgUnitDTO)
							properties.put("orgUnitId", currentContainerDTO.getId());

						properties.put("multiple", true);

						if (currentContainerDTO instanceof ProjectDTO)
							properties.put("phaseName", ((ProjectDTO) currentContainerDTO).getCurrentPhase().getPhaseModel().getName());

						if (currentContainerDTO instanceof OrgUnitDTO)
							properties.put("phaseName", null);

						dispatch.execute(new CreateEntity(ProjectReportDTO.ENTITY_NAME, properties), new CommandResultHandler<CreateResult>() {

							@Override
							public void onCommandFailure(final Throwable caught) {
								N10N.error(I18N.CONSTANTS.projectTabReports(), I18N.CONSTANTS.reportCreateError());
							}

							@Override
							public void onCommandSuccess(final CreateResult result) {

								final ProjectReportDTO createdProjetReport = (ProjectReportDTO) result.getEntity();

								final ReportReference reference = new ReportReference();
								reference.setId(createdProjetReport.getId());
								reference.setName(name);
								reference.setLastEditDate(new Date());
								reference.setEditorName(auth().getUserShortName());
								store.add(reference);

								N10N.validNotif(I18N.CONSTANTS.projectTabReports(), I18N.CONSTANTS.reportCreateSuccess());
							}

						});
					}
				}
			});
		}
	});

	// Adding buttons to the toolbar
	toolbar.add(createReportButton);

	return toolbar;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:79,代码来源:ReportListElementDTO.java


示例20: getNewSiteButton

import com.extjs.gxt.ui.client.widget.button.Button; //导入依赖的package包/类
public Button getNewSiteButton() {
	return newSiteButton;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:4,代码来源:SiteGridPanel.java



注:本文中的com.extjs.gxt.ui.client.widget.button.Button类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PaletteViewerProvider类代码示例发布时间:2022-05-22
下一篇:
Java Mnemonics类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap