本文整理了Java中com.extjs.gxt.ui.client.widget.button.Button.<init>()
方法的一些代码示例,展示了Button.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.<init>()
方法的具体详情如下:
包路径:com.extjs.gxt.ui.client.widget.button.Button
类名称:Button
方法名:<init>
[英]Creates a new button.
[中]创建一个新按钮。
代码示例来源: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: bedatadriven/activityinfo
private Button createAddButton(String text, AbstractImagePrototype icon, SelectionListener<ButtonEvent> listener) {
Button button = new Button(text, icon, listener);
button.setIconAlign(IconAlign.TOP);
return button;
}
}
代码示例来源:origin: pl.touk/wonderful-security-lib
protected BaseAssignableGridOfEntities(ArrayList beansToDisplay) {
super(beansToDisplay);
this.setButtonAlign(Style.HorizontalAlignment.CENTER);
this.addButton(new Button("Reset", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
getStore().rejectChanges();
}
}));
saveButton = new Button("Zapisz", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
getStore().commitChanges();
}
});
this.addButton(saveButton);
}
代码示例来源:origin: bedatadriven/activityinfo
private void createCloseButton() {
closeButton = new Button(I18N.CONSTANTS.close());
addButton(closeButton);
closeButton.addListener(Events.Select, new Listener<ButtonEvent>() {
@Override
public void handleEvent(ButtonEvent be) {
hide();
}
});
}
代码示例来源:origin: bedatadriven/activityinfo
/**
* @param actionId The id to be provided to the
* {@link org.activityinfo.ui.client.page.common.toolbar.ActionListener}
* if the button is selected
* @param text Text of the button
* @param icon Icon of the button. See
* {@link org.activityinfo.ui.client.style.legacy.icon.IconImageBundle}
*/
public Button addButton(String actionId, String text, AbstractImagePrototype icon) {
Button button = new Button(text, icon);
button.setItemId(actionId);
button.addListener(Events.Select, this);
add(button);
return button;
}
代码示例来源:origin: com.isotrol.impe3/impe3-gui-common
/**
* Creates a icon "Save and close" button.<br/>
*
* @param listener
* @return the created button
*/
public Button createSaveAndCloseButton(SelectionListener<ButtonEvent> listener) {
Button button = new Button(messages.labelSaveQuit());
button.setIconStyle(styles.iSaveQuit());
button.addSelectionListener(listener);
return button;
}
代码示例来源: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: bedatadriven/activityinfo
private void createRemoveButton() {
if (renderRemoveButton) {
removeButton = new Button(I18N.CONSTANTS.remove(), IconImageBundle.ICONS.delete(),
new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
fireEvent(new RemoveFilterEvent());
}
});
add(removeButton);
setRemoveFilterEnabled(false);
}
}
代码示例来源:origin: bedatadriven/activityinfo
private void createApplyButton() {
if (renderApplyButton) {
applyButton = new Button(I18N.CONSTANTS.apply(), IconImageBundle.ICONS.applyFilter(),
new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
fireEvent(new ApplyFilterEvent());
}
});
add(applyButton);
setApplyFilterEnabled(false);
}
}
代码示例来源: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: 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: 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
@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: 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: pl.touk.tola/tola
public MessagesHistoryPanel() {
Button clearBt = new Button("Wyczyść", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent arg0) {
messagesGrid.getStore().removeAll();
}
});
clearBt.setId("MHPclearBtn");
ToolBar topToolBar = new ToolBar();
topToolBar.add(clearBt);
this.setBottomComponent(topToolBar);
this.setHeading("Komunikaty");
this.setLayout(new FitLayout());
}
代码示例来源: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: 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: 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: bedatadriven/activityinfo
public ReportBar() {
setStyleName(ReportResources.INSTANCE.style().bar());
HBoxLayout layout = new HBoxLayout();
layout.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
layout.setPadding(new Padding(5));
setLayout(layout);
setMonitorWindowResize(true);
addTitle();
switchViewButton = new Button(I18N.CONSTANTS.switchToPageView(), IconImageBundle.ICONS.page());
add(switchViewButton);
dashboardButton = new ToggleButton(I18N.CONSTANTS.pinToDashboard(), IconImageBundle.ICONS.star());
add(dashboardButton);
shareButton = new Button(I18N.CONSTANTS.share(), IconImageBundle.ICONS.group());
add(shareButton);
exportButton = new ExportMenuButton();
add(exportButton);
saveButton = new SaveMenuButton();
add(saveButton);
}
代码示例来源:origin: bedatadriven/activityinfo
TableViewLinkPanel(final ResourceId formId) {
this.panel = new ContentPanel();
panel.setHeaderVisible(false);
panel.setLayout(new CenterLayout());
panel.setBodyStyle("font-family: sans-serif;");
panel.add(new Text(I18N.CONSTANTS.pleaseUseNewDataEntry()));
Button navigate = new Button(I18N.CONSTANTS.tryNewDataEntryInterface());
navigate.setScale(Style.ButtonScale.LARGE);
navigate.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent buttonEvent) {
App3.openNewTable(formId);
}
});
panel.addButton(navigate);
panel.setButtonAlign(Style.HorizontalAlignment.CENTER);
}
内容来源于网络,如有侵权,请联系作者删除!