public void onTypeCellSelection(ObjectProperty property) { DataObject dataObject = getDataModel().getDataObject(property.getClassName()); if (dataObject != null) { openDataObject(dataObject); } }
public String resolveAttributeType(ObjectProperty attribute) { StringBuffer type = new StringBuffer(""); if (attribute.isMultiple()) { if (attribute.getBag() != null && !"".equals(attribute.getBag())) { type.append(attribute.getBag()); } else { type.append("java.util.List"); } type.append("<"); } type.append(attribute.getClassName()); if (attribute.isMultiple()) { type.append(">"); } return type.toString(); }
private String propertyTypeDisplay(ObjectProperty property) { String displayName = property.getClassName(); if (property.isBaseType()) { displayName = DataModelerUtils.extractClassName(displayName); } else { String label = getContext().getHelper().getObjectLabelByClassName(displayName); if (label != null && !"".equals(label)) { displayName = label; } } if (property.isMultiple()) { displayName += " [" + Constants.INSTANCE.objectBrowser_typeLabelMultiple() + "]"; } return displayName; }
private void deleteDataObjectProperty(final ObjectProperty objectProperty, final int index) { if (dataObject != null) { dataObject.getProperties().remove(objectProperty); dataObjectPropertiesProvider.getList().remove(index); dataObjectPropertiesProvider.flush(); dataObjectPropertiesProvider.refresh(); getContext() .getHelper() .dataObjectUnReferenced(objectProperty.getClassName(), dataObject.getClassName()); notifyFieldDeleted(objectProperty); if (dataObjectPropertiesProvider.getList().size() == 0) { context.setObjectProperty(null); dataModelerWBContextEvent.fire(new DataModelerWorkbenchContextChangeEvent()); } else if (dataObjectPropertiesProvider.getList().size() == 1) { // BZ-1255449 tricky bug. Considerable time was spent, and it was no direct to find an // optimal/better solution. // Since in this use case the Data Object will have just one field, it's acceptable to // reload the list. setDataObject(dataObject); } } }