1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.editor.textEditor.requests.editTextRequests;
13
14 import org.eclipse.gef.EditDomain;
15
16 import sk.uniba.euromath.editor.textEditor.ITextPieceKeeper;
17 import sk.uniba.euromath.editor.textEditor.requests.IRequestSpecialization;
18 import sk.uniba.euromath.editor.textEditor.requests.RequestConstants;
19
20 /***
21 * Used when activating TextTool
22 *
23 * @author Martin Kollar
24 */
25 public class ActivateTextEditingRequest extends EditTextRequest implements IRequestSpecialization {
26
27 private EditDomain domain;
28
29 /*** ofsset in source editPart */
30 private int caretOffset;
31
32 /***
33 * @param source ITextPieceKeeper where the Caret is going to be activated
34 * @param caretOffset index from start of TextPiece before that Caret is
35 * going to be activated
36 */
37 public ActivateTextEditingRequest(ITextPieceKeeper source, int caretOffset, EditDomain domain){
38 super(source);
39 this.domain = domain;
40 this.caretOffset = caretOffset;
41 }
42
43 public EditDomain getDomain(){
44 return domain;
45 }
46
47 /***
48 *
49 * @return index from start of TextPiece before that Caret is going to be activated
50 */
51 public int getCaretOffset(){
52 return this.caretOffset;
53 }
54
55 public String getSpecialization() {
56 return RequestConstants.ACTIVATE_TEXT_EDITING_REQUEST;
57 }
58 }