Search in sources :

Example 1 with GPSecureButton

use of org.geosdi.geoplatform.gui.action.button.GPSecureButton in project geo-platform by geosdi.

the class CSWServerPaginationContainer method createButtons.

private void createButtons() {
    super.panel.setButtonAlign(Style.HorizontalAlignment.CENTER);
    GPSecureButton newServerButton = new GPSecureButton(CatalogFinderConstants.INSTANCE.CSWServerPaginationContainer_newServerButtonText(), new AddServerAction(GPTrustedLevel.NONE, this.serverForm));
    newServerButton.setIcon(AbstractImagePrototype.create(BasicWidgetResources.ICONS.done()));
    newServerButton.setToolTip(CatalogFinderConstants.INSTANCE.CSWServerPaginationContainer_newServerButtonTooltipText());
    super.panel.addButton(newServerButton);
    deleteServerButton = new GPSecureButton(CatalogFinderConstants.INSTANCE.CSWServerPaginationContainer_deleteServerButtonText(), new DeleteServerAction(GPTrustedLevel.HIGH, this));
    deleteServerButton.setIcon(AbstractImagePrototype.create(BasicWidgetResources.ICONS.delete()));
    deleteServerButton.setToolTip(CatalogFinderConstants.INSTANCE.CSWServerPaginationContainer_deleteServerButtonTooltipText());
    super.panel.addButton(deleteServerButton);
    deleteServerButton.disable();
}
Also used : DeleteServerAction(org.geosdi.geoplatform.gui.client.action.server.DeleteServerAction) AddServerAction(org.geosdi.geoplatform.gui.client.action.server.AddServerAction) GPSecureButton(org.geosdi.geoplatform.gui.action.button.GPSecureButton)

Example 2 with GPSecureButton

use of org.geosdi.geoplatform.gui.action.button.GPSecureButton in project geo-platform by geosdi.

the class ViewportGridFieldSet method addComponents.

@Override
public void addComponents() {
    store.addStoreListener(new StoreListener<GPClientViewport>() {

        @Override
        public void storeUpdate(StoreEvent<GPClientViewport> se) {
            super.storeUpdate(se);
            ViewportGridFieldSet.this.saveButton.enable();
        }
    });
    this.add(createViewportFilter());
    this.add(this.generateGrid(), new FormData("100%"));
    ButtonBar buttonBar = new ButtonBar();
    Button addEntryButton = new Button(MapModuleConstants.INSTANCE.ViewportGridFieldSet_buttonAddViewportText(), AbstractImagePrototype.create(BasicWidgetResources.ICONS.done()), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            ViewportGridFieldSet.this.store.add(ViewportUtility.generateViewportFromMap(map));
            viewportGrid.startEditing(store.getCount() - 1, 1);
            ViewportGridFieldSet.this.saveButton.enable();
        }
    });
    buttonBar.add(addEntryButton);
    this.deleteViewportButton = new Button(MapModuleConstants.INSTANCE.ViewportGridFieldSet_buttonDeleteViewportText(), AbstractImagePrototype.create(BasicWidgetResources.ICONS.delete()), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            final List<GPClientViewport> viewportList = viewportGrid.getSelectionModel().getSelectedItems();
            if (viewportList != null) {
                GeoPlatformMessage.confirmMessage(MapModuleConstants.INSTANCE.ViewportGridFieldSet_confirmDeleteViewportTitleText(), MapModuleConstants.INSTANCE.ViewportGridFieldSet_confirmDeleteViewportBodyText(), new Listener<MessageBoxEvent>() {

                    @Override
                    public void handleEvent(MessageBoxEvent be) {
                        if (Dialog.YES.equals(be.getButtonClicked().getItemId())) {
                            for (GPClientViewport viewport : viewportList) {
                                store.remove(viewport);
                                ViewportGridFieldSet.this.saveButton.enable();
                            }
                        }
                    }
                });
            }
        }
    });
    deleteViewportButton.setEnabled(Boolean.FALSE);
    buttonBar.add(deleteViewportButton);
    this.gotoViewportButton = new Button(MapModuleConstants.INSTANCE.ViewportGridFieldSet_buttonGoToViewportText(), AbstractImagePrototype.create(BasicWidgetResources.ICONS.gotoXY()), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            final List<GPClientViewport> viewportList = viewportGrid.getSelectionModel().getSelectedItems();
            if (viewportList != null && viewportList.size() == 1) {
                ViewportUtility.gotoViewportLocation(map, viewportList.get(0));
            } else {
                GeoPlatformMessage.alertMessage(MapModuleConstants.INSTANCE.ViewportGridFieldSet_singleSelectionAlertTitleText(), MapModuleConstants.INSTANCE.ViewportGridFieldSet_singleSelectionAlertBodyText());
            }
        }
    });
    gotoViewportButton.setEnabled(Boolean.FALSE);
    buttonBar.add(gotoViewportButton);
    this.setDefaultViewportButton = new Button(ButtonsConstants.INSTANCE.setDefautlText(), AbstractImagePrototype.create(BasicWidgetResources.ICONS.select()), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            final List<GPClientViewport> viewportList = viewportGrid.getSelectionModel().getSelectedItems();
            if (viewportList != null && viewportList.size() == 1) {
                GPClientViewport selectedViewport = viewportList.get(0);
                for (GPClientViewport viewport : ViewportGridFieldSet.this.store.getModels()) {
                    if (viewport.isDefault()) {
                        viewport.set(ViewportEnum.IS_DEFAULT.toString(), Boolean.FALSE);
                        store.update(viewport);
                    } else if (selectedViewport.equals(viewport)) {
                        viewport.set(ViewportEnum.IS_DEFAULT.toString(), Boolean.TRUE);
                        store.update(viewport);
                    }
                }
            } else {
                GeoPlatformMessage.alertMessage(MapModuleConstants.INSTANCE.ViewportGridFieldSet_setDefaultViewportAlertTitleText(), MapModuleConstants.INSTANCE.ViewportGridFieldSet_singleSelectionAlertBodyText());
            }
        }
    });
    setDefaultViewportButton.setEnabled(Boolean.FALSE);
    buttonBar.add(setDefaultViewportButton);
    SaveViewportAction saveViewportAction = new SaveViewportAction(GPTrustedLevel.LOW, this.store);
    this.saveButton = new GPSecureButton(ButtonsConstants.INSTANCE.saveText(), AbstractImagePrototype.create(BasicWidgetResources.ICONS.save()), saveViewportAction);
    buttonBar.add(this.saveButton);
    this.add(buttonBar, new FormData("100%"));
}
Also used : FormData(com.extjs.gxt.ui.client.widget.layout.FormData) ButtonBar(com.extjs.gxt.ui.client.widget.button.ButtonBar) GPSecureButton(org.geosdi.geoplatform.gui.action.button.GPSecureButton) SaveViewportAction(org.geosdi.geoplatform.gui.client.action.viewport.SaveViewportAction) GPClientViewport(org.geosdi.geoplatform.gui.configuration.map.client.GPClientViewport) GPSecureButton(org.geosdi.geoplatform.gui.action.button.GPSecureButton) Button(com.extjs.gxt.ui.client.widget.button.Button)

