use of org.jkiss.dbeaver.ui.data.IValueController in project dbeaver by serge-rider.
the class DateTimeStandaloneEditor method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
IValueController valueController = getValueController();
Object value = valueController.getValue();
Composite dialogGroup = (Composite) super.createDialogArea(parent);
Composite panel = UIUtils.createPlaceholder(dialogGroup, 3);
panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
int style = SWT.BORDER;
if (valueController.isReadOnly()) {
style |= SWT.READ_ONLY;
}
UIUtils.createControlLabel(panel, "Time").setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
timeEditor = new CustomTimeEditor(panel, style);
timeEditor.getControl().addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
dirty = true;
}
});
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalAlignment = GridData.CENTER;
timeEditor.getControl().setLayoutData(gd);
primeEditorValue(value);
Button button = UIUtils.createPushButton(panel, "Set Current", null);
button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
button.setEnabled(!valueController.isReadOnly());
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
primeEditorValue(new Date());
}
});
return dialogGroup;
}
use of org.jkiss.dbeaver.ui.data.IValueController in project dbeaver by serge-rider.
the class ContentEditor method getContent.
@Nullable
DBDContent getContent() {
IValueController valueController = getValueController();
Object value = valueController == null ? null : valueController.getValue();
if (value instanceof DBDContent) {
return (DBDContent) value;
} else {
return null;
}
}
Aggregations