use of org.jkiss.dbeaver.ui.MenuCreator in project dbeaver by serge-rider.
the class SelectCRSAction method getMenuCreator.
@Override
public IMenuCreator getMenuCreator() {
return new MenuCreator(control -> {
MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
menuManager.addMenuListener(manager -> {
menuManager.add(new SetCRSAction(valueEditor, GisConstants.SRID_4326));
menuManager.add(new SetCRSAction(valueEditor, GisConstants.SRID_3857));
menuManager.add(new SetCRSAction(valueEditor, GisConstants.SRID_3395));
menuManager.add(new SetCRSAction(valueEditor, GisConstants.SRID_SIMPLE));
menuManager.add(new Separator());
List<Integer> recentSRIDs = GISEditorUtils.getRecentSRIDs();
if (!recentSRIDs.isEmpty()) {
for (Integer recentSRID : recentSRIDs) {
menuManager.add(new SetCRSAction(valueEditor, recentSRID));
}
menuManager.add(new Separator());
}
menuManager.add(new Action(GISMessages.panel_select_crs_action_menu_manager_other) {
@Override
public void run() {
SelectCRSAction.this.run();
}
});
menuManager.add(new Action(GISMessages.panel_select_crs_action_menu_manager_config) {
@Override
public void run() {
new GISViewerConfigurationDialog(valueEditor.getEditorControl().getShell()).open();
}
});
});
return menuManager;
});
}
use of org.jkiss.dbeaver.ui.MenuCreator in project dbeaver by serge-rider.
the class SelectTilesAction method getMenuCreator.
@Override
public IMenuCreator getMenuCreator() {
return new MenuCreator(control -> {
MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
menuManager.addMenuListener(manager -> {
if (valueEditor.getValueSRID() != 0) {
for (LeafletTilesDescriptor ld : GeometryViewerRegistry.getInstance().getLeafletTiles()) {
menuManager.add(new SetTilesAction(valueEditor, ld));
}
}
});
return menuManager;
});
}
Aggregations