]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.issues.common/src/org/simantics/issues/common/preferences/IssuePrefs.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.issues.common / src / org / simantics / issues / common / preferences / IssuePrefs.java
index 2b7f477c7d056fb4157d1c23cb626ad0ce5763dd..3c82ac1866654c38c7953bcb4f21dba8343f9b5c 100644 (file)
@@ -1,62 +1,62 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2011 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
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.issues.common.preferences;\r
-\r
-import org.simantics.databoard.Bindings;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.WriteGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.issues.ui.ontology.IssueUIResource;\r
-\r
-/**\r
- * @author Tuukka Lehtonen\r
- */\r
-public final class IssuePrefs {\r
-\r
-    public static boolean showHiddenIssues(ReadGraph graph, Resource project) throws DatabaseException {\r
-        return testBoolean(graph, project, IssueUIResource.getInstance(graph).ShowHiddenIssues, false);\r
-    }\r
-\r
-    public static boolean showNormalIssues(ReadGraph graph, Resource project) throws DatabaseException {\r
-        return testBoolean(graph, project, IssueUIResource.getInstance(graph).ShowNormalIssues, true);\r
-    }\r
-\r
-    public static boolean showUserIssues(ReadGraph graph, Resource project) throws DatabaseException {\r
-        return testBoolean(graph, project, IssueUIResource.getInstance(graph).ShowUserIssues, true);\r
-    }\r
-\r
-    private static boolean testBoolean(ReadGraph graph, Resource project, Resource property, boolean defaultValue) throws DatabaseException {\r
-        if (project == null)\r
-            return defaultValue;\r
-        Boolean b = graph.getPossibleRelatedValue(project, property, Bindings.BOOLEAN);\r
-        return b == null ? defaultValue : b;\r
-    }\r
-\r
-    public static void setShowHiddenIssues(WriteGraph graph, Resource project, boolean show) throws DatabaseException {\r
-        setBoolean(graph, project, IssueUIResource.getInstance(graph).ShowHiddenIssues, show);\r
-    }\r
-\r
-    public static void setShowNormalIssues(WriteGraph graph, Resource project, boolean show) throws DatabaseException {\r
-        setBoolean(graph, project, IssueUIResource.getInstance(graph).ShowNormalIssues, show);\r
-    }\r
-\r
-    public static void setShowUserIssues(WriteGraph graph, Resource project, boolean show) throws DatabaseException {\r
-        setBoolean(graph, project, IssueUIResource.getInstance(graph).ShowUserIssues, show);\r
-    }\r
-\r
-    private static void setBoolean(WriteGraph graph, Resource project, Resource property, boolean value)\r
-            throws DatabaseException {\r
-        graph.claimLiteral(project, property, value, Bindings.BOOLEAN);\r
-    }\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2011 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:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.issues.common.preferences;
+
+import org.simantics.databoard.Bindings;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.WriteGraph;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.issues.ui.ontology.IssueUIResource;
+
+/**
+ * @author Tuukka Lehtonen
+ */
+public final class IssuePrefs {
+
+    public static boolean showHiddenIssues(ReadGraph graph, Resource project) throws DatabaseException {
+        return testBoolean(graph, project, IssueUIResource.getInstance(graph).ShowHiddenIssues, false);
+    }
+
+    public static boolean showNormalIssues(ReadGraph graph, Resource project) throws DatabaseException {
+        return testBoolean(graph, project, IssueUIResource.getInstance(graph).ShowNormalIssues, true);
+    }
+
+    public static boolean showUserIssues(ReadGraph graph, Resource project) throws DatabaseException {
+        return testBoolean(graph, project, IssueUIResource.getInstance(graph).ShowUserIssues, true);
+    }
+
+    private static boolean testBoolean(ReadGraph graph, Resource project, Resource property, boolean defaultValue) throws DatabaseException {
+        if (project == null)
+            return defaultValue;
+        Boolean b = graph.getPossibleRelatedValue(project, property, Bindings.BOOLEAN);
+        return b == null ? defaultValue : b;
+    }
+
+    public static void setShowHiddenIssues(WriteGraph graph, Resource project, boolean show) throws DatabaseException {
+        setBoolean(graph, project, IssueUIResource.getInstance(graph).ShowHiddenIssues, show);
+    }
+
+    public static void setShowNormalIssues(WriteGraph graph, Resource project, boolean show) throws DatabaseException {
+        setBoolean(graph, project, IssueUIResource.getInstance(graph).ShowNormalIssues, show);
+    }
+
+    public static void setShowUserIssues(WriteGraph graph, Resource project, boolean show) throws DatabaseException {
+        setBoolean(graph, project, IssueUIResource.getInstance(graph).ShowUserIssues, show);
+    }
+
+    private static void setBoolean(WriteGraph graph, Resource project, Resource property, boolean value)
+            throws DatabaseException {
+        graph.claimLiteral(project, property, value, Bindings.BOOLEAN);
+    }
+
+}