Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Close Action progress. Now just need to build Close action dialog and trigger Save...
authorpreecej <preecej@localhost>
Tue, 2 Oct 2012 23:49:22 +0000 (23:49 +0000)
committerpreecej <preecej@localhost>
Tue, 2 Oct 2012 23:49:22 +0000 (23:49 +0000)
svn path=/; revision=386

Annotation/src/ie/dcu/apps/ist/actions/CloseAction.java
Annotation/src/ie/dcu/apps/ist/dialogs/SaveReminderDialog.java

index 6c3fe1aba40abf1d7a105e829c7d85c1f3a7fa8a..433c88adbdda137e196a1d017245c44853bfe9c8 100644 (file)
@@ -18,19 +18,23 @@ public class CloseAction extends AppAction {
        public void run() {
                // call Save Reminder dialog
                SaveReminderDialog dialog = new SaveReminderDialog(window.getShell());
-               SaveReminderDialog.Result result = dialog.open();
+               SaveReminderDialog.ResultChoice result = dialog.open();
                
                if (result != null) {
-                       /* check return choice in result here and fire appropriate action:
-                        *              - save now and then close file ("Save now")
-                        *              - do not save and then close file ("I've already saved my work")
-                        *              - cancel the close ("Do not close this file")
-                        */
-                       /*if (confirmClose(window)) {
-                               window.close();                 
-                               // TODO: not really; you'll close the file here after a confirmation from the user via the ConfirmSaved dialog
-                               System.exit(0);
-                       }*/
+                       // check return choice in result here and fire appropriate action:
+                       switch (result) {
+                               case SAVE: // save now and then close file ("Save now")
+                                       //TODO: trigger Save dialog to save the file
+                                       window.getView().resetView(); // clear current data and work
+                                       break;
+                               case NOSAVE: // do not save and then close file ("I've already saved my work")
+                                       window.getView().resetView(); // clear current data and work
+                                       status("Closed");
+                                       break;
+                               case CANCEL: // cancel the close ("Do not close this file")
+                                       status("Close cancelled.");
+                                       break;
+                       }
                }
        }
        
index ea70c94213203397ff049b100cbaa941716c6a6b..5f2e16f9bb691d5a3a982b6c5bfac82cb9000294 100644 (file)
@@ -1,25 +1,31 @@
 package ie.dcu.apps.ist.dialogs;
 
+import ie.dcu.apps.ist.dialogs.ExportDialog.Result;
+import ie.dcu.apps.ist.export.imagemap.AreaShape;
+import ie.dcu.apps.ist.export.imagemap.RolloverEffect;
+
+import java.io.File;
+
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Dialog;
 import org.eclipse.swt.widgets.Shell;
 
 public class SaveReminderDialog extends Dialog {
 
-       // Default title
-       private static final String TITLE = "Save Reminder";
-       public class Result {};
-
        public SaveReminderDialog(Shell shell) {
                super(shell);
                setText(TITLE);
        }
-       
-       public Result open() {
-               return null;
+
+       public enum ResultChoice {
+               SAVE, NOSAVE, CANCEL
        }
        
-       //return MessageDialog.openConfirm(
-       //      window.getShell(), "Save", 
-       //      "Have you remembered to save your work before closing this file?");
+       // Default title
+       private static final String TITLE = "Save Reminder";
+
+       public ResultChoice open() {
+               //TODO: build dialog UI here
+               return ResultChoice.SAVE;
+       }
 }