Search in sources :

Example 16 with Separator

use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.

the class CpuSection method addToolBarActions.

/*
     * @see AbstractJvmPropertySection#addToolBarActions(IToolBarManager)
     */
@Override
protected void addToolBarActions(IToolBarManager manager) {
    suspendCpuProfilingAction.setEnabled(false);
    resumeCpuProfilingAction.setEnabled(false);
    clearCpuProfilingDataAction.setEnabled(false);
    if (manager.find("separator") == null) {
        //$NON-NLS-1$
        //$NON-NLS-1$ //$NON-NLS-2$
        manager.insertAfter("defaults", new Separator("separator"));
    }
    if (manager.find(clearCpuProfilingDataAction.getId()) == null) {
        //$NON-NLS-1$
        manager.insertAfter("defaults", clearCpuProfilingDataAction);
    }
    if (manager.find(suspendCpuProfilingAction.getId()) == null) {
        //$NON-NLS-1$
        manager.insertAfter("defaults", suspendCpuProfilingAction);
    }
    if (manager.find(resumeCpuProfilingAction.getId()) == null) {
        //$NON-NLS-1$
        manager.insertAfter("defaults", resumeCpuProfilingAction);
    }
    if (manager.find(dumpCpuProfilingDataAction.getId()) == null) {
        //$NON-NLS-1$
        manager.insertAfter("defaults", dumpCpuProfilingDataAction);
    }
}
Also used : Separator(org.eclipse.jface.action.Separator)

Example 17 with Separator

use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.

the class ErDiagramMenuProvider method buildContextMenu.

@Override
public void buildContextMenu(IMenuManager menu) {
    menu.add(new Separator(RELATION));
    menu.add(new Separator(GEFActionConstants.GROUP_EDIT));
    IAction action;
    action = getAction(ActionFactory.DELETE.getId());
    ((ErDiagramItemDeleteAction) action).update();
    if (action.isEnabled()) {
        menu.appendToGroup(GEFActionConstants.GROUP_EDIT, action);
    }
    CreateRelationAction createRelation;
    createRelation = new CreateRelationAction(part);
    createRelation.update();
    if (createRelation.isEnabled()) {
        menu.add(createRelation);
    }
    TableAddAction addAction = new TableAddAction(part);
    addAction.update();
    menu.add(addAction);
}
Also used : TableAddAction(org.talend.sqlbuilder.erdiagram.ui.actions.TableAddAction) IAction(org.eclipse.jface.action.IAction) ErDiagramItemDeleteAction(org.talend.sqlbuilder.erdiagram.ui.actions.ErDiagramItemDeleteAction) CreateRelationAction(org.talend.sqlbuilder.erdiagram.ui.actions.CreateRelationAction) Separator(org.eclipse.jface.action.Separator)

Example 18 with Separator

use of org.eclipse.jface.action.Separator in project MonjaDB by Kanatoko.

the class MSavedActionsView method init2.

//--------------------------------------------------------------------------------
public void init2() {
    parent.setLayout(new FormLayout());
    tree = new Tree(parent, SWT.BORDER);
    tree.addListener(SWT.KeyDown, this);
    tree.addListener(SWT.MouseDoubleClick, this);
    /*
tree.addKeyListener(new KeyAdapter() {
	public void keyPressed(KeyEvent e) {
	onKeyPressed( e );
	}
});
*/
    tree.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            onTreeSelect();
        }
    });
    tree.addDisposeListener(new DisposeListener() {

        public void widgetDisposed(DisposeEvent e) {
            saveSavedActions();
        }
    });
    tree.setHeaderVisible(true);
    FormData fd_tree_1 = new FormData();
    fd_tree_1.bottom = new FormAttachment(100, 0);
    fd_tree_1.right = new FormAttachment(100, -1);
    fd_tree_1.top = new FormAttachment(0, 0);
    fd_tree_1.left = new FormAttachment(0, 0);
    tree.setLayoutData(fd_tree_1);
    loadSavedActions();
    menuManager = new MenuManager();
    Menu contextMenu = menuManager.createContextMenu(tree);
    tree.setMenu(contextMenu);
    executeAction = new Action() {

        public void run() {
            //-----------
            onExecute();
        }
    };
    //-----------
    executeAction.setToolTipText("Execute Saved Actions");
    executeAction.setText("Execute\tShift+Enter");
    initAction(executeAction, "cog_go.png", menuManager);
    editAction = new Action() {

        public void run() {
            //-----------
            onEdit();
        }
    };
    //-----------
    editAction.setToolTipText("Edit Saved Actions");
    editAction.setText("Edit");
    initAction(editAction, "cog_edit.png", menuManager);
    menuManager.add(new Separator());
    newAction = new Action() {

        public void run() {
            //-----------
            onNewSavedAction();
        }
    };
    //-----------
    newAction.setToolTipText("New");
    newAction.setText("New");
    initAction(newAction, "cog_add.png", menuManager);
    newFolderAction = new Action() {

        public void run() {
            //-----------
            onNewFolder();
        }
    };
    //-----------
    newFolderAction.setToolTipText("Create A New Folder");
    newFolderAction.setText("New Folder");
    initAction(newFolderAction, "folder_add.png", menuManager);
    menuManager.add(new Separator());
    removeAction = new Action() {

        public void run() {
            //-----------
            onRemove();
        }
    };
    //-----------
    removeAction.setToolTipText("Remove Selected Item");
    removeAction.setText("Remove");
    initAction(removeAction, "cog_delete.png", menuManager);
    executeAction.setEnabled(false);
    editAction.setEnabled(false);
    newAction.setEnabled(false);
    newFolderAction.setEnabled(false);
    removeAction.setEnabled(false);
    display = shell.getDisplay();
    setupDnd();
    if (tree.getItemCount() > 0) {
        tree.setSelection(tree.getItems()[0]);
        onTreeSelect();
    }
