use of org.jkiss.dbeaver.runtime.properties.PropertyCollector in project dbeaver by serge-rider.
the class DataSourceAuthModelDescriptor method createCredentialsSource.
@NotNull
@Override
public DBPPropertySource createCredentialsSource(DBPDataSourceContainer dataSource, DBPConnectionConfiguration configuration) {
DBAAuthModel instance = getInstance();
DBAAuthCredentials credentials = dataSource == null || configuration == null ? instance.createCredentials() : instance.loadCredentials(dataSource, configuration);
PropertyCollector propertyCollector = new PropertyCollector(credentials, false);
propertyCollector.collectProperties();
return propertyCollector;
}
use of org.jkiss.dbeaver.runtime.properties.PropertyCollector in project dbeaver by serge-rider.
the class ColumnInfoPanel method createPanel.
protected void createPanel(IAttributeController valueController) {
PropertyCollector infoItem = new PropertyCollector(valueController.getBinding().getMetaAttribute(), false);
infoItem.collectProperties();
valueController.getValueManager().contributeProperties(infoItem, valueController);
DBDRowIdentifier rowIdentifier = valueController.getRowIdentifier();
if (rowIdentifier != null) {
infoItem.addProperty(null, "Key", DataEditorsMessages.controls_column_info_panel_property_key, new CellKeyInfo(valueController.getRowController(), rowIdentifier));
}
this.setLayout(new FillLayout());
{
propViewer = new PropertyTreeViewer(this, SWT.H_SCROLL | SWT.V_SCROLL);
propViewer.loadProperties(infoItem);
}
}
use of org.jkiss.dbeaver.runtime.properties.PropertyCollector in project dbeaver by serge-rider.
the class SessionManagerViewer method showPlanNode.
private void showPlanNode() {
detailsItem.setText("Plan Details");
ISelection selection = planViewer.getSelection();
if (selection.isEmpty()) {
sessionProps.clearProperties();
} else if (selection instanceof IStructuredSelection) {
Object element = ((IStructuredSelection) selection).getFirstElement();
if (element != selectedPlanElement) {
PropertyCollector propertySource = new PropertyCollector(element, true);
propertySource.collectProperties();
sessionProps.loadProperties(propertySource);
selectedPlanElement = element;
}
}
}
use of org.jkiss.dbeaver.runtime.properties.PropertyCollector in project dbeaver by dbeaver.
the class DBInfoUtils method makeObjectDescription.
public static String makeObjectDescription(@NotNull DBRProgressMonitor monitor, DBPNamedObject object, boolean html) {
StringBuilder info = new StringBuilder();
DBPNamedObject targetObject = object;
if (object instanceof DBSObjectReference) {
try {
targetObject = ((DBSObjectReference) object).resolveObject(monitor);
} catch (DBException e) {
StringWriter buf = new StringWriter();
e.printStackTrace(new PrintWriter(buf, true));
info.append(buf.toString());
}
}
PropertyCollector collector = new PropertyCollector(targetObject, false);
collector.collectProperties();
for (DBPPropertyDescriptor descriptor : collector.getProperties()) {
Object propValue = collector.getPropertyValue(null, descriptor.getId());
if (propValue == null) {
continue;
}
String propString;
if (propValue instanceof DBPNamedObject) {
propString = ((DBPNamedObject) propValue).getName();
} else {
propString = DBValueFormatting.getDefaultValueDisplayString(propValue, DBDDisplayFormat.UI);
}
if (CommonUtils.isEmpty(propString)) {
continue;
}
if (html) {
info.append("<b>").append(descriptor.getDisplayName()).append(": </b>");
info.append(propString);
info.append("<br>");
} else {
info.append(descriptor.getDisplayName()).append(": ").append(propString).append("\n");
}
}
return info.toString();
}
use of org.jkiss.dbeaver.runtime.properties.PropertyCollector in project dbeaver by dbeaver.
the class MySQLTable method getStatProperties.
@Nullable
@Override
public DBPPropertySource getStatProperties() {
PropertyCollector collector = new PropertyCollector(additionalInfo, true);
collector.collectProperties();
return collector;
}
Aggregations