Search in sources :

Example 1 with SameShellProvider

use of org.eclipse.jface.window.SameShellProvider in project webtools.sourceediting by eclipse.

the class XMLMultiPageEditorPart method addEditorActions.

private void addEditorActions(IDesignViewer viewer) {
    if (viewer instanceof AbstractTreeViewer) {
        final Tree tree = (Tree) ((AbstractTreeViewer) viewer).getControl();
        fMenuManager = new MenuManager();
        fMenuManager.add(new Action(XMLEditorMessages.ConfigureColumns_label) {

            public void run() {
                ConfigureColumns.forTree(tree, new SameShellProvider(tree));
            }
        });
        // $NON-NLS-1$
        getSite().registerContextMenu("org.eclipse.wst.xml.ui.editor", fMenuManager, getSite().getSelectionProvider());
        fMenuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        fEditorManager.add(new EditorActions(fEditorManager.getControl()));
        fEditorManager.update(true);
    }
}
Also used : Action(org.eclipse.jface.action.Action) SameShellProvider(org.eclipse.jface.window.SameShellProvider) MenuManager(org.eclipse.jface.action.MenuManager) Tree(org.eclipse.swt.widgets.Tree) AbstractTreeViewer(org.eclipse.jface.viewers.AbstractTreeViewer) Separator(org.eclipse.jface.action.Separator)

Aggregations

Action (org.eclipse.jface.action.Action)1 MenuManager (org.eclipse.jface.action.MenuManager)1 Separator (org.eclipse.jface.action.Separator)1 AbstractTreeViewer (org.eclipse.jface.viewers.AbstractTreeViewer)1 SameShellProvider (org.eclipse.jface.window.SameShellProvider)1 Tree (org.eclipse.swt.widgets.Tree)1