KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > memoire > vainstall > builder > action > QuitAction


1 /*
2  * $RCSfile: QuitAction.java,v $
3  * @modification $Date: 2001/09/28 19:31:19 $
4  * @version $Id: QuitAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
5  *
6  */

7
8 package com.memoire.vainstall.builder.action;
9
10 import com.memoire.vainstall.builder.*;
11
12 import java.util.Iterator JavaDoc;
13
14 /**
15  * This action quits the install builder
16  *
17  * @see com.memoire.vainstall.builder.util.AbstractVAIBuilderAction
18  *
19  * @author Henrik Falk
20  * @version $Id: QuitAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
21  */

22 public class QuitAction extends AbstractVAIBuilderAction {
23
24     /**
25      * Default constructor
26      */

27     public QuitAction() {
28         super();
29     }
30
31     /**
32      * Implements the runnit method
33      */

34     public void runnit() {
35
36         // save any opened projects ?
37
SaveAllProductAction action = new SaveAllProductAction();
38         action.initialize(getController());
39         action.runnit();
40
41         // close all opened projects
42
Iterator JavaDoc iterator = getController().getProductControllerList().values().iterator();
43         while (iterator.hasNext() == true) {
44             VAIProductController productController = (VAIProductController)iterator.next();
45
46             String JavaDoc id = productController.getModel().getProductDirectory();
47             getController().removeProduct(id);
48         }
49
50         // save window position
51
getModel().getWindowList().put("VAIBuilderFrame",getController().getFrame().getBounds());
52
53         getModel().save();
54
55         System.exit(0);
56     }
57 }
58
Popular Tags