Search in sources :

Example 1 with ErlangSearchActionGroup

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);
}
Also used : GotoMatchingBracketAction(org.erlide.ui.editors.erl.actions.GotoMatchingBracketAction) CompositeActionGroup(org.erlide.ui.actions.CompositeActionGroup) ErlangSearchActionGroup(org.erlide.ui.actions.ErlangSearchActionGroup) CallHierarchyAction(org.erlide.ui.editors.erl.actions.CallHierarchyAction) ShowOutlineAction(org.erlide.ui.editors.erl.actions.ShowOutlineAction) CleanUpAction(org.erlide.ui.editors.erl.actions.CleanUpAction) CallHierarchyAction(org.erlide.ui.editors.erl.actions.CallHierarchyAction) CompileAction(org.erlide.ui.editors.erl.actions.CompileAction) ShowOutlineAction(org.erlide.ui.editors.erl.actions.ShowOutlineAction) ClearCacheAction(org.erlide.ui.editors.erl.actions.ClearCacheAction) ClearAllCachesAction(org.erlide.ui.editors.erl.actions.ClearAllCachesAction) GotoMatchingBracketAction(org.erlide.ui.editors.erl.actions.GotoMatchingBracketAction) Action(org.eclipse.jface.action.Action) CompileAction(org.erlide.ui.editors.erl.actions.CompileAction) ErlangSearchActionGroup(org.erlide.ui.actions.ErlangSearchActionGroup) CompositeActionGroup(org.erlide.ui.actions.CompositeActionGroup) ActionGroup(org.eclipse.ui.actions.ActionGroup) CleanUpAction(org.erlide.ui.editors.erl.actions.CleanUpAction)

Example 2 with ErlangSearchActionGroup

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");
        }
    }
}
Also used : IWorkbenchPartSite(org.eclipse.ui.IWorkbenchPartSite) ErlangSearchActionGroup(org.erlide.ui.actions.ErlangSearchActionGroup) ICommonViewerSite(org.eclipse.ui.navigator.ICommonViewerSite) IContextService(org.eclipse.ui.contexts.IContextService) ICommonViewerWorkbenchSite(org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)

Example 3 with ErlangSearchActionGroup

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);
// }
}
Also used : CompositeActionGroup(org.erlide.ui.actions.CompositeActionGroup) ErlangSearchActionGroup(org.erlide.ui.actions.ErlangSearchActionGroup) ActionGroup(org.eclipse.ui.actions.ActionGroup) ErlangSearchActionGroup(org.erlide.ui.actions.ErlangSearchActionGroup) CompositeActionGroup(org.erlide.ui.actions.CompositeActionGroup)

Example 4 with ErlangSearchActionGroup

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);
}
Also used : CompositeActionGroup(org.erlide.ui.actions.CompositeActionGroup) ErlangSearchActionGroup(org.erlide.ui.actions.ErlangSearchActionGroup) TreeViewer(org.eclipse.jface.viewers.TreeViewer) IPartListener(org.eclipse.ui.IPartListener) IPageSite(org.eclipse.ui.part.IPageSite) IMenuListener(org.eclipse.jface.action.IMenuListener) IHandlerService(org.eclipse.ui.handlers.IHandlerService) ActionGroup(org.eclipse.ui.actions.ActionGroup) ErlangSearchActionGroup(org.erlide.ui.actions.ErlangSearchActionGroup) CompositeActionGroup(org.erlide.ui.actions.CompositeActionGroup) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Tree(org.eclipse.swt.widgets.Tree) IContextService(org.eclipse.ui.contexts.IContextService) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) ActionHandler(org.eclipse.jface.commands.ActionHandler) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

ErlangSearchActionGroup (org.erlide.ui.actions.ErlangSearchActionGroup)4 ActionGroup (org.eclipse.ui.actions.ActionGroup)3 CompositeActionGroup (org.erlide.ui.actions.CompositeActionGroup)3 IContextService (org.eclipse.ui.contexts.IContextService)2 Action (org.eclipse.jface.action.Action)1 IMenuListener (org.eclipse.jface.action.IMenuListener)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 ActionHandler (org.eclipse.jface.commands.ActionHandler)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 Menu (org.eclipse.swt.widgets.Menu)1 Tree (org.eclipse.swt.widgets.Tree)1 IActionBars (org.eclipse.ui.IActionBars)1 IPartListener (org.eclipse.ui.IPartListener)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1 IWorkbenchPartSite (org.eclipse.ui.IWorkbenchPartSite)1 IHandlerService (org.eclipse.ui.handlers.IHandlerService)1 ICommonViewerSite (org.eclipse.ui.navigator.ICommonViewerSite)1 ICommonViewerWorkbenchSite (org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)1 IPageSite (org.eclipse.ui.part.IPageSite)1