01: /*
02: * $RCSfile: SaveAllProductAction.java,v $
03: * @modification $Date: 2001/09/28 19:31:19 $
04: * @version $Id: SaveAllProductAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
05: *
06: */
07:
08: package com.memoire.vainstall.builder.action;
09:
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;
15:
16: import javax.swing.JOptionPane;
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 iterator = getController().getProductControllerList()
41: .values().iterator();
42: while (iterator.hasNext() == true) {
43: VAIProductController productController = (VAIProductController) iterator
44: .next();
45: if (productController.isDirty() == true) {
46: try {
47: productController.getModel().save();
48: } catch (VAIBuilderException exc) {
49: JOptionPane.showMessageDialog(getController()
50: .getFrame(), exc.getMessageAsHtml(),
51: VAGlobals.NAME, JOptionPane.ERROR_MESSAGE);
52: }
53: }
54: }
55:
56: }
57: }
|