use of org.qi4j.tools.model.descriptor.CompositeDetailDescriptor in project qi4j-sdk by Qi4j.
the class MethodPane method setDescriptor.
@Override
protected void setDescriptor(Object objectDesciptor) {
clear();
if (objectDesciptor instanceof CompositeDetailDescriptor) {
CompositeDetailDescriptor descriptor = ((CompositeDetailDescriptor) objectDesciptor);
List<CompositeMethodDetailDescriptor> list = DescriptorUtilities.findMethod(descriptor);
for (CompositeMethodDetailDescriptor methodDescriptor : list) {
methodListModel.addElement(methodDescriptor);
}
if (!methodListModel.isEmpty()) {
methodList.setSelectedIndex(0);
}
} else if (objectDesciptor instanceof ObjectDetailDescriptor) {
// Object does not have methods
}
}
use of org.qi4j.tools.model.descriptor.CompositeDetailDescriptor in project qi4j-sdk by Qi4j.
the class DependencyPane method setDescriptor.
@Override
protected void setDescriptor(Object objectDesciptor) {
clear();
if (objectDesciptor instanceof CompositeDetailDescriptor) {
CompositeDetailDescriptor descriptor = ((CompositeDetailDescriptor) objectDesciptor);
Iterable<MixinDetailDescriptor> iter = descriptor.mixins();
for (MixinDetailDescriptor mixinDescriptor : iter) {
reload(mixinDescriptor.injectedFields());
}
} else if (objectDesciptor instanceof ObjectDetailDescriptor) {
ObjectDetailDescriptor descriptor = ((ObjectDetailDescriptor) objectDesciptor);
reload(descriptor.injectedFields());
}
if (!fieldListModel.isEmpty()) {
fieldList.setSelectedIndex(0);
}
}
use of org.qi4j.tools.model.descriptor.CompositeDetailDescriptor 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);
}
use of org.qi4j.tools.model.descriptor.CompositeDetailDescriptor in project qi4j-sdk by Qi4j.
the class StatePane method setDescriptor.
@Override
protected void setDescriptor(Object objectDesciptor) {
clear();
if (objectDesciptor instanceof CompositeDetailDescriptor) {
CompositeDetailDescriptor descriptor = ((CompositeDetailDescriptor) objectDesciptor);
List<CompositeMethodDetailDescriptor> list = DescriptorUtilities.findState(descriptor);
for (CompositeMethodDetailDescriptor methodDescriptor : list) {
methodListModel.addElement(methodDescriptor);
}
if (!methodListModel.isEmpty()) {
methodList.setSelectedIndex(0);
}
} else if (objectDesciptor instanceof ObjectDetailDescriptor) {
// Object does not have state
}
}
Aggregations