]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/Action.java
Salome HOME
Left menu is improved
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / Action.java
index aef69cf121b3a2ba7897de8da2352d34753c60bc..7b56bc4c3d9e579374c1d201bd4169892606929d 100644 (file)
@@ -73,10 +73,21 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
         */
        private ToolBarSettings _toolBarSettings;
        
+       /**
+        * LeftMenuSettings bean.
+        */
+       private LeftMenuSettings _leftMenuSettings;
+       
        /**
         * Injected application settings bean.
         */
        private ApplicationSettings _applicationSettings;
+       
+       /**
+        * Will be removed!!!
+        * It's temporary solution for menuitem.jsp
+        */
+       private static Menu staticMenu; 
 
     public class DocumentTypeComparator implements Comparator<DocumentType> {
       public int compare(DocumentType t1, DocumentType t2)
@@ -176,7 +187,7 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
     }
     
     /**
-     * Initialization the Context for menubar.
+     * Initialization the Context for menubar and toolbar.
      */
     public void initializationContext() {
        getMenuBarSettings().initializeInitialMenuProperties();
@@ -231,6 +242,20 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
     }
     
     /**
+     * Initialization the Context for left menu.
+     * @param leftMenuProperty - the property of the left menu.
+     */
+    public void initializationContextLeftMenus(final String leftMenuProperty) {
+                 
+        Menu    menu   = (Menu)session.get("menu." + leftMenuProperty);
+        
+        getLeftMenuSettings().setMenu(menu);
+        setStaticMenu(menu);
+        getLeftMenuSettings().setMenuName(menu.getName());
+        getLeftMenuSettings().setMenuNamespace(menu.getNamespace());
+    }
+    
+    /**s
      * Initialization the Context for Menu Bar and Tool Bar.
      * 
      * @param titleProperty - The title of the open study/knowledge.
@@ -304,6 +329,40 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
                getMenuBarSettings().intializeMenuBar(menuProperty);
                getToolBarSettings().intializeMenuBar(toolProperty);
        }
+       
+       /**
+        * Initialization of the screen context for menu bar, title bar and tool bar.
+        * 
+        * @param menuProperty - the property of the menu bar.
+        * @param titleProperty - The title of the open study/knowledge.
+     * @param editDisabledProperty - Property that indicates whether the current open study is editable or not.
+     * @param toolProperty - the property of the tool bar.
+     * @param leftMenuProperty - the property of the left menu.
+        */
+       public void initializationFullScreenContext(final String menuProperty, 
+                       final String titleProperty, final String editDisabledProperty,
+                       final String toolProperty, final String leftMenuProperty) {
+               
+               initializationScreenContext(menuProperty, titleProperty, editDisabledProperty);
+               initializationContextLeftMenus(leftMenuProperty);
+               getToolBarSettings().intializeMenuBar(toolProperty);
+       }
+       
+       /**
+        * Initialization of the screen context for menu bar and tool bar.
+        * 
+        * @param menuProperty - the property of the menu bar.
+     * @param toolProperty - the property of the tool bar.
+     * @param leftMenuProperty - the property of the left menu.
+        */
+       public void initializationFullScreenContext(final String menuProperty, 
+                       final String toolProperty, final String leftMenuProperty) {
+               
+               initializationContext();
+               initializationContextLeftMenus(leftMenuProperty);
+               getMenuBarSettings().intializeMenuBar(menuProperty);
+               getToolBarSettings().intializeMenuBar(toolProperty);
+       }
 //  ==============================================================================================================================
 //  Getters and setters
 //  ==============================================================================================================================
@@ -389,4 +448,35 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio
        public void setApplicationSettings(ApplicationSettings applicationSettings) {
                _applicationSettings = applicationSettings;
        }
+       /**
+        * Get the leftMenuSettings.
+        * @return the leftMenuSettings
+        */
+       public LeftMenuSettings getLeftMenuSettings() {
+               return _leftMenuSettings;
+       }
+               
+       /**
+        * Get the staticMenu.
+        * @return the staticMenu
+        */
+       public static Menu getStaticMenu() {
+               return staticMenu;
+       }
+       /**
+        * Set the staticMenu.
+        * @param staticMenu the staticMenu to set
+        */
+       public static void setStaticMenu(Menu staticMenu) {
+               Action.staticMenu = staticMenu;
+       }
+       /**
+        * Set the leftMenuSettings.
+        * @param leftMenuSettings the leftMenuSettings to set
+        */
+       public void setLeftMenuSettings(LeftMenuSettings leftMenuSettings) {
+               _leftMenuSettings = leftMenuSettings;
+       }
+       
+       
 }
\ No newline at end of file