Search in sources :

Example 6 with EntityDetailDescriptor

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);
}
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)

Aggregations

EntityDetailDescriptor (org.qi4j.tools.model.descriptor.EntityDetailDescriptor)6 LayerDetailDescriptor (org.qi4j.tools.model.descriptor.LayerDetailDescriptor)2 ModuleDetailDescriptor (org.qi4j.tools.model.descriptor.ModuleDetailDescriptor)2 ObjectDetailDescriptor (org.qi4j.tools.model.descriptor.ObjectDetailDescriptor)2 ServiceDetailDescriptor (org.qi4j.tools.model.descriptor.ServiceDetailDescriptor)2 ValueDetailDescriptor (org.qi4j.tools.model.descriptor.ValueDetailDescriptor)2 Component (java.awt.Component)1 ComboBoxModel (javax.swing.ComboBoxModel)1 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 TreePath (javax.swing.tree.TreePath)1 ModelDescriptor (org.qi4j.api.composite.ModelDescriptor)1 Query (org.qi4j.api.query.Query)1 Module (org.qi4j.api.structure.Module)1 ApplicationDetailDescriptor (org.qi4j.tools.model.descriptor.ApplicationDetailDescriptor)1 CompositeDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeDetailDescriptor)1 ImportedServiceDetailDescriptor (org.qi4j.tools.model.descriptor.ImportedServiceDetailDescriptor)1 TransientDetailDescriptor (org.qi4j.tools.model.descriptor.TransientDetailDescriptor)1