use of org.jkiss.dbeaver.ui.properties.PropertySourceDelegate in project dbeaver by dbeaver.
the class SpreadsheetPresentation method getAdapter.
@Override
public <T> T getAdapter(Class<T> adapter) {
if (adapter == IPropertySheetPage.class) {
// Show cell properties
PropertyPageStandard page = new PropertyPageStandard();
page.setPropertySourceProvider(object -> {
if (object instanceof GridCell) {
GridCell cell = (GridCell) object;
boolean recordMode = controller.isRecordMode();
final DBDAttributeBinding attr = (DBDAttributeBinding) (recordMode ? cell.row : cell.col);
final ResultSetRow row = (ResultSetRow) (recordMode ? cell.col : cell.row);
final SpreadsheetValueController valueController = new SpreadsheetValueController(controller, attr, row, IValueController.EditType.NONE, null);
PropertyCollector props = new PropertyCollector(valueController.getBinding().getAttribute(), false);
props.collectProperties();
valueController.getValueManager().contributeProperties(props, valueController);
return new PropertySourceDelegate(props);
}
return null;
});
return adapter.cast(page);
} else if (adapter == IFindReplaceTarget.class) {
return adapter.cast(findReplaceTarget);
}
return null;
}
Aggregations