]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction.java
Salome HOME
Actions menu properties are refactored, unnecessary code is removed.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / EditKnowledgeElementAction.java
index cfcb2c5da289e630be51843265c7bb2945741c63..6d488e7a9f6db45d1ebeaa1aa6e6695af325688c 100644 (file)
@@ -45,32 +45,6 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         */
        private KnowledgeElementTypeService _knowledgeElementTypeService;
 
-       /**
-        * 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.
-        */
-       private String _titleProperty;
-
-       /**
-        * 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";
-
-       /**
-        * 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
        // ==============================================================================================================================
@@ -82,19 +56,7 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         */
        public String doInitialize() {
                _openStudy = getOpenStudy();
-
-               setMenuProperty(Constants.STUDY_MENU);
-               setTitleProperty(Constants.STUDY_MENU);
-               if ("true".equals(getWriteAccess())
-                               && getUserRights().canCreateDocument()) {
-                       setToolProperty(Constants.STUDY_MENU);
-               } else {
-                       setToolProperty("standard");
-               }
-               setLeftMenuProperty(Constants.STUDY_MENU);
-               initializationFullScreenContext(_menuProperty, _titleProperty,
-                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+               setMenu();
                return SUCCESS;
        }
 
@@ -106,17 +68,7 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
        public String doSetKnowledge() {
 
                String res = SUCCESS;
-               setMenuProperty(Constants.STUDY_MENU);
-               setTitleProperty(Constants.STUDY_MENU);
-               if ("true".equals(getWriteAccess())
-                               && getUserRights().canCreateDocument()) {
-                       setToolProperty(Constants.STUDY_MENU);
-               } else {
-                       setToolProperty("standard");
-               }
-               setLeftMenuProperty(Constants.STUDY_MENU);
-               initializationFullScreenContext(_menuProperty, _titleProperty,
-                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
+               setMenu();
 
                try {
                        _openStudy = getOpenStudy();
@@ -212,19 +164,7 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         */
        private void updateMenu() {
                getMenu(Constants.STUDY_MENU).selects(_openStudy.getSelection()); // Updates the menu icon, in case of last removed document
-
-               setMenuProperty(Constants.STUDY_MENU);
-               setTitleProperty(Constants.STUDY_MENU);
-               if ("true".equals(getWriteAccess())
-                               && getUserRights().canCreateDocument()) {
-                       setToolProperty(Constants.STUDY_MENU);
-               } else {
-                       setToolProperty("standard");
-               }
-               setLeftMenuProperty(Constants.STUDY_MENU);
-               initializationFullScreenContext(_menuProperty, _titleProperty,
-                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+               setMenu();
        }
 
        // ==============================================================================================================================
@@ -338,111 +278,6 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
                _knowledgeElementTypeService = knowledgeElementTypeService;
        }
 
-       /**
-        * Get the menuProperty.
-        * 
-        * @return the menuProperty
-        */
-       @Override
-       public String getMenuProperty() {
-               return _menuProperty;
-       }
-
-       /**
-        * Set the menuProperty.
-        * 
-        * @param menuProperty
-        *            the menuProperty to set
-        */
-       @Override
-       public void setMenuProperty(final String menuProperty) {
-               this._menuProperty = menuProperty;
-       }
-
-       /**
-        * Get the _titleProperty.
-        * 
-        * @return the _titleProperty
-        */
-       @Override
-       public String getTitleProperty() {
-               return _titleProperty;
-       }
-
-       /**
-        * Set the titleProperty.
-        * 
-        * @param titleProperty
-        *            the titleProperty to set
-        */
-       @Override
-       public void setTitleProperty(final String titleProperty) {
-               _titleProperty = titleProperty;
-       }
-
-       /**
-        * Get the editDisabledProperty.
-        * 
-        * @return the editDisabledProperty
-        */
-       @Override
-       public String getEditDisabledProperty() {
-               return _editDisabledProperty;
-       }
-
-       /**
-        * Set the editDisabledProperty.
-        * 
-        * @param editDisabledProperty
-        *            the editDisabledProperty to set
-        */
-       @Override
-       public void setEditDisabledProperty(final String editDisabledProperty) {
-               _editDisabledProperty = editDisabledProperty;
-       }
-
-       /**
-        * Get the toolProperty.
-        * 
-        * @return the toolProperty
-        */
-       @Override
-       public String getToolProperty() {
-               return _toolProperty;
-       }
-
-       /**
-        * Set the toolProperty.
-        * 
-        * @param toolProperty
-        *            the toolProperty to set
-        */
-       @Override
-       public void setToolProperty(final String toolProperty) {
-               _toolProperty = toolProperty;
-       }
-
-       /**
-        * Get the leftMenuProperty.
-        * 
-        * @return the leftMenuProperty
-        */
-       @Override
-       public String getLeftMenuProperty() {
-               return _leftMenuProperty;
-       }
-
-       /**
-        * Set the leftMenuProperty.
-        * 
-        * @param leftMenuProperty
-        *            the leftMenuProperty to set
-        */
-       @Override
-       public void setLeftMenuProperty(final String leftMenuProperty) {
-               _leftMenuProperty = leftMenuProperty;
-       }
-
        /**
         * Get the knowledgeValue.
         * 
@@ -460,5 +295,4 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
        public String getKnowledgeTitle() {
                return _knowledgeTitle;
        }
-
 }
\ No newline at end of file