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();
}
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%"));
}
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);
}
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);
}
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);
}
Aggregations