1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.editor.selections;
13
14 import java.util.EventObject;
15
16 import org.eclipse.jface.util.Assert;
17
18 import sk.baka.ikslibs.interval.DOMIntervalSet;
19
20 /***
21 * XML selection changed event object.
22 *
23 * TODO GUI : this could contains only some update of previous selection
24 * e.g. some DOMInterval is add to selection, than the result of
25 * @see DOMIntervalSet#union(sk.baka.ikslibs.interval.DOMInterval) can be this update
26 *
27 * @author Tomas Studva
28 */
29 public class DOMSelectionChangedEvent extends EventObject {
30
31 /***
32 * Autogenerated uid.
33 */
34 private static final long serialVersionUID = 6448236361981041006L;
35
36 /***
37 * The selection.
38 */
39 protected DOMIntervalSet selection;
40
41 /***
42 * Creates a new event for the given source and selection.
43 *
44 * @param source
45 * the selection provider
46 * @param selection
47 * the selection
48 */
49 public DOMSelectionChangedEvent(IDOMSelectionProvider source,
50 DOMIntervalSet selection) {
51 super(source);
52 Assert.isNotNull(selection);
53 this.selection = selection;
54 }
55
56 /***
57 * Returns the selection.
58 *
59 * @return the selection
60 */
61 public DOMIntervalSet getDOMSelection() {
62 return selection;
63 }
64
65 /***
66 * Returns the selection provider that is the source of this event.
67 *
68 * @return the originating selection provider
69 */
70 public IDOMSelectionProvider getSelectionProvider() {
71 return getSource();
72 }
73
74 @Override
75 public IDOMSelectionProvider getSource() {
76 return (IDOMSelectionProvider)super.getSource();
77 }
78
79 }