public void init(ICommonActionExtensionSite actionExtensionSite) { super.init(actionExtensionSite); this.actionExtensionSite = actionExtensionSite; ICommonViewerSite site = actionExtensionSite.getViewSite(); if (site instanceof ICommonViewerWorkbenchSite) { action.setViewer(actionExtensionSite.getStructuredViewer()); action.setSelection(actionExtensionSite.getStructuredViewer().getSelection()); actionExtensionSite.getStructuredViewer().addSelectionChangedListener(action); } }
@Override public void fillContextMenu(IMenuManager menu) { Object sel = getSelection(); if (sel instanceof IServer) { IServer server = (IServer) sel; if (ExpressServerUtils.isOpenShiftRuntime(server) || ExpressServerUtils.isInOpenshiftBehaviourMode(server)) { action.validate(); if (action != null) { MenuManager openshiftMenu = getOpenShiftMenuManager(menu); openshiftMenu.add(action); } } } }