// Copyright (c) 1995, 1996 Regents of the University of California. // File: ActionQuit.java // Classes: ActionQuit // Original Author: Kedar Patankar // Date 21 Jan 1997 package uci.graphedit; import gjt.DialogClient; import java.awt.Dialog; /**Action to close all windows and exit the application.*/ public class ActionClose extends Action implements DialogClient { public ActionClose(Editor e,Document d) { super(e,d);} public String name() { return "Close File"; } public void doIt() { if( _document.isSaved()) shutDown(); else { AlarmDialog ad = new AlarmDialog (_editor,this,"Northeastern AP-Studio",_document.getDocName()); ad.show(); } } public void undoIt() { } public void dialogDismissed(Dialog dl) { if (((AlarmDialog)dl).getChoice().equals("YES")) { Action act=new ActionSave(_editor,_document); act.doIt(); } shutDown(); } private void shutDown() { _editor.detach(_document.getDocName(),_document); } } /* end class ActionQuit */