]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java
Salome HOME
Fix for the bug: urls to documents in the repository are cached for all users with...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / DisplayStudyStepAction.java
index b0852f0d6ca3989a5d7fe1c6a72a80fd34212d34..d0a30e6bad3480147629cda6b421ba9abb8c27b2 100644 (file)
@@ -13,8 +13,9 @@ import org.splat.wapp.SimpleMenu;
 
 /**
  * Presents the current open study information.
+ * 
  * @author Daniel Brunier-Coulin.
- *
+ * 
  */
 public class DisplayStudyStepAction extends AbstractDisplayAction {
 
@@ -32,35 +33,30 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
         * Injected study service.
         */
        private StudyService _studyService;
-       
+
        /**
-        * Value of the menu property. 
-        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
         */
        private String _menuProperty;
-       
+
        /**
-        * Value of the title bar property. 
-        * It can be: study, knowledge.
+        * Value of the title bar property. It can be: study, knowledge.
         */
        private String _titleProperty;
-       
+
        /**
-        * Value of the tool bar property. 
-        * It can be: none, standard, study, back.
+        * Value of the tool bar property. It can be: none, standard, study, back.
         */
        private String _toolProperty;
-       
+
        /**
-        * Value of the left menu property. 
-        * It can be: open, study, knowledge, scenario.
+        * Value of the left menu property. It can be: open, study, knowledge, scenario.
         */
        private String _leftMenuProperty;
-       
+
        /**
-        * 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.
-        * It is necessary for correct building the title bar.
+        * 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. It is necessary for correct building the title bar.
         */
        private String _editDisabledProperty = "false";
 
@@ -103,10 +99,10 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                                res = ERROR;
                        }
                }
-               if (!ERROR.equals(res)){
+               if (!ERROR.equals(res)) {
                        // Initialization of menus
                        ProjectElement owner = _openStudy.getSelectedStep().getOwner();
-                       SimpleMenu menu = ApplicationSettings.getMenu("configuration");
+                       SimpleMenu menu = getApplicationSettings().getMenu("configuration");
                        if (owner instanceof Scenario) {
                                menu.enables(Constants.PROP_SCENARIO);
                                menu.selects(Constants.PROP_SCENARIO);
@@ -115,18 +111,20 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                                menu.selects("prop-general");
                        }
                        getSession().put("menu.study", _openStudy.getMenu());
-                       
+
                        setMenuProperty(Constants.STUDY_MENU);
                        setTitleProperty(Constants.STUDY_MENU);
-                       if (Constants.TRUE.equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+                       if (Constants.TRUE.equals(getWriteAccess())
+                                       && getUserRights().canCreateDocument()) {
                                setToolProperty(Constants.STUDY_MENU);
                        } else {
                                setToolProperty(Constants.STANDARD_MENU);
                        }
-                       
+
                        setLeftMenuProperty(Constants.STUDY_MENU);
-       
-                       initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
+                       initializationFullScreenContext(_menuProperty, _titleProperty,
+                                       _editDisabledProperty, _toolProperty, _leftMenuProperty);
                }
                return res;
        }
@@ -141,7 +139,7 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                }
                // Re-initialization of the properties menu according to the selected step
                ProjectElement owner = _openStudy.getSelectedStep().getOwner();
-               SimpleMenu menu = ApplicationSettings.getMenu("configuration");
+               SimpleMenu menu = getApplicationSettings().getMenu("configuration");
                if (owner instanceof Scenario) {
                        menu.enables(Constants.PROP_SCENARIO);
                        menu.selects(Constants.PROP_SCENARIO);
@@ -149,18 +147,20 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                        menu.disables(Constants.PROP_SCENARIO);
                        menu.selects("prop-general");
                }
-               
+
                setMenuProperty(Constants.STUDY_MENU);
                setTitleProperty(Constants.STUDY_MENU);
-               if (Constants.TRUE.equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+               if (Constants.TRUE.equals(getWriteAccess())
+                               && getUserRights().canCreateDocument()) {
                        setToolProperty(Constants.STUDY_MENU);
                } else {
                        setToolProperty(Constants.STANDARD_MENU);
                }
-               
+
                setLeftMenuProperty(Constants.STUDY_MENU);
-               initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-               
+               initializationFullScreenContext(_menuProperty, _titleProperty,
+                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
                return SUCCESS;
        }
 
@@ -174,17 +174,19 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                } else if (todo == Execute.reduceall) {
                        _openStudy.reduceDocument(_myindex);
                }
