Salome HOME
Menus are improved
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / EditSimulationContextAction.java
index 79718e2123d70ebef0c827b3c4536cfa37d85798..939d5d1ba1d4d2929ee83facb038721f913382db 100644 (file)
@@ -37,6 +37,12 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
         * Injected simulation context type service.
         */
        private SimulationContextTypeService _simulationContextTypeService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        /**
         * Get the stepService.
@@ -67,6 +73,9 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
 
                mystudy = getOpenStudy();
                contype = getInvolvedContexts();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
 
                if (contype.isEmpty())
                        return "create";
@@ -76,6 +85,10 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
 
        public String doSelectContext() {
                mystudy = getOpenStudy();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                int typid = Integer.valueOf(selectype);
                if (typid == 0)
                        return "create";
@@ -94,6 +107,10 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
                // --------------------------------
                try {
                        mystudy = getOpenStudy();
+                       
+                       setMenuProperty("study");
+                       initializationScreenContext(_menuProperty);
+                       
                        if (newtype.length() == 0 || value.length() == 0)
                                return INPUT;
 
@@ -122,6 +139,10 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
        }
 
        public String doDeleteContext() {
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        mystudy = getOpenStudy();
 
@@ -148,6 +169,10 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
                String[] input = value.split(",");
 //             Session connex = Database.getCurSession();
 //             Transaction transax = connex.beginTransaction();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        mystudy = getOpenStudy();
 
@@ -326,4 +351,20 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
                        SimulationContextTypeService simulationContextTypeService) {
                _simulationContextTypeService = simulationContextTypeService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file