站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

EditorContext (JPDA Debugger API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.api.debugger.jpda/2 2.13

org.netbeans.spi.debugger.jpda
Class EditorContext

java.lang.Object
  extended by org.netbeans.spi.debugger.jpda.EditorContext

public abstract class EditorContext
extends Object

Defines bridge to editor and src hierarchy. It allows to use different source viewer for debugger (like some UML view).


Nested Class Summary
static interface EditorContext.BytecodeProvider
          A provider of method bytecode information.
static class EditorContext.MethodArgument
          Representation of an argument to a method.
static class EditorContext.Operation
          The operation definition.
static class EditorContext.Position
          Representation of a position in a source code.
 
Field Summary
static String BREAKPOINT_ANNOTATION_TYPE
          Annotation type constant.
static String CALL_STACK_FRAME_ANNOTATION_TYPE
          Annotation type constant.
static String CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE
          Annotation type constant.
static String CURRENT_EXPRESSION_CURRENT_LINE_ANNOTATION_TYPE
          Annotation type constant.
static String CURRENT_EXPRESSION_SECONDARY_LINE_ANNOTATION_TYPE
          Annotation type constant.
static String CURRENT_LAST_OPERATION_ANNOTATION_TYPE
          Annotation type constant.
static String CURRENT_LINE_ANNOTATION_TYPE
          Annotation type constant.
static String CURRENT_OUT_OPERATION_ANNOTATION_TYPE
          Annotation type constant.
static String DISABLED_BREAKPOINT_ANNOTATION_TYPE
          Annotation type constant.
static String DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE
          Annotation type constant.
static String DISABLED_FIELD_BREAKPOINT_ANNOTATION_TYPE
          Annotation type constant.
static String DISABLED_METHOD_BREAKPOINT_ANNOTATION_TYPE
          Annotation type constant.
static String FIELD_BREAKPOINT_ANNOTATION_TYPE
          Annotation type constant.
static String METHOD_BREAKPOINT_ANNOTATION_TYPE
          Annotation type constant.
static String PROP_LINE_NUMBER
          Property name constant.
 
Constructor Summary
EditorContext()
           
 
Method Summary
protected  void addNextOperationTo(EditorContext.Operation operation, EditorContext.Operation next)
          Assign a next operation, concatenates operations.
abstract  void addPropertyChangeListener(PropertyChangeListener l)
          Adds a property change listener.
abstract  void addPropertyChangeListener(String propertyName, PropertyChangeListener l)
          Adds a property change listener.
 Object annotate(String url, int startPosition, int endPosition, String annotationType, Object timeStamp)
          Adds annotation to given url on given character range.
abstract  Object annotate(String url, int lineNumber, String annotationType, Object timeStamp)
          Adds annotation to given url on given line.
protected  EditorContext.Operation createMethodOperation(EditorContext.Position startPosition, EditorContext.Position endPosition, EditorContext.Position methodStartPosition, EditorContext.Position methodEndPosition, String methodName, String methodClassType, int bytecodeIndex)
          Creates a method operation.
protected  EditorContext.Position createPosition(int offset, int line, int column)
          Creates a new EditorContext.Position object.
abstract  void createTimeStamp(Object timeStamp)
          Creates a new time stamp.
abstract  void disposeTimeStamp(Object timeStamp)
          Disposes given time stamp.
 EditorContext.MethodArgument[] getArguments(String url, EditorContext.Operation operation)
          Get a list of arguments to the given operation.
 EditorContext.MethodArgument[] getArguments(String url, int methodLineNumber)
          Get a list of arguments passed to method located at the given line.
abstract  String getClassName(String url, int lineNumber)
          Returns class name for given url and line number or null.
abstract  String getCurrentClassName()
          Returns name of class currently selected in editor or empty string.
abstract  String getCurrentFieldName()
          Returns name of field currently selected in editor or null.
abstract  int getCurrentLineNumber()
          Returns number of line currently selected in editor or -1.
 String[] getCurrentMethodDeclaration()
          Returns name and signature of method declaration currently selected in editor, or null.
abstract  String getCurrentMethodName()
          Returns name of method currently selected in editor or empty string.
abstract  String getCurrentURL()
          Returns URL of source currently selected in editor or empty string.
abstract  int getFieldLineNumber(String url, String className, String fieldName)
          Returns line number of given field in given class.
abstract  String[] getImports(String url)
          Returns list of imports for given source url.
abstract  int getLineNumber(Object annotation, Object timeStamp)
          Returns line number given annotation is associated with.
 int getMethodLineNumber(String url, String className, String methodName, String methodSignature)
          Returns line number of given method in given class.
 EditorContext.Operation[] getOperations(String url, int lineNumber, EditorContext.BytecodeProvider bytecodeProvider)
          Get the list of operations that are in expression(s) located at the given line.
abstract  String getSelectedIdentifier()
          Returns identifier currently selected in editor or null.
abstract  String getSelectedMethodName()
          Returns method name currently selected in editor or empty string.
abstract  void removeAnnotation(Object annotation)
          Removes given annotation.
abstract  void removePropertyChangeListener(PropertyChangeListener l)
          Removes a property change listener.
abstract  void removePropertyChangeListener(String propertyName, PropertyChangeListener l)
          Removes a property change listener.
abstract  boolean showSource(String url, int lineNumber, Object timeStamp)
          Shows source with given url on given line number.
abstract  void updateTimeStamp(Object timeStamp, String url)
          Updates timeStamp for gived url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BREAKPOINT_ANNOTATION_TYPE

public static final String BREAKPOINT_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

DISABLED_BREAKPOINT_ANNOTATION_TYPE

public static final String DISABLED_BREAKPOINT_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE

public static final String CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE

public static final String DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

FIELD_BREAKPOINT_ANNOTATION_TYPE

public static final String FIELD_BREAKPOINT_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

DISABLED_FIELD_BREAKPOINT_ANNOTATION_TYPE

public static final String DISABLED_FIELD_BREAKPOINT_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

METHOD_BREAKPOINT_ANNOTATION_TYPE

public static final String METHOD_BREAKPOINT_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

DISABLED_METHOD_BREAKPOINT_ANNOTATION_TYPE

public static final String DISABLED_METHOD_BREAKPOINT_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

CURRENT_LINE_ANNOTATION_TYPE

public static final String CURRENT_LINE_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

CALL_STACK_FRAME_ANNOTATION_TYPE

public static final String CALL_STACK_FRAME_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

CURRENT_LAST_OPERATION_ANNOTATION_TYPE

public static final String CURRENT_LAST_OPERATION_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

CURRENT_OUT_OPERATION_ANNOTATION_TYPE

public static final String CURRENT_OUT_OPERATION_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

CURRENT_EXPRESSION_SECONDARY_LINE_ANNOTATION_TYPE

public static final String CURRENT_EXPRESSION_SECONDARY_LINE_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

CURRENT_EXPRESSION_CURRENT_LINE_ANNOTATION_TYPE

public static final String CURRENT_EXPRESSION_CURRENT_LINE_ANNOTATION_TYPE
Annotation type constant.

See Also:
Constant Field Values

PROP_LINE_NUMBER

public static final String PROP_LINE_NUMBER
Property name constant.

See Also:
Constant Field Values
Constructor Detail

EditorContext

public EditorContext()
Method Detail

showSource

public abstract boolean showSource(String url,
                                   int lineNumber,
                                   Object timeStamp)
Shows source with given url on given line number.

Parameters:
url - a url of source to be shown
lineNumber - a number of line to be shown
timeStamp - a time stamp to be used

createTimeStamp

public abstract void createTimeStamp(Object timeStamp)
Creates a new time stamp.

Parameters:
timeStamp - a new time stamp

disposeTimeStamp

public abstract void disposeTimeStamp(Object timeStamp)
Disposes given time stamp.

Parameters:
timeStamp - a time stamp to be disposed

updateTimeStamp

public abstract void updateTimeStamp(Object timeStamp,
                                     String url)
Updates timeStamp for gived url.

Parameters:
timeStamp - time stamp to be updated
url - an url

annotate

public abstract Object annotate(String url,
                                int lineNumber,
                                String annotationType,
                                Object timeStamp)
Adds annotation to given url on given line.

Parameters:
url - a url of source annotation should be set into
lineNumber - a number of line annotation should be set into
annotationType - a type of annotation to be set
timeStamp - a time stamp to be used
Returns:
annotation or null, when the annotation can not be created at the given URL or line number.

annotate

public Object annotate(String url,
                       int startPosition,
                       int endPosition,
                       String annotationType,
                       Object timeStamp)
Adds annotation to given url on given character range.

Parameters:
url - a url of source annotation should be set into
startPosition - the offset of the starting position of the annotation
endPosition - the offset of the ending position of the annotation
annotationType - a type of annotation to be set
Returns:
annotation or null, when the annotation can not be created at the given URL or line number.

getLineNumber

public abstract int getLineNumber(Object annotation,
                                  Object timeStamp)
Returns line number given annotation is associated with.

Parameters:
annotation - a annotation
timeStamp - a time stamp to be used
Returns:
line number given annotation is associated with

removeAnnotation

public abstract void removeAnnotation(Object annotation)
Removes given annotation.


getCurrentLineNumber

public abstract int getCurrentLineNumber()
Returns number of line currently selected in editor or -1.

Returns:
number of line currently selected in editor or -1

getCurrentClassName

public abstract String getCurrentClassName()
Returns name of class currently selected in editor or empty string.

Returns:
name of class currently selected in editor or empty string

getCurrentURL

public abstract String getCurrentURL()
Returns URL of source currently selected in editor or empty string.

Returns:
URL of source currently selected in editor or empty string

getCurrentMethodName

public abstract String getCurrentMethodName()
Returns name of method currently selected in editor or empty string.

Returns:
name of method currently selected in editor or empty string

getCurrentFieldName

public abstract String getCurrentFieldName()
Returns name of field currently selected in editor or null.

Returns:
name of field currently selected in editor or null

getSelectedIdentifier

public abstract String getSelectedIdentifier()
Returns identifier currently selected in editor or null.

Returns:
identifier currently selected in editor or null

getSelectedMethodName

public abstract String getSelectedMethodName()
Returns method name currently selected in editor or empty string.

Returns:
method name currently selected in editor or empty string

getFieldLineNumber

public abstract int getFieldLineNumber(String url,
                                       String className,
                                       String fieldName)
Returns line number of given field in given class.

Parameters:
url - the url of source file the class is deined in
className - the name of class (or innerclass) the field is defined in
fieldName - the name of field
Returns:
line number or -1

getMethodLineNumber

public int getMethodLineNumber(String url,
                               String className,
                               String methodName,
                               String methodSignature)
Returns line number of given method in given class.

Parameters:
url - the url of source file the class is deined in
className - the name of class (or innerclass) the method is defined in
methodName - the name of the method
methodSignature - the JNI-style signature of the method. If null, then the first method found is returned.
Returns:
line number or -1

getCurrentMethodDeclaration

public String[] getCurrentMethodDeclaration()
Returns name and signature of method declaration currently selected in editor, or null.

Returns:
name and signature of the method, or null.

getClassName

public abstract String getClassName(String url,
                                    int lineNumber)
Returns class name for given url and line number or null.

Parameters:
url - a url
lineNumber - a line number
Returns:
class name for given url and line number or null

getImports

public abstract String[] getImports(String url)
Returns list of imports for given source url.

Parameters:
url - the url of source file
Returns:
list of imports for given source url

createMethodOperation

protected final EditorContext.Operation createMethodOperation(EditorContext.Position startPosition,
                                                              EditorContext.Position endPosition,
                                                              EditorContext.Position methodStartPosition,
                                                              EditorContext.Position methodEndPosition,
                                                              String methodName,
                                                              String methodClassType,
                                                              int bytecodeIndex)
Creates a method operation.

Parameters:
startPosition - The starting position of the operation
endPosition - The ending position of the operation
methodStartPosition - The starting position of the method name
methodEndPosition - The ending position of the method name
methodName - The string representation of the method name
methodClassType - The class type, which defines this method
bytecodeIndex - The bytecode index of this method call

addNextOperationTo

protected final void addNextOperationTo(EditorContext.Operation operation,
                                        EditorContext.Operation next)
Assign a next operation, concatenates operations.

Parameters:
operation - The first operation
next - The next operation

createPosition

protected final EditorContext.Position createPosition(int offset,
                                                      int line,
                                                      int column)
Creates a new EditorContext.Position object.

Parameters:
offset - The offset
line - The line number
column - The column number

getOperations

public EditorContext.Operation[] getOperations(String url,
                                               int lineNumber,
                                               EditorContext.BytecodeProvider bytecodeProvider)
Get the list of operations that are in expression(s) located at the given line.

Parameters:
url - The file's URL
lineNumber - The line number
bytecodeProvider - The provider of method bytecodes.

getArguments

public EditorContext.MethodArgument[] getArguments(String url,
                                                   EditorContext.Operation operation)
Get a list of arguments to the given operation.

Parameters:
url - The URL of the source file with the operation
operation - The operation

getArguments

public EditorContext.MethodArgument[] getArguments(String url,
                                                   int methodLineNumber)
Get a list of arguments passed to method located at the given line.

Parameters:
url - The URL of the source file
methodLineNumber - The line number of the method header

addPropertyChangeListener

public abstract void addPropertyChangeListener(PropertyChangeListener l)
Adds a property change listener.

Parameters:
l - the listener to add

removePropertyChangeListener

public abstract void removePropertyChangeListener(PropertyChangeListener l)
Removes a property change listener.

Parameters:
l - the listener to remove

addPropertyChangeListener

public abstract void addPropertyChangeListener(String propertyName,
                                               PropertyChangeListener l)
Adds a property change listener.

Parameters:
propertyName - the name of property
l - the listener to add

removePropertyChangeListener

public abstract void removePropertyChangeListener(String propertyName,
                                                  PropertyChangeListener l)
Removes a property change listener.

Parameters:
propertyName - the name of property
l - the listener to remove

org.netbeans.api.debugger.jpda/2 2.13

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.