Search in sources :

Example 56 with Separator

use of org.eclipse.jface.action.Separator in project dbeaver by serge-rider.

the class SQLEditorNested method contributeEditorCommands.

protected void contributeEditorCommands(IContributionManager toolBarManager) {
    toolBarManager.add(ActionUtils.makeCommandContribution(getSite().getWorkbenchWindow(), CoreCommands.CMD_OPEN_FILE));
    toolBarManager.add(ActionUtils.makeCommandContribution(getSite().getWorkbenchWindow(), CoreCommands.CMD_SAVE_FILE));
    String compileCommandId = getCompileCommandId();
    if (compileCommandId != null) {
        toolBarManager.add(new Separator());
        toolBarManager.add(ActionUtils.makeCommandContribution(getSite().getWorkbenchWindow(), compileCommandId));
        toolBarManager.add(new ViewLogAction());
    }
}
Also used : Separator(org.eclipse.jface.action.Separator)

Example 57 with Separator

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

the class SQLEditorComposite method createContextMenu.

protected void createContextMenu() {
    MenuManager menuManager = new MenuManager();
    menuManager.setRemoveAllWhenShown(true);
    menuManager.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            IAction copyAction = ActionManager.getInstance().getAction(CopyAction.ID);
            if (copyAction != null) {
                manager.add(copyAction);
            }
            IAction cutAction = ActionManager.getInstance().getAction(CutAction.ID);
            if (cutAction != null) {
                manager.add(cutAction);
            }
            IAction pasteAction = ActionManager.getInstance().getAction(PasteAction.ID);
            if (pasteAction != null) {
                manager.add(pasteAction);
            }
            manager.add(new Separator());
            IAction findAction = ActionManager.getInstance().getAction(FindReplaceAction.ID);
            if (findAction != null) {
                manager.add(findAction);
            }
            manager.add(new Separator());
            IAction runQueryAction = ActionManager.getInstance().getAction(RunQueryAction.ID);
            if (runQueryAction != null) {
                manager.add(runQueryAction);
            }
            IAction runSqlmapQueryAction = ActionManager.getInstance().getAction(ParseSqlmapQueryAction.ID);
            if (runSqlmapQueryAction != null) {
                manager.add(runSqlmapQueryAction);
            }
            IAction runQueryPlanAction = ActionManager.getInstance().getAction(RunQueryPlanAction.ID);
            if (runQueryPlanAction != null) {
                manager.add(runQueryPlanAction);
            }
            IAction favoriteQueryAction = ActionManager.getInstance().getAction(AddQueryToFavoriteAction.ID);
            if (favoriteQueryAction != null) {
                manager.add(favoriteQueryAction);
            }
            manager.add(new Separator());
            IAction showSchemaViewAction = ActionManager.getInstance().getAction(ShowSchemaAction.ID);
            if (showSchemaViewAction != null) {
                manager.add(showSchemaViewAction);
            }
            manager.add(new Separator());
            IAction queryTunerRunAction = ActionManager.getInstance().getAction(QueryTunerRunAction.ID);
            manager.add(queryTunerRunAction);
            manager.add(new Separator());
            IAction createPhpCodeAction = ActionManager.getInstance().getAction(CreateSqlPhpCodeAction.ID);
            if (createPhpCodeAction != null) {
                manager.add(createPhpCodeAction);
            }
            IAction createJavaCodeAction = ActionManager.getInstance().getAction(CreateSqlJavaCodeAction.ID);
            if (createJavaCodeAction != null) {
                manager.add(createJavaCodeAction);
            }
            manager.add(new Separator());
            IAction reformatColumnsAliasAction = ActionManager.getInstance().getAction(ReformatColumnsAliasAction.ID);
            if (reformatColumnsAliasAction != null) {
                manager.add(reformatColumnsAliasAction);
            }
        }
    });
    Menu contextMenu = menuManager.createContextMenu(text);
    text.setMenu(contextMenu);
}
Also used : IAction(org.eclipse.jface.action.IAction) 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) Separator(org.eclipse.jface.action.Separator)

Example 58 with Separator

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

the class MenuProvider method buildMenu.

/**
	 * Build the context menu and menubar menu according to the selected cubrid
	 * node
	 *
	 * @param manager the parent menu manager
	 * @param node the ICubridNode object
	 */
