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

Annotation (NetBeans Text API) - NetBeans API Javadoc 5.5.1

org.openide.text 6.9.32

org.openide.text
Class Annotation

java.lang.Object
  extended by org.openide.text.Annotation

public abstract class Annotation
extends Object

Description of annotation. The class is extended by modules which creates annotations and defines annotation type and tooltip. The annotation can be attached to Annotatable object. Editors which displays Annotations listen on PropertyChangeListner for changes of annotation type or tooltip text. The tooltip text can be evaluated asynchronously. It means that editors after the getShortDescription call must listen on PropertyChangeListner while the tooltip is visible. If the tooltip text property is changed, the tooltip value must be updated.

Since:
1.20

Field Summary
static String PROP_ANNOTATION_TYPE
          Property name of the annotation type
static String PROP_MOVE_TO_FRONT
          Virtual property which does not have getter/setter.
static String PROP_SHORT_DESCRIPTION
          Property name of the tip text
 
Constructor Summary
Annotation()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Add listeners on changes of annotation properties
 void attach(Annotatable anno)
          Attach annotation to Annotatable object.
 void detach()
          Detach annotation.
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Fire property change to registered listeners.
abstract  String getAnnotationType()
          Returns name of the file which describes the annotation type.
 Annotatable getAttachedAnnotatable()
          Gets annotatable object to which this annotation is attached.
abstract  String getShortDescription()
          Returns the tooltip text for this annotation.
 void moveToFront()
          Helper method for moving annotation which is covered by other annotations on the same line in front of others.
protected  void notifyAttached(Annotatable toAnno)
          Notifies the annotation that it was attached to the annotatable.
protected  void notifyDetached(Annotatable fromAnno)
          Notifies the annotation that it was detached from the annotatable.
 void removePropertyChangeListener(PropertyChangeListener l)
          Remove listeners on changes of annotation properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_SHORT_DESCRIPTION

public static final String PROP_SHORT_DESCRIPTION
Property name of the tip text

See Also:
Constant Field Values

PROP_ANNOTATION_TYPE

public static final String PROP_ANNOTATION_TYPE
Property name of the annotation type

See Also:
Constant Field Values

PROP_MOVE_TO_FRONT

public static final String PROP_MOVE_TO_FRONT
Virtual property which does not have getter/setter. When change on this property is fired, listeners (= editors) must ensure that this annotation is not covered by some other annotation which is on the same line - annotation must be moved in front of others. See also moveToFront() method.

Since:
1.27
See Also:
Constant Field Values
Constructor Detail

Annotation

public Annotation()
Method Detail

getAnnotationType

public abstract String getAnnotationType()
Returns name of the file which describes the annotation type. The file must be defined in module installation layer in the directory "Editors/AnnotationTypes"

Returns:
name of the anotation type

getShortDescription

public abstract String getShortDescription()
Returns the tooltip text for this annotation.

Returns:
tooltip for this annotation

attach

public final void attach(Annotatable anno)
Attach annotation to Annotatable object.

Parameters:
anno - annotatable class to which this annotation will be attached

notifyAttached

protected void notifyAttached(Annotatable toAnno)
Notifies the annotation that it was attached to the annotatable.

Parameters:
toAnno - annotatable to which the annotation was attached.
Since:
1.38

detach

public final void detach()
Detach annotation.


notifyDetached

protected void notifyDetached(Annotatable fromAnno)
Notifies the annotation that it was detached from the annotatable.

Parameters:
fromAnno - annotatable from which the annotation was detached.
Since:
1.38

getAttachedAnnotatable

public final Annotatable getAttachedAnnotatable()
Gets annotatable object to which this annotation is attached.

Returns:
null if annotation is not attached or reference to annotatable object.
Since:
1.27

addPropertyChangeListener

public final void addPropertyChangeListener(PropertyChangeListener l)
Add listeners on changes of annotation properties

Parameters:
l - change listener

removePropertyChangeListener

public final void removePropertyChangeListener(PropertyChangeListener l)
Remove listeners on changes of annotation properties

Parameters:
l - change listener

firePropertyChange

protected final void firePropertyChange(String propertyName,
                                        Object oldValue,
                                        Object newValue)
Fire property change to registered listeners.


moveToFront

public final void moveToFront()
Helper method for moving annotation which is covered by other annotations on the same line in front of others. The method fires change on PROP_MOVE_TO_FRONT property on which editors must listen and do the fronting of the annotation. Whether the annotation is visible in editor or not is not guaranteed by this method - use Line.show instead.

Since:
1.27

org.openide.text 6.9.32

Built on March 26 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.