// File: ActionSaveall.java // Classes: ActionSaveall // Author: Kedar Patankar // Last modified : 22 Oct 1997 package edu.neu.ccs.demeter.tools.apstudio.graphedit; import java.util.Vector; import java.util.Enumeration; import javax.swing.tree.DefaultMutableTreeNode; /**Action to save all files.*/ public class ActionSaveallBeh extends Action { DefaultMutableTreeNode _root; public ActionSaveallBeh(Editor e,DefaultMutableTreeNode root) { super(e);_root=root; } public String name() { return "Save All Files"; } public void doIt() { // If there are no behaviors opened in the strategy panel return. Should never happen if(_root.getChildCount()<1) return ; // separate into modified and non-modified nodes. Enumeration enum = _root.children(); Vector vSave = new Vector(); while(enum.hasMoreElements()) { DefaultMutableTreeNode node = (DefaultMutableTreeNode)enum.nextElement(); if(((BehaviorNode)node.getUserObject()).needsSaving()) vSave.addElement(node); } // Files those need saving are saved int size = vSave.size(); for(int i=0;i