KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > source > TextInvocationContext


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.text.source;
12
13 import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
14
15
16 /**
17  * Text quick assist invocation context.
18  * <p>
19  * Clients may extend this class to add additional context information.
20  * </p>
21  *
22  * @since 3.3
23  */

24 public class TextInvocationContext implements IQuickAssistInvocationContext {
25
26     private ISourceViewer fSourceViewer;
27     private int fOffset;
28     private int fLength;
29     
30     public TextInvocationContext(ISourceViewer sourceViewer, int offset, int length) {
31         fSourceViewer= sourceViewer;
32         fOffset= offset;
33         fLength= length;
34     }
35
36     /*
37      * @see org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext#getOffset()
38      */

39     public int getOffset() {
40         return fOffset;
41     }
42
43     /*
44      * @see org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext#getLength()
45      */

46     public int getLength() {
47         return fLength;
48     }
49
50     /*
51      * @see org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext#getSourceViewer()
52      */

53     public ISourceViewer getSourceViewer() {
54         return fSourceViewer;
55     }
56     
57 }
58
Popular Tags