]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction.java
Salome HOME
Tool bar is improved.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / EditKnowledgeElementAction.java
index 177f5b41defe59accd85f28e8ca37a19a532e819..5e839d72c37943efa28907deeeedb7dec2dbd9c9 100644 (file)
@@ -61,6 +61,12 @@ public class EditKnowledgeElementAction 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;
 
        // ==============================================================================================================================
        // Action methods
@@ -76,7 +82,12 @@ public class EditKnowledgeElementAction 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;
        }
@@ -90,7 +101,12 @@ public class EditKnowledgeElementAction 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);
 
                try {
                        User user = getConnectedUser();
@@ -148,7 +164,12 @@ public class EditKnowledgeElementAction 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;
        }
@@ -284,7 +305,7 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         * @param menuProperty
         *            the menuProperty to set
         */
-       public void setMenuProperty(String menuProperty) {
+       public void setMenuProperty(final String menuProperty) {
                this._menuProperty = menuProperty;
        }
        
@@ -297,10 +318,10 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
        }
 
        /**
-        * Set the _titleProperty.
-        * @param _titleProperty the titleProperty to set
+        * Set the titleProperty.
+        * @param titleProperty the titleProperty to set
         */
-       public void setTitleProperty(String titleProperty) {
+       public void setTitleProperty(final String titleProperty) {
                _titleProperty = titleProperty;
        }
 
@@ -308,7 +329,7 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         * Get the editDisabledProperty.
         * @return the editDisabledProperty
         */
-       public final String getEditDisabledProperty() {
+       public String getEditDisabledProperty() {
                return _editDisabledProperty;
        }
 
@@ -316,9 +337,25 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         * Set the editDisabledProperty.
         * @param editDisabledProperty the editDisabledProperty to set
         */
-       public final void setEditDisabledProperty(String editDisabledProperty) {
+       public void setEditDisabledProperty(final 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