-               
+
                setMenuProperty(Constants.STUDY_MENU);
                setTitleProperty(Constants.STUDY_MENU);
-               if (Constants.TRUE.equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+               if (Constants.TRUE.equals(getWriteAccess())
+                               && getUserRights().canCreateDocument()) {
                        setToolProperty(Constants.STUDY_MENU);
                } else {
                        setToolProperty(Constants.STANDARD_MENU);
                }
                setLeftMenuProperty(Constants.STUDY_MENU);
-               initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-               
+               initializationFullScreenContext(_menuProperty, _titleProperty,
+                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
                return SUCCESS;
        }
 
@@ -196,26 +198,28 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                } else if (todo == Execute.reduce) {
                        _openStudy.reduceKnowledge(_myindex);
                }
-               
+
                setMenuProperty(Constants.STUDY_MENU);
                setTitleProperty(Constants.STUDY_MENU);
-               if (Constants.TRUE.equals(getWriteAccess()) &&  getUserRights().canCreateDocument()) {
+               if (Constants.TRUE.equals(getWriteAccess())
+                               && getUserRights().canCreateDocument()) {
                        setToolProperty(Constants.STUDY_MENU);
                } else {
                        setToolProperty(Constants.STANDARD_MENU);
                }
                setLeftMenuProperty(Constants.STUDY_MENU);
-               initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-               
+               initializationFullScreenContext(_menuProperty, _titleProperty,
+                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
                return SUCCESS;
        }
 
        public String doClose() {
                closeStudy();
-               
+
                setMenuProperty("none");
                initializationScreenContext(_menuProperty);
-               
+
                return SUCCESS;
        }
 
@@ -289,9 +293,10 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                super.setOpenStudy(study);
                _openStudy = study;
        }
-       
+
        /**
         * Get the menuProperty.
+        * 
         * @return the menuProperty
         */
        public String getMenuProperty() {
@@ -300,14 +305,17 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Set the menuProperty.
-        * @param menuProperty the menuProperty to set
+        * 
+        * @param menuProperty
+        *            the menuProperty to set
         */
        public void setMenuProperty(final String menuProperty) {
                this._menuProperty = menuProperty;
        }
-       
+
        /**
         * Get the _titleProperty.
+        * 
         * @return the _titleProperty
         */
        public String getTitleProperty() {
@@ -316,7 +324,9 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Set the _titleProperty.
-        * @param _titleProperty the titleProperty to set
+        * 
+        * @param _titleProperty
+        *            the titleProperty to set
         */
        public void setTitleProperty(final String titleProperty) {
                _titleProperty = titleProperty;
@@ -324,6 +334,7 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Get the editDisabledProperty.
+        * 
         * @return the editDisabledProperty
         */
        public String getEditDisabledProperty() {
@@ -332,14 +343,17 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Set the editDisabledProperty.
-        * @param editDisabledProperty the editDisabledProperty to set
+        * 
+        * @param editDisabledProperty
+        *            the editDisabledProperty to set
         */
        public void setEditDisabledProperty(final String editDisabledProperty) {
                _editDisabledProperty = editDisabledProperty;
        }
-       
+
        /**
         * Get the toolProperty.
+        * 
         * @return the toolProperty
         */
        public String getToolProperty() {
@@ -348,14 +362,17 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Set the toolProperty.
-        * @param toolProperty the toolProperty to set
+        * 
+        * @param toolProperty
+        *            the toolProperty to set
         */
        public void setToolProperty(final String toolProperty) {
                _toolProperty = toolProperty;
        }
-       
+
        /**
         * Get the leftMenuProperty.
+        * 
         * @return the leftMenuProperty
         */
        public String getLeftMenuProperty() {
@@ -364,7 +381,9 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Set the leftMenuProperty.
-        * @param leftMenuProperty the leftMenuProperty to set
+        * 
+        * @param leftMenuProperty
+        *            the leftMenuProperty to set
         */
        public void setLeftMenuProperty(final String leftMenuProperty) {
                _leftMenuProperty = leftMenuProperty;