01: package com.jidesoft.swing;
02:
03: import java.awt.*;
04:
05: public class TabEditingEvent extends AWTEvent {
06: /**
07: * The first number in the range of IDs used for <code>TabChangeEvent</code>.
08: */
09: public static final int TAB_EDITING_STARTED = AWTEvent.RESERVED_ID_MAX + 1300;
10: public static final int TAB_EDITING_STOPPED = TAB_EDITING_STARTED + 1;
11: public static final int TAB_EDITING_CANCELLED = TAB_EDITING_STOPPED + 1;
12:
13: private int _tabIndex;
14: private String _oldTitle;
15: private String _newTitle;
16:
17: public TabEditingEvent(Object source, int id, int tabIndex) {
18: super (source, id);
19: _tabIndex = tabIndex;
20: }
21:
22: public TabEditingEvent(Object source, int id, int tabIndex,
23: String oldTitle, String newTitle) {
24: super (source, id);
25: _tabIndex = tabIndex;
26: _oldTitle = oldTitle;
27: _newTitle = newTitle;
28: }
29:
30: /**
31: * Gets the tab index where the tab editing happened.
32: *
33: * @return the tab index.
34: */
35: public int getTabIndex() {
36: return _tabIndex;
37: }
38:
39: /**
40: * Gets the old the title. If the event is to indicate the tab editing is started, this will be the current title.
41: * If tab editing is cancelled, it will still be the current title.
42: *
43: * @return the old title.
44: */
45: public String getOldTitle() {
46: return _oldTitle;
47: }
48:
49: /**
50: * The new title after tab editing. If the event is to indicate the tab editing is started, this will be null.
51: * If tab editing is cancelled, it will be the same as the getOldTitle.
52: *
53: * @return the new title.
54: */
55: public String getNewTitle() {
56: return _newTitle;
57: }
58: }
|