// File: ActionCloseMultipleBehaviors.java // Classes: ActionCloseMultipleBehaviors // Author: Kedar Patankar package edu.neu.ccs.demeter.tools.apstudio.graphedit; import java.util.Vector; import javax.swing.tree.DefaultMutableTreeNode; /**Action to close all behavior files.*/ public class ActionCloseMultipleBehaviors extends Action { private Vector _v; private boolean _userCancelled; public ActionCloseMultipleBehaviors(Editor e,Vector v) { super(e);_v=v;} public String name() { return "close multiple unsaved files"; } public boolean executeIt() { _userCancelled = false; doIt(); return !_userCancelled; } public void doIt() { for(int i = _v.size();i>0;i--) { ActionCloseBeh act= new ActionCloseBeh(_editor,(DefaultMutableTreeNode)_v.elementAt(i-1)); if(!act.executeIt()) { _userCancelled = true; return; } } } public void undoIt() { } } /* end class ActionCloseMultipleBehaviors */