/plugins/LogViewer/trunk/src/java/logviewer/ClearAll.java
# · Java · 64 lines · 22 code · 8 blank · 34 comment · 1 complexity · f95355ef5c1706d0d55890de3435abe3 MD5 · raw file
- /*
- * Copyright (C) 2003 Don Brown (mrdon@techie.com)
- * Copyright (C) 2000, 2001 Greg Merrill (greghmerrill@yahoo.com)
- * This file is part of Log Viewer, a plugin for jEdit (http://www.jedit.org).
- * It is heavily based off Follow (http://follow.sf.net).
- * Log Viewer is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- * Log Viewer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with Log Viewer; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
- package logviewer;
- import java.awt.event.ActionEvent;
- import java.io.IOException;
- import java.util.Iterator;
- import java.util.List;
- import javax.swing.AbstractAction;
- /**
- * Clears the contents of all opened files
- *
- * @author <a href="mailto:mrdon@techie.com">Don Brown</a>
- * @author <a href="mailto:greghmerrill@yahoo.com">Greg Merrill</a>
- */
- class ClearAll extends AbstractAction {
- LogViewer app;
- /**
- * Constructor
- *
- * @param app The main class
- * @param name The name
- */
- ClearAll(LogViewer app, String name) {
- super(name);
- this.app = app;
- }
- /**
- * Performs the action
- *
- * @param e The action event
- */
- public void actionPerformed(ActionEvent e) {
- List allFileFollowingPanes = app.getAllFileFollowingPanes();
- Iterator i = allFileFollowingPanes.iterator();
- FileFollowingPane fileFollowingPane;
- while (i.hasNext()) {
- fileFollowingPane = (FileFollowingPane) i.next();
- //fileFollowingPane.getTextArea().setText("");
- fileFollowingPane.getOutputDestination().clear();
- }
- }
- }