Search in sources :

Example 1 with SelectByMultiPstmtDataAction

use of com.cubrid.common.ui.cubrid.table.action.SelectByMultiPstmtDataAction 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 2 with SelectByMultiPstmtDataAction

use of com.cubrid.common.ui.cubrid.table.action.SelectByMultiPstmtDataAction in project cubrid-manager by CUBRID.

the class ActionBuilder method makeActions.

/**
	 * Make all actions for CUBRID Manager menu and toolbar
	 *
	 * @param window the workbench window
	 */
protected void makeActions(Shell shell) {
    IAction openAction = new OpenQueryAction(shell, Messages.openActionName, null);
    registerAction(openAction);
    // implemented actions for retarget actions
    IAction undoAction = new UndoAction(shell, Messages.undoActionName, null);
    registerAction(undoAction);
    IAction redoAction = new RedoAction(shell, Messages.redoActionName, null);
    registerAction(redoAction);
    IAction copyAction = new CopyAction(shell, Messages.copyActionName, null);
    registerAction(copyAction);
    IAction copyAllAction = new CopyAllAction(shell, Messages.copyAllActionName, null);
    registerAction(copyAllAction);
    IAction inputMethodAction = new InputMethodAction(shell, Messages.inputMethodActionName, null);
    registerAction(inputMethodAction);
    IAction pasteAction = new PasteAction(shell, Messages.pasteActionName, null);
    registerAction(pasteAction);
    IAction cutAction = new CutAction(shell, Messages.cutActionName, null);
    registerAction(cutAction);
    IAction findReplaceAction = new FindReplaceAction(shell, Messages.findReplaceActionName, null);
    registerAction(findReplaceAction);
    // common action
    IAction oidNavigatorAction = new OIDNavigatorAction(shell, Messages.oidNavigatorActionName, null);
    registerAction(oidNavigatorAction);
    // table schema related action
    IAction tableNewAction = new NewTableAction(shell, Messages.tableNewActionName, loadImage("icons/action/schema_table_add.png"), loadImage("icons/action/schema_table_add_disabled.png"));
    registerAction(tableNewAction);
    IAction pstmtOneDataAction = new PstmtOneDataAction(shell, Messages.pstmtOneDataActionName, null);
    registerAction(pstmtOneDataAction);
    IAction pstmtMultiDataAction = new PstmtMultiDataAction(shell, Messages.pstmtMultiDataActionName, null);
    registerAction(pstmtMultiDataAction);
    IAction selectByOnePstmtDataAction = new SelectByOnePstmtDataAction(shell, Messages.selectByOnePstmtDataActionName, null);
    registerAction(selectByOnePstmtDataAction);
    IAction selectByMultiPstmtDataAction = new SelectByMultiPstmtDataAction(shell, Messages.selectByMultiPstmtDataActionName, null);
    registerAction(selectByMultiPstmtDataAction);
    IAction insertOneByPstmtAction = new InsertOneByPstmtAction(shell, Messages.insertOneByPstmtActionName, loadImage("icons/action/table_record_insert.png"));
    registerAction(insertOneByPstmtAction);
    IAction insertMultiByPstmtAction = new ImportDataFromFileAction(shell, Messages.insertMultiByPstmtActionName, null);
    registerAction(insertMultiByPstmtAction);
    IAction tableEditAction = new EditTableAction(shell, Messages.tableEditActionName, loadImage("icons/action/schema_table_edit.png"));
    registerAction(tableEditAction);
    IAction createViewAction = new CreateViewAction(shell, Messages.createViewActionName, loadImage("icons/action/schema_view_add.png"), loadImage("icons/action/schema_view_add_disabled.png"));
    registerAction(createViewAction);
    IAction editViewAction = new EditViewAction(shell, Messages.editViewActionName, loadImage("icons/action/schema_view_edit.png"));
    registerAction(editViewAction);
    IAction propertyViewAction = new PropertyViewAction(shell, Messages.propertyViewActionName, loadImage("icons/action/view_property.png"));
    registerAction(propertyViewAction);
    IAction tableSelectCountAction = new TableSelectCountAction(shell, Messages.tableSelectCountActionName, loadImage("icons/action/table_select_count.png"));
    registerAction(tableSelectCountAction);
    IAction tableDeleteAction = new DeleteTableAction(shell, Messages.tableDeleteAllActionName, loadImage("icons/action/schema_table_delete.png"));
    registerAction(tableDeleteAction);
    IAction truncateTableAction = new TruncateTableAction(shell, Messages.truncateTableActionName, null);
    registerAction(truncateTableAction);
    IAction createLikeTableAction = new CreateLikeTableAction(shell, Messages.createLikeTableActionName, null);
    registerAction(createLikeTableAction);
    IAction tableSelectAllAction = new TableSelectAllAction(shell, Messages.tableSelectAllActionName, loadImage("icons/action/table_select_all.png"));
    registerAction(tableSelectAllAction);
    //		IAction tableInsertAction = new InsertTableDataAction(
    //				shell,
    //				Messages.tableInsertActionName,
    //				loadImage("icons/action/table_record_insert.png"));
    //		registerAction(tableInsertAction);
    IAction tableExportAction = new ExportWizardAction(shell, Messages.tableExportActionName, loadImage("icons/action/export_on.png"), loadImage("icons/action/export_off.png"));
    registerAction(tableExportAction);
    IAction tableImportAction = new ImportWizardAction(shell, Messages.tableImportActionName, loadImage("icons/action/import_on.png"), loadImage("icons/action/import_off.png"));
    registerAction(tableImportAction);
    // export table definitions to excel file action by fulei
    IAction exportTableDefinitionAction = new ExportTableDefinitionAction(shell, com.cubrid.common.ui.common.Messages.exportTableDefinitionAction, loadImage("icons/action/export_excel.png"));
    registerAction(exportTableDefinitionAction);
    IAction tableRenameAction = new RenameTableAction(shell, Messages.tableRenameActionName, loadImage("icons/action/table_rename.png"));
    registerAction(tableRenameAction);
    IAction tableDropAction = new DropTableAction(shell, Messages.tableDropActionName, null);
    registerAction(tableDropAction);
    tableDropAction.setImageDescriptor(loadImage("icons/action/schema_table_delete.png"));
    IAction viewDropAction = new DropViewAction(shell, Messages.viewDropActionName, null);
    registerAction(viewDropAction);
    viewDropAction.setImageDescriptor(loadImage("icons/action/schema_view_delete.png"));
    IAction showSchemaAction = new ShowSchemaAction(shell, Messages.showSchemaActionName, null);
    registerAction(showSchemaAction);
    IAction updateStatisticsAction = new UpdateStatisticsAction(shell, Messages.updateStatisticsActionName, null);
    registerAction(updateStatisticsAction);
    TableToJavaCodeAction tableToJavaCodeAction = new TableToJavaCodeAction(shell, Messages.tableToJavaCodeAction, loadImage("icons/action/copy_pojo_to_clipboard.gif"));
    registerAction(tableToJavaCodeAction);
    TableToPhpCodeAction tableToPhpCodeAction = new TableToPhpCodeAction(shell, Messages.tableToPhpCodeAction, loadImage("icons/action/copy_pojo_to_clipboard.gif"));
    registerAction(tableToPhpCodeAction);
    IAction columnSelectSqlAction = new ColumnSelectSqlAction(shell, Messages.columnSelectSqlActionName, null);
    registerAction(columnSelectSqlAction);
    IAction columnSelectCountAction = new ColumnSelectCountAction(shell, Messages.columnSelectCountActionName, null);
    registerAction(columnSelectCountAction);
    // trigger related action
    IAction newTriggerAction = new NewTriggerAction(shell, Messages.newTriggerActionName, loadImage("icons/action/trigger_add.png"), loadImage("icons/action/trigger_add_disabled.png"));
    registerAction(newTriggerAction);
    IAction alterTriggerAction = new AlterTriggerAction(shell, Messages.alterTriggerActionName, loadImage("icons/action/trigger_edit.png"));
    registerAction(alterTriggerAction);
    IAction dropTriggerAction = new DropTriggerAction(shell, Messages.dropTriggerActionName, loadImage("icons/action/trigger_delete.png"));
    registerAction(dropTriggerAction);
    // serial related action
    IAction deleteSerialAction = new DeleteSerialAction(shell, Messages.deleteSerialActionName, loadImage("icons/action/serial_delete.png"));
    registerAction(deleteSerialAction);
    IAction createSerialAction = new CreateSerialAction(shell, Messages.createSerialActionName, loadImage("icons/action/serial_add.png"), loadImage("icons/action/serial_add_disabled.png"));
    registerAction(createSerialAction);
    IAction editSerialAction = new EditSerialAction(shell, Messages.editSerialActionName, loadImage("icons/action/serial_edit.png"));
    registerAction(editSerialAction);
    // stored procedure related action
    IAction addFunctionAction = new AddFunctionAction(shell, Messages.addFunctionActionName, loadImage("icons/action/function_add.png"), loadImage("icons/action/function_add_disabled.png"));
    registerAction(addFunctionAction);
    IAction editFunctionAction = new EditFunctionAction(shell, Messages.editFunctionActionName, loadImage("icons/action/procedure_edit.png"));
    registerAction(editFunctionAction);
    IAction deleteFunctionAction = new DeleteFunctionAction(shell, Messages.deleteFunctionActionName, loadImage("icons/action/procedure_delete.png"));
    registerAction(deleteFunctionAction);
    IAction addProcedureAction = new AddProcedureAction(shell, Messages.addProcedureActionName, loadImage("icons/action/procedure_add.png"), loadImage("icons/action/procedure_add_disabled.png"));
    registerAction(addProcedureAction);
    IAction editProcedureAction = new EditProcedureAction(shell, Messages.editProcedureActionName, loadImage("icons/action/procedure_edit.png"));
    registerAction(editProcedureAction);
    IAction deleteProcedureAction = new DeleteProcedureAction(shell, Messages.deleteProcedureActionName, loadImage("icons/action/procedure_delete.png"));
    registerAction(deleteProcedureAction);
    // query editor related action
    SqlFormatAction formatAction = new SqlFormatAction(shell, Messages.formatActionName, loadImage("icons/queryeditor/query_format.png"));
    registerAction(formatAction);
    // run a pstmt sql
    SqlPstmtAction sqlPstmtAction = new SqlPstmtAction(shell, Messages.sqlPstmtActionName, loadImage("icons/queryeditor/qe_set_param.png"));
    registerAction(sqlPstmtAction);
    CreateSqlPhpCodeAction createSqlPhpCodeAction = new CreateSqlPhpCodeAction(shell, Messages.createSqlCodePhpActionName, loadImage("icons/action/copy_pojo_to_clipboard.gif"));
    registerAction(createSqlPhpCodeAction);
    CreateSqlJavaCodeAction createSqlJavaCodeAction = new CreateSqlJavaCodeAction(shell, Messages.createSqlCodeJavaActionName, loadImage("icons/action/copy_pojo_to_clipboard.gif"));
    registerAction(createSqlJavaCodeAction);
    IAction databaseQueryNewAction = new DatabaseQueryNewAction(shell, Messages.queryOpenActionName, loadImage("icons/action/new_query.png"), loadImage("icons/action/new_query_disable.png"), false);
    registerAction(databaseQueryNewAction);
    IAction databaseQueryNewActionBig = new DatabaseQueryNewAction(shell, Messages.queryOpenActionName, loadImage("icons/action/new_query_big.png"), loadImage("icons/action/new_query_big_disable.png"), true);
    registerAction(databaseQueryNewActionBig);
    IAction queryOpenAction = new QueryOpenAction(shell, Messages.queryOpenActionName, null);
    registerAction(queryOpenAction);
    IAction showSchemaEditorAction = new ShowSchemaEditorAction(shell, Messages.showSchemaActionName, null);
    registerAction(showSchemaEditorAction);
    // navigator view action
    IAction collapseAllAction = new CollapseAllAction(Messages.collapseAllActionName, loadImage("icons/action/collapseall.gif"), null);
    registerAction(collapseAllAction);
    IAction filterAction = new FilterSettingAction(Messages.filterSettingActionName, loadImage("icons/action/filter.gif"), null);
    registerAction(filterAction);
    IAction hiddenAction = new HiddenElementAction(shell, Messages.hiddenElementActionName, loadImage("icons/action/filter.gif"));
    registerAction(hiddenAction);
    IAction showHiddenElementsAction = new ShowHiddenElementsAction(shell, Messages.showAllActionName, null);
    registerAction(showHiddenElementsAction);
    IAction copyQueryEditorAction = new CopyQueryEditorAction(Messages.queryCopyActionName, loadImage("icons/action/new_query.png"));
    registerAction(copyQueryEditorAction);
    IAction renameColumnAction = new RenameColumnAction(shell, Messages.renameColumnAction, null);
    registerAction(renameColumnAction);
    //group actions
    IAction topGroupAction = new TopGroupAction(Messages.topGroupAction, null, null);
    registerAction(topGroupAction);
    IAction switchGroupModeAction = new SwitchGroupModeAction(Messages.topGroupAction, loadImage("icons/navigator/group.png"), null);
    registerAction(switchGroupModeAction);
    IAction topGroupItemAction = new TopGroupItemAction(Messages.topGroupItemAction, null, null);
    registerAction(topGroupItemAction);
    //report bug action
    IAction reportBugAction = new ReportBugAction(shell, Messages.reportBugAction, loadImage("icons/action/bug.png"), false);
    registerAction(reportBugAction);
    //report bug action
    IAction reportBugActionBig = new ReportBugAction(shell, Messages.reportBugActionBig, loadImage("icons/action/bug_big.png"), true);
    registerAction(reportBugActionBig);
    //run sql file action by fulei
    IAction runSQLFileAction = new RunSQLFileAction(shell, com.cubrid.common.ui.common.Messages.runSQLFileAction, loadImage("icons/navigator/sql.png"));
    registerAction(runSQLFileAction);
    IAction noticeAction = new NoticeAction(com.cubrid.common.ui.common.Messages.titleNoticeDialog, null);
    registerAction(noticeAction);
    IAction queryTunerAction = new QueryTunerAction(shell, com.cubrid.common.ui.common.Messages.actionQueryTuner, loadImage("icons/action/query_tuner.png"), loadImage("icons/action/query_tuner.png"));
    registerAction(queryTunerAction);
    IAction queryTunerRunAction = new QueryTunerRunAction(shell, com.cubrid.common.ui.common.Messages.actionQueryTuner, loadImage("icons/action/query_tuner.png"), loadImage("icons/action/query_tuner.png"));
    registerAction(queryTunerRunAction);
    // new query editor action
    IAction databaseQueryNewActionTb = new DatabaseQueryNewAction(shell, Messages.queryOpenActionNameBig, loadImage("icons/action/new_query_big.png"), loadImage("icons/action/new_query_big_disabled.png"), true);
    registerAction(databaseQueryNewActionTb);
    // navigation tree expand/unexpand on tree navigator
    IAction expandTreeItemAction = new ExpandTreeItemAction(com.cubrid.common.ui.spi.Messages.msgExpandAction, loadImage("icons/navigator/expand.png"), null);
    registerAction(expandTreeItemAction);
    IAction unExpandTreeItemAction = new UnExpandTreeItemAction(com.cubrid.common.ui.spi.Messages.msgUnExpandAction, loadImage("icons/navigator/unexpand.png"), null);
    registerAction(unExpandTreeItemAction);
    IAction batchRunAction = new BatchRunAction(com.cubrid.common.ui.query.Messages.batchRun, loadImage("icons/queryeditor/run_batch_sql.png"));
    registerAction(batchRunAction);
    /*Assign name action*/
    IAction assignNameAction = new AssignEditorNameAction(Messages.titleAssignNameAction, loadImage("icons/action/assign_name.gif"));
    registerAction(assignNameAction);
    IAction compareSchemaAction = new SchemaCompareAction(shell, Messages.compareSchema, null);
    registerAction(compareSchemaAction);
    IAction exportConnectionAction = new ConnectionUrlExportAction(shell, Messages.exportConnections, loadImage("icons/action/export_connection.png"));
    registerAction(exportConnectionAction);
    IAction importERwinAction = new ImportERwinAction(shell, Messages.compareSchemaERXml, loadImage("icons/action/erw_import.png"), null);
    registerAction(importERwinAction);
    IAction exportERwinAction = new ExportERwinAction(shell, Messages.exportSchemaERXml, loadImage("icons/action/erw_export.png"), null);
    registerAction(exportERwinAction);
    IAction helpDocumentAction = new HelpDocumentAction(Messages.helpActionName, loadImage("icons/help.gif"));
    registerAction(helpDocumentAction);
    IAction gotoLineAction = new GotoLineAction(shell, Messages.gotoLineActionName, null);
    registerAction(gotoLineAction);
    IAction reformatColumnsAliasAction = new ReformatColumnsAliasAction(shell, Messages.reformatColumsAliasActionName, null);
    registerAction(reformatColumnsAliasAction);
    IAction action = null;
    // Tools
    action = new SchemaCompareWizardAction(shell, Messages.schemaCompareWizardActionName, loadImage("icons/action/schema_compare_wizard.png"));
    registerAction(action);
    action = new DataCompareWizardAction(shell, Messages.dataCompareWizardActionName, loadImage("icons/action/data_compare_wizard.png"));
    registerAction(action);
    action = new OpenSchemaEditorAction(shell, Messages.schemaDesignerActionName, CommonUIPlugin.getImageDescriptor("icons/action/schema_edit_on.png"));
    ActionManager.getInstance().registerAction(action);
    action = new InstallMigrationToolkitAction(Messages.installMigrationActionName, loadImage("icons/action/cubrid-logo-32.gif"));
    action.setToolTipText(Messages.installMigrationToolkitActionName);
    registerAction(action);
    //		action = new LaunchManagerAction(
    //				Messages.launchManagerActionName,
    //				loadImage("icons/action/launch_cm.gif"));
    //		registerAction(action);
    //		action = new LaunchBrowserAction(
    //				Messages.launchBrowserActionName,
    //				loadImage("icons/action/launch_cqb.gif"));
    //		registerAction(action);
    action = new OpenCMPerspectiveAction(Messages.openCMViewActionName, loadImage("icons/action/launch_cm.gif"));
    registerAction(action);
    action = new OpenCQBPerspectiveAction(Messages.openCQBViewActionName, loadImage("icons/action/launch_cqb.gif"));
    registerAction(action);
    //		action = new CMServiceAnalysisAction(
    //				"CM Service Analysis Demo",
    //				loadImage("icons/action/launch_cqb.gif"));
    //		registerAction(action);
    action = new RestoreQueryEditorAction(com.cubrid.common.ui.common.Messages.restoreQueryEditorMenu, null);
    registerAction(action);
    action = new RunQueryAction(shell, com.cubrid.common.ui.query.Messages.btnRunThisQuery, loadImage("icons/queryeditor/query_run.png"));
    registerAction(action);
    action = new ParseSqlmapQueryAction(shell, com.cubrid.common.ui.query.Messages.btnParseThisSqlmapQuery, loadImage("icons/navigator/sql.png"));
    registerAction(action);
    action = new RunQueryPlanAction(shell, com.cubrid.common.ui.query.Messages.btnRunThisQueryPlan, loadImage("icons/queryeditor/query_execution_plan.png"));
    registerAction(action);
    action = new AddQueryToFavoriteAction(shell, com.cubrid.common.ui.query.Messages.btnAddSelectedQueryIntoFavorite, loadImage("icons/navigator/favorite_query.png"));
    registerAction(action);
    // initialize query making actions
    initMakeQueryActions(shell, ActionManager.getInstance());
}
Also used : ImportWizardAction(com.cubrid.common.ui.cubrid.table.action.ImportWizardAction) HelpDocumentAction(com.cubrid.common.ui.common.action.HelpDocumentAction) TableToPhpCodeAction(com.cubrid.common.ui.cubrid.table.action.TableToPhpCodeAction) FindReplaceAction(com.cubrid.common.ui.query.action.FindReplaceAction) DeleteSerialAction(com.cubrid.common.ui.cubrid.serial.action.DeleteSerialAction) CreateViewAction(com.cubrid.common.ui.cubrid.table.action.CreateViewAction) CopyAllAction(com.cubrid.common.ui.query.action.CopyAllAction) PropertyViewAction(com.cubrid.common.ui.cubrid.table.action.PropertyViewAction) QueryTunerRunAction(com.cubrid.common.ui.query.tuner.action.QueryTunerRunAction) OpenQueryAction(com.cubrid.common.ui.common.action.OpenQueryAction) TableSelectAllAction(com.cubrid.common.ui.cubrid.table.action.TableSelectAllAction) OIDNavigatorAction(com.cubrid.common.ui.common.action.OIDNavigatorAction) DropTriggerAction(com.cubrid.common.ui.cubrid.trigger.action.DropTriggerAction) ReformatColumnsAliasAction(com.cubrid.common.ui.query.action.ReformatColumnsAliasAction) AddFunctionAction(com.cubrid.common.ui.cubrid.procedure.action.AddFunctionAction) CollapseAllAction(com.cubrid.common.ui.common.action.CollapseAllAction) OpenCMPerspectiveAction(com.cubrid.common.ui.perspective.OpenCMPerspectiveAction) RedoAction(com.cubrid.common.ui.query.action.RedoAction) DropTableAction(com.cubrid.common.ui.cubrid.table.action.DropTableAction) ShowSchemaEditorAction(com.cubrid.common.ui.cubrid.table.action.ShowSchemaEditorAction) ExportWizardAction(com.cubrid.common.ui.cubrid.table.action.ExportWizardAction) UpdateStatisticsAction(com.cubrid.common.ui.cubrid.table.action.UpdateStatisticsAction) SchemaCompareWizardAction(com.cubrid.common.ui.compare.schema.action.SchemaCompareWizardAction) InstallMigrationToolkitAction(com.cubrid.common.ui.external.action.InstallMigrationToolkitAction) ColumnSelectCountAction(com.cubrid.common.ui.cubrid.table.action.ColumnSelectCountAction) DatabaseQueryNewAction(com.cubrid.common.ui.query.action.DatabaseQueryNewAction) OpenCQBPerspectiveAction(com.cubrid.common.ui.perspective.OpenCQBPerspectiveAction) CopyQueryEditorAction(com.cubrid.common.ui.query.action.CopyQueryEditorAction) ImportERwinAction(com.cubrid.common.ui.cubrid.database.erwin.action.ImportERwinAction) EditViewAction(com.cubrid.common.ui.cubrid.table.action.EditViewAction) ExpandTreeItemAction(com.cubrid.common.ui.common.action.ExpandTreeItemAction) UnExpandTreeItemAction(com.cubrid.common.ui.common.action.UnExpandTreeItemAction) SchemaCompareAction(com.cubrid.common.ui.common.action.SchemaCompareAction) GotoLineAction(com.cubrid.common.ui.query.action.GotoLineAction) ShowHiddenElementsAction(com.cubrid.common.ui.common.action.ShowHiddenElementsAction) DropViewAction(com.cubrid.common.ui.cubrid.table.action.DropViewAction) DataCompareWizardAction(com.cubrid.common.ui.compare.data.action.DataCompareWizardAction) AddProcedureAction(com.cubrid.common.ui.cubrid.procedure.action.AddProcedureAction) SelectByOnePstmtDataAction(com.cubrid.common.ui.cubrid.table.action.SelectByOnePstmtDataAction) TableToJavaCodeAction(com.cubrid.common.ui.cubrid.table.action.TableToJavaCodeAction) SwitchGroupModeAction(com.cubrid.common.ui.common.action.SwitchGroupModeAction) DeleteProcedureAction(com.cubrid.common.ui.cubrid.procedure.action.DeleteProcedureAction) AlterTriggerAction(com.cubrid.common.ui.cubrid.trigger.action.AlterTriggerAction) EditProcedureAction(com.cubrid.common.ui.cubrid.procedure.action.EditProcedureAction) PstmtMultiDataAction(com.cubrid.common.ui.cubrid.table.action.PstmtMultiDataAction) QueryTunerAction(com.cubrid.common.ui.query.tuner.action.QueryTunerAction) TruncateTableAction(com.cubrid.common.ui.cubrid.table.action.TruncateTableAction) CutAction(com.cubrid.common.ui.query.action.CutAction) RenameTableAction(com.cubrid.common.ui.cubrid.table.action.RenameTableAction) SqlFormatAction(com.cubrid.common.ui.query.action.SqlFormatAction) ParseSqlmapQueryAction(com.cubrid.common.ui.query.action.ParseSqlmapQueryAction) SelectByMultiPstmtDataAction(com.cubrid.common.ui.cubrid.table.action.SelectByMultiPstmtDataAction) QueryOpenAction(com.cubrid.common.ui.query.action.QueryOpenAction) TableSelectCountAction(com.cubrid.common.ui.cubrid.table.action.TableSelectCountAction) EditFunctionAction(com.cubrid.common.ui.cubrid.procedure.action.EditFunctionAction) ExportERwinAction(com.cubrid.common.ui.cubrid.database.erwin.action.ExportERwinAction) CreateSerialAction(com.cubrid.common.ui.cubrid.serial.action.CreateSerialAction) RestoreQueryEditorAction(com.cubrid.common.ui.common.action.RestoreQueryEditorAction) AddQueryToFavoriteAction(com.cubrid.common.ui.query.action.AddQueryToFavoriteAction) ReportBugAction(com.cubrid.common.ui.common.action.ReportBugAction) NewTableAction(com.cubrid.common.ui.cubrid.table.action.NewTableAction) RenameColumnAction(com.cubrid.common.ui.cubrid.table.action.RenameColumnAction) BatchRunAction(com.cubrid.common.ui.query.action.BatchRunAction) CreateLikeTableAction(com.cubrid.common.ui.cubrid.table.action.CreateLikeTableAction) AssignEditorNameAction(com.cubrid.common.ui.query.action.AssignEditorNameAction) DeleteFunctionAction(com.cubrid.common.ui.cubrid.procedure.action.DeleteFunctionAction) ConnectionUrlExportAction(com.cubrid.common.ui.common.action.ConnectionUrlExportAction) CreateSqlPhpCodeAction(com.cubrid.common.ui.query.action.CreateSqlPhpCodeAction) RunQueryPlanAction(com.cubrid.common.ui.query.action.RunQueryPlanAction) IAction(org.eclipse.jface.action.IAction) RunSQLFileAction(com.cubrid.common.ui.common.action.RunSQLFileAction) CopyAction(com.cubrid.common.ui.query.action.CopyAction) ShowSchemaAction(com.cubrid.common.ui.query.action.ShowSchemaAction) EditTableAction(com.cubrid.common.ui.cubrid.table.action.EditTableAction) NewTriggerAction(com.cubrid.common.ui.cubrid.trigger.action.NewTriggerAction) FilterSettingAction(com.cubrid.common.ui.common.action.FilterSettingAction) RunQueryAction(com.cubrid.common.ui.query.action.RunQueryAction) EditSerialAction(com.cubrid.common.ui.cubrid.serial.action.EditSerialAction) InsertOneByPstmtAction(com.cubrid.common.ui.cubrid.table.action.InsertOneByPstmtAction) ExportTableDefinitionAction(com.cubrid.common.ui.cubrid.table.action.ExportTableDefinitionAction) NoticeAction(com.cubrid.common.ui.common.action.NoticeAction) SqlPstmtAction(com.cubrid.common.ui.query.action.SqlPstmtAction) PasteAction(com.cubrid.common.ui.query.action.PasteAction) DeleteTableAction(com.cubrid.common.ui.cubrid.table.action.DeleteTableAction) ColumnSelectSqlAction(com.cubrid.common.ui.cubrid.table.action.ColumnSelectSqlAction) TopGroupAction(com.cubrid.common.ui.common.action.TopGroupAction) OpenSchemaEditorAction(com.cubrid.common.ui.er.action.OpenSchemaEditorAction) HiddenElementAction(com.cubrid.common.ui.common.action.HiddenElementAction) InputMethodAction(com.cubrid.common.ui.query.action.InputMethodAction) TopGroupItemAction(com.cubrid.common.ui.common.action.TopGroupItemAction) CreateSqlJavaCodeAction(com.cubrid.common.ui.query.action.CreateSqlJavaCodeAction) UndoAction(com.cubrid.common.ui.query.action.UndoAction) ImportDataFromFileAction(com.cubrid.common.ui.cubrid.table.action.ImportDataFromFileAction) PstmtOneDataAction(com.cubrid.common.ui.cubrid.table.action.PstmtOneDataAction) UnExpandTreeItemAction(com.cubrid.common.ui.common.action.UnExpandTreeItemAction)

