KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $RCSfile: SaveAllProductAction.java,v $
3  * @modification $Date: 2001/09/28 19:31:19 $
4  * @version $Id: SaveAllProductAction.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.VAGlobals;
11 import com.memoire.vainstall.builder.*;
12 import com.memoire.vainstall.builder.util.*;
13
14 import java.util.Iterator JavaDoc;
15
16 import javax.swing.JOptionPane JavaDoc;
17
18 /**
19  * This action saves all opened projects if they are 'dirty'.
20  *
21  * @see com.memoire.vainstall.builder.util.AbstractVAIBuilderAction
22  *
23  * @author Henrik Falk
24  * @version $Id: SaveAllProductAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
25  */

26 public class SaveAllProductAction extends AbstractVAIBuilderAction {
27
28     /**
29      * Default constructor
30      */

31     public SaveAllProductAction() {
32         super();
33     }
34
35     /**
36      * Implements the runnit method
37      */

38     public void runnit() {
39
40         Iterator JavaDoc iterator = getController().getProductControllerList().values().iterator();
41         while (iterator.hasNext() == true) {
42             VAIProductController productController = (VAIProductController)iterator.next();
43             if (productController.isDirty() == true) {
44                 try {
45                     productController.getModel().save();
46                 } catch (VAIBuilderException exc) {
47                     JOptionPane.showMessageDialog(getController().getFrame(),
48                     exc.getMessageAsHtml(),
49                     VAGlobals.NAME,
50                     JOptionPane.ERROR_MESSAGE);
51                 }
52             }
53         }
54
55     }
56 }
57
Popular Tags