use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.
the class LayersWidget method createAddLayerButton.
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);
}
use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.
the class ReportViewRetrier method createRetryPanel.
private static ContentPanel createRetryPanel(final Throwable caught, final ClickHandler retryCallback) {
Button retryButton = new Button(I18N.CONSTANTS.retry());
retryButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
if (retryCallback != null) {
retryCallback.onClick(null);
}
}
});
Text label = new Text(ExceptionOracle.getExplanation(caught));
label.setWidth("50%");
VBoxLayout layout = new VBoxLayout(VBoxLayout.VBoxLayoutAlign.CENTER);
ContentPanel panel = new ContentPanel();
panel.setHeaderVisible(false);
panel.setLayout(layout);
panel.add(label, new RowData(1, -1, new Margins(4)));
panel.add(retryButton, new RowData(-1, -1, new Margins(4)));
return panel;
}
use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.
the class MailingListDialog method createCloseButton.
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();
}
});
}
use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.
the class DbEditor method initToolBar.
private void initToolBar() {
toolBar.addSaveButton();
SelectionListener<MenuEvent> listener = new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent ce) {
onNew(ce.getItem().getItemId());
}
};
newMenu = new DbEditorMenu(listener);
Button newButtonMenu = new Button(I18N.CONSTANTS.newText(), IconImageBundle.ICONS.add());
newButtonMenu.setMenu(newMenu.asMenu());
toolBar.add(newButtonMenu);
toolBar.add(new SeparatorMenuItem());
toolBar.addButton(UIActions.EDIT, I18N.CONSTANTS.openFormDesigner(), IconImageBundle.ICONS.edit());
toolBar.addButton(UIActions.OPEN_TABLE, I18N.CONSTANTS.openTable(), IconImageBundle.ICONS.table());
toolBar.addDeleteButton();
toolBar.add(new SeparatorToolItem());
toolBar.addImportButton();
Menu exportMenu = new Menu();
exportMenu.add(new MenuItem("Export complete database (classic)", IconImageBundle.ICONS.excel(), new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent menuEvent) {
exportFullDatabase();
}
}));
exportMenu.add(new MenuItem("Export complete database (beta)", IconImageBundle.ICONS.excel(), new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent menuEvent) {
exportFullDatabaseBeta();
}
}));
exportMenu.add(new SeparatorMenuItem());
exportMenu.add(new MenuItem("Export selected form as XLSForm", IconImageBundle.ICONS.excel(), new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent menuEvent) {
exportFormAsXlsForm();
}
}));
exportMenu.add(new SeparatorMenuItem());
exportMenu.add(new MenuItem("Export audit log", IconImageBundle.ICONS.excel(), new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent menuEvent) {
exportAuditLog();
}
}));
Button exportButton = new Button(I18N.CONSTANTS.export(), IconImageBundle.ICONS.excel());
exportButton.setMenu(exportMenu);
toolBar.add(exportButton);
}
use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.
the class ActionToolBar method addButton.
/**
* @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;
}
Aggregations