1 package org.simantics.modeling.ui.componentTypeEditor;
3 import java.util.Collection;
5 import org.simantics.db.ReadGraph;
6 import org.simantics.db.Resource;
7 import org.simantics.db.exception.DatabaseException;
8 import org.simantics.modeling.utils.ComponentTypeViewerPropertyInfo;
9 import org.simantics.modeling.utils.HeadlessComponentTypePropertiesResultRequest;
11 public class ComponentTypePropertiesResultRequest extends HeadlessComponentTypePropertiesResultRequest {
13 private final Collection<ComponentTypeViewerSection> sections;
16 * @param componentTypeViewer
18 public ComponentTypePropertiesResultRequest(Resource componentType, Collection<ComponentTypeViewerSection> sections) {
20 this.sections = sections;
24 protected void readSectionSpecificData(ReadGraph graph, ComponentTypeViewerPropertyInfo info) throws DatabaseException {
26 Object sectionSpecificData = null;
27 double priority = Double.NEGATIVE_INFINITY;
28 if(sections != null) {
29 for(ComponentTypeViewerSection section : sections) {
30 Object temp = section.getSectionSpecificData(graph, info);
32 double sectionPriority = section.getDataPriority();
33 if(sectionPriority > priority) {
34 sectionSpecificData = temp;
35 priority = sectionPriority;
41 info.sectionSpecificData = sectionSpecificData;