Search in sources :

Example 71 with Separator

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

the class ActionAdvisor method showMenu.

public void showMenu(IMenuManager menuManager) {
    ActionManager manager = ActionManager.getInstance();
    MenuManager fileMenu = new MenuManager(Messages.mnu_fileMenuName, IActionConstants.MENU_FILE);
    MenuManager editMenu = new MenuManager(Messages.mnu_editMenuName, IActionConstants.MENU_EDIT);
    MenuManager toolsMenu = new MenuManager(Messages.mnu_toolsMenuName, IActionConstants.MENU_TOOLS);
    MenuManager actionMenu = new MenuManager(Messages.mnu_actionMenuName, IActionConstants.MENU_ACTION);
    // fill in file menu
    fileMenu.add(manager.getAction(OpenQueryConnAction.ID));
    fileMenu.add(manager.getAction(CloseQueryConnAction.ID));
    fileMenu.add(new Separator());
    fileMenu.add(manager.getAction(NewQueryConnAction.ID));
    fileMenu.add(manager.getAction(EditQueryConnAction.ID));
    fileMenu.add(manager.getAction(DeleteQueryConnAction.ID));
    fileMenu.add(new Separator());
    fileMenu.add(manager.getAction(ConnectionUrlImportAction.ID));
    fileMenu.add(manager.getAction(ConnectionUrlExportAction.ID));
    fileMenu.add(new Separator());
    fileMenu.add(manager.getAction(ConnectionImportAction.ID));
    fileMenu.add(manager.getAction(ConnectionExportAction.ID));
    fileMenu.add(new Separator());
    fileMenu.add(closeAction);
    fileMenu.add(closeAllAction);
    fileMenu.add(new Separator());
    fileMenu.add(manager.getAction(OpenQueryAction.ID));
    fileMenu.add(saveAction);
    fileMenu.add(saveasAction);
    fileMenu.add(saveAllAction);
    fileMenu.add(new Separator());
    fileMenu.add(manager.getAction(RestoreQueryEditorAction.ID));
    fileMenu.add(new Separator());
    fileMenu.add(manager.getAction(ImportConnsAction.ID));
    fileMenu.add(SelectWorkspaceDialog.getWorkspaceMenu(ApplicationType.CUBRID_QUERY_BROWSER.getShortName(), Version.buildVersionId));
    fileMenu.add(new Separator());
    ActionContributionItem preferencesActionItem = new ActionContributionItem(preferenceAction);
    fileMenu.add(preferencesActionItem);
    if (Util.isMac()) {
    }
    fileMenu.add(manager.getAction(RefreshAction.ID));
    fileMenu.add(new Separator());
    fileMenu.add(quitAction);
    fileMenu.add(new Separator());
    // fill in edit menu
    editMenu.add(undoRetargetAction);
    editMenu.add(redoRetargetAction);
    editMenu.add(new Separator());
    editMenu.add(copyRetargetAction);
    editMenu.add(cutRetargetAction);
    editMenu.add(pasteRetargetAction);
    editMenu.add(new Separator());
    editMenu.add(findRetargetAction);
    editMenu.add(manager.getAction(GotoLineAction.ID));
    // fill in the tools menu
    toolsMenu.add(manager.getAction(QueryNewAction.ID));
    toolsMenu.add(manager.getAction(QueryNewCustomAction.ID));
    toolsMenu.add(new Separator());
    toolsMenu.add(manager.getAction(OIDNavigatorAction.ID));
    toolsMenu.add(new Separator());
    toolsMenu.add(manager.getAction(NewTableAction.ID));
    toolsMenu.add(manager.getAction(CreateViewAction.ID));
    toolsMenu.add(new Separator());
    toolsMenu.add(manager.getAction(CreateSerialAction.ID));
    toolsMenu.add(new Separator());
    toolsMenu.add(manager.getAction(NewTriggerAction.ID));
    toolsMenu.add(new Separator());
    toolsMenu.add(manager.getAction(AddFunctionAction.ID));
    toolsMenu.add(manager.getAction(AddProcedureAction.ID));
    toolsMenu.add(new Separator());
    toolsMenu.add(manager.getAction(ExportWizardAction.ID));
    toolsMenu.add(manager.getAction(ImportWizardAction.ID));
    //		toolsMenu.add(new Separator());
    //		fileMenu.add(manager.getAction(OpenSchemaEditorAction.ID));
    fileMenu.add(new Separator());
    IMenuManager perparedMenu = new MenuManager(com.cubrid.common.ui.spi.Messages.preparedTableDataMenuName);
    toolsMenu.add(perparedMenu);
    perparedMenu.add(manager.getAction(PstmtOneDataAction.ID));
    perparedMenu.add(manager.getAction(PstmtMultiDataAction.ID));
    toolsMenu.add(new Separator());
    toolsMenu.add(manager.getAction(BrokerLogParserAction.ID));
    toolsMenu.add(manager.getAction(BrokerLogTopMergeAction.ID));
    toolsMenu.add(manager.getAction(BrokerConfOpenFileAction.ID));
    toolsMenu.add(new Separator());
    toolsMenu.add(manager.getAction(SchemaCommentInstallAction.ID));
    menuManager.insertBefore(getMenuInsertPoint(menuManager), fileMenu);
    menuManager.insertBefore(getMenuInsertPoint(menuManager), editMenu);
    menuManager.insertBefore(getMenuInsertPoint(menuManager), toolsMenu);
    menuManager.insertBefore(getMenuInsertPoint(menuManager), actionMenu);
    menuManager.update(true);
}
Also used : ActionManager(com.cubrid.common.ui.spi.action.ActionManager) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) 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 72 with Separator

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

