Search in sources :

Example 96 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tmdm-studio-se by Talend.

the class DataModelMainPage method hookContextMenu.

private void hookContextMenu() {
    menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            DataModelMainPage.this.fillContextMenu(manager, false);
        }
    });
    Menu menu = menuMgr.createContextMenu(viewer.getControl());
    viewer.getControl().setMenu(menu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 97 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tmdm-studio-se by Talend.

the class StoredProcedureMainPage method hookContextMenu.

private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            manager.add(new ResultsViewAction(StoredProcedureMainPage.this.getSite().getShell(), StoredProcedureMainPage.this.resultsViewer));
        }
    });
    Menu menu = menuMgr.createContextMenu(resultsViewer.getControl());
    resultsViewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, resultsViewer);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 98 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tmdm-studio-se by Talend.

the class ViewBrowserMainPage method hookContextMenu.

private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            manager.add(new DOMViewAction(ViewBrowserMainPage.this.getSite().getShell(), ViewBrowserMainPage.this.resultsViewer));
        }
    });
    Menu menu = menuMgr.createContextMenu(resultsViewer.getControl());
    resultsViewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, resultsViewer);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 99 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tmdm-studio-se by Talend.

the class DataClusterDialog method hookContextMenu.

private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new NewItemAction(site.getShell()));
        }
    });
    Menu menu = menuMgr.createContextMenu(clusterComposite.getResultsViewer().getControl());
    clusterComposite.getResultsViewer().getControl().setMenu(menu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 100 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tmdm-studio-se by Talend.

the class ItemsTrashBrowserMainPage method hookContextMenu.

private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            // ItemsTrashBrowserMainPage.this.fillContextMenu(manager);
            manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new RestoreAction(ItemsTrashBrowserMainPage.this.getSite().getShell(), ItemsTrashBrowserMainPage.this.resultsViewer));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new RemoveAction(ItemsTrashBrowserMainPage.this.getSite().getShell(), ItemsTrashBrowserMainPage.this.resultsViewer));
        }
    });
    Menu menu = menuMgr.createContextMenu(resultsViewer.getControl());
    resultsViewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, resultsViewer);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Aggregations

MenuManager (org.eclipse.jface.action.MenuManager)657 IMenuManager (org.eclipse.jface.action.IMenuManager)498 Menu (org.eclipse.swt.widgets.Menu)303 IMenuListener (org.eclipse.jface.action.IMenuListener)246 Separator (org.eclipse.jface.action.Separator)220 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)65 Point (org.eclipse.swt.graphics.Point)63 Action (org.eclipse.jface.action.Action)55 Composite (org.eclipse.swt.widgets.Composite)49 IAction (org.eclipse.jface.action.IAction)48 SelectionEvent (org.eclipse.swt.events.SelectionEvent)44 GridData (org.eclipse.swt.layout.GridData)44 GroupMarker (org.eclipse.jface.action.GroupMarker)43 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)43 Transfer (org.eclipse.swt.dnd.Transfer)35 GridLayout (org.eclipse.swt.layout.GridLayout)32 List (java.util.List)30 EditingDomainViewerDropAdapter (org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)30 LocalTransfer (org.eclipse.emf.edit.ui.dnd.LocalTransfer)30 ViewerDragAdapter (org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter)30