]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/NewStudyAction.java
Salome HOME
Actions menu properties are refactored, unnecessary code is removed.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / NewStudyAction.java
index 8020aff1004dbe93397a96311fa4d625743c4127..dd3296953f6c46eae41c99af65376246d7bff8af 100644 (file)
@@ -12,6 +12,7 @@ import org.splat.kernel.MissedPropertyException;
 import org.splat.kernel.MultiplyDefinedException;
 import org.splat.service.ScenarioService;
 import org.splat.service.SimulationContextService;
+import org.splat.wapp.Constants;
 
 /**
  * Action for creation of a new study.
@@ -49,21 +50,6 @@ public class NewStudyAction extends Action {
         */
        private ScenarioService _scenarioService;
 
-       /**
-        * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
-        */
-       private String _menuProperty;
-
-       /**
-        * 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.
-        */
-       private String _leftMenuProperty;
-
        // ==============================================================================================================================
        // Action methods
        // ==============================================================================================================================
@@ -84,11 +70,8 @@ public class NewStudyAction extends Action {
                _title = locale.getString("label.study") + " "
                                + String.valueOf(number + 1);
 
-               setMenuProperty("create");
-               setToolProperty("none");
-               setLeftMenuProperty("open");
-               initializationFullScreenContext(_menuProperty, _toolProperty,
-                               _leftMenuProperty);
+               initializationFullScreenContext(Constants.CREATE_MENU, Constants.NONE,
+                               Constants.OPEN);
 
                return SUCCESS;
        }
@@ -124,8 +107,7 @@ public class NewStudyAction extends Action {
                if (valid == 0) {
                        value = input[1].trim();
                        if (value.length() == 0) {
-                               setMenuProperty("create");
-                               initializationScreenContext(_menuProperty);
+                               initializationScreenContext(Constants.CREATE_MENU);
                                return INPUT; // No need to reinitialize the list of existing products
                        }
                }
@@ -153,18 +135,14 @@ public class NewStudyAction extends Action {
                        number += 1;
                        open(study); // Opens the study,
 
-                       setMenuProperty("study");
-                       setToolProperty("none");
-                       setLeftMenuProperty("open");
-                       initializationFullScreenContext(_menuProperty, _toolProperty,
-                                       _leftMenuProperty);
+                       initializationFullScreenContext(Constants.STUDY_MENU,
+                                       Constants.NONE, Constants.OPEN);
 
                        return SUCCESS;
                } catch (Exception error) {
                        LOG.error("Unable to save the study, reason:", error);
                        setErrorCode("message.error.newstudy");
-                       setMenuProperty("none");
-                       initializationScreenContext(_menuProperty);
+                       initializationScreenContext(Constants.NONE);
                        return ERROR;
                }
        }
@@ -258,61 +236,4 @@ public class NewStudyAction extends Action {
        public void setScenarioService(final ScenarioService scenarioService) {
                _scenarioService = scenarioService;
        }
-
-       /**
-        * Get the menuProperty.
-        * 
-        * @return the menuProperty
-        */
-       public String getMenuProperty() {
-               return _menuProperty;
-       }
-
-       /**
-        * Set the menuProperty.
-        * 
-        * @param menuProperty
-        *            the menuProperty to set
-        */
-       public void setMenuProperty(final String menuProperty) {
-               this._menuProperty = menuProperty;
-       }
-
-       /**
-        * 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;
-       }
-
-       /**
-        * Get the leftMenuProperty.
-        * 
-        * @return the leftMenuProperty
-        */
-       public String getLeftMenuProperty() {
-               return _leftMenuProperty;
-       }
-
-       /**
-        * Set the leftMenuProperty.
-        * 
-        * @param leftMenuProperty
-        *            the leftMenuProperty to set
-        */
-       public void setLeftMenuProperty(final String leftMenuProperty) {
-               _leftMenuProperty = leftMenuProperty;
-       }
 }
\ No newline at end of file