Example 3 with GPSecureButton

use of org.geosdi.geoplatform.gui.action.button.GPSecureButton in project geo-platform by geosdi.

the class ProjectBindingWidget method addButtons.

private void addButtons() {
    getFormPanel().setButtonAlign(HorizontalAlignment.RIGHT);
    this.save = new GPSecureButton(ButtonsConstants.INSTANCE.saveText(), AbstractImagePrototype.create(BasicWidgetResources.ICONS.save()), new AddProjectAction(GPTrustedLevel.HIGH, this));
    getFormPanel().addButton(save);
    buttonBinding = new FormButtonBinding(getFormPanel());
    buttonBinding.addButton(save);
    this.cancel = new Button(ButtonsConstants.INSTANCE.cancelText(), AbstractImagePrototype.create(BasicWidgetResources.ICONS.cancel()), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            storeRejectChanges();
            hide();
        }
    });
    getFormPanel().addButton(cancel);
}
Also used : AddProjectAction(org.geosdi.geoplatform.gui.client.action.projects.AddProjectAction) GPSecureButton(org.geosdi.geoplatform.gui.action.button.GPSecureButton) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) FormButtonBinding(com.extjs.gxt.ui.client.widget.form.FormButtonBinding) GPSecureButton(org.geosdi.geoplatform.gui.action.button.GPSecureButton) SelectionListener(com.extjs.gxt.ui.client.event.SelectionListener)

Example 4 with GPSecureButton

use of org.geosdi.geoplatform.gui.action.button.GPSecureButton in project geo-platform by geosdi.

the class GPProjectSearchPanel method finalizeInitOperations.

