Search in sources :

Example 1 with PostgreSessionManager

use of org.jkiss.dbeaver.ext.postgresql.model.session.PostgreSessionManager 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

IContributionManager (org.eclipse.jface.action.IContributionManager)1 Separator (org.eclipse.jface.action.Separator)1 PostgreDataSource (org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource)1 PostgreSessionManager (org.jkiss.dbeaver.ext.postgresql.model.session.PostgreSessionManager)1 DBAServerSession (org.jkiss.dbeaver.model.admin.sessions.DBAServerSession)1 DBAServerSessionManager (org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager)1 SessionManagerViewer (org.jkiss.dbeaver.ui.views.session.SessionManagerViewer)1