]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java
Salome HOME
Show and Edit comments functionalities are implemented
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / DisplayStudyStepAction.java
index 82dca6d924169e80c05f68f8b9a5488da61c51e6..f8523e137db8092e6a34c1d151f2caecf356ff73 100644 (file)
@@ -4,7 +4,10 @@ import java.util.List;
 
 import org.splat.dal.bo.som.ProjectElement;
 import org.splat.dal.bo.som.Scenario;
+import org.splat.exception.InvalidParameterException;
+import org.splat.service.StepService;
 import org.splat.service.StudyService;
+import org.splat.service.dto.StepCommentDTO;
 import org.splat.som.StepRights;
 import org.splat.wapp.Constants;
 import org.splat.wapp.PopupMenu;
@@ -32,6 +35,16 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
         * Injected study service.
         */
        private StudyService _studyService;
+       
+       /**
+        * Step comments.
+        */
+       private List<StepCommentDTO> _comments = null;
+
+       /**
+        * Injected Step Service.
+        */
+       private StepService _stepService;
 
        // ==============================================================================================================================
        // Action methods
@@ -88,6 +101,7 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
                        setMenu();
                }
+               loadComments();
                return res;
        }
 
@@ -172,6 +186,18 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                return SUCCESS;
        }
 
+       /**
+        * Loads step comments (if already loaded - reloads).
+        */
+       public void loadComments() {
+               try {
+                       _comments = _stepService.getStepComments(_openStudy.getSelectedStep());
+               } catch(InvalidParameterException exception) {
+                       _comments = null;
+                       LOG.debug("Error while trying to add comment: " + exception.getMessage());
+               }
+       }
+       
        // ==============================================================================================================================
        // Getters
        // ==============================================================================================================================
@@ -242,4 +268,36 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                super.setOpenStudy(study);
                _openStudy = study;
        }
+       
+       /**
+        * Get the comments.
+        * @return the comments
+        */
+       public List<StepCommentDTO> getComments() {
+               return _comments;
+       }
+
+       /**
+        * Set the comments.
+        * @param comments the comments to set
+        */
+       public void setComments(final List<StepCommentDTO> comments) {
+               _comments = comments;
+       }
+
+       /**
+        * Get the stepService.
+        * @return the stepService
+        */
+       public StepService getStepService() {
+               return _stepService;
+       }
+
+       /**
+        * Set the stepService.
+        * @param stepService the stepService to set
+        */
+       public void setStepService(final StepService stepService) {
+               _stepService = stepService;
+       }
 }
\ No newline at end of file