+/*****************************************************************************
+ * Company OPEN CASCADE
+ * Application SIMAN
+ * File $Id$
+ * Creation date 11.03.2013
+ * @author $Author$
+ * @version $Revision$
+ * @copyright OPEN CASCADE 2012
+ *****************************************************************************/
+
+package org.splat.simer;
+
+import org.splat.service.StudyService;
+
+/**
+ * The action for removing a study.
+ *
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
+ */
+public class RemoveStudyAction extends Action {
+ /**
+ * Serialization version UID.
+ */
+ private static final long serialVersionUID = -6914581042309013794L;
+ /**
+ * Injected study service.
+ */
+ private StudyService _studyService;
+
+ /**
+ * Remove the selected study.
+ *
+ * @return SUCCESS
+ */
+ public String doRemove() {
+ OpenStudy openStudy = getOpenStudy();
+ if (openStudy != null && openStudy.isOpenForWriting()) {
+ long id = openStudy.getIndex();
+ getStudyService().removeStudy(id);
+ }
+ closeStudy();
+ initializationScreenContext("none");
+ return SUCCESS;
+ }
+
+ /**
+ * Get the studyService.
+ *
+ * @return the studyService
+ */
+ public StudyService getStudyService() {
+ return _studyService;
+ }
+
+ /**
+ * Set the studyService.
+ *
+ * @param studyService
+ * the studyService to set
+ */
+ public void setStudyService(final StudyService studyService) {
+ _studyService = studyService;
+ }
+}