@Override
public void finalizeInitOperations() {
    super.finalizeInitOperations();
    super.selectButton.setText(LayerModuleConstants.INSTANCE.GPProjectSearchPanel_selectButtonText());
    super.search.setFieldLabel(LayerModuleConstants.INSTANCE.GPProjectSearchPanel_searchlabelText());
    GPProjectAction action = new GPProjectAction(GPTrustedLevel.HIGH, this);
    GPSecureButton addProjectButton = new GPSecureButton(ButtonsConstants.INSTANCE.addText(), create(ICONS.projectAdd()), action);
    super.addButton(1, addProjectButton);
    addProjectButton.disable();
    this.editButton = new GPSecureButton(ButtonsConstants.INSTANCE.editText(), create(BasicWidgetResources.ICONS.edit()), action);
    this.editButton.disable();
    super.addButton(2, this.editButton);
    this.deleteButton = new GPSecureButton(ButtonsConstants.INSTANCE.deleteText(), create(ICONS.projectDelete()), new DeleteProjectAction(GPTrustedLevel.HIGH, this));
    this.deleteButton.disable();
    super.addButton(3, this.deleteButton);
    ShareProjectAction shareProjectAction = new ShareProjectAction(GPTrustedLevel.HIGH, this);
    this.shareButton = new GPSecureButton(ButtonsConstants.INSTANCE.shareText(), create(ICONS.arrowRefresh()), shareProjectAction);
    this.shareButton.disable();
    super.addButton(4, this.shareButton);
}
Also used : GPProjectAction(org.geosdi.geoplatform.gui.client.action.projects.GPProjectAction) ShareProjectAction(org.geosdi.geoplatform.gui.client.action.projects.ShareProjectAction) GPSecureButton(org.geosdi.geoplatform.gui.action.button.GPSecureButton) DeleteProjectAction(org.geosdi.geoplatform.gui.client.action.projects.DeleteProjectAction)

Example 5 with GPSecureButton

use of org.geosdi.geoplatform.gui.action.button.GPSecureButton in project geo-platform by geosdi.

the class BaseLayerWidget method addComponent.

@Override
public void addComponent() {
    this.store.add(GPMapBaseLayerFactory.getBaseLayerList());
    GeoPlatformSecureAction saveBaseLayerAction = new SaveBaseLayerAction(GPTrustedLevel.LOW, this);
    this.saveButton = new GPSecureButton(INSTANCE.saveText(), create(ICONS.save()), saveBaseLayerAction);
    this.saveButton.disable();
    Button applyButton = new Button(INSTANCE.applyCloseText(), create(ICONS.done()), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            BaseLayerWidget.super.hide();
        }
    });
    super.addButton(saveButton);
    super.addButton(applyButton);
}
Also used : SaveBaseLayerAction(org.geosdi.geoplatform.gui.client.action.baselayer.SaveBaseLayerAction) GPSecureButton(org.geosdi.geoplatform.gui.action.button.GPSecureButton) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) GeoPlatformSecureAction(org.geosdi.geoplatform.gui.configuration.action.GeoPlatformSecureAction) GPSecureButton(org.geosdi.geoplatform.gui.action.button.GPSecureButton)

Aggregations

GPSecureButton (org.geosdi.geoplatform.gui.action.button.GPSecureButton)6 Button (com.extjs.gxt.ui.client.widget.button.Button)3 ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)2 GeoPlatformSecureAction (org.geosdi.geoplatform.gui.configuration.action.GeoPlatformSecureAction)2 SelectionListener (com.extjs.gxt.ui.client.event.SelectionListener)1 Margins (com.extjs.gxt.ui.client.util.Margins)1 VerticalPanel (com.extjs.gxt.ui.client.widget.VerticalPanel)1 ButtonBar (com.extjs.gxt.ui.client.widget.button.ButtonBar)1 FieldSet (com.extjs.gxt.ui.client.widget.form.FieldSet)1 FormButtonBinding (com.extjs.gxt.ui.client.widget.form.FormButtonBinding)1 FormPanel (com.extjs.gxt.ui.client.widget.form.FormPanel)1 FormData (com.extjs.gxt.ui.client.widget.layout.FormData)1 SaveBaseLayerAction (org.geosdi.geoplatform.gui.client.action.baselayer.SaveBaseLayerAction)1 AddProjectAction (org.geosdi.geoplatform.gui.client.action.projects.AddProjectAction)1 DeleteProjectAction (org.geosdi.geoplatform.gui.client.action.projects.DeleteProjectAction)1 GPProjectAction (org.geosdi.geoplatform.gui.client.action.projects.GPProjectAction)1 ShareProjectAction (org.geosdi.geoplatform.gui.client.action.projects.ShareProjectAction)1 AddServerAction (org.geosdi.geoplatform.gui.client.action.server.AddServerAction)1 DeleteServerAction (org.geosdi.geoplatform.gui.client.action.server.DeleteServerAction)1 SaveViewportAction (org.geosdi.geoplatform.gui.client.action.viewport.SaveViewportAction)1