KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > contentassist > IJavaDebugContentAssistContext


1 /*******************************************************************************
2  * Copyright (c) 2005 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.jdt.internal.debug.ui.contentassist;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.jdt.core.IType;
15
16 /**
17  * Provides a context for context assist in the Java debugger.
18  *
19  * @since 3.2
20  */

21 public interface IJavaDebugContentAssistContext {
22     
23     /**
24      * Returns the type in which to perfrom completions.
25      *
26      * @return type in which to perform completions
27      * @throws CoreException if a type cannot be resolved
28      */

29     public IType getType() throws CoreException;
30
31     /**
32      * Returns the position within this context's type's source where the snippet
33      * on which completions are being performed is inserted. This position must not
34      * be in comments. Returns -1, if the position is not known.
35      *
36      * @return position within source where completions are performed or -1
37      * @throws CoreException if an exception occurrs determining the position
38      */

39     public int getInsertionPosition() throws CoreException;
40     
41     /**
42      * Returns an array (possibly empty) of local variable information.
43      * If the result is not empty, two arrays are returned. The first
44      * array contains the names of local variables visible at the current
45      * scope, and the second array contains the associated fully qualified
46      * type names of the local variables.
47      * <p>
48      * Local variable information can be optionally be provided when an insertion
49      * position is unknown, but local variable information is known.
50      * </p>
51      *
52      * @return arrays of variable names and fully qualified type names of local variables
53      * visible at the current scope
54      * @throws CoreException if an exception occurrs determining local variable
55      * information
56      */

57     public String JavaDoc[][] getLocalVariables() throws CoreException;
58     
59     /**
60      * Returns whether the current scope is in a static context.
61      *
62      * @return whether the current scope is in a static context
63      * @throws CoreException if an exception occurrs while determining scope
64      */

65     public boolean isStatic() throws CoreException;
66     
67     /**
68      * Returns the snippet on which code completion is should be performed, given the
69      * snippet that is currently being edited. Allows implementations to perform any
70      * special preprocessing on the snippet.
71      *
72      * @param snippet the snippet in source viewer on which completion is being performed
73      * @return the snippet on which to perform code completion
74      * @throws CoreException
75      */

76     public String JavaDoc getSnippet(String JavaDoc snippet) throws CoreException;
77 }
78
Popular Tags