KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > java > source > transform > UndoList


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.api.java.source.transform;
21
22 /**
23  * A service that maintains the stack of Jackpot UndoEntry instances.
24  */

25 public interface UndoList {
26     void add(UndoEntry u);
27
28     /**
29      * Adds an UndoEntry to the UndoList and executes its redo() method.
30      * This execution eliminates the duplicate code often found in redo
31      * and when the caller is run.
32      */

33     void addAndApply(UndoEntry u);
34
35     /**
36      * Returns true if the last operation was setting the end command.
37      * This method is typically used during cleanup when an operation fails.
38      */

39     boolean atEndCommand();
40
41     /**
42      * Returns true if there are UndoEntry instances that can be redone.
43      */

44     boolean canRedo();
45
46     /**
47      * Returns true if there are UndoEntry instances that can be undone.
48      */

49     boolean canUndo();
50
51     /**
52      * Releases any UndoEntry instances which can be redone.
53      */

54     void clearRedo();
55     
56     /**
57      * Searches the UndoList for an older version of a specified object.
58      */

59     <T> T getOld(T o);
60
61     /**
62      * Invoke the redo() method on any UndoEntry instances which can be redone.
63      */

64     void redo();
65     
66     /**
67      * Release all UndoEntry instances, reseting the list.
68      */

69     void reset();
70
71     /**
72      * Sets the end command in the UndoList.
73      */

74     void setEndCommand(boolean b);
75
76     /**
77      * Invoke the undo() method on any UndoEntry instances which can be undone.
78      */

79     void undo();
80     
81 }
82
Popular Tags