public OpenInBrowserAction( BootDashModel model, MultiSelection<BootDashElement> selection, UserInteractions ui) { super(selection, ui); this.model = model; this.setText("Open Web Browser"); this.setToolTipText("Open a Web Browser on the default URL"); this.setImageDescriptor(BootDashActivator.getImageDescriptor("icons/open_browser.gif")); this.setDisabledImageDescriptor( BootDashActivator.getImageDescriptor("icons/open_browser_disabled.gif")); if (model != null) { model.addElementStateListener( listener = new ElementStateListener() { public void stateChanged(BootDashElement e) { Display.getDefault() .asyncExec( new Runnable() { public void run() { updateEnablement(); } }); } }); } }
private void fillContextMenu(IMenuManager manager) { for (RunStateAction a : actions.getRunStateActions()) { addVisible(manager, a); } addVisible(manager, actions.getOpenBrowserAction()); addVisible(manager, actions.getOpenConsoleAction()); addVisible(manager, actions.getOpenInPackageExplorerAction()); addVisible(manager, actions.getShowPropertiesViewAction()); manager.add(new Separator()); addVisible(manager, actions.getOpenConfigAction()); addVisible(manager, actions.getDuplicateConfigAction()); addVisible(manager, actions.getDeleteConfigsAction()); manager.add(new Separator()); addVisible(manager, actions.getExposeRunAppAction()); addVisible(manager, actions.getExposeDebugAppAction()); addSubmenu( manager, "Deploy and Run On...", BootDashActivator.getImageDescriptor("icons/run-on-cloud.png"), actions.getRunOnTargetActions()); addSubmenu( manager, "Deploy and Debug On...", BootDashActivator.getImageDescriptor("icons/debug-on-cloud.png"), actions.getDebugOnTargetActions()); manager.add(new Separator()); for (AddRunTargetAction a : actions.getAddRunTargetActions()) { addVisible(manager, a); } manager.add(new Separator()); IAction removeTargetAction = actions.getRemoveRunTargetAction(); if (removeTargetAction != null) { addVisible(manager, removeTargetAction); } IAction refreshAction = actions.getRefreshRunTargetAction(); if (refreshAction != null) { addVisible(manager, refreshAction); } IAction restartOnlyAction = actions.getRestartOnlyApplicationAction(); if (restartOnlyAction != null) { addVisible(manager, restartOnlyAction); } IAction selectManifestAction = actions.getSelectManifestAction(); if (selectManifestAction != null) { addVisible(manager, selectManifestAction); } IAction restartWithRemoteDevClientAction = actions.getRestartWithRemoteDevClientAction(); if (restartWithRemoteDevClientAction != null) { addVisible(manager, actions.getRestartWithRemoteDevClientAction()); } IAction deleteAppsAction = actions.getDeleteAppsAction(); if (deleteAppsAction != null) { addVisible(manager, deleteAppsAction); } IAction updatePasswordAction = actions.getUpdatePasswordAction(); if (updatePasswordAction != null) { addVisible(manager, updatePasswordAction); } IAction openCloudAdminConsoleAction = actions.getOpenCloudAdminConsoleAction(); if (openCloudAdminConsoleAction != null) { addVisible(manager, openCloudAdminConsoleAction); } IAction toggleCloudConnectAction = actions.getToggleTargetConnectionAction(); if (toggleCloudConnectAction != null) { addVisible(manager, toggleCloudConnectAction); } IAction reconnectConsole = actions.getReconnectCloudConsole(); if (reconnectConsole != null) { addVisible(manager, reconnectConsole); } // manager.add // addVisible(manager, new Separator()); // addVisible(manager, refreshAction); // addVisible(manager, action2); // Other plug-ins can contribute there actions here // manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); }