]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.selectionview/src/org/simantics/selectionview/DisplayPropertyVariableAdapter.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.selectionview / src / org / simantics / selectionview / DisplayPropertyVariableAdapter.java
index a0e30e994e6058957af239686b4b223b4b6d023c..6c05005b2fba18ebb300810f7dbb6aa2a9278551 100644 (file)
@@ -1,35 +1,35 @@
-package org.simantics.selectionview;\r
-\r
-import org.simantics.databoard.Datatypes;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.adaption.SimpleContextualAdapter;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.variable.ConstantValueStandardGraphPropertyVariable;\r
-import org.simantics.db.layer0.variable.ModelledVariablePropertyDescriptor;\r
-import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.db.layer0.variable.Variables;\r
-\r
-public class DisplayPropertyVariableAdapter extends SimpleContextualAdapter<Variable, ModelledVariablePropertyDescriptor> {\r
-       \r
-    public String getDisplayProperty(ReadGraph graph, Variable property) throws DatabaseException {\r
-       Resource predicate = property.getPossiblePredicateResource(graph);\r
-       if(predicate == null) return property.getName(graph);\r
-       return Variables.getVariable(graph, graph.getURI(predicate)).getLabel(graph);\r
-//        Variable predicate = property.getPossiblePropertyValue(graph, Variables.PREDICATE);\r
-//        if(predicate == null) return property.getName(graph);\r
-//        else return predicate.getPropertyValue(graph, Variables.LABEL);\r
-    }\r
-       \r
-       @Override\r
-       public Variable adapt(ReadGraph graph, Resource source, ModelledVariablePropertyDescriptor context) throws DatabaseException {\r
-               \r
-       String value = getDisplayProperty(graph, context.getVariable());\r
-       return new ConstantValueStandardGraphPropertyVariable(graph, context.getVariable(), \r
-                       context.getSubject(),\r
-                       SelectionViewResources.getInstance(graph).HasDisplayProperty,\r
-                       value != null ? value : "", Datatypes.STRING);\r
-               \r
-       }\r
-\r
-}\r
+package org.simantics.selectionview;
+
+import org.simantics.databoard.Datatypes;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.adaption.SimpleContextualAdapter;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.variable.ConstantValueStandardGraphPropertyVariable;
+import org.simantics.db.layer0.variable.ModelledVariablePropertyDescriptor;
+import org.simantics.db.layer0.variable.Variable;
+import org.simantics.db.layer0.variable.Variables;
+
+public class DisplayPropertyVariableAdapter extends SimpleContextualAdapter<Variable, ModelledVariablePropertyDescriptor> {
+       
+    public String getDisplayProperty(ReadGraph graph, Variable property) throws DatabaseException {
+       Resource predicate = property.getPossiblePredicateResource(graph);
+       if(predicate == null) return property.getName(graph);
+       return Variables.getVariable(graph, graph.getURI(predicate)).getLabel(graph);
+//        Variable predicate = property.getPossiblePropertyValue(graph, Variables.PREDICATE);
+//        if(predicate == null) return property.getName(graph);
+//        else return predicate.getPropertyValue(graph, Variables.LABEL);
+    }
+       
+       @Override
+       public Variable adapt(ReadGraph graph, Resource source, ModelledVariablePropertyDescriptor context) throws DatabaseException {
+               
+       String value = getDisplayProperty(graph, context.getVariable());
+       return new ConstantValueStandardGraphPropertyVariable(graph, context.getVariable(), 
+                       context.getSubject(),
+                       SelectionViewResources.getInstance(graph).HasDisplayProperty,
+                       value != null ? value : "", Datatypes.STRING);
+               
+       }
+
+}