]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java
Salome HOME
Tool bar is improved.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / DisplayStudyStepAction.java
index c90f0497684a23d12ac7b7c5118bb6ad4d88740f..ff3b5de00120379c92b16776fb50378a7c36e39a 100644 (file)
@@ -44,6 +44,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
         */
        private String _titleProperty;
        
+       /**
+        * Value of the tool bar property. 
+        * It can be: none, standard, study, back.
+        */
+       private String _toolProperty;
+       
        /**
         * Property that indicates whether the current open study is editable or not.
         * On the screen it looks like pen on the status icon, pop-up menu also can be called.
@@ -101,7 +107,13 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                
                setMenuProperty("study");
                setTitleProperty("study");
-               initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+               if ("true".equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+                       setToolProperty("study");
+               } else {
+                       setToolProperty("standard");
+               }
+
+               initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
 
                return SUCCESS;
        }
@@ -127,7 +139,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                
                setMenuProperty("study");
                setTitleProperty("study");
-               initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+               if ("true".equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+                       setToolProperty("study");
+               } else {
+                       setToolProperty("standard");
+               }
+               initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
                
                return SUCCESS;
        }
@@ -144,7 +161,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                
                setMenuProperty("study");
                setTitleProperty("study");
-               initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+               if ("true".equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+                       setToolProperty("study");
+               } else {
+                       setToolProperty("standard");
+               }
+               initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
                
                return SUCCESS;
        }
@@ -159,7 +181,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                
                setMenuProperty("study");
                setTitleProperty("study");
-               initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+               if ("true".equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+                       setToolProperty("study");
+               } else {
+                       setToolProperty("standard");
+               }
+               initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
                
                return SUCCESS;
        }
@@ -291,4 +318,19 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                _editDisabledProperty = editDisabledProperty;
        }
        
+       /**
+        * Get the toolProperty.
+        * @return the toolProperty
+        */
+       public String getToolProperty() {
+               return _toolProperty;
+       }
+
+       /**
+        * Set the toolProperty.
+        * @param toolProperty the toolProperty to set
+        */
+       public void setToolProperty(final String toolProperty) {
+               _toolProperty = toolProperty;
+       }
 }
\ No newline at end of file