]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Externalize strings in org.simantics.db.procore.ui 02/2502/3
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 28 Nov 2018 13:15:54 +0000 (15:15 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 7 Dec 2018 13:08:28 +0000 (15:08 +0200)
gitlab #210

Change-Id: Id68728d5e8202fdadeef86d1d91e4f397ab6a4a7

16 files changed:
bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/BuiltinKeys.java
bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/Column.java
bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/ExplorerState.java
bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/GraphExplorer.java
bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/content/Labeler.java
bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/content/PrunedChildrenResult.java
bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/exception/NoDataSourceException.java
bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/exception/NoQueryProcessorException.java
bundles/org.simantics.db.procore.ui/META-INF/MANIFEST.MF
bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/Auxiliary.java
bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/Handler.java
bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/Messages.java [new file with mode: 0644]
bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/UI.java
bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/Util.java
bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/messages.properties [new file with mode: 0644]
i18n.md

index 4c219defb6a59750c7b27e4ca02fe059e245a16a..be283bd84845f322ef1a5c4ce6bb900e56c2faff 100644 (file)
@@ -58,7 +58,7 @@ public interface BuiltinKeys {
         private InputKey() {}
         @Override
         public String toString() {
         private InputKey() {}
         @Override
         public String toString() {
-            return "INPUT";
+            return "INPUT"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -77,7 +77,7 @@ public interface BuiltinKeys {
         private UIContextKey() {}
         @Override
         public String toString() {
         private UIContextKey() {}
         @Override
         public String toString() {
-            return "UI_CONTEXT";
+            return "UI_CONTEXT"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -96,7 +96,7 @@ public interface BuiltinKeys {
         private BrowseContextKey() {}
         @Override
         public String toString() {
         private BrowseContextKey() {}
         @Override
         public String toString() {
-            return "BROWSE_CONTEXT";
+            return "BROWSE_CONTEXT"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -115,7 +115,7 @@ public interface BuiltinKeys {
         private ActionBrowseContextKey() {}
         @Override
         public String toString() {
         private ActionBrowseContextKey() {}
         @Override
         public String toString() {
-            return "ACTION_BROWSE_CONTEXT";
+            return "ACTION_BROWSE_CONTEXT"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -134,7 +134,7 @@ public interface BuiltinKeys {
         private FilterKey() {}
         @Override
         public String toString() {
         private FilterKey() {}
         @Override
         public String toString() {
-            return "FILTER";
+            return "FILTER"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -153,21 +153,21 @@ public interface BuiltinKeys {
     public static final QueryKey<Viewpoint> SELECTED_VIEWPOINT = new QueryKey<Viewpoint>() {
         @Override
         public String toString() {
     public static final QueryKey<Viewpoint> SELECTED_VIEWPOINT = new QueryKey<Viewpoint>() {
         @Override
         public String toString() {
-            return "SELECTED_VIEWPOINT";
+            return "SELECTED_VIEWPOINT"; //$NON-NLS-1$
         }
     };
 
     public static final QueryKey<String> ACTIVE_FILTER = new QueryKey<String>() {
         @Override
         public String toString() {
         }
     };
 
     public static final QueryKey<String> ACTIVE_FILTER = new QueryKey<String>() {
         @Override
         public String toString() {
-            return "ACTIVE_FILTER";
+            return "ACTIVE_FILTER"; //$NON-NLS-1$
         }
     };
 
     public static final QueryKey<Collection<ViewpointContribution>> VIEWPOINT_CONTRIBUTIONS = new QueryKey<Collection<ViewpointContribution>>() {
         @Override
         public String toString() {
         }
     };
 
     public static final QueryKey<Collection<ViewpointContribution>> VIEWPOINT_CONTRIBUTIONS = new QueryKey<Collection<ViewpointContribution>>() {
         @Override
         public String toString() {
-            return "VIEWPOINT_CONTRIBUTIONS";
+            return "VIEWPOINT_CONTRIBUTIONS"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -181,7 +181,7 @@ public interface BuiltinKeys {
     public static final QueryKey<Collection<ViewpointFactory>> VIEWPOINT_FACTORIES = new QueryKey<Collection<ViewpointFactory>>() {
         @Override
         public String toString() {
     public static final QueryKey<Collection<ViewpointFactory>> VIEWPOINT_FACTORIES = new QueryKey<Collection<ViewpointFactory>>() {
         @Override
         public String toString() {
-            return "VIEWPOINT_FACTORIES";
+            return "VIEWPOINT_FACTORIES"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -192,7 +192,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "SELECTED_VIEWPOINT_FACTORY";
+            return "SELECTED_VIEWPOINT_FACTORY"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -203,7 +203,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "VIEWPOINT";
+            return "VIEWPOINT"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -214,7 +214,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "VIEWPOINT_CONTRIBUTION";
+            return "VIEWPOINT_CONTRIBUTION"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -224,7 +224,7 @@ public interface BuiltinKeys {
     public static final QueryKey<Collection<LabelDecoratorFactory>> LABEL_DECORATOR_FACTORIES = new QueryKey<Collection<LabelDecoratorFactory>>() {
         @Override
         public String toString() {
     public static final QueryKey<Collection<LabelDecoratorFactory>> LABEL_DECORATOR_FACTORIES = new QueryKey<Collection<LabelDecoratorFactory>>() {
         @Override
         public String toString() {
-            return "LABEL_DECORATOR_FACTORIES";
+            return "LABEL_DECORATOR_FACTORIES"; //$NON-NLS-1$
         }
     };
     /**
         }
     };
     /**
@@ -233,7 +233,7 @@ public interface BuiltinKeys {
     public static final QueryKey<Collection<LabelDecorator>> LABEL_DECORATORS = new QueryKey<Collection<LabelDecorator>>() {
         @Override
         public String toString() {
     public static final QueryKey<Collection<LabelDecorator>> LABEL_DECORATORS = new QueryKey<Collection<LabelDecorator>>() {
         @Override
         public String toString() {
-            return "LABEL_DECORATORS";
+            return "LABEL_DECORATORS"; //$NON-NLS-1$
         }
     };
     /**
         }
     };
     /**
@@ -242,7 +242,7 @@ public interface BuiltinKeys {
     public static final QueryKey<Collection<ImageDecoratorFactory>> IMAGE_DECORATOR_FACTORIES = new QueryKey<Collection<ImageDecoratorFactory>>() {
         @Override
         public String toString() {
     public static final QueryKey<Collection<ImageDecoratorFactory>> IMAGE_DECORATOR_FACTORIES = new QueryKey<Collection<ImageDecoratorFactory>>() {
         @Override
         public String toString() {
-            return "IMAGE_DECORATOR_FACTORIES";
+            return "IMAGE_DECORATOR_FACTORIES"; //$NON-NLS-1$
         }
     };
     /**
         }
     };
     /**
@@ -251,35 +251,35 @@ public interface BuiltinKeys {
     public static final QueryKey<Collection<ImageDecorator>> IMAGE_DECORATORS = new QueryKey<Collection<ImageDecorator>>() {
         @Override
         public String toString() {
     public static final QueryKey<Collection<ImageDecorator>> IMAGE_DECORATORS = new QueryKey<Collection<ImageDecorator>>() {
         @Override
         public String toString() {
-            return "IMAGE_DECORATORS";
+            return "IMAGE_DECORATORS"; //$NON-NLS-1$
         }
     };
 
     public static final QueryKey<Labeler> SELECTED_LABELER = new QueryKey<Labeler>() {
         @Override
         public String toString() {
         }
     };
 
     public static final QueryKey<Labeler> SELECTED_LABELER = new QueryKey<Labeler>() {
         @Override
         public String toString() {
-            return "SELECTED_LABELER";
+            return "SELECTED_LABELER"; //$NON-NLS-1$
         }
     };
 
     public static final QueryKey<Imager> SELECTED_IMAGER = new QueryKey<Imager>() {
         @Override
         public String toString() {
         }
     };
 
     public static final QueryKey<Imager> SELECTED_IMAGER = new QueryKey<Imager>() {
         @Override
         public String toString() {
-            return "SELECTED_IMAGER";
+            return "SELECTED_IMAGER"; //$NON-NLS-1$
         }
     };
 
     public static final QueryKey<Collection<LabelDecoratorFactory>> SELECTED_LABEL_DECORATOR_FACTORIES = new QueryKey<Collection<LabelDecoratorFactory>>() {
         @Override
         public String toString() {
         }
     };
 
     public static final QueryKey<Collection<LabelDecoratorFactory>> SELECTED_LABEL_DECORATOR_FACTORIES = new QueryKey<Collection<LabelDecoratorFactory>>() {
         @Override
         public String toString() {
-            return "SELECTED_LABEL_DECORATOR_FACTORIES";
+            return "SELECTED_LABEL_DECORATOR_FACTORIES"; //$NON-NLS-1$
         }
     };
 
     public static final QueryKey<Collection<ImageDecoratorFactory>> SELECTED_IMAGE_DECORATOR_FACTORIES = new QueryKey<Collection<ImageDecoratorFactory>>() {
         @Override
         public String toString() {
         }
     };
 
     public static final QueryKey<Collection<ImageDecoratorFactory>> SELECTED_IMAGE_DECORATOR_FACTORIES = new QueryKey<Collection<ImageDecoratorFactory>>() {
         @Override
         public String toString() {
-            return "SELECTED_IMAGE_DECORATOR_FACTORIES";
+            return "SELECTED_IMAGE_DECORATOR_FACTORIES"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -293,7 +293,7 @@ public interface BuiltinKeys {
     public static final QueryKey<Collection<LabelerFactory>> LABELER_FACTORIES = new QueryKey<Collection<LabelerFactory>>() {
         @Override
         public String toString() {
     public static final QueryKey<Collection<LabelerFactory>> LABELER_FACTORIES = new QueryKey<Collection<LabelerFactory>>() {
         @Override
         public String toString() {
-            return "LABELER_FACTORIES";
+            return "LABELER_FACTORIES"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -307,7 +307,7 @@ public interface BuiltinKeys {
     public static final QueryKey<Collection<ImagerFactory>> IMAGER_FACTORIES = new QueryKey<Collection<ImagerFactory>>() {
         @Override
         public String toString() {
     public static final QueryKey<Collection<ImagerFactory>> IMAGER_FACTORIES = new QueryKey<Collection<ImagerFactory>>() {
         @Override
         public String toString() {
-            return "IMAGER_FACTORIES";
+            return "IMAGER_FACTORIES"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -318,7 +318,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "LABELER";
+            return "LABELER"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -329,7 +329,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "CHECK_STATE";
+            return "CHECK_STATE"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -340,7 +340,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "LABEL_DECORATOR";
+            return "LABEL_DECORATOR"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -351,7 +351,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "IMAGER";
+            return "IMAGER"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -362,7 +362,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "IMAGE_DECORATOR";
+            return "IMAGE_DECORATOR"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -380,7 +380,7 @@ public interface BuiltinKeys {
     public static final PrimitiveQueryKey<Collection<SelectionRequest>> SELECTION_REQUESTS = new PrimitiveQueryKey<Collection<SelectionRequest>>() {
         @Override
         public String toString() {
     public static final PrimitiveQueryKey<Collection<SelectionRequest>> SELECTION_REQUESTS = new PrimitiveQueryKey<Collection<SelectionRequest>>() {
         @Override
         public String toString() {
-            return "SELECTION_REQUEST";
+            return "SELECTION_REQUEST"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -400,7 +400,7 @@ public interface BuiltinKeys {
     public static final QueryKey<PrunedChildrenResult> PRUNED_CHILDREN = new QueryKey<PrunedChildrenResult>() {
         @Override
         public String toString() {
     public static final QueryKey<PrunedChildrenResult> PRUNED_CHILDREN = new QueryKey<PrunedChildrenResult>() {
         @Override
         public String toString() {
-            return "PRUNED_CHILDREN";
+            return "PRUNED_CHILDREN"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -417,7 +417,7 @@ public interface BuiltinKeys {
     public static final QueryKey<ComparableContext[]> COMPARABLE_CHILDREN = new QueryKey<ComparableContext[]>() {
         @Override
         public String toString() {
     public static final QueryKey<ComparableContext[]> COMPARABLE_CHILDREN = new QueryKey<ComparableContext[]>() {
         @Override
         public String toString() {
-            return "COMPARABLE_CHILDREN";
+            return "COMPARABLE_CHILDREN"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -431,7 +431,7 @@ public interface BuiltinKeys {
     public static final QueryKey<Collection<ComparableContextFactory>> COMPARABLE_FACTORIES = new QueryKey<Collection<ComparableContextFactory>>() {
         @Override
         public String toString() {
     public static final QueryKey<Collection<ComparableContextFactory>> COMPARABLE_FACTORIES = new QueryKey<Collection<ComparableContextFactory>>() {
         @Override
         public String toString() {
-            return "COMPARABLE_FACTORIES";
+            return "COMPARABLE_FACTORIES"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -442,7 +442,7 @@ public interface BuiltinKeys {
         }
         @Override
         public String getKeyName() {
         }
         @Override
         public String getKeyName() {
-            return "SELECTED_COMPARABLE_FACTORY";
+            return "SELECTED_COMPARABLE_FACTORY"; //$NON-NLS-1$
         }
     }
 
         }
     }
 
@@ -460,7 +460,7 @@ public interface BuiltinKeys {
     public static final QueryKey<NodeContext[]> FINAL_CHILDREN = new QueryKey<NodeContext[]>() {
         @Override
         public String toString() {
     public static final QueryKey<NodeContext[]> FINAL_CHILDREN = new QueryKey<NodeContext[]>() {
         @Override
         public String toString() {
-            return "FINAL_CHILDREN";
+            return "FINAL_CHILDREN"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -472,7 +472,7 @@ public interface BuiltinKeys {
     public static final PrimitiveQueryKey<Boolean> IS_EXPANDED = new PrimitiveQueryKey<Boolean>() {
         @Override
         public String toString() {
     public static final PrimitiveQueryKey<Boolean> IS_EXPANDED = new PrimitiveQueryKey<Boolean>() {
         @Override
         public String toString() {
-            return "IS_EXPANDED";
+            return "IS_EXPANDED"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -486,7 +486,7 @@ public interface BuiltinKeys {
     public static final QueryKey<CheckedState> IS_CHECKED = new QueryKey<CheckedState>() {
         @Override
         public String toString() {
     public static final QueryKey<CheckedState> IS_CHECKED = new QueryKey<CheckedState>() {
         @Override
         public String toString() {
-            return "IS_CHECKED";
+            return "IS_CHECKED"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -506,7 +506,7 @@ public interface BuiltinKeys {
     public static final PrimitiveQueryKey<Integer> SHOW_MAX_CHILDREN = new PrimitiveQueryKey<Integer>() {
         @Override
         public String toString() {
     public static final PrimitiveQueryKey<Integer> SHOW_MAX_CHILDREN = new PrimitiveQueryKey<Integer>() {
         @Override
         public String toString() {
-            return "SHOW_MAX_CHILDREN";
+            return "SHOW_MAX_CHILDREN"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
@@ -514,7 +514,7 @@ public interface BuiltinKeys {
         private IsRootKey() {}
         @Override
         public String toString() {
         private IsRootKey() {}
         @Override
         public String toString() {
-            return "IS_ROOT";
+            return "IS_ROOT"; //$NON-NLS-1$
         }
     };
 
         }
     };
 
index 08262ce841466375f40ae708b2d229be6ce62788..380d48230fa2c98a6d08fd5f25551635d7ff4e62 100644 (file)
@@ -123,9 +123,9 @@ public final class Column {
 
     public Column(String key, String label, Align alignment, int width, String tooltip, boolean grab, int weight) {
         if (alignment == null)
 
     public Column(String key, String label, Align alignment, int width, String tooltip, boolean grab, int weight) {
         if (alignment == null)
-            throw new IllegalArgumentException("null alignment");
+            throw new IllegalArgumentException("null alignment"); //$NON-NLS-1$
         if (key == null)
         if (key == null)
-            throw new IllegalArgumentException("null key");
+            throw new IllegalArgumentException("null key"); //$NON-NLS-1$
 
         this.key = key;
         this.label = label;
 
         this.key = key;
         this.label = label;
@@ -244,24 +244,24 @@ public final class Column {
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("Column[key=");
+        sb.append("Column[key="); //$NON-NLS-1$
         sb.append(key);
         if (!key.equals(label))
         sb.append(key);
         if (!key.equals(label))
-            sb.append(", label=");
+            sb.append(", label="); //$NON-NLS-1$
         sb.append(label);
         sb.append(label);
-        sb.append(", align=");
+        sb.append(", align="); //$NON-NLS-1$
         sb.append(alignment);
         sb.append(alignment);
-        sb.append(", width=");
+        sb.append(", width="); //$NON-NLS-1$
         sb.append(width);
         if (!label.equals(tooltip)) {
         sb.append(width);
         if (!label.equals(tooltip)) {
-            sb.append(", tooltip=");
+            sb.append(", tooltip="); //$NON-NLS-1$
             sb.append(tooltip);
         }
             sb.append(tooltip);
         }
-        sb.append(", grab=");
+        sb.append(", grab="); //$NON-NLS-1$
         sb.append(grab);
         sb.append(grab);
-        sb.append(", weight=");
+        sb.append(", weight="); //$NON-NLS-1$
         sb.append(weight);
         sb.append(weight);
-        sb.append("]");
+        sb.append("]"); //$NON-NLS-1$
         return sb.toString();
     }
 
         return sb.toString();
     }
 
index b7d152c99ce30b2a99e25d849d2f1ca75727089c..1e02fe034eee88b8b4a7ee8c186f9e0d0f3f915f 100644 (file)
@@ -64,7 +64,7 @@ public class ExplorerState {
         */
        public ExplorerState(NodeContext[] topNodePath, int[] topNodePathChildIndex, Collection<NodeContext> expandedNodes, Map<String, Integer> columnWidths) {
                if (expandedNodes == null)
         */
        public ExplorerState(NodeContext[] topNodePath, int[] topNodePathChildIndex, Collection<NodeContext> expandedNodes, Map<String, Integer> columnWidths) {
                if (expandedNodes == null)
-                       throw new IllegalArgumentException("null expanded nodes");
+                       throw new IllegalArgumentException("null expanded nodes"); //$NON-NLS-1$
                this.topNodePath = topNodePath;
                this.topNodePathChildIndex = topNodePathChildIndex;
                this.expandedNodes = expandedNodes;
                this.topNodePath = topNodePath;
                this.topNodePathChildIndex = topNodePathChildIndex;
                this.expandedNodes = expandedNodes;
@@ -73,10 +73,10 @@ public class ExplorerState {
 
        @Override
        public String toString() {
 
        @Override
        public String toString() {
-               return getClass().getSimpleName() + "[topNodePath="
-                               + Arrays.toString(topNodePath) + ", topNodePathChildIndex="
-                               + Arrays.toString(topNodePathChildIndex) + ", expandedNodes="
-                               + expandedNodes + ", " + columnWidths + "]";
+               return getClass().getSimpleName() + "[topNodePath=" //$NON-NLS-1$
+                               + Arrays.toString(topNodePath) + ", topNodePathChildIndex=" //$NON-NLS-1$
+                               + Arrays.toString(topNodePathChildIndex) + ", expandedNodes=" //$NON-NLS-1$
+                               + expandedNodes + ", " + columnWidths + "]"; //$NON-NLS-1$ //$NON-NLS-2$
        }
 
 }
        }
 
 }
index 0745d1d81cae3e2cd866cab0aa4210c85b9e0fe2..4136cec0425295cde7010cd50b4bed1ff72fb60a 100644 (file)
@@ -34,7 +34,7 @@ public interface GraphExplorer extends IAdaptable {
      * A key that can be used to associate GraphExplorer instances with other
      * objects in, e.g. SWT widgets using Widget.setData(String, Object).
      */
      * A key that can be used to associate GraphExplorer instances with other
      * objects in, e.g. SWT widgets using Widget.setData(String, Object).
      */
-    public static final String KEY_GRAPH_EXPLORER = "GraphExplorer";
+    public static final String KEY_GRAPH_EXPLORER = "GraphExplorer"; //$NON-NLS-1$
 
     /**
      * @see #setAutoExpandLevel(int)
 
     /**
      * @see #setAutoExpandLevel(int)
@@ -44,7 +44,7 @@ public interface GraphExplorer extends IAdaptable {
     public static final Object EMPTY_INPUT = new Object() {
 
         @Override
     public static final Object EMPTY_INPUT = new Object() {
 
         @Override
-        public String toString() { return "GraphExplorer.EMPTY_INPUT"; };
+        public String toString() { return "GraphExplorer.EMPTY_INPUT"; }; //$NON-NLS-1$
 
     };
 
 
     };
 
index 63e96e89002678aec23926a2b660f223ca21a666..587947488390fd1ad69b334d18ab6608cf860c9e 100644 (file)
@@ -180,7 +180,7 @@ public interface Labeler {
                 Consumer<String> applyCallback);
     }
 
                 Consumer<String> applyCallback);
     }
 
-    String              NO_LABEL  = "<no label>";
+    String              NO_LABEL  = "<no label>"; //$NON-NLS-1$
 
     /**
      * Use this map as a return value of {@link #getLabels()} to indicate no
 
     /**
      * Use this map as a return value of {@link #getLabels()} to indicate no
index 53f2e816842c96a5ca736e066dd4a821c164133b..2c603ba8a0284a039bb872ae2cf630613aee0bc4 100644 (file)
@@ -42,7 +42,7 @@ public final class PrunedChildrenResult {
 
     @Override
     public String toString() {
 
     @Override
     public String toString() {
-        return "PrunedChildrenResult [original count=" + originalChildCount + ", pruned children=" + prunedChildren.length + "]";
+        return "PrunedChildrenResult [original count=" + originalChildCount + ", pruned children=" + prunedChildren.length + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     }
 
 }
     }
 
 }
index edb43013091bb9d940ba2164574418d7cab74c07..28f4cdf3d561acdb46b04c970c868274adb1a771 100644 (file)
@@ -24,7 +24,7 @@ public class NoDataSourceException extends RuntimeException {
     private static final long serialVersionUID = -2394930587477837261L;
 
     public NoDataSourceException(Class<?> clazz) {
     private static final long serialVersionUID = -2394930587477837261L;
 
     public NoDataSourceException(Class<?> clazz) {
-        super("No DataSource available for class " + clazz);
+        super("No DataSource available for class " + clazz); //$NON-NLS-1$
     }
 
 }
     }
 
 }
index ce26f81b25d5072ddc66b30d64c61741f9651c2f..d60967d7f7e91f463201172d28fcf11b53afae7f 100644 (file)
@@ -18,7 +18,7 @@ public class NoQueryProcessorException extends RuntimeException {
     private static final long serialVersionUID = -5612824339530755041L;
 
     public NoQueryProcessorException(CacheKey<?> key) {
     private static final long serialVersionUID = -5612824339530755041L;
 
     public NoQueryProcessorException(CacheKey<?> key) {
-        super("No Query Processor found for key " + key);
+        super("No Query Processor found for key " + key); //$NON-NLS-1$
     }
 
 }
     }
 
 }
index a8974d653b3214d5eec943d06a034108ab42e841..bab8294d860e86c28369f2e804b6d1ba51b6e7c6 100644 (file)
@@ -12,6 +12,7 @@ Import-Package:
  org.eclipse.core.runtime,
  org.eclipse.jface.dialogs,
  org.eclipse.jface.operation,
  org.eclipse.core.runtime,
  org.eclipse.jface.dialogs,
  org.eclipse.jface.operation,
+ org.eclipse.osgi.util;version="1.1.0",
  org.eclipse.swt.widgets,
  org.osgi.framework;version="1.3.0",
  org.simantics.db,
  org.eclipse.swt.widgets,
  org.osgi.framework;version="1.3.0",
  org.simantics.db,
index b05ff95d26071755a3ce6de610ef93074671ff7f..36d8966735d01b31b0d79e96d60ed03a12f4482e 100644 (file)
@@ -13,7 +13,7 @@ public class Auxiliary {
      * @return true if server can be started.
      */
     public static boolean beforeStart(Shell shell, File folder) throws InternalException {
      * @return true if server can be started.
      */
     public static boolean beforeStart(Shell shell, File folder) throws InternalException {
-        boolean skipPurge = "true".equals(System.getProperty("org.simantics.db.procore.ui.skipPurge"));
+        boolean skipPurge = "true".equals(System.getProperty("org.simantics.db.procore.ui.skipPurge")); //$NON-NLS-1$ //$NON-NLS-2$
         if (skipPurge)
             return true;
         return UI.purge(shell, folder);
         if (skipPurge)
             return true;
         return UI.purge(shell, folder);
index 252bf2370d711fd0fdd408a19874861656f0fd39..3dd9e4d73fbe65fd8d81ec342be7ff29b18d8434 100644 (file)
@@ -10,6 +10,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.simantics.db.common.utils.Logger;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.simantics.db.common.utils.Logger;
@@ -17,11 +18,11 @@ import org.simantics.db.server.Auxiliary;
 import org.simantics.db.server.ProCoreException;
 
 abstract class Handler {
 import org.simantics.db.server.ProCoreException;
 
 abstract class Handler {
-    protected final String title = "Database Server";
+    protected final String title = Messages.Handler_DatabaseServer;
     abstract boolean start(Shell shell, ProCoreException e) throws ProCoreException;
     protected void checkFolderGiven(Shell shell, ProCoreException e) throws ProCoreException {
         if (null == e.getDbFolder()) {
     abstract boolean start(Shell shell, ProCoreException e) throws ProCoreException;
     protected void checkFolderGiven(Shell shell, ProCoreException e) throws ProCoreException {
         if (null == e.getDbFolder()) {
-            String msg = "No database folder given.";
+            String msg = Messages.Handler_NoDatabaseFolderGiven;
             MessageDialog.openWarning(shell, title, msg);
             throw new ProCoreException(msg);
         }
             MessageDialog.openWarning(shell, title, msg);
             throw new ProCoreException(msg);
         }
@@ -82,18 +83,18 @@ final class DatabaseVersionHandler extends Handler {
     }
 }
 class HandlerUtil {
     }
 }
 class HandlerUtil {
-    private static String NL = System.getProperty("line.separator");
+    private static String NL = System.getProperty("line.separator"); //$NON-NLS-1$
     private static boolean isFolder(final Shell shell, final File dbFolder, String title) {
         if (dbFolder.isDirectory())
             return true;
     private static boolean isFolder(final Shell shell, final File dbFolder, String title) {
         if (dbFolder.isDirectory())
             return true;
-        MessageDialog.openWarning(shell, title, "Database folder does not exist. folder=" + dbFolder);
+        MessageDialog.openWarning(shell, title, Messages.Handler_WarningMsgDatabaseFolderNotExists + dbFolder);
         return false;
     }
     public static boolean saveWithQuestion(final Shell shell, final File dbFolder, String title, String msg) {
         if (!isFolder(shell, dbFolder, title))
             return false; // Save not possible.
         return false;
     }
     public static boolean saveWithQuestion(final Shell shell, final File dbFolder, String title, String msg) {
         if (!isFolder(shell, dbFolder, title))
             return false; // Save not possible.
-        String question = ((null != msg) ? (msg + NL) : "")
-        + "Do you want to save database?" + NL + "folder=" + dbFolder;
+        String question = NLS.bind(Messages.Handler_SaveDatabase,new Object[] {((null != msg) ? (msg + NL) : ""),  //$NON-NLS-1$
+        NL , dbFolder}); 
         boolean yes = MessageDialog.openQuestion(shell, title, question);
         if (!yes)
             return true;
         boolean yes = MessageDialog.openQuestion(shell, title, question);
         if (!yes)
             return true;
@@ -101,20 +102,20 @@ class HandlerUtil {
             Path saveFolder;
             SaveDatabase(File dbFolder) {
                 super(dbFolder);
             Path saveFolder;
             SaveDatabase(File dbFolder) {
                 super(dbFolder);
-                beginMessage = "Saving database.";
-                okMessage = "Database has been saved.";
-                failMessage = "Failed to save database.";
-                cancelMessage = "Save cancelled.";
+                beginMessage = Messages.Handler_SavingDatabaseBeginMsg;
+                okMessage = Messages.Handler_SavingDatabaseOkMsg;
+                failMessage = Messages.Handler_SavingDatabaseFailMsg;
+                cancelMessage = Messages.Handler_SavingDatabaseCancelledMsg;
             }
             @Override
             public void execute() throws Throwable {
                 saveFolder = Auxiliary.saveDatabase(dbFolder);
                 if (null == saveFolder || !Files.isDirectory(saveFolder))
             }
             @Override
             public void execute() throws Throwable {
                 saveFolder = Auxiliary.saveDatabase(dbFolder);
                 if (null == saveFolder || !Files.isDirectory(saveFolder))
-                    throw new ProCoreException("Save folder not ok.");
+                    throw new ProCoreException("Save folder not ok."); //$NON-NLS-1$
             }
             @Override
             public String getMessage() {
             }
             @Override
             public String getMessage() {
-                return NL + "folder=" + saveFolder;
+                return NLS.bind( Messages.Handler_FolderEquals ,new Object[] { NL , saveFolder});
             }
         }
         SaveDatabase save = new SaveDatabase(dbFolder);
             }
         }
         SaveDatabase save = new SaveDatabase(dbFolder);
@@ -126,15 +127,14 @@ class HandlerUtil {
         boolean ok = saveWithQuestion(shell, dbFolder, title, msg);
         if (ok)
             return true;
         boolean ok = saveWithQuestion(shell, dbFolder, title, msg);
         if (ok)
             return true;
-        String question = "Save failed. Do you want me to contine?";
+        String question = Messages.Handler_SaveContinue;
         return Util.confirm(shell, title, question);
     }
 
     public static boolean delete(final Shell shell, final File dbFolder, String title, String msg) {
         if (!isFolder(shell, dbFolder, title))
             return false; // Delete not possible.
         return Util.confirm(shell, title, question);
     }
 
     public static boolean delete(final Shell shell, final File dbFolder, String title, String msg) {
         if (!isFolder(shell, dbFolder, title))
             return false; // Delete not possible.
-        String question = ((null != msg) ? (msg + NL) : "")
-        + "Do you want to delete database?" + NL + "folder=" + dbFolder;
+        String question = NLS.bind(Messages.Handler_DeleteDatabase, new Object[] {((null != msg) ? (msg + NL) : ""), NL , dbFolder}); //$NON-NLS-1$
         boolean yes = MessageDialog.openQuestion(shell, title, question);
         if (!yes)
             return false;
         boolean yes = MessageDialog.openQuestion(shell, title, question);
         if (!yes)
             return false;
@@ -142,10 +142,10 @@ class HandlerUtil {
         final class DeleteDatabase extends ExecutorDatabase {
             DeleteDatabase(File dbFolder) {
                 super(dbFolder);
         final class DeleteDatabase extends ExecutorDatabase {
             DeleteDatabase(File dbFolder) {
                 super(dbFolder);
-                beginMessage = "Deleting database.";
-                okMessage = "Database has been deleted.";
-                failMessage = "Failed to delete database.";
-                cancelMessage = "Delete cancelled.";
+                beginMessage = Messages.Handler_DeletingDatabase;
+                okMessage = Messages.Handler_DatabaseHasBeenDeleted;
+                failMessage = Messages.Handler_FailedDeleteDatabase;
+                cancelMessage = Messages.Handler_DeleteCancelled;
             }
             @Override
             public void execute() throws Throwable {
             }
             @Override
             public void execute() throws Throwable {
@@ -162,14 +162,14 @@ class HandlerUtil {
             return false; // Purge not possible.
         try {
             if (Auxiliary.purgeDatabaseDone(dbFolder)) {
             return false; // Purge not possible.
         try {
             if (Auxiliary.purgeDatabaseDone(dbFolder)) {
-                MessageDialog.openInformation(shell, title, "Database already purged." + NL + "folder=" + dbFolder);
+                MessageDialog.openInformation(shell, title, NLS.bind(Messages.Handler_DatabaseAlreadyPurged, new Object[] { NL, dbFolder}));
                 return true; // Already clean.
             }
         } catch (ProCoreException e) {
                 return true; // Already clean.
             }
         } catch (ProCoreException e) {
-            Logger.defaultLogError("Failed to query database purge state.", e);
+            Logger.defaultLogError("Failed to query database purge state.", e); //$NON-NLS-1$
         }
         }
-        String question = ((null != msg) ? (msg + NL) : "")
-        + "Do you want to purge database?";
+        String question = ((null != msg) ? (msg + NL) : "") //$NON-NLS-1$
+        + Messages.Handler_PurgeDatabaseQuestion;
         boolean yes = MessageDialog.openQuestion(shell, title, question);
         if (!yes)
             return false;
         boolean yes = MessageDialog.openQuestion(shell, title, question);
         if (!yes)
             return false;
@@ -182,10 +182,10 @@ class HandlerUtil {
         final class PurgeDatabase extends ExecutorDatabase {
             PurgeDatabase(File dbFolder) {
                 super(dbFolder);
         final class PurgeDatabase extends ExecutorDatabase {
             PurgeDatabase(File dbFolder) {
                 super(dbFolder);
-                beginMessage = "Purging database.";
-                okMessage = "Database has been purged.";
-                failMessage = "Failed to purge database.";
-                cancelMessage = "Purge cancelled.";
+                beginMessage = Messages.Handler_PurgingDatabase;
+                okMessage = Messages.Handler_DatabaseHasBeenPurged;
+                failMessage = Messages.Handler_FailedToPurgeDatabase;
+                cancelMessage = Messages.Handler_PurgeCancelled;
             }
             @Override
             public void execute() throws Throwable {
             }
             @Override
             public void execute() throws Throwable {
@@ -199,20 +199,19 @@ class HandlerUtil {
     }
     public static boolean recoverFromGuardFileVersion(final Shell shell, final File dbFolder, String title, String msg)
     throws ProCoreException {
     }
     public static boolean recoverFromGuardFileVersion(final Shell shell, final File dbFolder, String title, String msg)
     throws ProCoreException {
-        String question = ((null != msg) ? msg : "")
-        + NL + "Guard file version mismatch indicates that the database was made with different server version."
-        + "It would be best to open the database with the same version it was made.";
+        String question = NLS.bind(Messages.Handler_GuardFileMisMatchQuestion, new Object[] { ((null != msg) ? msg : ""),  //$NON-NLS-1$
+        NL}); 
         MessageDialog.openWarning(shell, title, question);
         return false;
     }
     public static boolean recoverFromDatabaseLastExit(final Shell shell, final File dbFolder, String title, String msg)
     throws ProCoreException {
         MessageDialog.openWarning(shell, title, question);
         return false;
     }
     public static boolean recoverFromDatabaseLastExit(final Shell shell, final File dbFolder, String title, String msg)
     throws ProCoreException {
-        String message = ((null != msg) ? msg : "") + NL + "What should I try to do?";
+        String message = NLS.bind(Messages.Handler_MessageWhatToDo, new Object[] {((null != msg) ? msg : "") , NL }) ;  //$NON-NLS-1$
         ArrayList<Util.Choice> choices = new ArrayList<Util.Choice>();
         ArrayList<Util.Choice> choices = new ArrayList<Util.Choice>();
-        choices.add(new Util.Choice("Cancel", "Cancel i.e. do nothing. Choose this if you want to manually analyze and correct the situation. This is the safest choice."));
-        choices.add(new Util.Choice("Ignore", "Ignore the exit status. Choose this if you do not know what you are doing. This is fast way to recover and is the safest choice except for cancel."));
-        choices.add(new Util.Choice("Remove", "Remove history. Choose this you know what you are doing. This is fast way to recover but can leave tricky semantic errors in the database. Furhermore, depending on the reason for the non clean exit status, this can fail and corrupt data. However, depending on how the client and/or server died, this could be the right choice."));
-        choices.add(new Util.Choice("Recover", "Recover using journal. Choose this if you are willing to wait and know that the other choices won't work."));
+        choices.add(new Util.Choice(Messages.Handler_Cancel, Messages.Handler_CancelDescription));
+        choices.add(new Util.Choice(Messages.Handler_Ignore, Messages.Handler_IgnoreDescription));
+        choices.add(new Util.Choice(Messages.Handler_Remove, Messages.Handler_RemoveDescription));
+        choices.add(new Util.Choice(Messages.Handler_Recover, Messages.Handler_RecoverDescription));
         Util.Choice[] t = new Util.Choice[choices.size()];
         int choice = Util.select(shell, title, message, choices.toArray(t), 0);
         switch (choice) {
         Util.Choice[] t = new Util.Choice[choices.size()];
         int choice = Util.select(shell, title, message, choices.toArray(t), 0);
         switch (choice) {
@@ -229,10 +228,10 @@ class HandlerUtil {
         final class IgnoreExitDatabase extends ExecutorDatabase {
             IgnoreExitDatabase(File dbFolder) {
                 super(dbFolder);
         final class IgnoreExitDatabase extends ExecutorDatabase {
             IgnoreExitDatabase(File dbFolder) {
                 super(dbFolder);
-                beginMessage = "Ignoring last exit status.";
-                okMessage = "Ignore done.";
-                failMessage = "Failed to start.";
-                cancelMessage = "Ignore cancelled.";
+                beginMessage = Messages.Handler_IgnoreExitDatabaseBeginMsg;
+                okMessage = Messages.Handler_IgnoreExitDatabaseOkMsg;
+                failMessage = Messages.Handler_IgnoreExitDatabaseBeginFailMsg;
+                cancelMessage = Messages.Handler_IgnoreExitDatabaseCancelMsg;
             }
             @Override
             public void execute() throws Throwable {
             }
             @Override
             public void execute() throws Throwable {
@@ -251,10 +250,10 @@ class HandlerUtil {
         final class IgnoreProtocolDatabase extends ExecutorDatabase {
             IgnoreProtocolDatabase(File dbFolder) {
                 super(dbFolder);
         final class IgnoreProtocolDatabase extends ExecutorDatabase {
             IgnoreProtocolDatabase(File dbFolder) {
                 super(dbFolder);
-                beginMessage = "Ignoring protocol version mismatch.";
-                okMessage = "Ignore done.";
-                failMessage = "Failed to start.";
-                cancelMessage = "Ignore cancelled.";
+                beginMessage = Messages.Handler_IgnoreProtocolDatabaseBeginMsg;
+                okMessage = Messages.Handler_IgnoreProtocolDatabaseOkMsg;
+                failMessage = Messages.Handler_IgnoreProtocolDatabaseFailMsg;
+                cancelMessage = Messages.Handler_IgnoreProtocolDatabaseCancelMsg;
             }
             @Override
             public void execute() throws Throwable {
             }
             @Override
             public void execute() throws Throwable {
@@ -268,13 +267,7 @@ class HandlerUtil {
     }
     public static boolean recoverFromProtocol(final Shell shell, final File dbFolder, String title, String msg)
     throws ProCoreException {
     }
     public static boolean recoverFromProtocol(final Shell shell, final File dbFolder, String title, String msg)
     throws ProCoreException {
-        String question = ((null != msg) ? msg : "")
-        + NL + "Protocol version mismatch indicates that server and client versions differ."
-        + " It would be best to open the database using the same server and client version."
-        + " But if you insist I can ignore the mismatch and try to muddle along."
-        + " If this works then you should export the data and get matching client and server versions."
-        + " Otherwise there could later be strange errors caused by this version mismatch."
-        + " Shoud I try?";
+        String question = ((null != msg) ? msg : "") + NL + Messages.Handler_ProCoreExceptionQuestion; //$NON-NLS-1$
         boolean yes = Util.openDefaultNo(shell, title, question, MessageDialog.QUESTION);
         if (!yes)
             return false;
         boolean yes = Util.openDefaultNo(shell, title, question, MessageDialog.QUESTION);
         if (!yes)
             return false;
@@ -288,10 +281,7 @@ class HandlerUtil {
 //    }
     public static boolean recoverFromDatabaseVersion(final Shell shell, final File dbFolder, String title, String msg)
     throws ProCoreException {
 //    }
     public static boolean recoverFromDatabaseVersion(final Shell shell, final File dbFolder, String title, String msg)
     throws ProCoreException {
-        String question = ((null != msg) ? msg : "")
-        + NL + "Database version mismatch indicates that the database was made with different server version."
-        + " It would be best to open the database with the same version it was made."
-        + " But if you insist I can try to recover database from journal.";
+        String question = ((null != msg) ? msg : "") + NL + Messages.Handler_ProCoreException2; //$NON-NLS-1$
         boolean yes = Util.openDefaultNo(shell, title, question, MessageDialog.QUESTION);
         if (!yes)
             return false;
         boolean yes = Util.openDefaultNo(shell, title, question, MessageDialog.QUESTION);
         if (!yes)
             return false;
@@ -302,11 +292,11 @@ class HandlerUtil {
         if (!isFolder(shell, dbFolder, title))
             return false; // Recovery not possible.
         if (!Auxiliary.canReadJournal(dbFolder)) {
         if (!isFolder(shell, dbFolder, title))
             return false; // Recovery not possible.
         if (!Auxiliary.canReadJournal(dbFolder)) {
-            MessageDialog.openWarning(shell, title, "Journal file does not exist or isn't readable." + NL + "folder=" + dbFolder);
+            MessageDialog.openWarning(shell, title, NLS.bind(Messages.Handler_JournalFileNotExists ,new Object[] { NL , dbFolder})); 
             return false; // Recovery not possible.
         }
             return false; // Recovery not possible.
         }
-        String question = ((null != msg) ? msg : "")
-        + NL + "Do you want me to try to recreate the database from journal?";
+        String question = ((null != msg) ? msg : "") //$NON-NLS-1$
+        + NL + Messages.Handler_RecreateDatabaseFromJournalQuestion;
         boolean yes = MessageDialog.openQuestion(shell, title, question);
         if (!yes)
             return false;
         boolean yes = MessageDialog.openQuestion(shell, title, question);
         if (!yes)
             return false;
@@ -319,10 +309,10 @@ class HandlerUtil {
         final class RecoverDatabase extends ExecutorDatabase {
             RecoverDatabase(File dbFolder) {
                 super(dbFolder);
         final class RecoverDatabase extends ExecutorDatabase {
             RecoverDatabase(File dbFolder) {
                 super(dbFolder);
-                beginMessage = "Recovering database.";
-                okMessage = "Database has been recovered.";
-                failMessage = "Failed to recover database.";
-                cancelMessage = "Recovery cancelled.";
+                beginMessage = Messages.Handler_RecoveringDatabaseBeginMsg;
+                okMessage = Messages.Handler_RecoveringDatabaseRecoverdMsg;
+                failMessage = Messages.Handler_RecoveringDatabaseFailedMsg;
+                cancelMessage = Messages.Handler_RecoveringDatabaseCancelledMsg;
             }
             @Override
             public void execute() throws Throwable {
             }
             @Override
             public void execute() throws Throwable {
@@ -359,10 +349,10 @@ class HandlerUtil {
         public void showDone(Shell shell);
     }
     static abstract class ExecutorBase implements Executor {
         public void showDone(Shell shell);
     }
     static abstract class ExecutorBase implements Executor {
-        protected String beginMessage = "Task begin.";
-        protected String okMessage = "Task ok.";
-        protected String failMessage = "Task failed.";
-        protected String cancelMessage = "Task cancelled.";
+        protected String beginMessage = Messages.Handler_ExecutorBaseBeginMsg;
+        protected String okMessage = Messages.Handler_ExecutorBaseOkMsg;
+        protected String failMessage = Messages.Handler_ExecutorBaseFailedMsg;
+        protected String cancelMessage = Messages.Handler_ExecutorBaseCancelledMsg;
         protected boolean done = false;
         protected boolean ok = false;
         protected boolean cancelled = false;
         protected boolean done = false;
         protected boolean ok = false;
         protected boolean cancelled = false;
@@ -437,7 +427,7 @@ class HandlerUtil {
             this.dbFolder = dbFolder;
         }
         String getMessage() {
             this.dbFolder = dbFolder;
         }
         String getMessage() {
-            return NL + "folder=" + dbFolder;
+            return NLS.bind( Messages.Handler_FolderEquals ,new Object[] { NL , dbFolder});
         }
         @Override
         public String getMessageBegin() {
         }
         @Override
         public String getMessageBegin() {
@@ -472,7 +462,7 @@ class HandlerUtil {
                         return;
                     executor.setCancelled();
                     thread.interrupt();
                         return;
                     executor.setCancelled();
                     thread.interrupt();
-                    monitor.subTask("Waiting for cancellation to finish.");
+                    monitor.subTask(Messages.Handler_MonitorWaitingForCancellationToFinish);
                     while (!executor.isDone())
                         sleep(100);
                 } finally {
                     while (!executor.isDone())
                         sleep(100);
                 } finally {
diff --git a/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/Messages.java b/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/Messages.java
new file mode 100644 (file)
index 0000000..498d3be
--- /dev/null
@@ -0,0 +1,73 @@
+package org.simantics.db.procore.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+       private static final String BUNDLE_NAME = "org.simantics.db.procore.ui.internal.messages"; //$NON-NLS-1$
+       public static String Handler_Cancel;
+       public static String Handler_CancelDescription;
+       public static String Handler_DatabaseAlreadyPurged;
+       public static String Handler_DatabaseHasBeenDeleted;
+       public static String Handler_DatabaseHasBeenPurged;
+       public static String Handler_DatabaseServer;
+       public static String Handler_DeleteCancelled;
+       public static String Handler_DeleteDatabase;
+       public static String Handler_DeletingDatabase;
+       public static String Handler_ExecutorBaseBeginMsg;
+       public static String Handler_ExecutorBaseCancelledMsg;
+       public static String Handler_ExecutorBaseFailedMsg;
+       public static String Handler_ExecutorBaseOkMsg;
+       public static String Handler_FailedDeleteDatabase;
+       public static String Handler_FailedToPurgeDatabase;
+       public static String Handler_FolderEquals;
+       public static String Handler_GuardFileMisMatchQuestion;
+       public static String Handler_Ignore;
+       public static String Handler_IgnoreDescription;
+       public static String Handler_IgnoreExitDatabaseBeginFailMsg;
+       public static String Handler_IgnoreExitDatabaseBeginMsg;
+       public static String Handler_IgnoreExitDatabaseCancelMsg;
+       public static String Handler_IgnoreExitDatabaseOkMsg;
+       public static String Handler_IgnoreProtocolDatabaseBeginMsg;
+       public static String Handler_IgnoreProtocolDatabaseCancelMsg;
+       public static String Handler_IgnoreProtocolDatabaseFailMsg;
+       public static String Handler_IgnoreProtocolDatabaseOkMsg;
+       public static String Handler_JournalFileNotExists;
+       public static String Handler_MessageWhatToDo;
+       public static String Handler_MonitorWaitingForCancellationToFinish;
+       public static String Handler_NoDatabaseFolderGiven;
+       public static String Handler_ProCoreException2;
+       public static String Handler_ProCoreExceptionQuestion;
+       public static String Handler_PurgeCancelled;
+       public static String Handler_PurgeDatabaseQuestion;
+       public static String Handler_PurgingDatabase;
+       public static String Handler_Recover;
+       public static String Handler_RecoverDescription;
+       public static String Handler_RecoveringDatabaseBeginMsg;
+       public static String Handler_RecoveringDatabaseCancelledMsg;
+       public static String Handler_RecoveringDatabaseFailedMsg;
+       public static String Handler_RecoveringDatabaseRecoverdMsg;
+       public static String Handler_RecreateDatabaseFromJournalQuestion;
+       public static String Handler_Remove;
+       public static String Handler_RemoveDescription;
+       public static String Handler_SaveContinue;
+       public static String Handler_SaveDatabase;
+       public static String Handler_SavingDatabaseBeginMsg;
+       public static String Handler_SavingDatabaseCancelledMsg;
+       public static String Handler_SavingDatabaseFailMsg;
+       public static String Handler_SavingDatabaseOkMsg;
+       public static String Handler_WarningMsgDatabaseFolderNotExists;
+       public static String UI_DatabaseDelete;
+       public static String UI_DatabasePurge;
+       public static String Util_Error;
+       public static String Util_Information;
+       public static String Util_No;
+       public static String Util_Warning;
+       public static String Util_Yes;
+       static {
+               // initialize resource bundle
+               NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+       }
+
+       private Messages() {
+       }
+}
index 00cca9311329ff43eaf8afe4ae0835d69139a0d4..a36c6a20dc246e810b0404f739985050be4d9c1f 100644 (file)
@@ -19,10 +19,10 @@ import org.simantics.db.server.ProCoreException;
 
 public class UI {
     public static boolean delete(Shell shell, File folder) {
 
 public class UI {
     public static boolean delete(Shell shell, File folder) {
-        return HandlerUtil.delete(shell, folder, "Database Delete", null);
+        return HandlerUtil.delete(shell, folder, Messages.UI_DatabaseDelete, null);
     }
     public static boolean purge(Shell shell, File folder) {
     }
     public static boolean purge(Shell shell, File folder) {
-        return HandlerUtil.purge(shell, folder, "Database Purge", null);
+        return HandlerUtil.purge(shell, folder, Messages.UI_DatabasePurge, null);
     }
     public static boolean handleStart(Shell shell, InternalException e) throws ProCoreException {
         if (!(e instanceof ProCoreException))
     }
     public static boolean handleStart(Shell shell, InternalException e) throws ProCoreException {
         if (!(e instanceof ProCoreException))
@@ -50,7 +50,7 @@ public class UI {
     private static <E extends ProCoreException> long getId(E pe) {
         long id = 0;
         try {
     private static <E extends ProCoreException> long getId(E pe) {
         long id = 0;
         try {
-            Method m = pe.getClass().getMethod("getHandlerId");
+            Method m = pe.getClass().getMethod("getHandlerId"); //$NON-NLS-1$
             Object value = m.invoke(null);
             id = (long)value;
         } catch (RuntimeException e) {
             Object value = m.invoke(null);
             id = (long)value;
         } catch (RuntimeException e) {
index cc6c54bd2b9a1991b83fea1b8032a43602c47bd7..9c4a5e42302a71261fd878e129784616ca7370ca 100644 (file)
@@ -7,10 +7,10 @@ import org.simantics.db.common.utils.Logger;
 
 public class Util {
     static void showInfo(Shell shell, String message) {
 
 public class Util {
     static void showInfo(Shell shell, String message) {
-        MessageDialog.openInformation(shell, "Information", message);
+        MessageDialog.openInformation(shell, Messages.Util_Information, message);
     }
     static void showWarning(Shell shell, String message) {
     }
     static void showWarning(Shell shell, String message) {
-        MessageDialog.openWarning(shell, "Warning", message);
+        MessageDialog.openWarning(shell, Messages.Util_Warning, message);
     }
     public static void showError(Shell shell, String message) {
         Util.showError(shell, message, null);
     }
     public static void showError(Shell shell, String message) {
         Util.showError(shell, message, null);
@@ -18,8 +18,8 @@ public class Util {
     static void showError(Shell shell, String message, Throwable t) {
         Logger.defaultLogError(message, t);
         if (null != t)
     static void showError(Shell shell, String message, Throwable t) {
         Logger.defaultLogError(message, t);
         if (null != t)
-            message += "\n" + t.getMessage();
-        MessageDialog.openError(shell, "Error", message);
+            message += "\n" + t.getMessage(); //$NON-NLS-1$
+        MessageDialog.openError(shell, Messages.Util_Error, message);
     }
     public static void logError(String message) {
         Util.logError(message, null);
     }
     public static void logError(String message) {
         Util.logError(message, null);
@@ -34,14 +34,14 @@ public class Util {
         trace(null, message);
     }
     public static void trace(Class<?> clazz, String message) {
         trace(null, message);
     }
     public static void trace(Class<?> clazz, String message) {
-        String s = "";
+        String s = ""; //$NON-NLS-1$
         if (null != clazz)
         if (null != clazz)
-            s += clazz.getSimpleName() + " called.\n";
+            s += clazz.getSimpleName() + " called.\n"; //$NON-NLS-1$
         if (null != message)
             s += message;
         Logger.defaultLogInfo(s);
     }
         if (null != message)
             s += message;
         Logger.defaultLogInfo(s);
     }
-    private static String NL = System.getProperty("line.separator");
+    private static String NL = System.getProperty("line.separator"); //$NON-NLS-1$
     static class Choice {
         public Choice(String button, String text) {
             this.button = button;
     static class Choice {
         public Choice(String button, String text) {
             this.button = button;
@@ -86,16 +86,16 @@ public class Util {
     }
     public static boolean confirm(Shell shell, String title, String message) {
         String[] labels = new String[2];
     }
     public static boolean confirm(Shell shell, String title, String message) {
         String[] labels = new String[2];
-        labels[0] =  "Yes";
-        labels[1] = "No";
+        labels[0] =  Messages.Util_Yes;
+        labels[1] = Messages.Util_No;
         MessageDialog dialog = new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, labels, 1);
         int answer = dialog.open();
         return answer == 0;
     }
     public static boolean openDefaultNo(Shell shell, String title, String message, int style) {
         String[] labels = new String[2];
         MessageDialog dialog = new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, labels, 1);
         int answer = dialog.open();
         return answer == 0;
     }
     public static boolean openDefaultNo(Shell shell, String title, String message, int style) {
         String[] labels = new String[2];
-        labels[0] =  "Yes";
-        labels[1] = "No";
+        labels[0] =  Messages.Util_Yes;
+        labels[1] = Messages.Util_No;
         MessageDialog dialog = new MessageDialog(shell, title, null, message, style, labels, 1);
         int answer = dialog.open();
         return answer == 0;
         MessageDialog dialog = new MessageDialog(shell, title, null, message, style, labels, 1);
         int answer = dialog.open();
         return answer == 0;
@@ -105,7 +105,7 @@ public class Util {
         final int LIMIT = 10;
         int i = 0;
         for (Throwable c = t.getCause(); null != c && i < LIMIT; ++i, c = c.getCause())
         final int LIMIT = 10;
         int i = 0;
         for (Throwable c = t.getCause(); null != c && i < LIMIT; ++i, c = c.getCause())
-            s.append(NL + "cause: " + c.getMessage());
+            s.append(NL + "cause: " + c.getMessage()); //$NON-NLS-1$
         return s.toString();
     }
 }
         return s.toString();
     }
 }
diff --git a/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/messages.properties b/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/internal/messages.properties
new file mode 100644 (file)
index 0000000..4f0950f
--- /dev/null
@@ -0,0 +1,59 @@
+Handler_Cancel=Cancel\r
+Handler_CancelDescription=Cancel i.e. do nothing. Choose this if you want to manually analyze and correct the situation. This is the safest choice.\r
+Handler_DatabaseAlreadyPurged=Database already purged.{0}folder={1}\r
+Handler_DatabaseHasBeenDeleted=Database has been deleted.\r
+Handler_DatabaseHasBeenPurged=Database has been purged.\r
+Handler_DatabaseServer=Database Server\r
+Handler_DeleteCancelled=Delete cancelled.\r
+Handler_DeleteDatabase={0}Do you want to delete database?{1}folder={2}\r
+Handler_DeletingDatabase=Deleting database.\r
+Handler_ExecutorBaseBeginMsg=Task begin.\r
+Handler_ExecutorBaseCancelledMsg=Task cancelled.\r
+Handler_ExecutorBaseFailedMsg=Task failed.\r
+Handler_ExecutorBaseOkMsg=Task ok.\r
+Handler_FailedDeleteDatabase=Failed to delete database.\r
+Handler_FailedToPurgeDatabase=Failed to purge database.\r
+Handler_FolderEquals={0}folder={1}\r
+Handler_GuardFileMisMatchQuestion={0}{1}Guard file version mismatch indicates that the database was made with different server version.It would be best to open the database with the same version it was made.\r
+Handler_Ignore=Ignore\r
+Handler_IgnoreDescription=Ignore the exit status. Choose this if you do not know what you are doing. This is fast way to recover and is the safest choice except for cancel.\r
+Handler_IgnoreExitDatabaseBeginFailMsg=Failed to start.\r
+Handler_IgnoreExitDatabaseBeginMsg=Ignoring last exit status.\r
+Handler_IgnoreExitDatabaseCancelMsg=Ignore cancelled.\r
+Handler_IgnoreExitDatabaseOkMsg=Ignore done.\r
+Handler_IgnoreProtocolDatabaseBeginMsg=Ignoring protocol version mismatch.\r
+Handler_IgnoreProtocolDatabaseCancelMsg=Ignore cancelled.\r
+Handler_IgnoreProtocolDatabaseFailMsg=Failed to start.\r
+Handler_IgnoreProtocolDatabaseOkMsg=Ignore done.\r
+Handler_JournalFileNotExists=Journal file does not exist or isn't readable.{0}folder={1}\r
+Handler_MessageWhatToDo={0}{1}What should I try to do?\r
+Handler_MonitorWaitingForCancellationToFinish=Waiting for cancellation to finish.\r
+Handler_NoDatabaseFolderGiven=No database folder given.\r
+Handler_ProCoreExceptionQuestion=Protocol version mismatch indicates that server and client versions differ. It would be best to open the database using the same server and client version. But if you insist I can ignore the mismatch and try to muddle along. If this works then you should export the data and get matching client and server versions. Otherwise there could later be strange errors caused by this version mismatch. Shoud I try?\r
+Handler_ProCoreException2=Database version mismatch indicates that the database was made with different server version. It would be best to open the database with the same version it was made. But if you insist I can try to recover database from journal.Journal file does not exist or isn't readable.\r
+Handler_PurgeCancelled=Purge cancelled.\r
+Handler_PurgeDatabaseQuestion=Do you want to purge database?\r
+Handler_PurgingDatabase=Purging database.\r
+Handler_Recover=Recover\r
+Handler_RecoverDescription=Recover using journal. Choose this if you are willing to wait and know that the other choices won't work.\r
+Handler_RecoveringDatabaseBeginMsg=Recovering database.\r
+Handler_RecoveringDatabaseCancelledMsg=Recovery cancelled.\r
+Handler_RecoveringDatabaseFailedMsg=Failed to recover database.\r
+Handler_RecoveringDatabaseRecoverdMsg=Database has been recovered.\r
+Handler_RecreateDatabaseFromJournalQuestion=Do you want me to try to recreate the database from journal?\r
+Handler_Remove=Remove\r
+Handler_RemoveDescription=Remove history. Choose this you know what you are doing. This is fast way to recover but can leave tricky semantic errors in the database. Furhermore, depending on the reason for the non clean exit status, this can fail and corrupt data. However, depending on how the client and/or server died, this could be the right choice.\r
+Handler_SaveContinue=Save failed. Do you want me to contine?\r
+Handler_SaveDatabase={0}Do you want to save database?{1}folder={2}\r
+Handler_SavingDatabaseBeginMsg=Saving database.\r
+Handler_SavingDatabaseCancelledMsg=Save cancelled.\r
+Handler_SavingDatabaseFailMsg=Failed to save database.\r
+Handler_SavingDatabaseOkMsg=Database has been saved.\r
+Handler_WarningMsgDatabaseFolderNotExists=Database folder does not exist. folder=\r
+UI_DatabaseDelete=Database Delete\r
+UI_DatabasePurge=Database Purge\r
+Util_Error=Error\r
+Util_Information=Information\r
+Util_No=No\r
+Util_Warning=Warning\r
+Util_Yes=Yes\r
diff --git a/i18n.md b/i18n.md
index 8da7b4ad0e734723b56fdfa4f34c4511258f0bb5..28e1314d6f1d40bdb0291928112713db8f45ce13 100644 (file)
--- a/i18n.md
+++ b/i18n.md
@@ -3,8 +3,57 @@
 * [x] org.simantics.scl.ui
 
 ## TODO ##
 * [x] org.simantics.scl.ui
 
 ## TODO ##
-
-* [ ] org.simantics.event
-* [ ] org.simantics.modeling.ui
-* [ ] org.simantics.browsing.ui*
+* /org.simantics.browsing.ui 
+* /org.simantics.browsing.ui.common (All can be ignored)
+* /org.simantics.browsing.ui.feature (Nothing to Exeternalize or all can be ignored) 
+* /org.simantics.browsing.ui.graph (Nothing to Exeternalize or all can be ignored) 
+* /org.simantics.browsing.ui.graph  (Nothing to Exeternalize or all can be ignored) 
+* /org.simantics.browsing.ui.graph.impl (Nothing to Exeternalize or all can be ignored) 
+* /org.simantics.browsing.ui.model
+* /org.simantics.browsing.ui.nattable
+* /org.simantics.browsing.ui.nattable.feature (Nothing to Exeternalize)
+* /org.simantics.browsing.ui.ontology (Nothing to Exeternalize or all can be ignored) 
+* /org.simantics.browsing.ui.platform (Nothing to Exeternalize or all can be ignored) 
+* /org.simantics.browsing.ui.swt (Nothing to Exeternalize or all can be ignored) 
+* /org.simantics.debug.browser.ui (Nothing to Exeternalize or all can be ignored) 
+* /org.simantics.db.procore.ui
+* /org.simantics.debug.ui 
+* /org.simantics.desktop.ui
+* /org.simantics.desktop.ui.ontology
+* /org.simantics.document.ui
+* /org.simantics.document.ui.ontology
+* /org.simantics.export.ui
+* /org.simantics.fileimport.ui
+* /org.simantics.graphviz.ui
+* /org.simantics.help.ui
+* /org.simantics.image.ui
+* /org.simantics.issues.ui
+* /org.simantics.issues.ui.feature
+* /org.simantics.issues.ui.ontology
+* /org.simantics.logging.ui
+* /org.simantics.message.ui
+* /org.simantics.migration.ui
+* /org.simantics.modeling.ui
+* /org.simantics.modeling.ui.workbench
+* /org.simantics.modeling.ui.workbench.feature
+* /org.simantics.platform.ui.feature
+* /org.simantics.platform.ui.ontology
+* /org.simantics.scenegraph.ui
+* /org.simantics.simulation.ui
+* /org.simantics.spreadsheet.ui
+* /org.simantics.spreadsheet.ui.feature
+* /org.simantics.structural.ui
+* /org.simantics.team.ui
+* /org.simantics.tests.modelled.ui
+* /org.simantics.tests.modelled.ui.feature
+* /org.simantics.tests.modelled.ui.ontology
+* /org.simantics.ui
+* /org.simantics.ui.workbench.feature
+* /org.simantics.ui.workspace.tracker
+* /org.simantics.utils.ui
+* /org.simantics.utils.ui.feature
+* /org.simantics.wiki.ui
+* /org.simantics.wiki.ui.feature
+* 
+*
 * ...
 * ...