Salome HOME
Tool bar is improved.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / EditScenarioPropertiesAction.java
index dc3036ba3394c136834726db18c49fb14405d26e..884426e3882c7f1572f2dd301a0de923673ea5c3 100644 (file)
@@ -36,6 +36,12 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
         * It is necessary for correct building the title bar.
         */
        private String _editDisabledProperty = "false";
+       
+       /**
+        * Value of the tool bar property. 
+        * It can be: none, standard, study, back.
+        */
+       private String _toolProperty;
 
        /**
         * Serial version ID.
@@ -65,7 +71,8 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
                setMenuProperty("study");
                setTitleProperty("study");
                setEditDisabledProperty("true");
-        initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+               setToolProperty("back");
+        initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
 
                return SUCCESS;
        }
@@ -84,7 +91,13 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
                                getProjectElementService().getFirstStep(myscenario)); // For updating the scenario icon
                
                setMenuProperty("study");
-               initializationScreenContext(_menuProperty);
+               if ("true".equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+                       setToolProperty("study");
+               } else {
+                       setToolProperty("standard");
+               }
+               initializationScreenContext(_menuProperty, _toolProperty);
+
                
                return SUCCESS;
        }
@@ -213,5 +226,19 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
                _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