本文整理了Java中com.extjs.gxt.ui.client.widget.button.Button
类的一些代码示例,展示了Button
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button
类的具体详情如下:
包路径:com.extjs.gxt.ui.client.widget.button.Button
类名称:Button
[英]A button component. Events:BeforeSelect : ButtonEvent(button, event)
Fires before this button is selected.
Fires when this button is selected.
If this button has a menu, this event fires when it is shown.
If this button has a menu, this event fires when it is hidden.
代码示例来源:origin: com.isotrol.impe3/impe3-gui-common
/**
* Creates a "Save" button.<br/>
*
* @param listener
* @return the created button
*/
public Button createSaveButton(SelectionListener<ButtonEvent> listener) {
Button button = new Button(messages.labelSave());
button.setIconStyle(styles.iSave());
button.addSelectionListener(listener);
return button;
}
代码示例来源:origin: pl.touk/wonderful-security-lib
@Override
protected Component constructTopComponent() {
ToolBar toolbar = new ToolBar();
Button addNewRole = new Button("Dodaj nową rolę");
addNewRole.setIconStyle("icon-add");
addNewRole.addSelectionListener(new SelectionListener<ButtonEvent>(){
@Override
public void componentSelected(ButtonEvent ce) {
Dispatcher.get().dispatch(WsEvents.CREATE_NEW_ROLE);
}
});
addNewRole.setEnabled(ClientSecurity.hasPermission(WsecPermission.WSEC_ADD_ROLE_BTN));
toolbar.add( addNewRole);
return toolbar;
}
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public void componentSelected(ButtonEvent ce) {
finishButton.disable();
if (validateSections()) {
saveLocation();
} else {
finishButton.enable();
}
}
});
代码示例来源:origin: pl.touk.top/file-upload-gwtclient-lib
private void createDeleteButton() {
deleteButton = new Button("Usun plik");
deleteButton.addListener(Events.OnClick, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent baseEvent) {
displayDeleteConfirmationBox();
}
});
}
代码示例来源:origin: geoserver/geofence
/**
* Disable save button.
*/
public void disableSaveButton()
{
if (this.saveUserDetailsButton.isEnabled())
{
this.saveUserDetailsButton.disable();
}
}
代码示例来源:origin: geoserver/geofence
/**
* Enable save button.
*/
public void enableSaveButton()
{
if (!this.saveLayerDetailsButton.isEnabled())
{
this.saveLayerDetailsButton.enable();
}
}
代码示例来源:origin: geoserver/geofence
Button removeButton = new Button();
removeButton.setBorders(false);
removeButton.setIcon(Resources.ICONS.delete());
removeButton.setEnabled(true);
removeButton.addListener(Events.OnClick, new Listener<ButtonEvent>()
代码示例来源:origin: bedatadriven/activityinfo
private void createCancelButton() {
cancelButton = new Button(I18N.CONSTANTS.cancel());
cancelButton.setIcon(IconImageBundle.ICONS.cancel());
addButton(cancelButton);
cancelButton.addListener(Events.Select, new Listener<ButtonEvent>() {
@Override
public void handleEvent(ButtonEvent be) {
hide();
onCancel();
}
});
}
代码示例来源:origin: geoserver/geofence
Button ruleDetailsButton = new Button("Edit rule");
ruleDetailsButton.setIcon(Resources.ICONS.table());
ruleDetailsButton.setToolTip("Edit this rule");
ruleDetailsButton.setEnabled(true);
ruleDetailsButton.addListener(Events.OnClick,
new Listener<ButtonEvent>() {
代码示例来源:origin: com.extjs/gxt
protected Button createButton(AbstractImagePrototype icon, final String tt, String toolTipTitle) {
Button item = new Button() {
@Override
protected void afterRender() {
super.afterRender();
if (GXT.isAriaEnabled()) buttonEl.dom.setTitle(tt);
}
};
item.setIcon(icon);
item.setTabIndex(-1);
ToolTipConfig cfg = new ToolTipConfig(toolTipTitle, tt);
item.setToolTip(cfg);
if (GXT.isAriaEnabled()) {
item.setData("gxt-menutext", toolTipTitle);
}
item.addSelectionListener(btnListener);
return item;
}
代码示例来源:origin: com.isotrol.impe3/impe3-gui-common
/**
* Creates a generic Button for the specified params.<br/> Does not add it to any container.<br/>
* @param label text to display on the button
* @param tooltip tooltip shown when hovering the button. May be <code>null</code>
* @param style the button style. May be <code>null</code>
* @param listener button selection listener. May be <code>null</code>
* @return
*/
public Button createGenericButton(String label, String tooltip, String style,
SelectionListener<ButtonEvent> listener) {
Button b = new Button(label);
if (!Util.emptyString(tooltip)) {
b.setToolTip(tooltip);
}
if (style != null) {
b.setIconStyle(style);
}
if (listener != null) {
b.addSelectionListener(listener);
}
return b;
}
代码示例来源:origin: pl.touk/wonderful-security-lib
@Override
protected Component constructTopComponent() {
ToolBar toolbar = new ToolBar();
Button addNewGroup = new Button("Dodaj nową grupę");
addNewGroup.setStyleName("icon-add");
addNewGroup.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
Dispatcher.get().dispatch(CREATE_NEW_GROUP);
}
});
addNewGroup.setEnabled(ClientSecurity.hasPermission(WsecPermission.WSEC_ADD_GRP_BTN));
toolbar.add(addNewGroup);
return toolbar;
}
代码示例来源:origin: geoserver/geofence
reset = new Button(I18nProvider.getMessages().resetLabel());
reset.setIconStyle("x-geofence-reset");
reset.addSelectionListener(new SelectionListener<ButtonEvent>()
login = new Button(I18nProvider.getMessages().loginLabel());
login.setIconStyle("x-geofence-login");
login.disable();
login.addSelectionListener(new SelectionListener<ButtonEvent>()
代码示例来源:origin: bedatadriven/activityinfo
private void createAddLayerButton() {
Button addLayerButton = new Button();
addLayerButton.setText(I18N.CONSTANTS.add());
addLayerButton.addListener(Events.Select, new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final NewLayerWizard wizard = new NewLayerWizard(service, locator);
addLayersDialog = new WizardDialog(wizard);
addLayersDialog.show(new WizardCallback() {
@Override
public void onFinished() {
addLayer(wizard.createLayer());
}
});
}
});
addLayerButton.setIcon(IconImageBundle.ICONS.add());
layersPanel.getHeader().addTool(addLayerButton);
}
代码示例来源:origin: bedatadriven/activityinfo
public void setPrintEnabled(boolean enabled) {
if (printButton != null) {
printButton.setEnabled(enabled);
}
}
代码示例来源:origin: com.extjs/gxt
protected Button createColorButton(AbstractImagePrototype icon, String toolTip, String toolTipTitle,
Listener<ComponentEvent> listener) {
Button item = new Button();
item.setIcon(icon);
item.setTabIndex(-1);
ToolTipConfig cfg = new ToolTipConfig(toolTipTitle, toolTip);
item.setToolTip(cfg);
if (GXT.isAriaEnabled()) {
item.setData("gxt-menutext", toolTipTitle);
}
ColorMenu menu = new ColorMenu();
menu.getColorPalette().addListener(Events.Select, listener);
item.setMenu(menu);
return item;
}
代码示例来源:origin: geoserver/geofence
this.saveLayerDetailsButton = new Button("Save");
saveLayerDetailsButton.setIcon(Resources.ICONS.save());
saveLayerDetailsButton.disable();
saveLayerDetailsButton.addListener(Events.OnClick, new Listener<ButtonEvent>()
cancelButton = new Button("Cancel");
cancelButton.addListener(Events.OnClick, new Listener<ButtonEvent>()
代码示例来源:origin: bedatadriven/activityinfo
@Override
protected void createButtons() {
button = new Button();
button.setText(I18N.CONSTANTS.cancel());
button.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
ExportDialog.this.canceled = true;
bar.reset();
hide();
}
});
getButtonBar().add(button);
}
代码示例来源:origin: pl.touk/wonderful-security-lib
Button addNewUser = new Button("Dodaj nowego użytkownika");
addNewUser.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
Dispatcher.get().dispatch(WsEvents.CREATE_NEW_USER);
addNewUser.setEnabled(ClientSecurity.hasPermission(WsecPermission.WSEC_ADD_USR_BTN));
tb.add(addNewUser);
代码示例来源:origin: com.extjs/gxt
setFocusWidget(null);
if (buttons.indexOf(OK) != -1) {
Button okBtn = new Button(okText);
okBtn.setItemId(OK);
okBtn.addSelectionListener(l);
setFocusWidget(okBtn);
addButton(okBtn);
Button yesBtn = new Button(yesText);
yesBtn.setItemId(YES);
yesBtn.addSelectionListener(l);
setFocusWidget(yesBtn);
addButton(yesBtn);
Button noBtn = new Button(noText);
noBtn.setItemId(NO);
noBtn.addSelectionListener(l);
setFocusWidget(noBtn);
addButton(noBtn);
Button cancelBtn = new Button(cancelText);
cancelBtn.setItemId(CANCEL);
cancelBtn.addSelectionListener(l);
setFocusWidget(cancelBtn);
addButton(cancelBtn);
Button closeBtn = new Button(closeText);
closeBtn.setItemId(CLOSE);
closeBtn.addSelectionListener(l);
内容来源于网络,如有侵权,请联系作者删除!