// File: ActionCloseMultipleCds.java // Classes: ActionCloseMultipleCds // Author: Kedar Patankar package edu.neu.ccs.demeter.tools.apstudio.graphedit; import java.util.Vector; /**Action to close all windows.*/ public class ActionCloseMultipleCds extends Action { private Vector _v; private boolean _userCancelled; public ActionCloseMultipleCds(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--) { String s = (String)_v.elementAt(i-1); ActionClose act= new ActionClose(_editor,_editor.getDocument(s)); if(!act.executeIt()) { _userCancelled = true; return; } } } public void undoIt() { } } /* end class ActionCloseMultipleCds */