]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/console/AbstractCommandConsole.java
Externalize strings in org.simantics.scl.ui
[simantics/platform.git] / bundles / org.simantics.scl.ui / src / org / simantics / scl / ui / console / AbstractCommandConsole.java
index ab9e033d020cca6d2537c83a35020c976419a8a7..b0019688386fcbbf8f7d019dad052630c75410d0 100644 (file)
@@ -57,7 +57,7 @@ public abstract class AbstractCommandConsole extends Composite {
      */
     public static final int HIDE_INPUT = 1 << 0;
 
-    public static final String PLUGIN_ID = "org.simantics.scl.ui";
+    public static final String PLUGIN_ID = "org.simantics.scl.ui"; //$NON-NLS-1$
 
     public static final int COMMAND_HISTORY_SIZE = 50;
     
@@ -119,7 +119,7 @@ public abstract class AbstractCommandConsole extends Composite {
         // Initialize current text font
         fontRegistry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getFontRegistry();
         fontRegistry.addListener(fontRegistryListener);
-        FontDescriptor font = FontDescriptor.createFrom( fontRegistry.getFontData("org.simantics.scl.consolefont") );
+        FontDescriptor font = FontDescriptor.createFrom( fontRegistry.getFontData("org.simantics.scl.consolefont") ); //$NON-NLS-1$
         setTextFont(font);
 
         setLayout(new FormLayout());
@@ -184,14 +184,14 @@ public abstract class AbstractCommandConsole extends Composite {
         GC gc = new GC(deco);
         int inputLeftPos = gc.getFontMetrics().getAverageCharWidth()*2;
         gc.dispose();
-        deco.setText(">");
+        deco.setText(">"); //$NON-NLS-1$
         deco.setLayoutData( formData(sash, 100, 0, new Tuple2(0, inputLeftPos)) );
 
         // Input area
         input = new StyledText(this, SWT.MULTI);
         input.setFont(textFont);
         input.setLayoutData( formData(sash, 100, new Tuple2(0, inputLeftPos), 100) );
-        adjustInputSize("");
+        adjustInputSize(""); //$NON-NLS-1$
         input.addVerifyKeyListener(event -> {
             switch(event.keyCode) {
             case SWT.KEYPAD_CR:
@@ -228,19 +228,19 @@ public abstract class AbstractCommandConsole extends Composite {
             }
         });
         input.addVerifyListener(e -> {
-            if(e.text.contains("\n")) {
+            if(e.text.contains("\n")) { //$NON-NLS-1$
                 int lineId = input.getLineAtOffset(e.start);
                 int lineOffset = input.getOffsetAtLine(lineId);
                 int indentAmount;
                 for(indentAmount=0;
                         lineOffset+indentAmount < input.getCharCount() && 
-                        input.getTextRange(lineOffset+indentAmount, 1).equals(" ");
+                        input.getTextRange(lineOffset+indentAmount, 1).equals(" "); //$NON-NLS-1$
                         ++indentAmount);
                 StringBuilder indent = new StringBuilder();
                 indent.append('\n');
                 for(int i=0;i<indentAmount;++i)
                     indent.append(' ');
-                e.text = e.text.replace("\n", indent);
+                e.text = e.text.replace("\n", indent); //$NON-NLS-1$
             }
         });
         input.addModifyListener(e -> {
@@ -336,7 +336,7 @@ public abstract class AbstractCommandConsole extends Composite {
             Tuple2 t = (Tuple2) o;
             return new FormAttachment((Integer) t.c0, (Integer) t.c1);
         }
-        throw new IllegalArgumentException("argument not supported: " + o);
+        throw new IllegalArgumentException("argument not supported: " + o); //$NON-NLS-1$
     }
 
     private int getOffsetInInput(int x, int y) {
@@ -366,7 +366,7 @@ public abstract class AbstractCommandConsole extends Composite {
     
     String validatedText;
     
-    Job validationJob = new Job("SCL input validation") {
+    Job validationJob = new Job("SCL input validation") { //$NON-NLS-1$
 
         @Override
         protected IStatus run(IProgressMonitor monitor) {
@@ -377,7 +377,7 @@ public abstract class AbstractCommandConsole extends Composite {
         
     };
     
-    Job preValidationJob = new Job("SCL input validation") {
+    Job preValidationJob = new Job("SCL input validation") { //$NON-NLS-1$
         @Override
         protected IStatus run(IProgressMonitor monitor) {
             if(!input.isDisposed()) {
@@ -483,7 +483,7 @@ public abstract class AbstractCommandConsole extends Composite {
         
         // Print it into output area
         //appendOutput("> " + command.replace("\n", "\n  ") + "\n", greenColor, null);
-        input.setText("");
+        input.setText(""); //$NON-NLS-1$
         
         // Execute
         execute(command);
@@ -520,7 +520,7 @@ public abstract class AbstractCommandConsole extends Composite {
                 range.start = 0;
                 range.length = 1;
                 input.setStyleRange(range);
-                getLogger().error("The following error message didn't have a proper location: {}", annotation.description, e);
+                getLogger().error("The following error message didn't have a proper location: {}", annotation.description, e); //$NON-NLS-1$
             }
         }
     }
@@ -566,7 +566,7 @@ public abstract class AbstractCommandConsole extends Composite {
     
     public void clear() {
         outputModiLock = true;
-        output.setText("");
+        output.setText(""); //$NON-NLS-1$
         outputModiLock = false;
     }