the class CubridMonitorNavigatorView method buildPopupMenu.

/**
	 *
	 * Build the context menu
	 *
	 * @param menuManager IMenuManager
	 */
protected void buildPopupMenu(final IMenuManager menuManager) {
    IStructuredSelection selection = (IStructuredSelection) tv.getSelection();
    if (selection == null || selection.isEmpty()) {
        ActionManager.addActionToManager(menuManager, ActionManager.getInstance().getAction(AddMonitorDashboardAction.ID));
        ActionManager.addActionToManager(menuManager, ActionManager.getInstance().getAction(AddMonitorStatisticPageAction.ID));
        return;
    }
    ICubridNode node = null;
    Object obj = selection.getFirstElement();
    if (obj instanceof ICubridNode) {
        node = (ICubridNode) obj;
    } else {
        ActionManager.addActionToManager(menuManager, ActionManager.getInstance().getAction(AddMonitorDashboardAction.ID));
        ActionManager.addActionToManager(menuManager, ActionManager.getInstance().getAction(AddMonitorStatisticPageAction.ID));
        return;
    }
    ActionManager.getInstance().setActionsMenu(menuManager);
    if (CubridNodeTypeManager.isCanRefresh(node.getType())) {
        menuManager.add(new Separator());
        ActionManager.addActionToManager(menuManager, ActionManager.getInstance().getAction(RefreshAction.ID));
    }
}
Also used : IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) Separator(org.eclipse.jface.action.Separator)

Example 73 with Separator

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

the class CubridHostNavigatorView method buildPopupMenu.

/**
	 * Build the context menu
	 *
	 * @param menuManager IMenuManager
	 */