public void buildMenu(IMenuManager manager, ICubridNode node) {
    // fill Action Menu according to node type
    String type = node.getType();
    if (NodeType.STORED_PROCEDURE_FOLDER.equals(type)) {
        addActionToManager(manager, getAction(AddFunctionAction.ID));
        addActionToManager(manager, getAction(AddProcedureAction.ID));
    } else if (NodeType.STORED_PROCEDURE_FUNCTION_FOLDER.equals(type)) {
        addActionToManager(manager, getAction(AddFunctionAction.ID));
    } else if (NodeType.STORED_PROCEDURE_FUNCTION.equals(type)) {
        addActionToManager(manager, getAction(EditFunctionAction.ID));
        addActionToManager(manager, getAction(DeleteFunctionAction.ID));
    } else if (NodeType.STORED_PROCEDURE_PROCEDURE_FOLDER.equals(type)) {
        addActionToManager(manager, getAction(AddProcedureAction.ID));
    } else if (NodeType.STORED_PROCEDURE_PROCEDURE.equals(type)) {
        addActionToManager(manager, getAction(EditProcedureAction.ID));
        addActionToManager(manager, getAction(DeleteProcedureAction.ID));
    } else if (NodeType.TRIGGER_FOLDER.equals(type)) {
        // trigger
        addActionToManager(manager, getAction(NewTriggerAction.ID));
    } else if (NodeType.TRIGGER.equals(type)) {
        // trigger instance
        addActionToManager(manager, getAction(AlterTriggerAction.ID));
        addActionToManager(manager, getAction(DropTriggerAction.ID));
    } else if (NodeType.SERIAL_FOLDER.equals(type)) {
        addActionToManager(manager, getAction(CreateSerialAction.ID));
    } else if (NodeType.SERIAL.equals(type)) {
        addActionToManager(manager, getAction(EditSerialAction.ID));
        addActionToManager(manager, getAction(DeleteSerialAction.ID));
    } else if (NodeType.SYSTEM_TABLE.equals(type)) {
        buildSystemTableMenu(manager);
    } else if (NodeType.SYSTEM_VIEW.equals(type)) {
        buildSystemViewMenu(manager);
    } else if (NodeType.TABLE_FOLDER.equals(type)) {
        addActionToManager(manager, getAction(NewTableAction.ID));
        manager.add(new Separator());
        addActionToManager(manager, getAction(ExportTableDefinitionAction.ID));
        manager.add(new Separator());
        // Install Schema Comment
        addActionToManager(manager, getAction(SchemaCommentInstallAction.ID));
        manager.add(new Separator());
        IMenuManager perparedMenu = new MenuManager(Messages.preparedTableDataMenuName);
        manager.add(perparedMenu);
        addActionToManager(perparedMenu, getAction(PstmtOneDataAction.ID));
        addActionToManager(perparedMenu, getAction(PstmtMultiDataAction.ID));
        //			addActionToManager(manager, getAction(RunSQLFileAction.ID));
        manager.add(new Separator());
        // Export & Import Actions
        addActionToManager(manager, getAction(ExportWizardAction.ID));
        addActionToManager(manager, getAction(ImportWizardAction.ID));
        manager.add(new Separator());
    } else if (NodeType.USER_PARTITIONED_TABLE_FOLDER.equals(type)) {
        // partition table
        buildUserTableMenu(manager, node);
    } else if (NodeType.USER_PARTITIONED_TABLE.equals(type)) {
        // partition table/subtable
        buildPartitionedTableMenu(manager);
    } else if (NodeType.USER_TABLE.equals(type)) {
        buildUserTableMenu(manager, node);
    } else if (NodeType.USER_VIEW.equals(type)) {
        // User schema/View instance
        buildUserViewMenu(manager);
    } else if (NodeType.VIEW_FOLDER.equals(type)) {
        addActionToManager(manager, getAction(CreateViewAction.ID));
    } else if (NodeType.TABLE_COLUMN.equals(type)) {
        addActionToManager(manager, getAction(ColumnSelectSqlAction.ID));
        addActionToManager(manager, getAction(ColumnSelectCountAction.ID));
    } else if (NodeType.GROUP.equals(type)) {
        addActionToManager(manager, getAction(GroupPropertyAction.ID));
        manager.add(new Separator());
    }
    manager.update(true);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Separator(org.eclipse.jface.action.Separator)

Example 59 with Separator

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

the class MenuProvider method buildPartitionedTableMenu.

/**
	 * Build the partitioned table menu
	 *
	 * @param manager IMenuManager
	 */
public void buildPartitionedTableMenu(IMenuManager manager) {
    addActionToManager(manager, getAction(TableSelectAllAction.ID));
    addActionToManager(manager, getAction(TableSelectCountAction.ID));
    manager.add(new Separator());
    addActionToManager(manager, getAction(UpdateStatisticsAction.ID));
    manager.add(new Separator());
}
Also used : Separator(org.eclipse.jface.action.Separator)

Example 60 with Separator

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

the class MenuProvider method buildSystemViewMenu.

/**
	 *
	 * Build the system view menu
	 *
	 * @param manager IMenuManager
	 */
public void buildSystemViewMenu(IMenuManager manager) {
    addActionToManager(manager, getAction(DatabaseQueryNewAction.ID));
    manager.add(new Separator());
    addActionToManager(manager, getAction(TableSelectAllAction.ID));
    addActionToManager(manager, getAction(TableSelectCountAction.ID));
    manager.add(new Separator());
    //		addActionToManager(manager, getAction(ShowSchemaEditorAction.ID));
    addActionToManager(manager, getAction(PropertyViewAction.ID));
    manager.add(new Separator());
}
Also used : 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