Search in sources :

Example 1 with ExasolServerSessionManager

use of org.jkiss.dbeaver.ext.exasol.model.app.ExasolServerSessionManager in project dbeaver by dbeaver.

the class ExasolServerSessionEditor method createSessionViewer.

@SuppressWarnings("rawtypes")
@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
    return new SessionManagerViewer<ExasolServerSession>(this, parent, new ExasolServerSessionManager((ExasolDataSource) executionContext.getDataSource())) {

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

        @Override
        protected void onSessionSelect(DBAServerSession session) {
            super.onSessionSelect(session);
            killSessionAction.setEnabled(session != null);
            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) DBAServerSessionManager(org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager) ExasolDataSource(org.jkiss.dbeaver.ext.exasol.model.ExasolDataSource) ExasolServerSessionManager(org.jkiss.dbeaver.ext.exasol.model.app.ExasolServerSessionManager) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Example 2 with ExasolServerSessionManager

use of org.jkiss.dbeaver.ext.exasol.model.app.ExasolServerSessionManager in project dbeaver by serge-rider.

the class ExasolServerSessionEditor method createSessionViewer.

@SuppressWarnings("rawtypes")
@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
    return new SessionManagerViewer<ExasolServerSession>(this, parent, new ExasolServerSessionManager((ExasolDataSource) executionContext.getDataSource())) {

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

        @Override
        protected void onSessionSelect(DBAServerSession session) {
            super.onSessionSelect(session);
            killSessionAction.setEnabled(session != null);
            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) DBAServerSessionManager(org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager) ExasolDataSource(org.jkiss.dbeaver.ext.exasol.model.ExasolDataSource) ExasolServerSessionManager(org.jkiss.dbeaver.ext.exasol.model.app.ExasolServerSessionManager) IContributionManager(org.eclipse.jface.action.IContributionManager) Separator(org.eclipse.jface.action.Separator)

Aggregations

IContributionManager (org.eclipse.jface.action.IContributionManager)2 Separator (org.eclipse.jface.action.Separator)2 ExasolDataSource (org.jkiss.dbeaver.ext.exasol.model.ExasolDataSource)2 ExasolServerSessionManager (org.jkiss.dbeaver.ext.exasol.model.app.ExasolServerSessionManager)2 DBAServerSession (org.jkiss.dbeaver.model.admin.sessions.DBAServerSession)2 DBAServerSessionManager (org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager)2 SessionManagerViewer (org.jkiss.dbeaver.ui.views.session.SessionManagerViewer)2