use of org.jkiss.dbeaver.ui.data.editors.StringInlineEditor in project dbeaver by serge-rider.
the class FilterValueEditDialog method createSingleValueEditor.
private void createSingleValueEditor(Composite composite) {
Composite editorPlaceholder = UIUtils.createPlaceholder(composite, 1);
editorPlaceholder.setLayoutData(new GridData(GridData.FILL_BOTH));
editorPlaceholder.setLayout(new FillLayout());
ResultSetRow singleRow = handler.getRows()[0];
final ResultSetValueController valueController = new ResultSetValueController(handler.getViewer(), handler.getAttribute(), singleRow, IValueController.EditType.INLINE, editorPlaceholder) {
@Override
public boolean isReadOnly() {
// Filter value is never read-only
return false;
}
};
IValueEditor editor = null;
try {
editor = valueController.getValueManager().createEditor(valueController);
} catch (Exception e) {
log.error("Can't create inline value editor", e);
}
if (editor == null) {
editor = new StringInlineEditor(valueController);
}
handler.setEditor(editor);
editor.createControl();
try {
editor.primeEditorValue(valueController.getValue());
} catch (DBException e) {
log.error("Error populating filter value", e);
}
}
use of org.jkiss.dbeaver.ui.data.editors.StringInlineEditor in project dbeaver by dbeaver.
the class FilterValueEditDialog method createSingleValueEditor.
private void createSingleValueEditor(Composite composite) {
Composite editorPlaceholder = UIUtils.createPlaceholder(composite, 1);
editorPlaceholder.setLayoutData(new GridData(GridData.FILL_BOTH));
editorPlaceholder.setLayout(new FillLayout());
ResultSetRow singleRow = handler.getRows()[0];
final ResultSetValueController valueController = new ResultSetValueController(handler.getViewer(), handler.getAttribute(), singleRow, IValueController.EditType.INLINE, editorPlaceholder) {
@Override
public boolean isReadOnly() {
// Filter value is never read-only
return false;
}
};
IValueEditor editor = null;
try {
editor = valueController.getValueManager().createEditor(valueController);
} catch (Exception e) {
log.error("Can't create inline value editor", e);
}
if (editor == null) {
editor = new StringInlineEditor(valueController);
}
handler.setEditor(editor);
editor.createControl();
try {
editor.primeEditorValue(valueController.getValue());
} catch (DBException e) {
log.error("Error populating filter value", e);
}
}
Aggregations