]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueLabelRule.java
Externalize strings
[simantics/platform.git] / bundles / org.simantics.issues.ui / src / org / simantics / issues / ui / IssueLabelRule.java
index b92699043f1989ced60ffe4523e8a566ebe5b4ea..ada862d86b585b5b628847bce8c407bbef986df9 100644 (file)
@@ -1,52 +1,50 @@
-/*******************************************************************************\r
- * Copyright (c) 2010, 2011 Association for Decentralized Information Management in\r
- * 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.ui;\r
-\r
-import java.util.Map;\r
-\r
-import org.simantics.browsing.ui.common.ColumnKeys;\r
-import org.simantics.browsing.ui.model.labels.LabelRule;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.utils.datastructures.ArrayMap;\r
-import org.simantics.utils.strings.StringUtils;\r
-\r
-public class IssueLabelRule implements LabelRule {\r
-\r
-    public static final IssueLabelRule INSTANCE = new IssueLabelRule();\r
-\r
-    private static final String[] COLS = new String[] { ColumnKeys.SINGLE, "Resource", "Path" };\r
-\r
-    public IssueLabelRule() {\r
-    }\r
-\r
-    @Override\r
-    public boolean isCompatible(Class<?> contentType) {\r
-        return contentType.equals(Variable.class);\r
-    }\r
-\r
-    @Override\r
-    public Map<String,String> getLabel(ReadGraph graph, Object content) throws DatabaseException {\r
-\r
-        Variable issue = (Variable)content;\r
-        //Layer0 L0 = Layer0.getInstance(graph);\r
-        //IssueResource ISSUE = IssueResource.getInstance(graph);\r
-        String description = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "HasDescription") );\r
-        String resource = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "resource") );\r
-        String path = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "path") );\r
-\r
-        String[] result = new String[] { description, resource, path };\r
-        return new ArrayMap<String, String>(COLS, result);\r
-\r
-    }\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2010, 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.ui;
+
+import java.util.Map;
+
+import org.simantics.browsing.ui.common.ColumnKeys;
+import org.simantics.browsing.ui.model.labels.LabelRule;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.variable.Variable;
+import org.simantics.utils.datastructures.ArrayMap;
+import org.simantics.utils.strings.StringUtils;
+
+public class IssueLabelRule implements LabelRule {
+
+    public static final IssueLabelRule INSTANCE = new IssueLabelRule();
+
+    private static final String[] COLS = new String[] { ColumnKeys.SINGLE, Messages.IssueLabelRule_Resource, Messages.IssueLabelRule_Path };
+
+    public IssueLabelRule() {
+    }
+
+    @Override
+    public boolean isCompatible(Class<?> contentType) {
+        return contentType.equals(Variable.class);
+    }
+
+    @Override
+    public Map<String,String> getLabel(ReadGraph graph, Object content) throws DatabaseException {
+
+        Variable issue = (Variable)content;
+        String description = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "HasDescription") ); //$NON-NLS-1$
+        String resource = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "resource") ); //$NON-NLS-1$
+        String path = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "path") ); //$NON-NLS-1$
+
+        String[] result = new String[] { description, resource, path };
+        return new ArrayMap<String, String>(COLS, result);
+
+    }
+}