]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagram/PageSettingsDialog.java
Prevent unnecessary read transaction for synch master typical handle
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / diagram / PageSettingsDialog.java
index 0509329f32db517e75f6161444a6b53dcd15e967..ee7382cb3d29076b3554bb69465ac986fa1261ef 100644 (file)
@@ -27,6 +27,7 @@ import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
+import org.simantics.Simantics;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
@@ -38,7 +39,6 @@ import org.simantics.db.exception.DatabaseException;
 import org.simantics.diagram.synchronization.graph.DiagramGraphUtil;
 import org.simantics.modeling.ui.preferences.DiagramPreferences;
 import org.simantics.scl.commands.Commands;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.page.PageDesc;
 
 /**
@@ -65,7 +65,7 @@ public class PageSettingsDialog extends Dialog {
 
     public PageSettingsDialog(Resource diagramResource, Shell parentShell) {
         super(parentShell);
-        this.session = SimanticsUI.getSession();
+        this.session = Simantics.getSession();
         this.diagramResource = diagramResource;
     }
 
@@ -73,7 +73,7 @@ public class PageSettingsDialog extends Dialog {
     @Override
     protected void configureShell(Shell newShell) {
         super.configureShell(newShell);
-        newShell.setText("Page Settings");
+        newShell.setText(Messages.PageSettingsDialog_PageSettings);
     }
 
     @Override
@@ -81,27 +81,27 @@ public class PageSettingsDialog extends Dialog {
         Composite composite = (Composite) super.createDialogArea(parent);
 
         Group group = new Group(composite, SWT.NONE);
-        group.setText("Grid Snapping");
+        group.setText(Messages.PageSettingsDialog_GridSnapping);
         GridDataFactory.fillDefaults().grab(true, false).span(1, 1).applyTo(group);
         Label label = new Label(group, SWT.NONE);
-        label.setText("Grid size (mm)");
+        label.setText(Messages.PageSettingsDialog_GridSizeMM);
         gridSizeText = new Text(group, SWT.SINGLE|SWT.BORDER);
         GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).extendedMargins(12, 12, 12, 12).spacing(5, 4).applyTo(group);
         GridDataFactory.fillDefaults().grab(true, false).span(1, 1).applyTo(gridSizeText);
 
         Group pageGroup = new Group(composite, SWT.NONE);
-        pageGroup.setText("Page size");
+        pageGroup.setText(Messages.PageSettingsDialog_PageSize);
         pdc = new PageDescComposite(pageGroup, SWT.NONE);
         GridDataFactory.fillDefaults().grab(true, false).span(1, 1).applyTo(pageGroup);
         GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).extendedMargins(12, 12, 12, 12).spacing(5, 4).applyTo(pageGroup);
         GridDataFactory.fillDefaults().grab(true, true).span(1, 1).applyTo(pdc);
 
         Group displayGroup = new Group(composite, SWT.NONE);
-        displayGroup.setText("Display");
+        displayGroup.setText(Messages.PageSettingsDialog_Display);
         showBordersButton = new Button(displayGroup, SWT.CHECK);
-        showBordersButton.setText("Show page borders");
+        showBordersButton.setText(Messages.PageSettingsDialog_ShowPageBorders);
         showMarginsButton = new Button(displayGroup, SWT.CHECK);
-        showMarginsButton.setText("Show margins");
+        showMarginsButton.setText(Messages.PageSettingsDialog_ShowMargins);
         GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).extendedMargins(12, 12, 12, 12).spacing(5, 4).applyTo(displayGroup);
 
         GridDataFactory.fillDefaults().grab(true, false).span(1, 1).applyTo(displayGroup);
@@ -162,13 +162,13 @@ public class PageSettingsDialog extends Dialog {
             @Override
             public void perform(WriteGraph graph) throws DatabaseException {
                 Resource model = graph.syncRequest(new IndexRoot(diagramResource));
-                Commands.get(graph, "Simantics/PageSettings/setPageDesc")
+                Commands.get(graph, "Simantics/PageSettings/setPageDesc") //$NON-NLS-1$
                         .execute(graph, model, diagramResource, pageDesc.toRepr());
-                Commands.get(graph, "Simantics/PageSettings/setGridSize")
+                Commands.get(graph, "Simantics/PageSettings/setGridSize") //$NON-NLS-1$
                         .execute(graph, model, diagramResource, gridSize);
-                Commands.get(graph, "Simantics/PageSettings/setPageBordersVisible")
+                Commands.get(graph, "Simantics/PageSettings/setPageBordersVisible") //$NON-NLS-1$
                         .execute(graph, model, diagramResource, borders);
-                Commands.get(graph, "Simantics/PageSettings/setMarginsVisible")
+                Commands.get(graph, "Simantics/PageSettings/setMarginsVisible") //$NON-NLS-1$
                         .execute(graph, model, diagramResource, margins);
             }
         });