Search in sources :

Example 1 with ObjectDetailDescriptor

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

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

the class GraphBuilder method buildObjectsNode.

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

Example 3 with ObjectDetailDescriptor

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

the class TableRowUtilities method toTableRows.

public static List<TableRow> toTableRows(List<ServiceUsage> serviceUsages) {
    List<TableRow> rows = new ArrayList<>();
    for (ServiceUsage usage : serviceUsages) {
        TableRow row = new TableRow(5);
        if (usage.ownerDescriptor() instanceof MixinDetailDescriptor) {
            MixinDetailDescriptor mixinDescriptor = (MixinDetailDescriptor) usage.ownerDescriptor();
            row.set(0, mixinDescriptor.composite());
            row.set(1, usage.field());
            row.set(2, mixinDescriptor.composite().module());
            row.set(3, mixinDescriptor.composite().module().layer());
        } else {
            // assume ObjectDetailDescriptor
            ObjectDetailDescriptor objectDescriptor = (ObjectDetailDescriptor) usage.ownerDescriptor();
            row.set(0, objectDescriptor);
            row.set(1, usage.field());
            row.set(2, objectDescriptor.module());
            row.set(3, objectDescriptor.module().layer());
        }
        rows.add(row);
    }
    return rows;
}
Also used : MixinDetailDescriptor(org.qi4j.tools.model.descriptor.MixinDetailDescriptor) ArrayList(java.util.ArrayList) ServiceUsage(org.qi4j.tools.model.descriptor.ServiceUsage) ObjectDetailDescriptor(org.qi4j.tools.model.descriptor.ObjectDetailDescriptor)

Example 4 with ObjectDetailDescriptor

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

use of org.qi4j.tools.model.descriptor.ObjectDetailDescriptor 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)

Aggregations

ObjectDetailDescriptor (org.qi4j.tools.model.descriptor.ObjectDetailDescriptor)8 CompositeDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeDetailDescriptor)4 MixinDetailDescriptor (org.qi4j.tools.model.descriptor.MixinDetailDescriptor)3 CompositeMethodDetailDescriptor (org.qi4j.tools.model.descriptor.CompositeMethodDetailDescriptor)2 EntityDetailDescriptor (org.qi4j.tools.model.descriptor.EntityDetailDescriptor)2 ServiceDetailDescriptor (org.qi4j.tools.model.descriptor.ServiceDetailDescriptor)2 ServiceUsage (org.qi4j.tools.model.descriptor.ServiceUsage)2 ValueDetailDescriptor (org.qi4j.tools.model.descriptor.ValueDetailDescriptor)2 Component (java.awt.Component)1 Annotation (java.lang.annotation.Annotation)1 ArrayList (java.util.ArrayList)1 DependencyDescriptor (org.qi4j.api.composite.DependencyDescriptor)1 ModelDescriptor (org.qi4j.api.composite.ModelDescriptor)1 Service (org.qi4j.api.injection.scope.Service)1 Uses (org.qi4j.api.injection.scope.Uses)1 ImportedServiceDetailDescriptor (org.qi4j.tools.model.descriptor.ImportedServiceDetailDescriptor)1 InjectedFieldDetailDescriptor (org.qi4j.tools.model.descriptor.InjectedFieldDetailDescriptor)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