1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.editor.textEditor.requests.selectionRequest;
13
14 import java.util.Collection;
15 import java.util.HashSet;
16 import java.util.Set;
17
18 import org.eclipse.gef.Request;
19
20 import sk.uniba.euromath.editor.textEditor.Interval;
21 import sk.uniba.euromath.editor.textEditor.requests.RequestConstants;
22
23 /***
24 * @author Tomáš Studva 7.2.2006
25 */
26 public class TextSelectRequest extends Request{
27
28 /***
29 * Selection to select.
30 */
31 private final Set<Interval> selection;
32
33 /***
34 * Determines how to select. Can be: {@link #NEW_SELECTION } or
35 * {@link #XOR_SELECTION }.
36 */
37 private String selectType;
38
39 /***
40 * Type to new selection.
41 */
42 public static final String NEW_SELECTION = "NEW_SELECTION";
43
44 /***
45 * Type to XOR selection.
46 */
47 public static final String XOR_SELECTION = "XOR_SELECTION";
48
49 /***
50 * Constructor.
51 *
52 * @param selection
53 * @param selectType
54 */
55 public TextSelectRequest(Collection<Interval> selection, String selectType) {
56 super(RequestConstants.TEXT_SELECT);
57 this.selection = new HashSet<Interval>(selection);
58 this.selectType = selectType;
59 }
60
61 /***
62 * @return the selection
63 */
64 public Set<Interval> getSelection() {
65 return this.selection;
66 }
67
68 /***
69 * @return the selectType
70 */
71 public String getSelectType() {
72 return this.selectType;
73 }
74
75 }