/*
tree = new Tree( parent, SWT.BORDER );
tree.setHeaderVisible( true );
FormData d1 = new FormData();
d1.top = new FormAttachment( 0, 1 );
d1.left = new FormAttachment( 0, 1 );
d1.right = new FormAttachment( 100, -1 );
d1.bottom = new FormAttachment( 100, -1 );
tree.setLayoutData( d1 );
*/
/*
tree = new Tree( sashForm,  SWT.BORDER );
*/
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) Action(org.eclipse.jface.action.Action) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) MenuManager(org.eclipse.jface.action.MenuManager) DisposeEvent(org.eclipse.swt.events.DisposeEvent) Separator(org.eclipse.jface.action.Separator)

Example 19 with Separator

use of org.eclipse.jface.action.Separator in project cubrid-manager by CUBRID.

the class SchemaContextMenuProvider method buildPublicMenuItems.

/**
	 * Add public menu items
	 * 
	 * @param menu
	 */
private void buildPublicMenuItems(IMenuManager menu) {
    IAction action;
    GEFActionConstants.addStandardActionGroups(menu);
    menu.add(new Separator(AbstractSelectionAction.MANAGE_GROUP_ID));
    menu.add(new Separator(AbstractSelectionAction.GLOBAL_GROUP_ID));
    action = getActionRegistry().getAction(ImportERwinDataAction.ID);
    menu.appendToGroup(AbstractSelectionAction.MANAGE_GROUP_ID, action);
}
Also used : IAction(org.eclipse.jface.action.IAction) Separator(org.eclipse.jface.action.Separator)

Example 20 with Separator

use of org.eclipse.jface.action.Separator in project cubrid-manager by CUBRID.

the class ApplicationActionBarAdvisor method fillCoolBar.

/**
	 * Fills the cool bar with the main toolbars for the window.
	 *
	 * @param coolBar the cool bar manager
	 */
