use of org.jkiss.dbeaver.ext.oracle.model.OracleDDLFormat 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;
}
});
}
Aggregations