Search in sources :

Example 1 with Button

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);
}
Also used : WizardCallback(org.activityinfo.ui.client.widget.wizard.WizardCallback) Button(com.extjs.gxt.ui.client.widget.button.Button) WizardDialog(org.activityinfo.ui.client.widget.wizard.WizardDialog)

Example 2 with Button

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;
}
Also used : VBoxLayout(com.extjs.gxt.ui.client.widget.layout.VBoxLayout) RowData(com.extjs.gxt.ui.client.widget.layout.RowData) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) Margins(com.extjs.gxt.ui.client.util.Margins) Text(com.extjs.gxt.ui.client.widget.Text) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Example 3 with Button

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();
        }
    });
}
Also used : Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent)

Example 4 with Button

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);
}
Also used : Button(com.extjs.gxt.ui.client.widget.button.Button) SeparatorToolItem(com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem) SeparatorMenuItem(com.extjs.gxt.ui.client.widget.menu.SeparatorMenuItem) MenuItem(com.extjs.gxt.ui.client.widget.menu.MenuItem) Menu(com.extjs.gxt.ui.client.widget.menu.Menu) SeparatorMenuItem(com.extjs.gxt.ui.client.widget.menu.SeparatorMenuItem)

Example 5 with Button

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;
}
Also used : Button(com.extjs.gxt.ui.client.widget.button.Button) SplitButton(com.extjs.gxt.ui.client.widget.button.SplitButton) ToggleButton(com.extjs.gxt.ui.client.widget.button.ToggleButton)

Aggregations

Button (com.extjs.gxt.ui.client.widget.button.Button)14 ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)7 SelectionListener (com.extjs.gxt.ui.client.event.SelectionListener)2 LayoutContainer (com.extjs.gxt.ui.client.widget.LayoutContainer)2 SplitButton (com.extjs.gxt.ui.client.widget.button.SplitButton)2 ToggleButton (com.extjs.gxt.ui.client.widget.button.ToggleButton)2 Margins (com.extjs.gxt.ui.client.util.Margins)1 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)1 Text (com.extjs.gxt.ui.client.widget.Text)1 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)1 FlowLayout (com.extjs.gxt.ui.client.widget.layout.FlowLayout)1 HBoxLayout (com.extjs.gxt.ui.client.widget.layout.HBoxLayout)1 HBoxLayoutData (com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData)1 RowData (com.extjs.gxt.ui.client.widget.layout.RowData)1 VBoxLayout (com.extjs.gxt.ui.client.widget.layout.VBoxLayout)1 Menu (com.extjs.gxt.ui.client.widget.menu.Menu)1 MenuItem (com.extjs.gxt.ui.client.widget.menu.MenuItem)1 SeparatorMenuItem (com.extjs.gxt.ui.client.widget.menu.SeparatorMenuItem)1 SeparatorToolItem (com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem)1 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)1