KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > quickassist > IQuickAssistInvocationContext


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.quickassist;
12
13 import org.eclipse.jface.text.source.ISourceViewer;
14
15
16 /**
17  * Context information for quick fix and quick assist processors.
18  * <p>
19  * This interface can be implemented by clients.</p>
20  *
21  * @since 3.2
22  */

23 public interface IQuickAssistInvocationContext {
24
25     /**
26      * Returns the offset where quick assist was invoked.
27      *
28      * @return the invocation offset or <code>-1</code> if unknown
29      */

30     int getOffset();
31
32     /**
33      * Returns the length of the selection at the invocation offset.
34      *
35      * @return the length of the current selection or <code>-1</code> if none or unknown
36      */

37     int getLength();
38     
39     /**
40      * Returns the viewer for this context.
41      *
42      * @return the viewer or <code>null</code> if not available
43      */

44     ISourceViewer getSourceViewer();
45 }
46
Popular Tags