svn-gvsig-desktop / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / editabletextcomponent / event / UndoRedoEditEvent.java @ 18795
History | View | Annotate | Download (2.29 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
|
20 |
package org.gvsig.gui.beans.editabletextcomponent.event; |
21 |
|
22 |
|
23 |
/**
|
24 |
* <p>An event indicating the kind of operation occurred: undo or redo.</p>
|
25 |
*
|
26 |
* @version 12/02/2008
|
27 |
* @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
|
28 |
*/
|
29 |
public class UndoRedoEditEvent extends java.util.EventObject { |
30 |
public static final short UNDO = 0; |
31 |
public static final short REDO = 1; |
32 |
|
33 |
private short myType; |
34 |
private String myOldText; |
35 |
private String myNewText; |
36 |
|
37 |
/**
|
38 |
* Constructs an UndoableEditEvent object.
|
39 |
*
|
40 |
* @param source the Object that originated the event
|
41 |
* (typically <code>this</code>)
|
42 |
* @param type type of operation done <i>(undo or redo)</i>
|
43 |
* @param oldText text before the operation
|
44 |
* @param newText text after the operation
|
45 |
*/
|
46 |
public UndoRedoEditEvent(Object source, short type, String oldText, String newText) { |
47 |
super(source);
|
48 |
myType = type; |
49 |
myOldText = oldText; |
50 |
myNewText = newText; |
51 |
} |
52 |
|
53 |
/**
|
54 |
* Returns the edit operation identifier value.
|
55 |
*
|
56 |
* @return the UndoableEdit object encapsulating the edit
|
57 |
*/
|
58 |
public short getType() { |
59 |
return myType;
|
60 |
} |
61 |
|
62 |
/**
|
63 |
* Returns the previous text.
|
64 |
*
|
65 |
* @return the previous text
|
66 |
*/
|
67 |
public String getOldText() { |
68 |
return myOldText;
|
69 |
} |
70 |
|
71 |
/**
|
72 |
* Returns the new text.
|
73 |
*
|
74 |
* @return the new text
|
75 |
*/
|
76 |
public String getNewText() { |
77 |
return myNewText;
|
78 |
} |
79 |
} |