Search in sources :

Example 1 with ActionManager

use of com.cubrid.common.ui.spi.action.ActionManager in project cubrid-manager by CUBRID.

the class QueryEditorPart method hookRetragetActions.

protected void hookRetragetActions() {
    ActionManager actionManager = ActionManager.getInstance();
    IActionBars bar = this.getEditorSite().getActionBars();
    bar.setGlobalActionHandler(UndoAction.ID, actionManager.getAction(UndoAction.ID));
    bar.setGlobalActionHandler(RedoAction.ID, actionManager.getAction(RedoAction.ID));
    IAction action = actionManager.getAction(CutAction.ID);
    action.setEnabled(true);
    bar.setGlobalActionHandler(CutAction.ID, action);
    IAction copyAction = actionManager.getAction(CopyAction.ID);
    bar.setGlobalActionHandler(CopyAction.ID, copyAction);
    copyAction.setEnabled(true);
    IAction pasteAction = actionManager.getAction(PasteAction.ID);
    bar.setGlobalActionHandler(PasteAction.ID, pasteAction);
    pasteAction.setEnabled(true);
    bar.setGlobalActionHandler(FindReplaceAction.ID, actionManager.getAction(FindReplaceAction.ID));
    bar.setGlobalActionHandler(QueryOpenAction.ID, actionManager.getAction(QueryOpenAction.ID));
    bar.updateActionBars();
}
Also used : ActionManager(com.cubrid.common.ui.spi.action.ActionManager) IAction(org.eclipse.jface.action.IAction) IActionBars(org.eclipse.ui.IActionBars)

Example 2 with ActionManager

use of com.cubrid.common.ui.spi.action.ActionManager in project cubrid-manager by CUBRID.

the class ApplicationActionBarAdvisor method createItem.

/**
	 * Create action contribution item for action for show text and icon
	 *
	 * @param id action ID
	 * @return ActionContributionItem
	 */
private ActionContributionItem createItem(String id) {
    ActionManager manager = ActionManager.getInstance();
    IAction action = manager.getAction(id);
    if (action == null) {
        return null;
    }
    ActionContributionItem item = new ActionContributionItem(action);
    item.setMode(ActionContributionItem.MODE_FORCE_TEXT);
    return item;
}
Also used : ActionManager(com.cubrid.common.ui.spi.action.ActionManager) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) IAction(org.eclipse.jface.action.IAction)

Example 3 with ActionManager

use of com.cubrid.common.ui.spi.action.ActionManager 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)

Example 4 with ActionManager

use of com.cubrid.common.ui.spi.action.ActionManager in project cubrid-manager by CUBRID.

the class ColumnViewerSorter method registerContextMenu.

