use of org.jkiss.dbeaver.ext.oracle.model.session.OracleServerSessionManager in project dbeaver by serge-rider.
the class OracleSessionEditor method createSessionViewer.
@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
return new SessionManagerViewer<OracleServerSession>(this, parent, new OracleServerSessionManager((OracleDataSource) executionContext.getDataSource())) {
private boolean showBackground;
private boolean showInactive;
@Override
protected void contributeToToolbar(DBAServerSessionManager sessionManager, IContributionManager contributionManager) {
contributionManager.add(killSessionAction);
contributionManager.add(disconnectSessionAction);
contributionManager.add(new Separator());
contributionManager.add(ActionUtils.makeActionContribution(new Action("Show background", Action.AS_CHECK_BOX) {
{
setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.CONFIGURATION));
setToolTipText("Show background tasks");
setChecked(showBackground);
}
@Override
public void run() {
showBackground = isChecked();
refreshPart(OracleSessionEditor.this, true);
}
}, true));
contributionManager.add(ActionUtils.makeActionContribution(new Action("Show inactive", Action.AS_CHECK_BOX) {
{
setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.CONFIGURATION));
setToolTipText("Show inactive sessions");
setChecked(showInactive);
}
@Override
public void run() {
showInactive = isChecked();
refreshPart(OracleSessionEditor.this, true);
}
}, true));
}
@Override
protected void onSessionSelect(DBAServerSession session) {
super.onSessionSelect(session);
killSessionAction.setEnabled(session != null);
disconnectSessionAction.setEnabled(session != null);
}
@Override
protected void loadSettings(IDialogSettings settings) {
showBackground = CommonUtils.toBoolean(settings.get("showBackground"));
showInactive = CommonUtils.toBoolean(settings.get("showInactive"));
super.loadSettings(settings);
}
@Override
protected void saveSettings(IDialogSettings settings) {
super.saveSettings(settings);
settings.put("showBackground", showBackground);
settings.put("showInactive", showInactive);
}
@Override
public Map<String, Object> getSessionOptions() {
Map<String, Object> options = new HashMap<>();
if (showBackground) {
options.put(OracleServerSessionManager.OPTION_SHOW_BACKGROUND, true);
}
if (showInactive) {
options.put(OracleServerSessionManager.OPTION_SHOW_INACTIVE, true);
}
return options;
}
};
}
use of org.jkiss.dbeaver.ext.oracle.model.session.OracleServerSessionManager 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);
}
};
}
use of org.jkiss.dbeaver.ext.oracle.model.session.OracleServerSessionManager in project dbeaver by dbeaver.
the class OracleSessionEditor method createSessionViewer.
@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
return new SessionManagerViewer<OracleServerSession>(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);
}
};
}
Aggregations