Search in sources :

Example 1 with CompositeDetailDescriptor

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

Example 2 with CompositeDetailDescriptor

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

Example 3 with CompositeDetailDescriptor

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);
}
Also used : ServiceDetailDescriptor(org.qi4j.tools.model.descriptor.ServiceDetailDescriptor) EntityDetailDescriptor(org.qi4j.tools.model.descriptor.EntityDetailDescriptor) ModelDescriptor(org.qi4j.api.composite.ModelDescriptor) ValueDetailDescriptor(org.qi4j.tools.model.descriptor.ValueDetailDescriptor) ObjectDetailDescriptor(org.qi4j.tools.model.descriptor.ObjectDetailDescriptor) CompositeDetailDescriptor(org.qi4j.tools.model.descriptor.CompositeDetailDescriptor)

Example 4 with CompositeDetailDescriptor

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

Aggregations

CompositeDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeDetailDescriptor)4 ObjectDetailDescriptor (org.qi4j.tools.model.descriptor.ObjectDetailDescriptor)4 CompositeMethodDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeMethodDetailDescriptor)2 ModelDescriptor (org.qi4j.api.composite.ModelDescriptor)1 EntityDetailDescriptor (org.qi4j.tools.model.descriptor.EntityDetailDescriptor)1 MixinDetailDescriptor (org.qi4j.tools.model.descriptor.MixinDetailDescriptor)1 ServiceDetailDescriptor (org.qi4j.tools.model.descriptor.ServiceDetailDescriptor)1 ValueDetailDescriptor (org.qi4j.tools.model.descriptor.ValueDetailDescriptor)1