]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java
Salome HOME
Actions menu properties are refactored, unnecessary code is removed.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / ImportDocumentAction.java
index 0a45e294ae61ddce30b4bc49459990f40478e309..c5db79ea52bcb711d4ad135e718d108fbc8d4ddf 100644 (file)
@@ -76,31 +76,6 @@ public class ImportDocumentAction extends UploadBaseNextAction {
         * Injected repository service.
         */
        private RepositoryService _repositoryService;
-       /**
-        * 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;
-
-       /**
-        * 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;
-
-       /**
-        * 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";
 
        // ==============================================================================================================================
        // Action methods
@@ -113,17 +88,13 @@ public class ImportDocumentAction extends UploadBaseNextAction {
         */
        public String doInitialize() {
 
-               setMenuProperty(Constants.STUDY_MENU);
-               setTitleProperty(Constants.STUDY_MENU);
-               setEditDisabledProperty("true");
-               if ("true".equals(getWriteAccess())) {
+               if (Constants.TRUE.equals(getWriteAccess())) {
                        setToolProperty(Constants.STUDY_MENU);
                } else {
                        setToolProperty(Constants.NONE);
                }
-               setLeftMenuProperty(Constants.STUDY_MENU);
-               initializationFullScreenContext(_menuProperty, _titleProperty,
-                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
+               initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+                               Constants.FALSE, getToolProperty(), Constants.STUDY_MENU);
 
                User user = getConnectedUser();
                File updir = getRepositoryService().getDownloadDirectory(user);
@@ -270,9 +241,8 @@ public class ImportDocumentAction extends UploadBaseNextAction {
        private void setError(final String errorCode) {
                setErrorCode(errorCode);
 
-               setToolProperty(Constants.NONE);
-               initializationFullScreenContext(_menuProperty, _titleProperty,
-                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
+               initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+                               Constants.FALSE, Constants.NONE, Constants.STUDY_MENU);
        }
 
        /**
@@ -282,11 +252,8 @@ public class ImportDocumentAction extends UploadBaseNextAction {
         */
        public String doImport() {
 
-               setMenuProperty(Constants.STUDY_MENU);
-               setTitleProperty(Constants.STUDY_MENU);
-               setEditDisabledProperty("true");
-               initializationScreenContext(_menuProperty, _titleProperty,
-                               _editDisabledProperty);
+               initializationScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+                               Constants.TRUE);
 
                if (action == ToDo.cancel) {
                        return "cancel";
@@ -294,10 +261,8 @@ public class ImportDocumentAction extends UploadBaseNextAction {
                if (_documentType == 0) {
                        setErrorCode("message.error.import.type");
 
-                       setToolProperty(Constants.NONE);
-                       setLeftMenuProperty(Constants.STUDY_MENU);
-                       initializationFullScreenContext(_menuProperty, _titleProperty,
-                                       _editDisabledProperty, _toolProperty, _leftMenuProperty);
+                       initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+                                       Constants.TRUE, Constants.NONE, Constants.STUDY_MENU);
 
                        return ERROR;
                }
@@ -353,10 +318,8 @@ public class ImportDocumentAction extends UploadBaseNextAction {
                        setErrorCode("message.error.internal");
                }
 
-               setToolProperty(Constants.NONE);
-               setLeftMenuProperty(Constants.STUDY_MENU);
-               initializationFullScreenContext(_menuProperty, _titleProperty,
-                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
+               initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+                               Constants.TRUE, Constants.NONE, Constants.STUDY_MENU);
 
                return ERROR;
        }
@@ -589,99 +552,4 @@ public class ImportDocumentAction extends UploadBaseNextAction {
                        final DocumentTypeService documentTypeService) {
                _documentTypeService = documentTypeService;
        }
-
-       /**
-        * 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 _titleProperty.
-        * 
-        * @return the _titleProperty
-        */
-       public String getTitleProperty() {
-               return _titleProperty;
-       }
-
-       /**
-        * Set the titleProperty.
-        * 
-        * @param titleProperty
-        *            the titleProperty to set
-        */
-       public void setTitleProperty(final String titleProperty) {
-               _titleProperty = titleProperty;
-       }
-
-       /**
-        * Get the editDisabledProperty.
-        * 
-        * @return the editDisabledProperty
-        */
-       public final String getEditDisabledProperty() {
-               return _editDisabledProperty;
-       }
-
-       /**
-        * Set the editDisabledProperty.
-        * 
-        * @param editDisabledProperty
-        *            the editDisabledProperty to set
-        */
-       public final void setEditDisabledProperty(final String editDisabledProperty) {
-               _editDisabledProperty = editDisabledProperty;
-       }
-
-       /**
-        * 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