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 * @author Tomas Studva
24 */
25 public class DOMSelectionChangedEvent extends EventObject {
26
27 /***
28 * Autogenerated uid.
29 */
30 private static final long serialVersionUID = 6448236361981041006L;
31
32 /***
33 * The selection.
34 */
35 protected DOMIntervalSet selection;
36
37 /***
38 * Creates a new event for the given source and selection.
39 *
40 * @param source
41 * the selection provider
42 * @param selection
43 * the selection
44 */
45 public DOMSelectionChangedEvent(IDOMSelectionProvider source,
46 DOMIntervalSet selection) {
47 super(source);
48 Assert.isNotNull(selection);
49 this.selection = selection;
50 }
51
52 /***
53 * Returns the selection.
54 *
55 * @return the selection
56 */
57 public DOMIntervalSet getDOMSelection() {
58 return selection;
59 }
60
61 /***
62 * Returns the selection provider that is the source of this event.
63 *
64 * @return the originating selection provider
65 */
66 public IDOMSelectionProvider getSelectionProvider() {
67 return getSource();
68 }
69
70 @Override
71 public IDOMSelectionProvider getSource() {
72 return (IDOMSelectionProvider)super.getSource();
73 }
74
75 }