diff options
author | Bryce McKinlay <bryce@waitaki.otago.ac.nz> | 2002-08-09 04:26:17 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2002-08-09 05:26:17 +0100 |
commit | 7bde45b2eb84502b62e77e46d947e46dcbd333d6 (patch) | |
tree | cdf9958b411887bead2263ea8ef0bdfc8eae6319 /libjava/javax/swing/undo | |
parent | 097684ce62b505168739fc98e952f92a8719a1fa (diff) | |
download | gcc-7bde45b2eb84502b62e77e46d947e46dcbd333d6.zip gcc-7bde45b2eb84502b62e77e46d947e46dcbd333d6.tar.gz gcc-7bde45b2eb84502b62e77e46d947e46dcbd333d6.tar.bz2 |
AWT/Swing merge from GNU Classpath.
From-SVN: r56147
Diffstat (limited to 'libjava/javax/swing/undo')
-rw-r--r-- | libjava/javax/swing/undo/AbstractUndoableEdit.java | 214 | ||||
-rw-r--r-- | libjava/javax/swing/undo/CannotRedoException.java | 54 | ||||
-rw-r--r-- | libjava/javax/swing/undo/CannotUndoException.java | 54 | ||||
-rw-r--r-- | libjava/javax/swing/undo/CompoundEdit.java | 282 | ||||
-rw-r--r-- | libjava/javax/swing/undo/StateEdit.java | 151 | ||||
-rw-r--r-- | libjava/javax/swing/undo/StateEditable.java | 62 | ||||
-rw-r--r-- | libjava/javax/swing/undo/UndoManager.java | 259 | ||||
-rw-r--r-- | libjava/javax/swing/undo/UndoableEdit.java | 114 | ||||
-rw-r--r-- | libjava/javax/swing/undo/UndoableEditSupport.java | 170 |
9 files changed, 1360 insertions, 0 deletions
diff --git a/libjava/javax/swing/undo/AbstractUndoableEdit.java b/libjava/javax/swing/undo/AbstractUndoableEdit.java new file mode 100644 index 0000000..e98b87c --- /dev/null +++ b/libjava/javax/swing/undo/AbstractUndoableEdit.java @@ -0,0 +1,214 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +// Imports +import java.io.Serializable; + +/** + * AbstractUndoableEdit + * @author Andrew Selkirk + */ +public class AbstractUndoableEdit extends Object + implements UndoableEdit, + Serializable { + + //------------------------------------------------------------- + // Constants -------------------------------------------------- + //------------------------------------------------------------- + + /** + * String returned by getRedoPresentationName() + */ + protected static String RedoName = "Redo"; + + /** + * String returned by getUndoPresentationName() + */ + protected static String UndoName = "Undo"; + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * TODO + */ + private boolean hasBeenDone = false; + + /** + * The edit is alive + */ + private boolean alive = true; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Create new AbstractUndoableEdit + */ + public AbstractUndoableEdit() { + } // AbstractUndoableEdit() + + + //------------------------------------------------------------- + // Interface: UndoableEdit ------------------------------------ + //------------------------------------------------------------- + + /** + * addEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean addEdit(UndoableEdit anEdit) { + return false; + } // addEdit() + + /** + * canRedo() + * @returns true if redoable, false otherwise + */ + public boolean canRedo() { + if (alive == true && hasBeenDone == false) { + return true; + } // if + return false; + } // canRedo() + + /** + * canUndo() + * @returns true if undoable, false otherwise + */ + public boolean canUndo() { + if (alive == true && hasBeenDone == true) { + return true; + } // if + return false; + } // canUndo() + + /** + * die + */ + public void die() { + alive = false; + } // die() + + /** + * getPresentation + * @returns TODO + */ + public String getPresentationName() { + return ""; + } // getPresentationName() + + /** + * getRedoPresentationName + * @returns TODO + */ + public String getRedoPresentationName() { + if (getPresentationName().equals("") == true) { + return RedoName; + } else { + return RedoName + " " + getPresentationName(); + } + } // getRedoPresentationName() + + /** + * getUndoPresentationName + * @returns TODO + */ + public String getUndoPresentationName() { + if (getPresentationName().equals("") == true) { + return UndoName; + } else { + return UndoName + " " + getPresentationName(); + } + } // getUndoPresentationName() + + /** + * isSignificant + * @returns true + */ + public boolean isSignificant() { + return true; + } // isSignificant() + + /** + * redo + * @throws CannotRedoException TODO + */ + public void redo() throws CannotRedoException { + if (canRedo() == false) { + throw new CannotRedoException(); + } + hasBeenDone = true; + } // redo() + + /** + * replaceEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean replaceEdit(UndoableEdit anEdit) { + return false; + } // replaceEdit() + + /** + * String representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * undo + * @throws CannotUndoException TODO + */ + public void undo() throws CannotUndoException { + if (canUndo() == false) { + throw new CannotUndoException(); + } + hasBeenDone = false; + } // undo() + + +} // AbstractUndoableEdit diff --git a/libjava/javax/swing/undo/CannotRedoException.java b/libjava/javax/swing/undo/CannotRedoException.java new file mode 100644 index 0000000..030975d --- /dev/null +++ b/libjava/javax/swing/undo/CannotRedoException.java @@ -0,0 +1,54 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +/** + * CannotRedoException + * @author Andrew Selkirk + */ +public class CannotRedoException extends RuntimeException { + + /** + * Create exception + */ + public CannotRedoException() { + super(); + } // CannotRedoException() + + +} // CannotRedoException diff --git a/libjava/javax/swing/undo/CannotUndoException.java b/libjava/javax/swing/undo/CannotUndoException.java new file mode 100644 index 0000000..c039d1b --- /dev/null +++ b/libjava/javax/swing/undo/CannotUndoException.java @@ -0,0 +1,54 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +/** + * CannotUndoException + * @author Andrew Selkirk + */ +public class CannotUndoException extends RuntimeException { + + /** + * Create exception + */ + public CannotUndoException() { + super(); + } // CannotUndoException() + + +} // CannotUndoException diff --git a/libjava/javax/swing/undo/CompoundEdit.java b/libjava/javax/swing/undo/CompoundEdit.java new file mode 100644 index 0000000..37a7c4c --- /dev/null +++ b/libjava/javax/swing/undo/CompoundEdit.java @@ -0,0 +1,282 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +// Imports +import java.util.Vector; + +/** + * CompoundEdit + * @author Andrew Selkirk + */ +public class CompoundEdit extends AbstractUndoableEdit { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * The collection of UndoableEdits undone/redone en + * masse by this CompoundEdit + */ + protected Vector edits = new Vector(); + + /** + * TODO + */ + private boolean inProgress = false; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Create new Compound Edit + */ + public CompoundEdit() { + } // CompoundEdit() + + + //------------------------------------------------------------- + // Interface: UndoableEdit ------------------------------------ + //------------------------------------------------------------- + + /** + * addEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean addEdit(UndoableEdit anEdit) { + + // Variables + UndoableEdit lastEdit; + + if (inProgress == true) { + + // Get Last Edit + lastEdit = lastEdit(); + + // Check for null + if (lastEdit != null) { + + if (lastEdit.addEdit(anEdit) == false) { + if (lastEdit.replaceEdit(anEdit) == false) { + edits.add(anEdit); + } + } + + } // if: lastEdit + + return true; + + } else { + return false; + } + } // addEdit() + + /** + * canRedo + * @returns TODO + */ + public boolean canRedo() { + if (isInProgress() == true || super.canRedo() == false) { + return false; + } + return true; + } // canRedo() + + /** + * canUndo + * @returns TODO + */ + public boolean canUndo() { + if (isInProgress() == true || super.canUndo() == false) { + return false; + } + return true; + } // canUndo() + + /** + * die + */ + public void die() { + + // Variables + int index; + UndoableEdit current; + + // Loop through all contained UndoableEdits + for (index = edits.size() - 1; index >= 0; index--) { + current = (UndoableEdit) edits.elementAt(index); + current.die(); + } // for: index + + } // die() + + /** + * end + */ + public void end() { + inProgress = false; + } // end() + + /** + * getPresentationName + * @returns TODO + */ + public String getPresentationName() { + if (edits.size() == 0) { + return super.getPresentationName(); + } else { + return lastEdit().getPresentationName(); + } + } // getPresentationName() + + /** + * getRedoPresentationName + * @returns TODO + */ + public String getRedoPresentationName() { + if (edits.size() == 0) { + return super.getRedoPresentationName(); + } else { + return lastEdit().getRedoPresentationName(); + } + } // getRedoPresentationName() + + /** + * getUndoPresentationName + * @returns TODO + */ + public String getUndoPresentationName() { + if (edits.size() == 0) { + return super.getUndoPresentationName(); + } else { + return lastEdit().getUndoPresentationName(); + } + } // getUndoPresentationName() + + /** + * isInProgress + * @returns TODO + */ + public boolean isInProgress() { + return inProgress; + } // isInProgress() + + + /** + * isSignigicant + * @returns TODO + */ + public boolean isSignificant() { + + // Variables + int index; + UndoableEdit current; + + // Check each edit + for (index = 0; index < edits.size(); index++) { + current = (UndoableEdit) edits.elementAt(index); + if (current.isSignificant() == true) { + return true; + } + } // for: index + + return false; + + } // isSignificant() + + /** + * lastEdit + * @returns TODO + */ + protected UndoableEdit lastEdit() { + if (edits.size() == 0) { + return null; + } + return (UndoableEdit) edits.elementAt(edits.size() - 1); + } // lastEdit() + + /** + * redo + * @throws CannotRedoException TODO + */ + public void redo() throws CannotRedoException { + + // Variables + int index; + UndoableEdit current; + + // Loop through all contained UndoableEdits + for (index = 0; index < edits.size(); index++) { + current = (UndoableEdit) edits.elementAt(index); + current.redo(); + } // for: index + + } // redo() + + /** + * String representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * undo + * @throws CannotUndoException TODO + */ + public void undo() throws CannotUndoException { + + // Variables + int index; + UndoableEdit current; + + // Loop through all contained UndoableEdits + for (index = edits.size() - 1; index >= 0; index--) { + current = (UndoableEdit) edits.elementAt(index); + current.undo(); + } // for: index + + } // undo() + + +} // CompoundEdit diff --git a/libjava/javax/swing/undo/StateEdit.java b/libjava/javax/swing/undo/StateEdit.java new file mode 100644 index 0000000..a56564b --- /dev/null +++ b/libjava/javax/swing/undo/StateEdit.java @@ -0,0 +1,151 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +// Imports +import java.util.*; + +/** + * StateEdit + * @author Andrew Selkirk + */ +public class StateEdit extends AbstractUndoableEdit { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * RCSID + */ + protected static final String RCSID = ""; // TODO + + /** + * object + */ + protected StateEditable object; + + /** + * preState + */ + protected Hashtable preState; + + /** + * postState + */ + protected Hashtable postState; + + /** + * undoRedoName + */ + protected String undoRedoName; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor StateEdit + * @param value0 TODO + */ + public StateEdit(StateEditable value0) { + // TODO + } // StateEdit() + + /** + * Constructor StateEdit + * @param value0 TODO + * @param value1 TODO + */ + public StateEdit(StateEditable value0, String value1) { + // TODO + } // StateEdit() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * init + * @param value0 TODO + * @param value1 TODO + */ + protected void init(StateEditable value0, String value1) { + // TODO + } // init() + + /** + * end + */ + public void end() { + // TODO + } // end() + + /** + * undo + */ + public void undo() { + // TODO + } // undo() + + /** + * redo + */ + public void redo() { + // TODO + } // redo() + + /** + * getPresentationName + * @returns String + */ + public String getPresentationName() { + return null; // TODO + } // getPresentationName() + + /** + * removeRedundantState + */ + protected void removeRedundantState() { + // TODO + } // removeRedundantState() + + +} // StateEdit diff --git a/libjava/javax/swing/undo/StateEditable.java b/libjava/javax/swing/undo/StateEditable.java new file mode 100644 index 0000000..1d3eaa2 --- /dev/null +++ b/libjava/javax/swing/undo/StateEditable.java @@ -0,0 +1,62 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +// Imports +import java.util.Hashtable; + +/** + * StateEditable interface + * @author Andrew Selkirk + */ +public interface StateEditable { + + /** + * Restore State + * @param state State + */ + public void restoreState(Hashtable state); + + /** + * Store State + * @param state State + */ + public void storeState(Hashtable state); + + +} // StateEditable diff --git a/libjava/javax/swing/undo/UndoManager.java b/libjava/javax/swing/undo/UndoManager.java new file mode 100644 index 0000000..f13cd3b --- /dev/null +++ b/libjava/javax/swing/undo/UndoManager.java @@ -0,0 +1,259 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +// Imports +import javax.swing.event.*; + +/** + * UndoManager + * @author Andrew Selkirk + */ +public class UndoManager extends CompoundEdit implements UndoableEditListener { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * indexOfNextAdd + */ + int indexOfNextAdd; + + /** + * limit + */ + int limit; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UndoManager + */ + public UndoManager() { + // TODO + } // UndoManager() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * end + */ + public synchronized void end() { + // TODO + } // end() + + /** + * getLimit + * @returns int + */ + public synchronized int getLimit() { + return 0; // TODO + } // getLimit() + + /** + * discardAllEdits + */ + public synchronized void discardAllEdits() { + // TODO + } // discardAllEdits() + + /** + * trimForLimit + */ + protected void trimForLimit() { + // TODO + } // trimForLimit() + + /** + * trimEdits + * @param value0 TODO + * @param value1 TODO + */ + protected void trimEdits(int value0, int value1) { + // TODO + } // trimEdits() + + /** + * setLimit + * @param value0 TODO + */ + public synchronized void setLimit(int value0) { + // TODO + } // setLimit() + + /** + * editToBeUndone + * @returns UndoableEdit + */ + protected UndoableEdit editToBeUndone() { + return null; // TODO + } // editToBeUndone() + + /** + * editToBeRedone + * @returns UndoableEdit + */ + protected UndoableEdit editToBeRedone() { + return null; // TODO + } // editToBeRedone() + + /** + * undoTo + * @param value0 TODO + * @exception CannotUndoException TODO + */ + protected void undoTo(UndoableEdit value0) throws CannotUndoException { + // TODO + } // undoTo() + + /** + * redoTo + * @param value0 TODO + * @exception CannotRedoException TODO + */ + protected void redoTo(UndoableEdit value0) throws CannotRedoException { + // TODO + } // redoTo() + + /** + * undoOrRedo + * @exception CannotRedoException TODO + * @exception CannotUndoException TODO + */ + public synchronized void undoOrRedo() throws CannotRedoException, CannotUndoException { + // TODO + } // undoOrRedo() + + /** + * canUndoOrRedo + * @returns boolean + */ + public synchronized boolean canUndoOrRedo() { + return false; // TODO + } // canUndoOrRedo() + + /** + * undo + * @exception CannotUndoException TODO + */ + public synchronized void undo() throws CannotUndoException { + // TODO + } // undo() + + /** + * canUndo + * @returns boolean + */ + public synchronized boolean canUndo() { + return false; // TODO + } // canUndo() + + /** + * redo + * @exception CannotRedoException TODO + */ + public synchronized void redo() throws CannotRedoException { + // TODO + } // redo() + + /** + * canRedo + * @returns boolean + */ + public synchronized boolean canRedo() { + return false; // TODO + } // canRedo() + + /** + * addEdit + * @param value0 TODO + * @returns boolean + */ + public synchronized boolean addEdit(UndoableEdit value0) { + return false; // TODO + } // addEdit() + + /** + * getUndoOrRedoPresentationName + * @returns String + */ + public synchronized String getUndoOrRedoPresentationName() { + return null; // TODO + } // getUndoOrRedoPresentationName() + + /** + * getUndoPresentationName + * @returns String + */ + public synchronized String getUndoPresentationName() { + return null; // TODO + } // getUndoPresentationName() + + /** + * getRedoPresentationName + * @returns String + */ + public synchronized String getRedoPresentationName() { + return null; // TODO + } // getRedoPresentationName() + + /** + * undoableEditHappened + * @param value0 TODO + */ + public void undoableEditHappened(UndoableEditEvent value0) { + // TODO + } // undoableEditHappened() + + +} // UndoManager diff --git a/libjava/javax/swing/undo/UndoableEdit.java b/libjava/javax/swing/undo/UndoableEdit.java new file mode 100644 index 0000000..a5908ef --- /dev/null +++ b/libjava/javax/swing/undo/UndoableEdit.java @@ -0,0 +1,114 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +/** + * UndoableEdit interface + * @author Andrew Selkirk + */ +public interface UndoableEdit { + + /** + * anEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean addEdit(UndoableEdit anEdit); + + /** + * canRedo + * @returns TODO + */ + public boolean canRedo(); + + /** + * canRedo + * @returns TODO + */ + public boolean canUndo(); + + /** + * die + */ + public void die(); + + /** + * getPresentationName + * @returns TODO + */ + public String getPresentationName(); + + /** + * getRedoPresentationName + * @returns TODO + */ + public String getRedoPresentationName(); + + /** + * getUndoPresentationName + * @returns TODO + */ + public String getUndoPresentationName(); + + /** + * isSignificant + * @returns TODO + */ + public boolean isSignificant(); + + /** + * redo + * @throws CannotRedoException TODO + */ + public void redo() throws CannotRedoException; + + /** + * replaceEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean replaceEdit(UndoableEdit anEdit); + + /** + * undo + * @throws CannotUndoException TODO + */ + public void undo() throws CannotUndoException; + + +} // UndoableEdit diff --git a/libjava/javax/swing/undo/UndoableEditSupport.java b/libjava/javax/swing/undo/UndoableEditSupport.java new file mode 100644 index 0000000..6f87398 --- /dev/null +++ b/libjava/javax/swing/undo/UndoableEditSupport.java @@ -0,0 +1,170 @@ +/* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package javax.swing.undo; + +// Imports +import java.util.*; +import javax.swing.event.*; + +/** + * UndoableEditSupport + * @author Andrew Selkirk + */ +public class UndoableEditSupport { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * updateLevel + */ + protected int updateLevel; + + /** + * compoundEdit + */ + protected CompoundEdit compoundEdit; + + /** + * listeners + */ + protected Vector listeners = new Vector(); + + /** + * realSource + */ + protected Object realSource; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UndoableEditSupport + */ + public UndoableEditSupport() { + // TODO + } // UndoableEditSupport() + + /** + * Constructor UndoableEditSupport + * @param object TODO + */ + public UndoableEditSupport(Object object) { + realSource = object; + } // UndoableEditSupport() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * addUndoableEditListener + * @param value0 TODO + */ + public synchronized void addUndoableEditListener(UndoableEditListener value0) { + // TODO + } // addUndoableEditListener() + + /** + * removeUndoableEditListener + * @param value0 TODO + */ + public synchronized void removeUndoableEditListener(UndoableEditListener value0) { + // TODO + } // removeUndoableEditListener() + + /** + * _postEdit + * @param value0 TODO + */ + protected void _postEdit(UndoableEdit value0) { + // TODO + } // _postEdit() + + /** + * postEdit + * @param value0 TODO + */ + public synchronized void postEdit(UndoableEdit value0) { + // TODO + } // postEdit() + + /** + * getUpdateLevel + * @returns int + */ + public int getUpdateLevel() { + return 0; // TODO + } // getUpdateLevel() + + /** + * beginUpdate + */ + public synchronized void beginUpdate() { + // TODO + } // beginUpdate() + + /** + * createCompoundEdit + * @returns CompoundEdit + */ + protected CompoundEdit createCompoundEdit() { + return null; // TODO + } // createCompoundEdit() + + /** + * endUpdate + */ + public synchronized void endUpdate() { + // TODO + } // endUpdate() + + +} // UndoableEditSupport |