]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SCLQueryEditorDocumentProvider.java
Externalize strings
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / componentTypeEditor / SCLQueryEditorDocumentProvider.java
index da8965671316ff5238930f216e02203f3e8fe344..3c5c20763ef3ddc82eabe063027fee452d92e25b 100644 (file)
@@ -71,16 +71,16 @@ public class SCLQueryEditorDocumentProvider extends AbstractDocumentProvider {
                     ModelingResources MOD = ModelingResources.getInstance(graph);
                     if(isType(graph)) {
                        Collection<Resource> assertions = graph.getAssertedObjects(resource, MOD.SCLQuery_values);
                     ModelingResources MOD = ModelingResources.getInstance(graph);
                     if(isType(graph)) {
                        Collection<Resource> assertions = graph.getAssertedObjects(resource, MOD.SCLQuery_values);
-                       if(assertions.size() != 1) throw new DatabaseException("No query text assertion defined in Query Type");
+                       if(assertions.size() != 1) throw new DatabaseException("No query text assertion defined in Query Type"); //$NON-NLS-1$
                        Resource value = assertions.iterator().next();
                            currentText = graph.getRelatedValue(value, L0.SCLValue_expression, Bindings.STRING);
                            errorHappened = false;
                        Resource value = assertions.iterator().next();
                            currentText = graph.getRelatedValue(value, L0.SCLValue_expression, Bindings.STRING);
                            errorHappened = false;
-                           return new Document(currentText != null ? currentText : "");
+                           return new Document(currentText != null ? currentText : ""); //$NON-NLS-1$
                     } else {
                            Resource value = graph.getSingleObject(resource, MOD.SCLQuery_values);
                            currentText = graph.getRelatedValue(value, L0.SCLValue_expression, Bindings.STRING);
                            errorHappened = false;
                     } else {
                            Resource value = graph.getSingleObject(resource, MOD.SCLQuery_values);
                            currentText = graph.getRelatedValue(value, L0.SCLValue_expression, Bindings.STRING);
                            errorHappened = false;
-                           return new Document(currentText != null ? currentText : "");
+                           return new Document(currentText != null ? currentText : ""); //$NON-NLS-1$
                     }
                 }
             });
                     }
                 }
             });
@@ -107,7 +107,7 @@ public class SCLQueryEditorDocumentProvider extends AbstractDocumentProvider {
             public void run(ReadGraph graph) throws DatabaseException {
                 String moduleName = graph.getURI(resource);
                 SCLContext context = SCLContext.getCurrent();
             public void run(ReadGraph graph) throws DatabaseException {
                 String moduleName = graph.getURI(resource);
                 SCLContext context = SCLContext.getCurrent();
-                context.put("graph", graph);
+                context.put("graph", graph); //$NON-NLS-1$
                 Failable<Module> result = SCLOsgi.MODULE_REPOSITORY.getModule(moduleName, listener);
                 
                 if(result instanceof Failure) {
                 Failable<Module> result = SCLOsgi.MODULE_REPOSITORY.getModule(moduleName, listener);
                 
                 if(result instanceof Failure) {
@@ -125,7 +125,7 @@ public class SCLQueryEditorDocumentProvider extends AbstractDocumentProvider {
         synchronized(annotationModel.getLockObject()) {
             annotationModel.removeAllAnnotations();
             for(CompilationError error : errors) {
         synchronized(annotationModel.getLockObject()) {
             annotationModel.removeAllAnnotations();
             for(CompilationError error : errors) {
-                Annotation annotation = new Annotation("org.eclipse.ui.workbench.texteditor.error", true,
+                Annotation annotation = new Annotation("org.eclipse.ui.workbench.texteditor.error", true, //$NON-NLS-1$
                         error.description);
                 int begin = Locations.beginOf(error.location);
                 int end = Locations.endOf(error.location);
                         error.description);
                 int begin = Locations.beginOf(error.location);
                 int end = Locations.endOf(error.location);
@@ -150,7 +150,7 @@ public class SCLQueryEditorDocumentProvider extends AbstractDocumentProvider {
     @Override
     protected void doSaveDocument(IProgressMonitor monitor, Object element,
             IDocument document, boolean overwrite) throws CoreException {
     @Override
     protected void doSaveDocument(IProgressMonitor monitor, Object element,
             IDocument document, boolean overwrite) throws CoreException {
-        TimeLogger.resetTimeAndLog("SCLModuleEditorDocumentProvider.doSaveDocument");
+        TimeLogger.resetTimeAndLog("SCLModuleEditorDocumentProvider.doSaveDocument"); //$NON-NLS-1$
         currentText = document.get();
         Simantics.getSession().asyncRequest(new WriteRequest() {
                
         currentText = document.get();
         Simantics.getSession().asyncRequest(new WriteRequest() {
                
@@ -162,7 +162,7 @@ public class SCLQueryEditorDocumentProvider extends AbstractDocumentProvider {
                        if(isType(graph)) {
        
                                Collection<Resource> assertions = graph.getAssertedObjects(resource, MOD.SCLQuery_values);
                        if(isType(graph)) {
        
                                Collection<Resource> assertions = graph.getAssertedObjects(resource, MOD.SCLQuery_values);
-                       if(assertions.size() > 1) throw new DatabaseException("Invalid query text assertions in Query Type");
+                       if(assertions.size() > 1) throw new DatabaseException("Invalid query text assertions in Query Type"); //$NON-NLS-1$
                        if(assertions.size() == 1) return assertions.iterator().next();
                        
                        Resource value = graph.newResource();
                        if(assertions.size() == 1) return assertions.iterator().next();
                        
                        Resource value = graph.newResource();
@@ -194,7 +194,7 @@ public class SCLQueryEditorDocumentProvider extends AbstractDocumentProvider {
                 Layer0 L0 = Layer0.getInstance(graph);
                 Resource value = getValue(graph);
                 graph.claimLiteral(value, L0.SCLValue_expression, currentText, Bindings.STRING);
                 Layer0 L0 = Layer0.getInstance(graph);
                 Resource value = getValue(graph);
                 graph.claimLiteral(value, L0.SCLValue_expression, currentText, Bindings.STRING);
-                Layer0Utils.addCommentMetadata(graph, "Saved SCL Query " + graph.getRelatedValue2(resource, Layer0.getInstance(graph).HasName, Bindings.STRING));
+                Layer0Utils.addCommentMetadata(graph, "Saved SCL Query " + graph.getRelatedValue2(resource, Layer0.getInstance(graph).HasName, Bindings.STRING)); //$NON-NLS-1$
             }
         });
     }
             }
         });
     }