use of org.erlide.ui.actions.ErlangSearchActionGroup 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.erlide.ui.actions.ErlangSearchActionGroup in project erlide_eclipse by erlang.
the class ErlangFileActionProvider method init.
@Override
public void init(final ICommonActionExtensionSite aSite) {
final ICommonViewerSite viewSite = aSite.getViewSite();
if (viewSite instanceof ICommonViewerWorkbenchSite) {
final ICommonViewerWorkbenchSite workbenchSite = (ICommonViewerWorkbenchSite) viewSite;
final IWorkbenchPartSite site = workbenchSite.getSite();
openAction = new OpenErlangAction(aSite, workbenchSite.getSelectionProvider());
searchActionGroup = new ErlangSearchActionGroup(site);
final IContextService service = site.getService(IContextService.class);
if (service != null) {
service.activateContext("org.erlide.ui.erlangOutlineAndNavigatorScope");
}
}
}
use of org.erlide.ui.actions.ErlangSearchActionGroup 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.erlide.ui.actions.ErlangSearchActionGroup in project erlide_eclipse by erlang.
the class ErlangOutlinePage method createControl.
@Override
public void createControl(final Composite parent) {
final Tree tree = new Tree(parent, SWT.MULTI);
fOutlineViewer = new TreeViewer(tree);
fOutlineViewer.setAutoExpandLevel(0);
fOutlineViewer.setUseHashlookup(true);
fOutlineViewer.setContentProvider(fEditor.createOutlineContentProvider());
fOutlineViewer.setLabelProvider(fEditor.createOutlineLabelProvider());
fOutlineViewer.addPostSelectionChangedListener(this);
fOutlineViewer.setInput(fModule);
final IPageSite site = getSite();
fOpenAndLinkWithEditorHelper = new OpenAndLinkWithEditorHelper(fOutlineViewer, fEditor, site.getPage());
final IContextService service = site.getService(IContextService.class);
if (service != null) {
service.activateContext("org.erlide.ui.erlangOutlineAndNavigatorScope");
}
final MenuManager manager = new MenuManager();
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(final IMenuManager m) {
// recursive loop?
// menuAboutToShow(m);
contextMenuAboutToShow(m);
}
});
final Menu menu = manager.createContextMenu(tree);
tree.setMenu(menu);
site.registerContextMenu(ErlangCore.PLUGIN_ID + ".outline", manager, fOutlineViewer);
fActionGroups = new CompositeActionGroup(new ActionGroup[] { new ErlangSearchActionGroup(this) });
// register global actions
final IActionBars actionBars = site.getActionBars();
actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, fEditor.getAction(ITextEditorActionConstants.UNDO));
actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, fEditor.getAction(ITextEditorActionConstants.REDO));
fActionGroups.fillActionBars(actionBars);
registerToolbarActions(actionBars);
final IHandlerService handlerService = site.getService(IHandlerService.class);
if (handlerService != null) {
handlerService.activateHandler(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR, new ActionHandler(fToggleLinkingAction));
}
fPartListener = new IPartListener() {
@Override
public void partOpened(final IWorkbenchPart part) {
// JC borde filter-metoden ovan r�cka?
addFilters();
}
@Override
public void partDeactivated(final IWorkbenchPart part) {
}
@Override
public void partClosed(final IWorkbenchPart part) {
}
@Override
public void partBroughtToTop(final IWorkbenchPart part) {
}
@Override
public void partActivated(final IWorkbenchPart part) {
addFilters();
}
};
getSite().getPage().addPartListener(fPartListener);
}
Aggregations