Search in sources :

Example 6 with CompositeMethodDetailDescriptor

use of org.qi4j.tools.model.descriptor.CompositeMethodDetailDescriptor 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
    }
}
Also used : CompositeMethodDetailDescriptor(org.qi4j.tools.model.descriptor.CompositeMethodDetailDescriptor) ObjectDetailDescriptor(org.qi4j.tools.model.descriptor.ObjectDetailDescriptor) CompositeDetailDescriptor(org.qi4j.tools.model.descriptor.CompositeDetailDescriptor)

Aggregations

CompositeMethodDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeMethodDetailDescriptor)6 Method (java.lang.reflect.Method)2 ArrayList (java.util.ArrayList)2 Association (org.qi4j.api.association.Association)2 ManyAssociation (org.qi4j.api.association.ManyAssociation)2 NamedAssociation (org.qi4j.api.association.NamedAssociation)2 CompositeDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeDetailDescriptor)2 ObjectDetailDescriptor (org.qi4j.tools.model.descriptor.ObjectDetailDescriptor)2 CompositeDescriptor (org.qi4j.api.composite.CompositeDescriptor)1 Property (org.qi4j.api.property.Property)1