Search in sources :

Example 11 with Button

use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.

the class FilterToolBar method createRemoveButton.

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

Example 12 with Button

use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.

the class ActionToolBar method setDirty.

public void setDirty(boolean dirty) {
    Button currentSaveButton = getSaveButton();
    if (currentSaveButton != null) {
        currentSaveButton.setEnabled(dirty);
        if (dirty) {
            currentSaveButton.setText(I18N.CONSTANTS.save());
            currentSaveButton.setIcon(IconImageBundle.ICONS.save());
        } else {
            currentSaveButton.setText(I18N.CONSTANTS.saved());
        }
    }
}
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)

Example 13 with Button

use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.

the class FormDialogImpl method createCancelButton.

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

Example 14 with Button

use of com.extjs.gxt.ui.client.widget.button.Button in project activityinfo by bedatadriven.

the class FormDialogImpl method createSaveButton.

private void createSaveButton() {
    saveButton = new Button(I18N.CONSTANTS.save());
    saveButton.setIcon(IconImageBundle.ICONS.save());
    saveButton.addListener(Events.Select, new Listener<ButtonEvent>() {

        @Override
        public void handleEvent(ButtonEvent be) {
            // use a deferred handler to make sure we get any change
            // events first
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                @Override
                public void execute() {
                    if (!form.isValid()) {
                        MessageBox.alert(getHeadingHtml(), fromSafeConstant(I18N.CONSTANTS.pleaseCompleteForm()), null);
                    } else {
                        onValidated();
                    }
                }
            });
        }
    });
    addButton(saveButton);
}
Also used : ScheduledCommand(com.google.gwt.core.client.Scheduler.ScheduledCommand) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent)

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