use of org.eclipse.ui.actions.ActionGroup in project tdi-studio-se by Talend.
the class JobHierarchyViewPart method createPartControl.
@Override
public void createPartControl(Composite container) {
fParent = container;
addResizeListener(fParent);
fPagebook = new PageBook(container, SWT.NONE);
// page 1 of page book (no hierarchy label)
fNoHierarchyShownLabel = new Label(fPagebook, SWT.TOP + SWT.LEFT + SWT.WRAP);
fNoHierarchyShownLabel.setText(showEmptyLabel);
// page 2 of page book (viewers)
fTypeMethodsSplitter = new SashForm(fPagebook, SWT.VERTICAL);
fTypeMethodsSplitter.setVisible(false);
fTypeViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
Control typeViewerControl = createTypeViewerControl(fTypeViewerViewForm);
fTypeViewerViewForm.setContent(typeViewerControl);
dependencyViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
fTypeMethodsSplitter.setWeights(new int[] { 65, 35 });
Control dependencyViewerPart = createMethodViewerControl(dependencyViewerViewForm);
dependencyViewerViewForm.setContent(dependencyViewerPart);
dependencyViewerPaneLabel = new CLabel(dependencyViewerViewForm, SWT.NONE);
dependencyViewerViewForm.setTopLeft(dependencyViewerPaneLabel);
ToolBar methodViewerToolBar = new ToolBar(dependencyViewerViewForm, SWT.FLAT | SWT.WRAP);
dependencyViewerViewForm.setTopCenter(methodViewerToolBar);
initDragAndDrop();
MenuManager menu = new MenuManager();
menu.add(focusOnTypeAction);
fNoHierarchyShownLabel.setMenu(menu.createContextMenu(fNoHierarchyShownLabel));
fPagebook.showPage(fNoHierarchyShownLabel);
int layout;
try {
layout = fDialogSettings.getInt(DIALOGSTORE_VIEWLAYOUT);
if (layout < 0 || layout > 3) {
layout = VIEW_LAYOUT_AUTOMATIC;
}
} catch (NumberFormatException e) {
layout = VIEW_LAYOUT_AUTOMATIC;
}
// force the update
fCurrentLayout = -1;
// will fill the main tool bar
setViewLayout(layout);
// set the filter menu items
IActionBars actionBars = getViewSite().getActionBars();
IMenuManager viewMenu = actionBars.getMenuManager();
// for (int i = 0; i < fViewActions.length; i++) {
// ToggleViewAction action = fViewActions[i];
// viewMenu.add(action);
// action.setEnabled(false);
// }
// viewMenu.add(new Separator());
// IMenuManager layoutSubMenu = new MenuManager(TypeHierarchyMessages.TypeHierarchyViewPart_layout_submenu);
//$NON-NLS-1$
IMenuManager layoutSubMenu = new MenuManager(Messages.getString("FocusOnJobAction.TypeHierarchyViewPart_layout_submenu"));
viewMenu.add(layoutSubMenu);
for (int i = 0; i < fToggleOrientationActions.length; i++) {
layoutSubMenu.add(fToggleOrientationActions[i]);
}
viewMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
// selection provider
int nHierarchyViewers = fAllViewers.length;
StructuredViewer[] trackedViewers = new StructuredViewer[nHierarchyViewers + 1];
for (int i = 0; i < nHierarchyViewers; i++) {
trackedViewers[i] = fAllViewers[i];
}
trackedViewers[nHierarchyViewers] = dependencyViewer;
fSelectionProviderMediator = new SelectionProviderMediator(trackedViewers, getCurrentViewer());
getSite().setSelectionProvider(fSelectionProviderMediator);
ActionGroup[] actionGroups = new ActionGroup[] { new JobActionGroup() };
fActionGroups = new CompositeActionGroup(actionGroups);
fActionGroups.fillActionBars(actionBars);
}
use of org.eclipse.ui.actions.ActionGroup in project erlide_eclipse by erlang.
the class ErlangEditor method createActions.
@Override
protected void createActions() {
super.createActions();
ActionGroup esg;
fActionGroups = new CompositeActionGroup(new ActionGroup[] { esg = new ErlangSearchActionGroup(this) });
fContextMenuGroup = new CompositeActionGroup(new ActionGroup[] { esg });
createCommonActions();
compileAction = new CompileAction(getSite());
compileAction.setActionDefinitionId(IErlangEditorActionDefinitionIds.COMPILE);
setAction("compileFile", compileAction);
if (getModule() != null) {
cleanUpAction = new CleanUpAction(getModule().getResource());
cleanUpAction.setActionDefinitionId(IErlangEditorActionDefinitionIds.CLEAN_UP);
setAction("cleanUp", cleanUpAction);
}
callhierarchy = new CallHierarchyAction(this, getModule());
callhierarchy.setActionDefinitionId(IErlangEditorActionDefinitionIds.CALLHIERARCHY);
setAction("callHierarchy", callhierarchy);
markAsStateDependentAction("CallHierarchy", true);
markAsSelectionDependentAction("CallHierarchy", true);
if (SystemConfiguration.getInstance().isClearCacheAvailable()) {
setupClearCacheActions();
// PlatformUI.getWorkbench().getHelpSystem().setHelp(indentAction,
// IErlangHelpContextIds.INDENT_ACTION);
}
fShowOutline = new ShowOutlineAction(ErlangEditorMessages.getBundleForConstructedKeys(), "ShowOutline.", this);
fShowOutline.setActionDefinitionId(IErlangEditorActionDefinitionIds.SHOW_OUTLINE);
setAction(IErlangEditorActionDefinitionIds.SHOW_OUTLINE, fShowOutline);
markAsContentDependentAction(IErlangEditorActionDefinitionIds.SHOW_OUTLINE, true);
final Action action = new GotoMatchingBracketAction(this);
action.setActionDefinitionId(IErlangEditorActionDefinitionIds.GOTO_MATCHING_BRACKET);
setAction(GotoMatchingBracketAction.GOTO_MATCHING_BRACKET, action);
}
use of org.eclipse.ui.actions.ActionGroup in project erlide_eclipse by erlang.
the class ErlangScratchPad method createActions.
@Override
protected void createActions() {
super.createActions();
ActionGroup esg;
fActionGroups = new CompositeActionGroup(new ActionGroup[] { esg = new ErlangSearchActionGroup(this) });
fContextMenuGroup = new CompositeActionGroup(new ActionGroup[] { esg });
createCommonActions();
// if (ErlideUtil.isTest()) {
// testAction = new TestAction(ErlangEditorMessages
// .getBundleForConstructedKeys(), "Test.", this, getModule());
// testAction
// .setActionDefinitionId(IErlangEditorActionDefinitionIds.TEST);
// setAction("Test", testAction);
// markAsStateDependentAction("Test", true);
// markAsSelectionDependentAction("Test", true);
// // PlatformUI.getWorkbench().getHelpSystem().setHelp(indentAction,
// // IErlangHelpContextIds.INDENT_ACTION);
// }
}
use of org.eclipse.ui.actions.ActionGroup in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createExportActionGroup.
private ActionGroup createExportActionGroup() {
exportMenu = new MenuManager("Export", MdwPlugin.getImageDescriptor("icons/export.gif"), MdwMenuManager.MDW_MENU_PREFIX + "menu.export");
return new ActionGroup() {
@Override
public void fillContextMenu(IMenuManager menu) {
exportMenu.removeAll();
IStructuredSelection selection = getSelection();
if (exportPackageApplies(selection))
exportMenu.add(exportPackageAction);
if (exportProcessApplies(selection))
exportMenu.add(exportProcessAction);
if (exportWorkflowAssetApplies(selection)) {
WorkflowAsset asset = (WorkflowAsset) selection.getFirstElement();
// menu item text and icon are dynamic
exportWorkflowAssetAction.setId(MdwMenuManager.MDW_MENU_PREFIX + "export.to.file");
exportWorkflowAssetAction.setText(asset.getTitle() + " to File...");
exportWorkflowAssetAction.setImageDescriptor(MdwPlugin.getImageDescriptor(ICONS + asset.getIcon()));
exportMenu.add(exportWorkflowAssetAction);
}
if (exportAttributesApplies(selection)) {
List<IAction> exportAttrsActions = getExportAttributeActions(selection);
if (!exportAttrsActions.isEmpty()) {
MenuManager attributesMenu = new MenuManager("Attributes", MdwPlugin.getImageDescriptor("icons/attribute.gif"), MdwMenuManager.MDW_MENU_PREFIX + "menu.export.attributes");
attributesMenu.removeAll();
for (IAction action : exportAttrsActions) attributesMenu.add(action);
exportMenu.add(attributesMenu);
}
}
if (exportTaskTemplatesApplies(selection))
exportMenu.add(exportTaskTemplateAction);
exportMenu.add(new Separator(OTHER));
IWorkbenchAction otherAction = ActionFactory.EXPORT.create(getViewSite().getWorkbenchWindow());
otherAction.setId(MdwMenuManager.MDW_MENU_PREFIX + "export.other");
otherAction.setText(OTHER_DOT);
exportMenu.add(otherAction);
}
};
}
use of org.eclipse.ui.actions.ActionGroup in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createSwingActionGroup.
private ActionGroup createSwingActionGroup() {
swingMenu = new MenuManager("Swing Tools", null, MdwMenuManager.MDW_MENU_PREFIX + "menu.swing.tools");
return new ActionGroup() {
@Override
public void fillContextMenu(IMenuManager menu) {
swingMenu.removeAll();
IStructuredSelection selection = getSelection();
if (swingLaunchApplies(selection)) {
WorkflowProject project = (WorkflowProject) selection.getFirstElement();
MdwSettings settings = MdwPlugin.getSettings();
if (settings.isSwingLaunchEventManager() && project.isUserAuthorizedForSystemAdmin())
swingMenu.add(eventManagerAction);
if (settings.isSwingLaunchThreadPoolManager() && project.isUserAuthorizedForSystemAdmin())
swingMenu.add(threadPoolManagerAction);
}
}
};
}
Aggregations