当前位置: 首页>>代码示例>>Java>>正文


Java Button类代码示例

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


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


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