Search in sources :

Example 1 with TreePartFactory

use of org.jboss.tools.hibernate.ui.diagram.editors.parts.TreePartFactory in project jbosstools-hibernate by jbosstools.

the class DiagramContentOutlinePage method configureOutlineViewer.

/**
 * Outline viewer configuration
 */
protected void configureOutlineViewer() {
    getViewer().setEditDomain(editor.getDefaultEditDomain());
    getViewer().setEditPartFactory(new TreePartFactory());
    MenuManager provider = new PopupMenuProvider(getViewer(), getActionRegistry());
    // getViewer().setContextMenu(provider);
    getViewer().setContextMenu(provider);
    getSite().registerContextMenu(// $NON-NLS-1$
    "org.jboss.tools.hibernate.ui.diagram.editors.popup.outline.contextmenu", provider, getSite().getSelectionProvider());
    IToolBarManager tbm = getSite().getActionBars().getToolBarManager();
    tbm.add(editor.getLexicalSortingAction());
    showOutlineAction = new Action() {

        public void run() {
            showPage(ID_OUTLINE);
        }
    };
    showOutlineAction.setToolTipText(DiagramViewerMessages.DiagramContentOutlinePage_Outline);
    showOutlineAction.setImageDescriptor(ImageDescriptor.createFromFile(DiagramViewer.class, // $NON-NLS-1$
    "icons/outline.gif"));
    tbm.add(showOutlineAction);
    showOverviewAction = new Action() {

        public void run() {
            showPage(ID_OVERVIEW);
        }
    };
    showOverviewAction.setToolTipText(DiagramViewerMessages.DiagramContentOutlinePage_Overview);
    showOverviewAction.setImageDescriptor(ImageDescriptor.createFromFile(DiagramViewer.class, // $NON-NLS-1$
    "icons/overview.gif"));
    tbm.add(showOverviewAction);
    showPage(ID_OVERVIEW);
}
Also used : TreePartFactory(org.jboss.tools.hibernate.ui.diagram.editors.parts.TreePartFactory) IAction(org.eclipse.jface.action.IAction) ToggleShapeVisibleStateAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeVisibleStateAction) AutoLayoutAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.AutoLayoutAction) ToggleConnectionsAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleConnectionsAction) LexicalSortingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.LexicalSortingAction) ToggleShapeExpandStateAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeExpandStateAction) Action(org.eclipse.jface.action.Action) IToolBarManager(org.eclipse.jface.action.IToolBarManager) MenuManager(org.eclipse.jface.action.MenuManager) PopupMenuProvider(org.jboss.tools.hibernate.ui.diagram.editors.popup.PopupMenuProvider)

Aggregations

Action (org.eclipse.jface.action.Action)1 IAction (org.eclipse.jface.action.IAction)1 IToolBarManager (org.eclipse.jface.action.IToolBarManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 AutoLayoutAction (org.jboss.tools.hibernate.ui.diagram.editors.actions.AutoLayoutAction)1 LexicalSortingAction (org.jboss.tools.hibernate.ui.diagram.editors.actions.LexicalSortingAction)1 ToggleConnectionsAction (org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleConnectionsAction)1 ToggleShapeExpandStateAction (org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeExpandStateAction)1 ToggleShapeVisibleStateAction (org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeVisibleStateAction)1 TreePartFactory (org.jboss.tools.hibernate.ui.diagram.editors.parts.TreePartFactory)1 PopupMenuProvider (org.jboss.tools.hibernate.ui.diagram.editors.popup.PopupMenuProvider)1