Salome HOME
Tool bar is improved.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / EditStudyAction.java
index 6a4f468dbf22752f1bdfc17945bfba4708bd83fb..7c77a53a78883d36b5c402e1104585548c49850d 100644 (file)
@@ -27,6 +27,12 @@ public class EditStudyAction extends DisplayStudyStepAction {
         */
        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.
@@ -51,7 +57,12 @@ public class EditStudyAction extends DisplayStudyStepAction {
         
         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;
          }
@@ -124,5 +135,21 @@ public class EditStudyAction extends DisplayStudyStepAction {
        public final void setEditDisabledProperty(String editDisabledProperty) {
                _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