protected void buildPopupMenu(final IMenuManager menuManager) {
    IStructuredSelection selection = (IStructuredSelection) tv.getSelection();
    if (selection == null || selection.isEmpty()) {
        ActionManager.addActionToManager(menuManager, AddHostAction.ID);
        menuManager.add(new Separator());
        //			menuManager.add(new Separator());
        return;
    }
    ICubridNode node = null;
    Object obj = selection.getFirstElement();
    if (obj instanceof ICubridNode) {
        node = (ICubridNode) obj;
    } else {
        ActionManager.addActionToManager(menuManager, AddHostAction.ID);
        return;
    }
    String type = node.getType();
    if (CubridNodeType.SERVER.equals(type)) {
        if (ConnectHostAction.isSupportedNode(obj)) {
            ActionManager.addActionToManager(menuManager, ConnectHostAction.ID);
        }
        if (DisConnectHostAction.isSupportedNode(obj)) {
            ActionManager.addActionToManager(menuManager, DisConnectHostAction.ID);
        }
        menuManager.add(new Separator());
        ActionManager.addActionToManager(menuManager, AddHostAction.ID);
        ActionManager.addActionToManager(menuManager, EditHostAction.ID);
        ActionManager.addActionToManager(menuManager, DeleteHostAction.ID);
        menuManager.add(new Separator());
        //			ActionManager.addActionToManager(menuManager, OpenSchemaEditorAction.ID);
        //			menuManager.add(new Separator());
        ActionManager.addActionToManager(menuManager, ConnectionUrlExportAction.ID);
        menuManager.add(new Separator());
        ActionManager.addActionToManager(menuManager, ChangeManagerPasswordAction.ID);
        menuManager.add(new Separator());
    }
    ActionManager.getInstance().setActionsMenu(menuManager);
    if (CubridNodeTypeManager.isCanRefresh(node.getType())) {
        menuManager.add(new Separator());
        ActionManager.addActionToManager(menuManager, RefreshAction.ID);
    }
}
Also used : IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) Separator(org.eclipse.jface.action.Separator)

Example 74 with Separator

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

the class CubridMenuProvider method buildDatabaseMenu.

/**
	 * Construct database related actions
	 *
	 * @param manager the parent IMenuManager
	 * @param node the ICubridNode object
	 */
