]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.debug.browser/src/org/simantics/debug/browser/content/ResourceBrowserContent.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.debug.browser / src / org / simantics / debug / browser / content / ResourceBrowserContent.java
index ccb04411e6d7f90c41e48572dc7a7745c907a9ac..945bfd077a825371e39395e877643bcfbc87f982 100644 (file)
@@ -1,69 +1,69 @@
-/*******************************************************************************\r
- * Copyright (c) 2016 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     THTH ry - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.debug.browser.content;\r
-\r
-import gnu.trove.map.hash.THashMap;\r
-\r
-import java.io.PrintWriter;\r
-import java.util.ArrayList;\r
-import java.util.Collections;\r
-import java.util.Comparator;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.debug.browser.sections.ResourceBrowserSection;\r
-\r
-public class ResourceBrowserContent {\r
-    public final Resource resource;\r
-    private final THashMap<Class<?>, ResourceBrowserSection> sectionMap =\r
-            new THashMap<Class<?>, ResourceBrowserSection>();\r
-    \r
-    private ResourceBrowserContent(Resource resource) {\r
-        this.resource = resource;\r
-    }\r
-    \r
-    @SuppressWarnings("unchecked")\r
-    public <T extends ResourceBrowserSection> T getSection(Class<T> clazz) {\r
-        return (T)sectionMap.get(clazz);\r
-    }\r
-    \r
-    public <T extends ResourceBrowserSection> void putSection(Class<T> clazz, T section) {\r
-        sectionMap.put(clazz, section);\r
-    }\r
-    \r
-    @SuppressWarnings("unchecked")\r
-    public <T extends ResourceBrowserSection> T removeSection(Class<T> clazz) {\r
-        return (T)sectionMap.remove(clazz);\r
-    }\r
-    \r
-    private static final Comparator<ResourceBrowserSection> SECTION_COMPARATOR = new Comparator<ResourceBrowserSection>() {\r
-        @Override\r
-        public int compare(ResourceBrowserSection o1, ResourceBrowserSection o2) {\r
-            return Double.compare(o1.getPriority(), o2.getPriority());\r
-        }\r
-    };\r
-    \r
-    public void toHtml(ReadGraph graph, PrintWriter stream) throws DatabaseException {\r
-        ArrayList<ResourceBrowserSection> sections = new ArrayList<ResourceBrowserSection>(sectionMap.values());\r
-        Collections.sort(sections, SECTION_COMPARATOR);\r
-        for(ResourceBrowserSection section : sections)\r
-            section.toHtml(graph, stream);\r
-    }\r
-    \r
-    public static ResourceBrowserContent createContentFor(ReadGraph graph, Resource resource) throws DatabaseException {\r
-        ResourceBrowserContent content = new ResourceBrowserContent(resource);\r
-        for(ResourceBrowserRewriter rewriter : ResourceBrowserRewriterRepository.getRewriters())\r
-            rewriter.rewrite(graph, content);\r
-        return content;\r
-    }\r
+/*******************************************************************************
+ * Copyright (c) 2016 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     THTH ry - initial API and implementation
+ *******************************************************************************/
+package org.simantics.debug.browser.content;
+
+import gnu.trove.map.hash.THashMap;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.debug.browser.sections.ResourceBrowserSection;
+
+public class ResourceBrowserContent {
+    public final Resource resource;
+    private final THashMap<Class<?>, ResourceBrowserSection> sectionMap =
+            new THashMap<Class<?>, ResourceBrowserSection>();
+    
+    private ResourceBrowserContent(Resource resource) {
+        this.resource = resource;
+    }
+    
+    @SuppressWarnings("unchecked")
+    public <T extends ResourceBrowserSection> T getSection(Class<T> clazz) {
+        return (T)sectionMap.get(clazz);
+    }
+    
+    public <T extends ResourceBrowserSection> void putSection(Class<T> clazz, T section) {
+        sectionMap.put(clazz, section);
+    }
+    
+    @SuppressWarnings("unchecked")
+    public <T extends ResourceBrowserSection> T removeSection(Class<T> clazz) {
+        return (T)sectionMap.remove(clazz);
+    }
+    
+    private static final Comparator<ResourceBrowserSection> SECTION_COMPARATOR = new Comparator<ResourceBrowserSection>() {
+        @Override
+        public int compare(ResourceBrowserSection o1, ResourceBrowserSection o2) {
+            return Double.compare(o1.getPriority(), o2.getPriority());
+        }
+    };
+    
+    public void toHtml(ReadGraph graph, PrintWriter stream) throws DatabaseException {
+        ArrayList<ResourceBrowserSection> sections = new ArrayList<ResourceBrowserSection>(sectionMap.values());
+        Collections.sort(sections, SECTION_COMPARATOR);
+        for(ResourceBrowserSection section : sections)
+            section.toHtml(graph, stream);
+    }
+    
+    public static ResourceBrowserContent createContentFor(ReadGraph graph, Resource resource) throws DatabaseException {
+        ResourceBrowserContent content = new ResourceBrowserContent(resource);
+        for(ResourceBrowserRewriter rewriter : ResourceBrowserRewriterRepository.getRewriters())
+            rewriter.rewrite(graph, content);
+        return content;
+    }
 }
\ No newline at end of file