private void registerContextMenu() {
    final ActionManager manager = ActionManager.getInstance();
    final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    tableListView.getTable().addFocusListener(new FocusAdapter() {

        public void focusGained(FocusEvent event) {
            manager.changeFocusProvider(tableListView.getTable());
        }
    });
    Menu menu = new Menu(shell, SWT.POP_UP);
    // SELECT GROUP
    final Menu makeSelectQueryMenu = new Menu(menu);
    {
        MenuItem subMenuItem = new MenuItem(menu, SWT.CASCADE);
        subMenuItem.setText(com.cubrid.common.ui.spi.Messages.lblMakeSelectQueryGrp);
        subMenuItem.setMenu(makeSelectQueryMenu);
    }
    // SELECT
    initializeAction(makeSelectQueryMenu, getMakeQueryAction(MakeSelectQueryAction.ID));
    // Parameterized SELECT
    initializeAction(makeSelectQueryMenu, getMakeQueryAction(MakeSelectPstmtQueryAction.ID));
    // Parameterized INSERT
    initializeAction(menu, getMakeQueryAction(MakeInsertQueryAction.ID));
    // Parameterized UPDATE
    initializeAction(menu, getMakeQueryAction(MakeUpdateQueryAction.ID));
    // Parameterized DELETE
    initializeAction(menu, getMakeQueryAction(MakeDeleteQueryAction.ID));
    // CREATE
    initializeAction(menu, getMakeQueryAction(MakeCreateQueryAction.ID));
    new MenuItem(menu, SWT.SEPARATOR);
    final TableToJavaCodeAction createJavaCodeAction = (TableToJavaCodeAction) manager.getAction(TableToJavaCodeAction.ID);
    if (createJavaCodeAction != null) {
        MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
        menuItem.setText(createJavaCodeAction.getText());
        menuItem.setImage(CommonUITool.getImage(createJavaCodeAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode[] nodes = getAllSelectedNodes();
                if (nodes != null && nodes.length > 0) {
                    createJavaCodeAction.run(nodes);
                }
            }
        });
    }
    final TableToPhpCodeAction createPhpCodeAction = (TableToPhpCodeAction) manager.getAction(TableToPhpCodeAction.ID);
    if (createPhpCodeAction != null) {
        MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
        menuItem.setText(createPhpCodeAction.getText());
        menuItem.setImage(CommonUITool.getImage(createPhpCodeAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode[] nodes = getAllSelectedNodes();
                if (nodes != null && nodes.length > 0) {
                    createPhpCodeAction.run(nodes);
                }
            }
        });
    }
    final ExportTableDefinitionAction exportTableDefinitionAction = (ExportTableDefinitionAction) manager.getAction(ExportTableDefinitionAction.ID);
    if (exportTableDefinitionAction != null) {
        MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
        menuItem.setText(exportTableDefinitionAction.getText());
        menuItem.setImage(CommonUITool.getImage(exportTableDefinitionAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode[] nodes = getAllSelectedNodes();
                if (nodes != null && nodes.length > 0) {
                    exportTableDefinitionAction.run(nodes);
                }
            }
        });
    }
    new MenuItem(menu, SWT.SEPARATOR);
    // View data menu
    final Menu viewDataMenu = new Menu(menu);
    {
        final MenuItem subMenuItem = new MenuItem(menu, SWT.CASCADE);
        subMenuItem.setText(com.cubrid.common.ui.spi.Messages.viewDataMenuName);
        subMenuItem.setMenu(viewDataMenu);
    }
    final TableSelectAllAction selectAllAction = (TableSelectAllAction) manager.getAction(TableSelectAllAction.ID);
    if (selectAllAction != null) {
        MenuItem menuItem = new MenuItem(viewDataMenu, SWT.PUSH);
        menuItem.setText(selectAllAction.getText());
        menuItem.setImage(CommonUITool.getImage(selectAllAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode node = getFirstSelectedNode();
                if (node != null) {
                    selectAllAction.run((ISchemaNode) node);
                }
            }
        });
    }
    final SelectByOnePstmtDataAction selectPstmtAction = (SelectByOnePstmtDataAction) manager.getAction(SelectByOnePstmtDataAction.ID);
    if (selectPstmtAction != null) {
        MenuItem menuItem = new MenuItem(viewDataMenu, SWT.PUSH);
        menuItem.setText(selectPstmtAction.getText());
        menuItem.setImage(CommonUITool.getImage(selectPstmtAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode node = getFirstSelectedNode();
                if (node != null) {
                    selectPstmtAction.run((ISchemaNode) node);
                }
            }
        });
    }
    final SelectByMultiPstmtDataAction selectMultiPstmtAction = (SelectByMultiPstmtDataAction) manager.getAction(SelectByMultiPstmtDataAction.ID);
    if (selectMultiPstmtAction != null) {
        MenuItem menuItem = new MenuItem(viewDataMenu, SWT.PUSH);
        menuItem.setText(selectMultiPstmtAction.getText());
        menuItem.setImage(CommonUITool.getImage(selectMultiPstmtAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode node = getFirstSelectedNode();
                if (node != null) {
                    selectMultiPstmtAction.run((ISchemaNode) node);
                }
            }
        });
    }
    new MenuItem(viewDataMenu, SWT.SEPARATOR);
    final TableSelectCountAction selectCountAction = (TableSelectCountAction) manager.getAction(TableSelectCountAction.ID);
    if (selectCountAction != null) {
        MenuItem menuItem = new MenuItem(viewDataMenu, SWT.PUSH);
        menuItem.setText(selectCountAction.getText());
        menuItem.setImage(CommonUITool.getImage(selectAllAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode node = getFirstSelectedNode();
                if (node != null) {
                    selectCountAction.run((ISchemaNode) node);
                }
            }
        });
    }
    // Input data menu
    final Menu inputDataMenu = new Menu(menu);
    {
        MenuItem subMenuItem = new MenuItem(menu, SWT.CASCADE);
        subMenuItem.setText(com.cubrid.common.ui.spi.Messages.inputDataMenuName);
        subMenuItem.setMenu(inputDataMenu);
    }
    final InsertOneByPstmtAction insertStmtAction = (InsertOneByPstmtAction) manager.getAction(InsertOneByPstmtAction.ID);
    if (insertStmtAction != null) {
        MenuItem menuItem = new MenuItem(inputDataMenu, SWT.PUSH);
        menuItem.setText(insertStmtAction.getText());
        menuItem.setImage(CommonUITool.getImage(insertStmtAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode node = getFirstSelectedNode();
                if (node != null) {
                    insertStmtAction.run((ISchemaNode) node);
                }
            }
        });
    }
    final ImportDataFromFileAction insertMultiStmtAction = (ImportDataFromFileAction) manager.getAction(ImportDataFromFileAction.ID);
    if (insertMultiStmtAction != null) {
        MenuItem menuItem = new MenuItem(inputDataMenu, SWT.PUSH);
        menuItem.setText(insertMultiStmtAction.getText());
        menuItem.setImage(CommonUITool.getImage(insertMultiStmtAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode node = getFirstSelectedNode();
                if (node != null) {
                    insertMultiStmtAction.run((ISchemaNode) node);
                }
            }
        });
    }
    new MenuItem(menu, SWT.SEPARATOR);
    // Export & Import
    final ExportWizardAction exportWizardAction = (ExportWizardAction) manager.getAction(ExportWizardAction.ID);
    if (exportWizardAction != null) {
        MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
        menuItem.setText(exportWizardAction.getText());
        menuItem.setImage(CommonUITool.getImage(exportWizardAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode[] nodes = getAllSelectedNodes();
                if (nodes != null && nodes.length > 0) {
                    exportWizardAction.run(nodes);
                }
            }
        });
    }
    final ImportWizardAction importWizardAction = (ImportWizardAction) manager.getAction(ImportWizardAction.ID);
    if (importWizardAction != null) {
        MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
        menuItem.setText(importWizardAction.getText());
        menuItem.setImage(CommonUITool.getImage(importWizardAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode[] nodes = getAllSelectedNodes();
                if (nodes != null && nodes.length > 0) {
                    importWizardAction.run(nodes);
                }
            }
        });
    }
    new MenuItem(menu, SWT.SEPARATOR);
    final EditTableAction editTableAction = (EditTableAction) manager.getAction(EditTableAction.ID);
    if (editTableAction != null) {
        MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
        menuItem.setText(editTableAction.getText());
        menuItem.setImage(CommonUITool.getImage(editTableAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode node = getFirstSelectedNode();
                if (node != null) {
                    editTableAction.run((ISchemaNode) node);
                }
            }
        });
    }
    final RenameTableAction renameTableAction = (RenameTableAction) manager.getAction(RenameTableAction.ID);
    if (renameTableAction != null) {
        MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
        menuItem.setText(renameTableAction.getText());
        menuItem.setImage(CommonUITool.getImage(renameTableAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode node = getFirstSelectedNode();
                if (node != null) {
                    renameTableAction.run(database, (ISchemaNode) node);
                }
            }
        });
    }
    new MenuItem(menu, SWT.SEPARATOR);
    final Menu manageTableMenu = new Menu(menu);
    {
        final MenuItem subMenuItem = new MenuItem(menu, SWT.CASCADE);
        subMenuItem.setText(com.cubrid.common.ui.spi.Messages.tableMoreName);
        subMenuItem.setMenu(manageTableMenu);
    }
    final DeleteTableAction deleteTableAction = (DeleteTableAction) manager.getAction(DeleteTableAction.ID);
    if (deleteTableAction != null) {
        MenuItem menuItem = new MenuItem(manageTableMenu, SWT.PUSH);
        menuItem.setText(deleteTableAction.getText());
        menuItem.setImage(CommonUITool.getImage(deleteTableAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode[] nodes = getAllSelectedNodes();
                if (nodes != null && nodes.length > 0) {
                    deleteTableAction.run(nodes);
                }
            }
        });
    }
    final DropTableAction dropTableAction = (DropTableAction) manager.getAction(DropTableAction.ID);
    if (dropTableAction != null) {
        MenuItem menuItem = new MenuItem(manageTableMenu, SWT.PUSH);
        menuItem.setText(dropTableAction.getText());
        menuItem.setImage(CommonUITool.getImage(dropTableAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                ICubridNode[] nodes = getAllSelectedNodes();
                if (nodes != null && nodes.length > 0) {
                    dropTableAction.run(nodes);
                }
            }
        });
    }
    if (CompatibleUtil.isSupportCreateTableLike(database.getDatabaseInfo())) {
        final CreateLikeTableAction createLikeTableAction = (CreateLikeTableAction) manager.getAction(CreateLikeTableAction.ID);
        if (createLikeTableAction != null) {
            MenuItem menuItem = new MenuItem(manageTableMenu, SWT.PUSH);
            menuItem.setText(createLikeTableAction.getText());
            menuItem.setImage(CommonUITool.getImage(createLikeTableAction.getImageDescriptor()));
            menuItem.addSelectionListener(new SelectionAdapter() {

                public void widgetSelected(SelectionEvent event) {
                    ICubridNode node = getFirstSelectedNode();
                    if (node != null) {
                        createLikeTableAction.run((ISchemaNode) node);
                    }
                }
            });
        }
    }
    new MenuItem(menu, SWT.SEPARATOR);
    final NewTableAction newTableAction = (NewTableAction) manager.getAction(NewTableAction.ID);
    if (newTableAction != null) {
        MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
        menuItem.setText(newTableAction.getText());
        menuItem.setImage(CommonUITool.getImage(newTableAction.getImageDescriptor()));
        menuItem.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                newTableAction.run(database);
            }
        });
    }
    new MenuItem(menu, SWT.SEPARATOR);
    final MenuItem refreshItem = new MenuItem(menu, SWT.PUSH);
    refreshItem.setText(Messages.tablesDetailInfoPartRefreshMenu);
    refreshItem.setImage(CommonUIPlugin.getImage("icons/action/refresh.png"));
    refreshItem.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            refresh();
        }
    });
    tableListView.getTable().setMenu(menu);
}
Also used : FocusAdapter(org.eclipse.swt.events.FocusAdapter) ImportWizardAction(com.cubrid.common.ui.cubrid.table.action.ImportWizardAction) TableToPhpCodeAction(com.cubrid.common.ui.cubrid.table.action.TableToPhpCodeAction) RenameTableAction(com.cubrid.common.ui.cubrid.table.action.RenameTableAction) SelectByMultiPstmtDataAction(com.cubrid.common.ui.cubrid.table.action.SelectByMultiPstmtDataAction) TableSelectAllAction(com.cubrid.common.ui.cubrid.table.action.TableSelectAllAction) TableSelectCountAction(com.cubrid.common.ui.cubrid.table.action.TableSelectCountAction) FocusEvent(org.eclipse.swt.events.FocusEvent) ActionManager(com.cubrid.common.ui.spi.action.ActionManager) Shell(org.eclipse.swt.widgets.Shell) NewTableAction(com.cubrid.common.ui.cubrid.table.action.NewTableAction) SelectionEvent(org.eclipse.swt.events.SelectionEvent) DropTableAction(com.cubrid.common.ui.cubrid.table.action.DropTableAction) ExportWizardAction(com.cubrid.common.ui.cubrid.table.action.ExportWizardAction) Menu(org.eclipse.swt.widgets.Menu) CreateLikeTableAction(com.cubrid.common.ui.cubrid.table.action.CreateLikeTableAction) ISchemaNode(com.cubrid.common.ui.spi.model.ISchemaNode) EditTableAction(com.cubrid.common.ui.cubrid.table.action.EditTableAction) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) MenuItem(org.eclipse.swt.widgets.MenuItem) InsertOneByPstmtAction(com.cubrid.common.ui.cubrid.table.action.InsertOneByPstmtAction) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) ExportTableDefinitionAction(com.cubrid.common.ui.cubrid.table.action.ExportTableDefinitionAction) SelectByOnePstmtDataAction(com.cubrid.common.ui.cubrid.table.action.SelectByOnePstmtDataAction) DeleteTableAction(com.cubrid.common.ui.cubrid.table.action.DeleteTableAction) TableToJavaCodeAction(com.cubrid.common.ui.cubrid.table.action.TableToJavaCodeAction) ImportDataFromFileAction(com.cubrid.common.ui.cubrid.table.action.ImportDataFromFileAction)

