Search in sources :

Example 46 with Separator

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

the class ERDEditorContextMenuProvider method buildContextMenu.

/**
	 * @see ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager)
	 */
@Override
public void buildContextMenu(IMenuManager menu) {
    if (editor.isLoaded()) {
        GEFActionConstants.addStandardActionGroups(menu);
        menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        menu.add(new Separator());
        editor.fillAttributeVisibilityMenu(menu);
        menu.add(new DiagramLayoutAction(editor));
    }
}
Also used : DiagramLayoutAction(org.jkiss.dbeaver.ext.erd.action.DiagramLayoutAction) Separator(org.eclipse.jface.action.Separator)

Example 47 with Separator

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

the class DB2ServerApplicationEditor method createSessionViewer.

@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
    return new SessionManagerViewer(this, parent, new DB2ServerApplicationManager((DB2DataSource) executionContext.getDataSource())) {

        @Override
        @SuppressWarnings("rawtypes")
        protected void contributeToToolbar(DBAServerSessionManager sessionManager, IContributionManager contributionManager) {
            contributionManager.add(forceApplicationAction);
            contributionManager.add(new Separator());
        }

        @Override
        protected void onSessionSelect(DBAServerSession session) {
            super.onSessionSelect(session);
            forceApplicationAction.setEnabled(session != null);
        }
    };
}
Also used : SessionManagerViewer(org.jkiss.dbeaver.ui.views.session.SessionManagerViewer) DBAServerSession(org.jkiss.dbeaver.model.admin.sessions.DBAServerSession) DB2DataSource(org.jkiss.dbeaver.ext.db2.model.DB2DataSource) DBAServerSessionManager(org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Example 48 with Separator

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

the class OracleObjectDDLEditor method contributeEditorCommands.

@Override
protected void contributeEditorCommands(IContributionManager contributionManager) {
    super.contributeEditorCommands(contributionManager);
    contributionManager.add(new Separator());
    contributionManager.add(new ControlContribution("DDLFormat") {

        @Override
        protected Control createControl(Composite parent) {
            OracleDDLFormat ddlFormat = OracleDDLFormat.getCurrentFormat(getSourceObject().getDataSource());
            final Combo ddlFormatCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY | SWT.DROP_DOWN);
            ddlFormatCombo.setToolTipText("DDL Format");
            for (OracleDDLFormat format : OracleDDLFormat.values()) {
                ddlFormatCombo.add(format.getTitle());
                if (format == ddlFormat) {
                    ddlFormatCombo.select(ddlFormatCombo.getItemCount() - 1);
                }
            }
            ddlFormatCombo.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    for (OracleDDLFormat format : OracleDDLFormat.values()) {
                        if (format.ordinal() == ddlFormatCombo.getSelectionIndex()) {
                            getEditorInput().getDatabaseObject().getDataSource().getContainer().getPreferenceStore().setValue(OracleConstants.PREF_KEY_DDL_FORMAT, format.name());
                            refreshPart(this, true);
                            break;
                        }
                    }
                }
            });
            return ddlFormatCombo;
        }
    });
}
Also used : Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) OracleDDLFormat(org.jkiss.dbeaver.ext.oracle.model.OracleDDLFormat) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ControlContribution(org.eclipse.jface.action.ControlContribution) Combo(org.eclipse.swt.widgets.Combo) Separator(org.eclipse.jface.action.Separator)

Example 49 with Separator

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

the class OracleSessionEditor method createSessionViewer.

@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
    return new SessionManagerViewer(this, parent, new OracleServerSessionManager(getExecutionContext())) {

        @Override
        protected void contributeToToolbar(DBAServerSessionManager sessionManager, IContributionManager contributionManager) {
            contributionManager.add(killSessionAction);
            contributionManager.add(disconnectSessionAction);
            contributionManager.add(new Separator());
        }

        @Override
        protected void onSessionSelect(DBAServerSession session) {
            super.onSessionSelect(session);
            killSessionAction.setEnabled(session != null);
            disconnectSessionAction.setEnabled(session != null);
        }
    };
}
Also used : SessionManagerViewer(org.jkiss.dbeaver.ui.views.session.SessionManagerViewer) DBAServerSession(org.jkiss.dbeaver.model.admin.sessions.DBAServerSession) DBAServerSessionManager(org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager) OracleServerSessionManager(org.jkiss.dbeaver.ext.oracle.model.session.OracleServerSessionManager) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Example 50 with Separator

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

the class PostgreSessionEditor method createSessionViewer.

@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
    return new SessionManagerViewer(this, parent, new PostgreSessionManager((PostgreDataSource) executionContext.getDataSource())) {

        @Override
        protected void contributeToToolbar(DBAServerSessionManager sessionManager, IContributionManager contributionManager) {
            contributionManager.add(terminateQueryAction);
            contributionManager.add(new Separator());
        }

        @Override
        protected void onSessionSelect(DBAServerSession session) {
            super.onSessionSelect(session);
            terminateQueryAction.setEnabled(session != null && !CommonUtils.isEmpty(session.getActiveQuery()));
        }
    };
}
Also used : SessionManagerViewer(org.jkiss.dbeaver.ui.views.session.SessionManagerViewer) DBAServerSession(org.jkiss.dbeaver.model.admin.sessions.DBAServerSession) PostgreDataSource(org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource) DBAServerSessionManager(org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager) PostgreSessionManager(org.jkiss.dbeaver.ext.postgresql.model.session.PostgreSessionManager) IContributionManager(org.eclipse.jface.action.IContributionManager) 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