use of org.qi4j.tools.model.descriptor.EntityDetailDescriptor in project qi4j-sdk by Qi4j.
the class ServiceConfigurationPane method setDescriptor.
@Override
protected void setDescriptor(Object objectDesciptor) {
clear();
if (!(objectDesciptor instanceof ServiceDetailDescriptor)) {
return;
}
configDescriptor = DescriptorUtilities.findServiceConfiguration((ServiceDetailDescriptor) objectDesciptor);
if (configDescriptor == null) {
return;
}
ModelDescriptor spiDescriptor = null;
String typeString = null;
if (configDescriptor instanceof ServiceDetailDescriptor) {
spiDescriptor = ((ServiceDetailDescriptor) configDescriptor).descriptor();
typeString = "Service";
} else if (configDescriptor instanceof EntityDetailDescriptor) {
spiDescriptor = ((EntityDetailDescriptor) configDescriptor).descriptor();
typeString = "Entity";
} else if (configDescriptor instanceof ValueDetailDescriptor) {
spiDescriptor = ((ValueDetailDescriptor) configDescriptor).descriptor();
typeString = "Value";
} else if (configDescriptor instanceof ObjectDetailDescriptor) {
spiDescriptor = ((ObjectDetailDescriptor) configDescriptor).descriptor();
typeString = "Object";
} else if (configDescriptor instanceof CompositeDetailDescriptor) {
spiDescriptor = ((ObjectDetailDescriptor) configDescriptor).descriptor();
typeString = "Transient";
}
Class<?> type = first(spiDescriptor.types());
String simpleName = type.getSimpleName();
nameLabel.setText("<html><a href='" + simpleName + "'>" + simpleName + "</a></html>");
classLabel.setText(type.getName());
typeLabel.setText(typeString);
linkButton.setEnabled(true);
}
Aggregations