Example 5 with ActionManager

use of com.cubrid.common.ui.spi.action.ActionManager in project cubrid-manager by CUBRID.

the class CubridHostNavigatorView method buildToolBar.

/**
	 * Build the view toolbar
	 *
	 * @param toolBarManager IToolBarManager
	 */
protected void buildToolBar(IToolBarManager toolBarManager) {
    ActionManager manager = ActionManager.getInstance();
    RefreshAction refreshAction = (RefreshAction) ActionManager.getInstance().getAction(RefreshAction.ID);
    toolBarManager.add(refreshAction);
    OpenTargetAction openObjectTabAction = (OpenTargetAction) manager.getAction(OpenTargetAction.ID);
    toolBarManager.add(openObjectTabAction);
    SwitchGroupModeAction grpSwitchAction = (SwitchGroupModeAction) manager.getAction(SwitchGroupModeAction.ID);
    grpSwitchAction.setNavigatorView(this);
    grpSwitchAction.init();
    toolBarManager.add(grpSwitchAction);
    GroupSettingAction groupSettingAction = (GroupSettingAction) manager.getAction(GroupSettingAction.ID);
    groupSettingAction.setNavigatorView(this);
    toolBarManager.add(groupSettingAction);
    ExpandTreeItemAction expandAction = (ExpandTreeItemAction) manager.getAction(ExpandTreeItemAction.ID);
    expandAction.setTargetTreeViewer(tv);
    toolBarManager.add(expandAction);
    UnExpandTreeItemAction unexpandAction = (UnExpandTreeItemAction) manager.getAction(UnExpandTreeItemAction.ID);
    unexpandAction.setTv(tv);
    toolBarManager.add(unexpandAction);
}
Also used : ActionManager(com.cubrid.common.ui.spi.action.ActionManager) RefreshAction(com.cubrid.cubridmanager.ui.common.action.RefreshAction) UnExpandTreeItemAction(com.cubrid.common.ui.common.action.UnExpandTreeItemAction) ExpandTreeItemAction(com.cubrid.common.ui.common.action.ExpandTreeItemAction) SwitchGroupModeAction(com.cubrid.common.ui.common.action.SwitchGroupModeAction) GroupSettingAction(com.cubrid.common.ui.common.action.GroupSettingAction) OpenTargetAction(com.cubrid.common.ui.common.action.OpenTargetAction) UnExpandTreeItemAction(com.cubrid.common.ui.common.action.UnExpandTreeItemAction)

Aggregations

ActionManager (com.cubrid.common.ui.spi.action.ActionManager)19 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)7 IMenuManager (org.eclipse.jface.action.IMenuManager)7 MenuManager (org.eclipse.jface.action.MenuManager)7 Separator (org.eclipse.jface.action.Separator)7 IAction (org.eclipse.jface.action.IAction)6 SelectionEvent (org.eclipse.swt.events.SelectionEvent)5 DropDownAction (com.cubrid.common.ui.common.action.DropDownAction)3 IToolBarManager (org.eclipse.jface.action.IToolBarManager)3 Composite (org.eclipse.swt.widgets.Composite)3 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)3 GroupSettingAction (com.cubrid.common.ui.common.action.GroupSettingAction)2 OpenPreferenceAction (com.cubrid.common.ui.common.action.OpenPreferenceAction)2 RestoreQueryEditorAction (com.cubrid.common.ui.common.action.RestoreQueryEditorAction)2 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)2 QuitAction (com.cubrid.cubridmanager.ui.common.action.QuitAction)2 ControlContribution (org.eclipse.jface.action.ControlContribution)2 IContributionItem (org.eclipse.jface.action.IContributionItem)2 StatusLineManager (org.eclipse.jface.action.StatusLineManager)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2