Revision 3be6ef3e
Added by Niels Hoffmann over 13 years ago
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/model/TaxeditorPartService.java | ||
---|---|---|
14 | 14 |
import org.eclipse.ui.PlatformUI; |
15 | 15 |
|
16 | 16 |
/** |
17 |
* @author n.hoffmann
|
|
17 |
* <p>TaxeditorPartService class.</p>
|
|
18 | 18 |
* |
19 |
* @author n.hoffmann |
|
20 |
* @version $Id: $ |
|
19 | 21 |
*/ |
20 | 22 |
public class TaxeditorPartService implements IPartListener2{ |
21 | 23 |
|
24 |
/** Constant <code>PART_ACTIVATED=10</code> */ |
|
22 | 25 |
public static final int PART_ACTIVATED = 10; |
26 |
/** Constant <code>PART_BROUGHT_TO_TOP=20</code> */ |
|
23 | 27 |
public static final int PART_BROUGHT_TO_TOP = 20; |
28 |
/** Constant <code>PART_CLOSED=30</code> */ |
|
24 | 29 |
public static final int PART_CLOSED = 30; |
30 |
/** Constant <code>PART_DEAVTICATED=40</code> */ |
|
25 | 31 |
public static final int PART_DEAVTICATED = 40; |
32 |
/** Constant <code>PART_HIDDEN=50</code> */ |
|
26 | 33 |
public static final int PART_HIDDEN = 50; |
34 |
/** Constant <code>PART_INPUT_CHANGED=60</code> */ |
|
27 | 35 |
public static final int PART_INPUT_CHANGED = 60; |
36 |
/** Constant <code>PART_OPENED=70</code> */ |
|
28 | 37 |
public static final int PART_OPENED = 70; |
38 |
/** Constant <code>PART_VISIBLE=80</code> */ |
|
29 | 39 |
public static final int PART_VISIBLE = 80; |
30 | 40 |
|
41 |
/** Constant <code>instance</code> */ |
|
31 | 42 |
public static TaxeditorPartService instance = new TaxeditorPartService(); |
32 | 43 |
|
33 | 44 |
private IPartService partService; |
... | ... | |
39 | 50 |
partService.addPartListener(this); |
40 | 51 |
} |
41 | 52 |
|
53 |
/** |
|
54 |
* <p>Getter for the field <code>instance</code>.</p> |
|
55 |
* |
|
56 |
* @return a {@link eu.etaxonomy.taxeditor.model.TaxeditorPartService} object. |
|
57 |
*/ |
|
42 | 58 |
public static TaxeditorPartService getInstance(){ |
43 | 59 |
return instance; |
44 | 60 |
} |
45 | 61 |
|
62 |
/** |
|
63 |
* <p>addListener</p> |
|
64 |
* |
|
65 |
* @param eventType a {@link java.lang.Integer} object. |
|
66 |
* @param listener a {@link eu.etaxonomy.taxeditor.model.IPartChangeListener} object. |
|
67 |
*/ |
|
46 | 68 |
public void addListener(Integer eventType, IPartChangeListener listener){ |
47 | 69 |
Set<IPartChangeListener> partChangeListeners = listenerMap.get(eventType); |
48 | 70 |
|
... | ... | |
54 | 76 |
partChangeListeners.add(listener); |
55 | 77 |
} |
56 | 78 |
|
79 |
/** |
|
80 |
* <p>removeListener</p> |
|
81 |
* |
|
82 |
* @param eventType a {@link java.lang.Integer} object. |
|
83 |
* @param listener a {@link eu.etaxonomy.taxeditor.model.IPartChangeListener} object. |
|
84 |
*/ |
|
57 | 85 |
public void removeListener(Integer eventType, IPartChangeListener listener){ |
58 | 86 |
Set<IPartChangeListener> partChangeListeners = listenerMap.get(eventType); |
59 | 87 |
|
... | ... | |
77 | 105 |
} |
78 | 106 |
|
79 | 107 |
|
108 |
/** {@inheritDoc} */ |
|
80 | 109 |
public void partActivated(IWorkbenchPartReference partRef) { |
81 | 110 |
notifyListeners(PART_ACTIVATED, partRef); |
82 | 111 |
} |
83 | 112 |
|
113 |
/** {@inheritDoc} */ |
|
84 | 114 |
public void partBroughtToTop(IWorkbenchPartReference partRef) { |
85 | 115 |
notifyListeners(PART_BROUGHT_TO_TOP, partRef); |
86 | 116 |
} |
87 | 117 |
|
118 |
/** {@inheritDoc} */ |
|
88 | 119 |
public void partClosed(IWorkbenchPartReference partRef) { |
89 | 120 |
notifyListeners(PART_CLOSED, partRef); |
90 | 121 |
} |
91 | 122 |
|
123 |
/** {@inheritDoc} */ |
|
92 | 124 |
public void partDeactivated(IWorkbenchPartReference partRef) { |
93 | 125 |
notifyListeners(PART_DEAVTICATED, partRef); |
94 | 126 |
} |
95 | 127 |
|
128 |
/** {@inheritDoc} */ |
|
96 | 129 |
public void partOpened(IWorkbenchPartReference partRef) { |
97 | 130 |
notifyListeners(PART_OPENED, partRef); |
98 | 131 |
} |
99 | 132 |
|
133 |
/** {@inheritDoc} */ |
|
100 | 134 |
public void partHidden(IWorkbenchPartReference partRef) { |
101 | 135 |
notifyListeners(PART_HIDDEN, partRef); |
102 | 136 |
} |
103 | 137 |
|
138 |
/** {@inheritDoc} */ |
|
104 | 139 |
public void partVisible(IWorkbenchPartReference partRef) { |
105 | 140 |
notifyListeners(PART_VISIBLE, partRef); |
106 | 141 |
} |
107 | 142 |
|
143 |
/** {@inheritDoc} */ |
|
108 | 144 |
public void partInputChanged(IWorkbenchPartReference partRef) { |
109 | 145 |
notifyListeners(PART_INPUT_CHANGED, partRef); |
110 | 146 |
} |
Also available in: Unified diff
performed javacscript:fix and worked on documentation