KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > internal > 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.internal.text.source;
12
13 import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
14 import org.eclipse.jface.text.source.ISourceViewer;
15
16
17 /**
18  * Text quick assist invocation context.
19  *
20  * @since3.2
21  */

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

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

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

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