]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.ui/src/org/simantics/document/ui/contribution/DocumentTabContribution.java
Externalize strings in org.simantics.document.ui
[simantics/platform.git] / bundles / org.simantics.document.ui / src / org / simantics / document / ui / contribution / DocumentTabContribution.java
index 005cb9e457ae9d40b989f843904d9ce2f0f53b8d..f4f38a8ab74f1a243da6bb05d46f9b366730a4ed 100644 (file)
@@ -77,7 +77,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                DocumentResource doc = DocumentResource.getInstance(graph);
                if (!graph.isInstanceOf(resource, doc.Document))
                        return;
-               result.add(new ComparableTabContributor(new DocumentPropertyTabContributor(), 1, resource, "Document"));
+               result.add(new ComparableTabContributor(new DocumentPropertyTabContributor(), 1, resource, Messages.DocumentTabContribution_Document));
        }
        
        private class DocumentPropertyTabContributor extends PropertyTabContributorImpl {
@@ -90,7 +90,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                        GridLayoutFactory.fillDefaults().margins(3,3).spacing(1, 1).numColumns(4).applyTo(composite);
 
                        Label label = new Label(composite, SWT.NONE);
-                       label.setText("Name");
+                       label.setText(Messages.DocumentTabContribution_Name);
 
                        TrackedText name = new TrackedText(composite, support, SWT.BORDER);
                        name.setTextFactory(new StringPropertyFactory(Layer0.URIs.HasName));
@@ -100,7 +100,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                        support.register(validator);
                        
                        Button showButton = new Button(composite, SWT.PUSH);
-                       showButton.setText("Show");
+                       showButton.setText(Messages.DocumentTabContribution_Show);
                        showButton.addSelectionListener(new SelectionAdapter() {
                                @Override
                                public void widgetSelected(SelectionEvent e) {
@@ -110,10 +110,10 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                        DocumentResource doc;
                        try {
                                doc = DocumentResource.getInstance(context.getSession());
-                               new DocumentRevisionWidget(composite, support, doc.HasOlderVersion, "Old");
-                               new DocumentRevisionWidget(composite, support, doc.HasNewerVersion, "New");
+                               new DocumentRevisionWidget(composite, support, doc.HasOlderVersion, Messages.DocumentTabContribution_Old);
+                               new DocumentRevisionWidget(composite, support, doc.HasNewerVersion, Messages.DocumentTabContribution_New);
                        } catch (DatabaseException e1) {
-                               ExceptionUtils.logAndShowError("Cannot create documen version UI", e1);
+                               ExceptionUtils.logAndShowError(Messages.DocumentTabContribution_CannotCreateDocumentVersionUI, e1);
                        }
                        
 
@@ -129,7 +129,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                                public String perform(ReadGraph graph) throws DatabaseException {
                                        Resource res = AdaptionUtils.adaptToSingle(forSelection, Resource.class);
                                        if (res == null)
-                                               return "N/A";
+                                               return Messages.DocumentTabContribution_6;
                                        Layer0 l0 = Layer0.getInstance(graph);
                                        return graph.getPossibleRelatedValue(res, l0.HasName);
                                }
@@ -169,7 +169,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                                try {
                                        adapter.openEditor(resource);
                                } catch (Exception e) {
-                                       ExceptionUtils.logAndShowError("Cannot open editor", e);
+                                       ExceptionUtils.logAndShowError(Messages.DocumentTabContribution_7, e);
                                }
                        }
                });
@@ -194,7 +194,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                        label.setText(name);
                        text = new Text(parent, SWT.SINGLE|SWT.BORDER|SWT.READ_ONLY);
                        showButton = new Button(parent, SWT.PUSH);
-                       showButton.setText("Show");
+                       showButton.setText(Messages.DocumentTabContribution_8);
                        showButton.addSelectionListener(new SelectionAdapter() {
                                @Override
                                public void widgetSelected(SelectionEvent e) {
@@ -203,7 +203,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                                }
                        });
                        removeButton = new Button(parent, SWT.PUSH);
-                       removeButton.setText("Unset");
+                       removeButton.setText(Messages.DocumentTabContribution_9);
                        removeButton.addSelectionListener(new SelectionAdapter() {
                                @Override
                                public void widgetSelected(SelectionEvent e) {
@@ -219,7 +219,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                                                });
                                                revisionDoc = null;
                                        } catch (DatabaseException e1) {
-                                               ExceptionUtils.logAndShowError("Cannot remove document revision", e1);
+                                               ExceptionUtils.logAndShowError(Messages.DocumentTabContribution_10, e1);
                                        }
                                        updateUI();
                                }
@@ -297,7 +297,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                                
                                @Override
                                public void exception(AsyncReadGraph graph, Throwable t) {
-                                       ExceptionUtils.logAndShowError("Cannot show document revision", t);
+                                       ExceptionUtils.logAndShowError(Messages.DocumentTabContribution_11, t);
                                }
                                
                                @Override
@@ -318,7 +318,7 @@ public class DocumentTabContribution extends AbstractResourceTabContribution{
                        if (revisionDoc != null)
                                text.setText(revisionDoc.getName());
                        else
-                               text.setText("");
+                               text.setText(""); //$NON-NLS-1$
                }
                
                private void setRevisionDoc(final Resource toSet) {