protected void fillCoolBar(ICoolBarManager coolBarManager) {
    ActionManager manager = ActionManager.getInstance();
    coolBarManager.setLockLayout(true);
    IToolBarManager toolbarManager = new ToolBarManager(SWT.FLAT | SWT.WRAP | SWT.BOTTOM);
    coolBarManager.add(new ToolBarContributionItem(toolbarManager, IActionConstants.TOOL_NEW1));
    Bundle cqbBundle = Platform.getBundle(ApplicationUtil.CQB_PLUGIN_ID);
    /* Active the CQB plugin */
    if (cqbBundle != null) {
        try {
            cqbBundle.start();
        } catch (Exception e) {
            LOGGER.error(e.getMessage());
        }
    }
    Bundle cmBundle = Platform.getBundle(ApplicationUtil.CM_PLUGIN_ID);
    /* Active the CM plugin */
    if (cmBundle != null) {
        try {
            cmBundle.start();
        } catch (Exception e) {
            LOGGER.error(e.getMessage());
        }
    }
    // Change view actions
    if (cqbBundle != null) {
        DropDownAction viewAction = new DropDownAction(Messages.modeActionBig, IAction.AS_DROP_DOWN_MENU, CubridManagerAppPlugin.getImageDescriptor("icons/cubridmanager32.gif"));
        viewAction.setDisabledImageDescriptor(CubridManagerAppPlugin.getImageDescriptor("icons/cubridmanager32.gif"));
        MenuManager viewActionManager = viewAction.getMenuManager();
        viewActionManager.add(manager.getAction(OpenCMPerspectiveAction.ID));
        viewActionManager.add(manager.getAction(OpenCQBPerspectiveAction.ID));
        ActionContributionItem viewItems = new ActionContributionItem(viewAction);
        viewItems.setMode(ActionContributionItem.MODE_FORCE_TEXT);
        viewItems.setId(IPerspectiveConstance.PERSPECTIVE_ACTION_CONTRIBUTION_ID);
        toolbarManager.add(viewItems);
        toolbarManager.add(new Separator());
    }
    /*TOOLS-3988 There still is the install option after installing cmt plugin.*/
    Bundle bundle = Platform.getBundle(ApplicationUtil.CMT_PLUGIN_ID);
    if (bundle == null) {
        toolbarManager.add(new Separator());
        IAction action = ActionManager.getInstance().getAction(InstallMigrationToolkitAction.ID);
        if (action != null) {
            ActionContributionItem item = new ActionContributionItem(action);
            item.setMode(ActionContributionItem.MODE_FORCE_TEXT);
            toolbarManager.add(item);
            item.setId(IPerspectiveConstance.MIGRATION_ACTION_CONTRIBUTION_ID);
        }
    } else {
        /*Active the CMT plugin */
        try {
            bundle.start();
        } catch (Exception e) {
            LOGGER.error(e.getMessage());
        }
    }
    // Help
    toolbarManager.add(new Separator());
    DropDownAction helpDropAction = new DropDownAction(Messages.helpActionNameBig, IAction.AS_DROP_DOWN_MENU, CubridManagerUIPlugin.getImageDescriptor("icons/action/help_big.png"));
    helpDropAction.setDisabledImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/help_big.png"));
    MenuManager helpActionManager = helpDropAction.getMenuManager();
    helpActionManager.add(manager.getAction(HelpDocumentAction.ID));
    if ("ko".equals(Messages.language)) {
        helpActionManager.add(newFeatureAction);
    }
    helpActionManager.add(new Separator());
    helpActionManager.add(createItem(ReportBugAction.ID));
    helpActionManager.add(new Separator());
    helpActionManager.add(manager.getAction(ViewServerVersionAction.ID));
    helpActionManager.add(clientVersionAction);
    ActionContributionItem helpItems = new ActionContributionItem(helpDropAction);
    helpItems.setMode(ActionContributionItem.MODE_FORCE_TEXT);
    helpItems.setId(IPerspectiveConstance.HELP_ACTION_CONTRIBUTION_ID);
    toolbarManager.add(helpItems);
    ControlContribution searchContribution = new ControlContribution(SearchContributionComposite.class.getName()) {

        protected Control createControl(Composite parent) {
            return new SearchContributionComposite(parent, SWT.None);
        }
    };
    searchContribution.setId(IPerspectiveConstance.SEARCH_ACTION_CONTRIBUTION_ID);
    toolbarManager.add(new Separator());
    toolbarManager.add(searchContribution);
}
Also used : IAction(org.eclipse.jface.action.IAction) SearchContributionComposite(com.cubrid.common.ui.common.control.SearchContributionComposite) Composite(org.eclipse.swt.widgets.Composite) Bundle(org.osgi.framework.Bundle) ControlContribution(org.eclipse.jface.action.ControlContribution) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ToolBarManager(org.eclipse.jface.action.ToolBarManager) ActionManager(com.cubrid.common.ui.spi.action.ActionManager) ToolBarContributionItem(org.eclipse.jface.action.ToolBarContributionItem) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) DropDownAction(com.cubrid.common.ui.common.action.DropDownAction) IToolBarManager(org.eclipse.jface.action.IToolBarManager) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) SearchContributionComposite(com.cubrid.common.ui.common.control.SearchContributionComposite) Separator(org.eclipse.jface.action.Separator)

Aggregations

Separator (org.eclipse.jface.action.Separator)89 MenuManager (org.eclipse.jface.action.MenuManager)39 IMenuManager (org.eclipse.jface.action.IMenuManager)37 IAction (org.eclipse.jface.action.IAction)14 Menu (org.eclipse.swt.widgets.Menu)10 Action (org.eclipse.jface.action.Action)9 IMenuListener (org.eclipse.jface.action.IMenuListener)9 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)9 ActionManager (com.cubrid.common.ui.spi.action.ActionManager)7 IToolBarManager (org.eclipse.jface.action.IToolBarManager)7 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)6 GroupMarker (org.eclipse.jface.action.GroupMarker)6 IContributionManager (org.eclipse.jface.action.IContributionManager)5 TreeViewer (org.eclipse.jface.viewers.TreeViewer)5 IActionBars (org.eclipse.ui.IActionBars)5 DBAServerSession (org.jkiss.dbeaver.model.admin.sessions.DBAServerSession)5 DBAServerSessionManager (org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager)5 SessionManagerViewer (org.jkiss.dbeaver.ui.views.session.SessionManagerViewer)5 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)4 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)4