private void buildDatabaseMenu(IMenuManager manager, ICubridNode node) {
    if (LoginDatabaseAction.isSupportedNode(node)) {
        addActionToManager(manager, getAction(LoginDatabaseAction.ID));
    }
    if (LogoutDatabaseAction.isSupportedNode(node)) {
        addActionToManager(manager, getAction(LogoutDatabaseAction.ID));
    }
    manager.add(new Separator());
    addActionToManager(manager, getAction(EditDatabaseLoginAction.ID));
    addActionToManager(manager, getAction(ConnectionUrlExportAction.ID));
    manager.add(new Separator());
    addActionToManager(manager, getAction(DatabaseQueryNewAction.ID));
    manager.add(new Separator());
    addActionToManager(manager, getAction(ShowDatabaseDashboardAction.ID));
    manager.add(new Separator());
    ActionManager.addActionToManager(manager, SchemaCompareWizardAction.ID);
    ActionManager.addActionToManager(manager, DataCompareWizardAction.ID);
    //		manager.add(new Separator());
    //		addActionToManager(manager, getAction(OpenSchemaEditorAction.ID));
    manager.add(new Separator());
    addActionToManager(manager, getAction(ExportERwinAction.ID));
    addActionToManager(manager, getAction(ImportERwinAction.ID));
    manager.add(new Separator());
    CubridDatabase database = (CubridDatabase) node;
    if (database.isDistributorDb()) {
        buildReplicationMenu(manager);
        manager.add(new Separator());
    }
    // Export & Import Actions
    manager.add(new Separator());
    addActionToManager(manager, getAction(ExportWizardAction.ID));
    addActionToManager(manager, getAction(ImportWizardAction.ID));
    manager.add(new Separator());
    addActionToManager(manager, getAction(ExportTableDefinitionAction.ID));
    // Install Schema Comment
    addActionToManager(manager, getAction(SchemaCommentInstallAction.ID));
    manager.add(new Separator());
    //		manager.add(new Separator());
    //		addActionToManager(manager, getAction(RunSQLFileAction.ID));
    // Database Management Actions
    manager.add(new Separator());
    IMenuManager dbManMenu = new MenuManager(Messages.dbManMenu, CubridManagerUIPlugin.getImageDescriptor("icons/navigator/database_man.png"), null);
    manager.add(dbManMenu);
    if (StartDatabaseAction.isSupportedNode(node)) {
        addActionToManager(manager, getAction(StartDatabaseAction.ID));
    }
    if (StopDatabaseAction.isSupportedNode(node)) {
        addActionToManager(manager, getAction(StopDatabaseAction.ID));
    }
    addActionToManager(dbManMenu, getAction(LoadDatabaseAction.ID));
    addActionToManager(dbManMenu, getAction(UnloadDatabaseAction.ID));
    dbManMenu.add(new Separator());
    addActionToManager(dbManMenu, getAction(OptimizeAction.ID));
    addActionToManager(dbManMenu, getAction(CompactDatabaseAction.ID));
    addActionToManager(dbManMenu, getAction(CheckDatabaseAction.ID));
    dbManMenu.add(new Separator());
    addActionToManager(dbManMenu, getAction(CopyDatabaseAction.ID));
    addActionToManager(dbManMenu, getAction(RenameDatabaseAction.ID));
    dbManMenu.add(new Separator());
    addActionToManager(dbManMenu, getAction(BackupDatabaseAction.ID));
    addActionToManager(dbManMenu, getAction(RestoreDatabaseAction.ID));
    dbManMenu.add(new Separator());
    addActionToManager(dbManMenu, getAction(DeleteDatabaseAction.ID));
    IMenuManager dbInfoMenu = new MenuManager(Messages.dbInfoMenu, CubridManagerUIPlugin.getImageDescriptor("icons/navigator/database_info.png"), null);
    manager.add(dbInfoMenu);
    addActionToManager(dbInfoMenu, getAction(LockInfoAction.ID));
    addActionToManager(dbInfoMenu, getAction(TransactionInfoAction.ID));
    if (CompatibleUtil.isSupportPlanAndParamDump(database.getServer().getServerInfo())) {
        dbInfoMenu.add(new Separator());
        addActionToManager(dbInfoMenu, getAction(PlanDumpAction.ID));
        addActionToManager(dbInfoMenu, getAction(ParamDumpAction.ID));
    }
    dbInfoMenu.add(new Separator());
    addActionToManager(dbInfoMenu, getAction(OIDNavigatorAction.ID));
    manager.add(new Separator());
    addActionToManager(manager, getAction(PropertyAction.ID));
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) CubridDatabase(com.cubrid.common.ui.spi.model.CubridDatabase) Separator(org.eclipse.jface.action.Separator)

Example 75 with Separator

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

the class ReplEditorActionBarContributor method contributeToToolBar.

/**
	 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
	 * @param toolBarManager the manager that controls the workbench tool bar
	 */
public void contributeToToolBar(IToolBarManager toolBarManager) {
    toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
    toolBarManager.add(getAction(ActionFactory.REDO.getId()));
    toolBarManager.add(getAction(EditAction.ID));
    toolBarManager.add(getAction(ActionFactory.DELETE.getId()));
    toolBarManager.add(new Separator());
    toolBarManager.add(getAction(GEFActionConstants.ZOOM_IN));
    toolBarManager.add(getAction(GEFActionConstants.ZOOM_OUT));
    toolBarManager.add(new ZoomComboContributionItem(getPage()));
    toolBarManager.add(new Separator());
    toolBarManager.add(getAction(GEFActionConstants.ALIGN_LEFT));
    toolBarManager.add(getAction(GEFActionConstants.ALIGN_CENTER));
    toolBarManager.add(getAction(GEFActionConstants.ALIGN_RIGHT));
    toolBarManager.add(getAction(GEFActionConstants.ALIGN_TOP));
    toolBarManager.add(getAction(GEFActionConstants.ALIGN_MIDDLE));
    toolBarManager.add(getAction(GEFActionConstants.ALIGN_BOTTOM));
}
Also used : ZoomComboContributionItem(org.eclipse.gef.ui.actions.ZoomComboContributionItem) 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