use of com.twinsoft.convertigo.beans.transactions.couchdb.ICouchParametersExtra in project convertigo by convertigo.
the class CouchVariablesComposite method setPropertyDescriptor.
public void setPropertyDescriptor(AbstractCouchDbTransaction couchDbTransaction, PropertyDescriptor[] propertyDescriptors, DatabaseObject parentObject) {
cleanGroups();
/* Fill the Group widget */
for (PropertyDescriptor property : propertyDescriptors) {
String name = property.getName();
String description = property.getShortDescription();
if (!parametersCouch.contains(name)) {
if ((name.startsWith("q_") || name.startsWith("p_"))) {
if (!parentObject.getClass().getCanonicalName().equals(property.getValue(MySimpleBeanInfo.BLACK_LIST_PARENT_CLASS))) {
Group choosenGroup = name.startsWith("q_") ? groupQueries : groupParameters;
description = description.replaceFirst("\\|", "<br/>\n");
addToComposite(choosenGroup, name, description, false);
}
}
}
}
Collection<CouchExtraVariable> extraVariables = null;
if (couchDbTransaction instanceof ICouchParametersExtra) {
extraVariables = ((ICouchParametersExtra) couchDbTransaction).getCouchParametersExtra();
}
if (extraVariables != null) {
for (CouchExtraVariable extraVariable : extraVariables) {
String name = extraVariable.getVariableName();
Group group = name.startsWith("q_") ? groupQueries : groupData;
addToComposite(group, name, extraVariable.getVariableDescription(), extraVariable.isMultiValued());
}
}
if (groupQueries.getChildren().length == 1) {
groupQueries.dispose();
}
if (groupParameters.getChildren().length == 1) {
groupParameters.dispose();
}
if (groupData.getChildren().length == 1) {
groupData.dispose();
}
setContent(globalComposite);
globalComposite.pack(true);
// Fix text no displayed in C8oBrowser
LinkedList<Control> controls = new LinkedList<>();
controls.add(globalComposite);
Control c;
while ((c = controls.pollFirst()) != null) {
if (c instanceof C8oBrowser) {
((C8oBrowser) c).reloadText();
} else if (c instanceof Composite) {
controls.addAll(Arrays.asList(((Composite) c).getChildren()));
}
}
}
Aggregations