KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > NullUndoManager


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.editor;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.pde.core.IModelChangeProvider;
15
16 public class NullUndoManager implements IModelUndoManager {
17
18     /*
19      * @see IModelUndoManager#connect(IModelChangeProvider)
20      */

21     public void connect(IModelChangeProvider provider) {
22     }
23
24     /*
25      * @see IModelUndoManager#disconnect(IModelChangeProvider)
26      */

27     public void disconnect(IModelChangeProvider provider) {
28     }
29
30     /*
31      * @see IModelUndoManager#isUndoable()
32      */

33     public boolean isUndoable() {
34         return false;
35     }
36
37     /*
38      * @see IModelUndoManager#isRedoable()
39      */

40     public boolean isRedoable() {
41         return false;
42     }
43
44     /*
45      * @see IModelUndoManager#undo()
46      */

47     public void undo() {
48     }
49
50     /*
51      * @see IModelUndoManager#redo()
52      */

53     public void redo() {
54     }
55
56     /*
57      * @see IModelUndoManager#setUndoLevelLimit(int)
58      */

59     public void setUndoLevelLimit(int limit) {
60     }
61
62     /*
63      * @see IModelUndoManager#setIgnoreChanges(boolean)
64      */

65     public void setIgnoreChanges(boolean ignore) {
66     }
67     
68     public void setActions(IAction undoAction, IAction redoAction) {
69         if (undoAction!=null) undoAction.setEnabled(false);
70         if (redoAction!=null) redoAction.setEnabled(false);
71     }
72 }
73
Popular Tags