~ubuntu-branches/ubuntu/precise/classpath/precise

« back to all changes in this revision

Viewing changes to javax/swing/undo/UndoableEdit.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2006-05-27 16:11:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060527161115-h6e39eposdt5snb6
Tags: 2:0.91-3
* Install header files to /usr/include/classpath.
* debian/control: classpath: Conflict with jamvm < 1.4.3 and
  cacao < 0.96 (Closes: #368172).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* AbstractTableModel.java --
2
 
   Copyright (C) 2002 Free Software Foundation, Inc.
 
1
/* UndoableEdit.java --
 
2
   Copyright (C) 2002, 2006, Free Software Foundation, Inc.
3
3
 
4
4
This file is part of GNU Classpath.
5
5
 
38
38
package javax.swing.undo;
39
39
 
40
40
/**
41
 
 * UndoableEdit public interface
 
41
 * An editing operation that supports undo/redoability.
 
42
 * 
42
43
 * @author Andrew Selkirk
43
44
 */
44
 
public interface UndoableEdit {
45
 
 
46
 
        /**
47
 
         * anEdit
48
 
         * @param anEdit TODO
49
 
         * @returns TODO
50
 
         */
51
 
        boolean addEdit(UndoableEdit anEdit);
52
 
 
53
 
        /**
54
 
         * canRedo
55
 
         * @returns TODO
56
 
         */
57
 
        boolean canRedo();
58
 
 
59
 
        /**
60
 
         * canRedo
61
 
         * @returns TODO
62
 
         */
63
 
        boolean canUndo();
64
 
 
65
 
        /**
66
 
         * die
67
 
         */
68
 
        void die();
69
 
 
70
 
        /**
71
 
         * getPresentationName
72
 
         * @returns TODO
73
 
         */
74
 
        String getPresentationName();
75
 
 
76
 
        /**
77
 
         * getRedoPresentationName
78
 
         * @returns TODO
79
 
         */
80
 
        String getRedoPresentationName();
81
 
 
82
 
        /**
83
 
         * getUndoPresentationName
84
 
         * @returns TODO
85
 
         */
86
 
        String getUndoPresentationName();
87
 
 
88
 
        /**
89
 
         * isSignificant
90
 
         * @returns TODO
91
 
         */
92
 
        boolean isSignificant();
93
 
 
94
 
        /**
95
 
         * redo
96
 
         * @throws CannotRedoException TODO
97
 
         */
98
 
        void redo() throws CannotRedoException;
99
 
 
100
 
        /**
101
 
         * replaceEdit
102
 
         * @param anEdit TODO
103
 
         * @returns TODO
104
 
         */
105
 
        boolean replaceEdit(UndoableEdit anEdit);
106
 
 
107
 
        /**
108
 
         * undo
109
 
         * @throws CannotUndoException TODO
110
 
         */
111
 
        void undo() throws CannotUndoException;
112
 
 
113
 
 
114
 
} // UndoableEdit
 
45
public interface UndoableEdit 
 
46
{
 
47
 
 
48
  /**
 
49
   * Incorporates another editing action into this one, thus forming a
 
50
   * combined action.
 
51
   *
 
52
   * @param edit the editing action to be incorporated.
 
53
   * 
 
54
   * @return <code>true</code> if the edit was combined successfully, and 
 
55
   *         <code>false</code> if it could not be combined.
 
56
   */
 
57
  boolean addEdit(UndoableEdit edit);
 
58
 
 
59
  /**
 
60
   * Determines whether it would be possible to redo this editing
 
61
   * action.
 
62
   *
 
63
   * @return <code>true</code> to indicate that this action can be
 
64
   * redone, <code>false</code> otherwise.
 
65
   *
 
66
   * @see #redo()
 
67
   * @see #canUndo()
 
68
   */
 
69
  boolean canRedo();
 
70
 
 
71
  /**
 
72
   * Determines whether it would be possible to undo this editing
 
73
   * action.
 
74
   *
 
75
   * @return <code>true</code> to indicate that this action can be
 
76
   * undone, <code>false</code> otherwise.
 
77
   *
 
78
   * @see #undo()
 
79
   * @see #canRedo()
 
80
   */
 
81
  boolean canUndo();
 
82
 
 
83
  /**
 
84
   * Informs this edit action that it will no longer be used. Some
 
85
   * actions might use this information to release resources, for
 
86
   * example open files.  Called by {@link UndoManager} before this
 
87
   * action is removed from the edit queue.
 
88
   */
 
89
  void die();
 
90
 
 
91
  /**
 
92
   * Returns a human-readable, localized name that describes this
 
93
   * editing action and can be displayed to the user.
 
94
   *
 
95
   * @return The presentation name.
 
96
   */
 
97
  String getPresentationName();
 
98
 
 
99
  /**
 
100
   * Returns the redo presentation name.
 
101
   * 
 
102
   * @return The redo presentation name.
 
103
   */
 
104
  String getRedoPresentationName();
 
105
 
 
106
  /**
 
107
   * Returns the undo presentation name.
 
108
   * 
 
109
   * @return The undo presentation name.
 
110
   */
 
111
  String getUndoPresentationName();
 
112
 
 
113
  /**
 
114
   * Determines whether this editing action is significant enough for
 
115
   * being seperately undoable by the user. A typical significant
 
116
   * action would be the resizing of an object. However, changing the
 
117
   * selection in a text document would usually not be considered
 
118
   * significant.
 
119
   *
 
120
   * @return <code>true</code> to indicate that the action is
 
121
   * significant enough for being separately undoable, or
 
122
   * <code>false</code> otherwise.
 
123
   */
 
124
  boolean isSignificant();
 
125
 
 
126
  /**
 
127
   * Redoes this editing action.
 
128
   *
 
129
   * @throws CannotRedoException if the edit cannot be undone.
 
130
   *
 
131
   * @see #canRedo()
 
132
   * @see #undo()
 
133
   */
 
134
  void redo() throws CannotRedoException;
 
135
 
 
136
  /**
 
137
   * Incorporates another editing action into this one, thus forming a
 
138
   * combined action that replaces the argument action.
 
139
   *
 
140
   * @param edit the editing action to be replaced.
 
141
   * 
 
142
   * @return <code>true</code> if the edit is successfully replaced, and 
 
143
   *         <code>false</code> otherwise.
 
144
   */
 
145
  boolean replaceEdit(UndoableEdit edit);
 
146
 
 
147
  /**
 
148
   * Undoes this editing action.
 
149
   *
 
150
   * @throws CannotUndoException if the edit cannot be undone.
 
151
   *
 
152
   * @see #canUndo()
 
153
   * @see #redo()
 
154
   */
 
155
  void undo() throws CannotUndoException;
 
156
 
 
157
}