Search in sources :

Example 1 with ValueDetailDescriptor

use of org.qi4j.tools.model.descriptor.ValueDetailDescriptor in project qi4j-sdk by Qi4j.

the class DetailModelPane method setDescriptorImpl.

private void setDescriptorImpl(Object objectDescriptor) {
    Component curSelectedComp = tabPane.getSelectedComponent();
    tabPane.removeAll();
    generalPane.setDescriptor(objectDescriptor);
    dependencyPane.setDescriptor(objectDescriptor);
    methodPane.setDescriptor(objectDescriptor);
    statePane.setDescriptor(objectDescriptor);
    serviceConfigurationPane.setDescriptor(objectDescriptor);
    serviceUsagePane.setDescriptor(objectDescriptor);
    importedByPane.setDescriptor(objectDescriptor);
    apiPane.setDescriptor(objectDescriptor);
    spiPane.setDescriptor(objectDescriptor);
    if (objectDescriptor instanceof LayerDetailDescriptor || objectDescriptor instanceof ModuleDetailDescriptor) {
        tabPane.add(bundle.getString("CTL_APITab.Text"), apiPane);
        tabPane.add(bundle.getString("CTL_SPITab.Text"), spiPane);
    } else if (objectDescriptor instanceof ServiceDetailDescriptor) {
        tabPane.add(bundle.getString("CTL_GeneralTab.Text"), generalPane);
        tabPane.add(bundle.getString("CTL_DependencyTab.Text"), dependencyPane);
        tabPane.add(bundle.getString("CTL_MethodTab.Text"), methodPane);
        tabPane.add(bundle.getString("CTL_StateTab.Text"), statePane);
        tabPane.add(bundle.getString("CTL_ServiceConfiguration.Text"), serviceConfigurationPane);
        tabPane.add(bundle.getString("CTL_ServiceUsage.Text"), serviceUsagePane);
    } else if (objectDescriptor instanceof ImportedServiceDetailDescriptor) {
        tabPane.add(bundle.getString("CTL_GeneralTab.Text"), generalPane);
        tabPane.add(bundle.getString("CTL_MethodTab.Text"), methodPane);
        tabPane.add(bundle.getString("CTL_ServiceUsage.Text"), serviceUsagePane);
        tabPane.add(bundle.getString("CTL_ImportedBy.Text"), importedByPane);
    } else if (objectDescriptor instanceof EntityDetailDescriptor) {
        tabPane.add(bundle.getString("CTL_GeneralTab.Text"), generalPane);
        tabPane.add(bundle.getString("CTL_DependencyTab.Text"), dependencyPane);
        tabPane.add(bundle.getString("CTL_MethodTab.Text"), methodPane);
        tabPane.add(bundle.getString("CTL_StateTab.Text"), statePane);
    } else if (objectDescriptor instanceof ValueDetailDescriptor) {
        tabPane.add(bundle.getString("CTL_GeneralTab.Text"), generalPane);
        tabPane.add(bundle.getString("CTL_DependencyTab.Text"), dependencyPane);
        tabPane.add(bundle.getString("CTL_MethodTab.Text"), methodPane);
        tabPane.add(bundle.getString("CTL_StateTab.Text"), statePane);
    } else if (objectDescriptor instanceof ObjectDetailDescriptor) {
        tabPane.add(bundle.getString("CTL_GeneralTab.Text"), generalPane);
        tabPane.add(bundle.getString("CTL_DependencyTab.Text"), dependencyPane);
        tabPane.add(bundle.getString("CTL_MethodTab.Text"), methodPane);
    } else if (objectDescriptor instanceof TransientDetailDescriptor) {
        tabPane.add(bundle.getString("CTL_GeneralTab.Text"), generalPane);
        tabPane.add(bundle.getString("CTL_DependencyTab.Text"), dependencyPane);
        tabPane.add(bundle.getString("CTL_MethodTab.Text"), methodPane);
        tabPane.add(bundle.getString("CTL_StateTab.Text"), statePane);
    }
    if (linkActivatedInProgress) {
        // for linking always display the first tab (General)
        linkActivatedInProgress = false;
        tabPane.setSelectedIndex(0);
    } else {
        // if not linking, then maintain the current selected tab
        if (curSelectedComp != null) {
            int index = tabPane.indexOfComponent(curSelectedComp);
            if (index != -1) {
                tabPane.setSelectedIndex(index);
            }
        }
    }
}
Also used : ImportedServiceDetailDescriptor(org.qi4j.tools.model.descriptor.ImportedServiceDetailDescriptor) ServiceDetailDescriptor(org.qi4j.tools.model.descriptor.ServiceDetailDescriptor) EntityDetailDescriptor(org.qi4j.tools.model.descriptor.EntityDetailDescriptor) LayerDetailDescriptor(org.qi4j.tools.model.descriptor.LayerDetailDescriptor) ModuleDetailDescriptor(org.qi4j.tools.model.descriptor.ModuleDetailDescriptor) ImportedServiceDetailDescriptor(org.qi4j.tools.model.descriptor.ImportedServiceDetailDescriptor) ValueDetailDescriptor(org.qi4j.tools.model.descriptor.ValueDetailDescriptor) ObjectDetailDescriptor(org.qi4j.tools.model.descriptor.ObjectDetailDescriptor) Component(java.awt.Component) TransientDetailDescriptor(org.qi4j.tools.model.descriptor.TransientDetailDescriptor)

Example 2 with ValueDetailDescriptor

use of org.qi4j.tools.model.descriptor.ValueDetailDescriptor 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 3 with ValueDetailDescriptor

use of org.qi4j.tools.model.descriptor.ValueDetailDescriptor in project qi4j-sdk by Qi4j.

the class GraphBuilder method buildValuesNode.

private void buildValuesNode(Node parent, Iterable<ValueDetailDescriptor> iter) {
    sortTypeChildren(iter);
    boolean first = true;
    for (Object obj : childList) {
        ValueDetailDescriptor descriptor = (ValueDetailDescriptor) obj;
        if (first) {
            String name = "Values";
            parent = addChild(parent, name, name);
            first = false;
        }
        addChild(parent, descriptor.descriptor().toString(), descriptor);
    }
}
Also used : ValueDetailDescriptor(org.qi4j.tools.model.descriptor.ValueDetailDescriptor)

Aggregations

ValueDetailDescriptor (org.qi4j.tools.model.descriptor.ValueDetailDescriptor)3 EntityDetailDescriptor (org.qi4j.tools.model.descriptor.EntityDetailDescriptor)2 ObjectDetailDescriptor (org.qi4j.tools.model.descriptor.ObjectDetailDescriptor)2 ServiceDetailDescriptor (org.qi4j.tools.model.descriptor.ServiceDetailDescriptor)2 Component (java.awt.Component)1 ModelDescriptor (org.qi4j.api.composite.ModelDescriptor)1 CompositeDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeDetailDescriptor)1 ImportedServiceDetailDescriptor (org.qi4j.tools.model.descriptor.ImportedServiceDetailDescriptor)1 LayerDetailDescriptor (org.qi4j.tools.model.descriptor.LayerDetailDescriptor)1 ModuleDetailDescriptor (org.qi4j.tools.model.descriptor.ModuleDetailDescriptor)1 TransientDetailDescriptor (org.qi4j.tools.model.descriptor.TransientDetailDescriptor)1