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));
}
}
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);
}
};
}
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;
}
});
}
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);
}
};
}
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()));
}
};
}
Aggregations