Aggregations

CreateLikeTableAction (com.cubrid.common.ui.cubrid.table.action.CreateLikeTableAction)2 DeleteTableAction (com.cubrid.common.ui.cubrid.table.action.DeleteTableAction)2 DropTableAction (com.cubrid.common.ui.cubrid.table.action.DropTableAction)2 EditTableAction (com.cubrid.common.ui.cubrid.table.action.EditTableAction)2 CollapseAllAction (com.cubrid.common.ui.common.action.CollapseAllAction)1 ConnectionUrlExportAction (com.cubrid.common.ui.common.action.ConnectionUrlExportAction)1 ExpandTreeItemAction (com.cubrid.common.ui.common.action.ExpandTreeItemAction)1 FilterSettingAction (com.cubrid.common.ui.common.action.FilterSettingAction)1 HelpDocumentAction (com.cubrid.common.ui.common.action.HelpDocumentAction)1 HiddenElementAction (com.cubrid.common.ui.common.action.HiddenElementAction)1 NoticeAction (com.cubrid.common.ui.common.action.NoticeAction)1 OIDNavigatorAction (com.cubrid.common.ui.common.action.OIDNavigatorAction)1 OpenQueryAction (com.cubrid.common.ui.common.action.OpenQueryAction)1 ReportBugAction (com.cubrid.common.ui.common.action.ReportBugAction)1 RestoreQueryEditorAction (com.cubrid.common.ui.common.action.RestoreQueryEditorAction)1 RunSQLFileAction (com.cubrid.common.ui.common.action.RunSQLFileAction)1 SchemaCompareAction (com.cubrid.common.ui.common.action.SchemaCompareAction)1 ShowHiddenElementsAction (com.cubrid.common.ui.common.action.ShowHiddenElementsAction)1 SwitchGroupModeAction (com.cubrid.common.ui.common.action.SwitchGroupModeAction)1 TopGroupAction (com.cubrid.common.ui.common.action.TopGroupAction)1