]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural.ui/src/org/simantics/structural/ui/modelBrowser/contributions/ComponentTypeLockStatusImageDecorationRule.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.structural.ui / src / org / simantics / structural / ui / modelBrowser / contributions / ComponentTypeLockStatusImageDecorationRule.java
index d17dd598fc8f36e1b185dea28bf8e2456a47ae17..9f9295f3260f6bd5d008a91d5beb6c1d0ed69836 100644 (file)
@@ -1,40 +1,40 @@
-package org.simantics.structural.ui.modelBrowser.contributions;\r
-\r
-import org.eclipse.jface.resource.ImageDescriptor;\r
-import org.eclipse.jface.viewers.IDecoration;\r
-import org.simantics.browsing.ui.content.ImageDecorator;\r
-import org.simantics.browsing.ui.model.imagedecorators.ImageDecorationRule;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.structural.stubs.StructuralResource2;\r
-import org.simantics.structural.ui.Activator;\r
-import org.simantics.utils.ui.gfx.DecorationOverlayIcon;\r
-\r
-public class ComponentTypeLockStatusImageDecorationRule implements ImageDecorationRule {\r
-\r
-    @Override\r
-    public boolean isCompatible(Class<?> contentType) {\r
-        return Resource.class.isAssignableFrom(contentType);\r
-    }\r
-\r
-    @Override\r
-    public ImageDecorator getImageDecorator(ReadGraph graph, Object content)\r
-            throws DatabaseException {\r
-        Resource resource = (Resource) content;\r
-        StructuralResource2 STR = StructuralResource2.getInstance(graph);\r
-        if(!graph.hasStatement(resource, STR.ComponentType_Locked))\r
-            return null;\r
-        \r
-        return new ImageDecorator() {\r
-            @Override\r
-            public <Image> Image decorateImage(Image image, String column, int itemIndex) {\r
-                ImageDescriptor original = (ImageDescriptor)image;\r
-                ImageDescriptor decorated = (original == null || original.getImageData() == null) ? Activator.LOCK\r
-                        : new DecorationOverlayIcon(original, Activator.LOCK, IDecoration.TOP_RIGHT);\r
-                return (Image)decorated;\r
-            }\r
-        };\r
-    }\r
-\r
-}\r
+package org.simantics.structural.ui.modelBrowser.contributions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IDecoration;
+import org.simantics.browsing.ui.content.ImageDecorator;
+import org.simantics.browsing.ui.model.imagedecorators.ImageDecorationRule;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.structural.stubs.StructuralResource2;
+import org.simantics.structural.ui.Activator;
+import org.simantics.utils.ui.gfx.DecorationOverlayIcon;
+
+public class ComponentTypeLockStatusImageDecorationRule implements ImageDecorationRule {
+
+    @Override
+    public boolean isCompatible(Class<?> contentType) {
+        return Resource.class.isAssignableFrom(contentType);
+    }
+
+    @Override
+    public ImageDecorator getImageDecorator(ReadGraph graph, Object content)
+            throws DatabaseException {
+        Resource resource = (Resource) content;
+        StructuralResource2 STR = StructuralResource2.getInstance(graph);
+        if(!graph.hasStatement(resource, STR.ComponentType_Locked))
+            return null;
+        
+        return new ImageDecorator() {
+            @Override
+            public <Image> Image decorateImage(Image image, String column, int itemIndex) {
+                ImageDescriptor original = (ImageDescriptor)image;
+                ImageDescriptor decorated = (original == null || original.getImageData() == null) ? Activator.LOCK
+                        : new DecorationOverlayIcon(original, Activator.LOCK, IDecoration.TOP_RIGHT);
+                return (Image)decorated;
+            }
+        };
+    }
+
+}