JIDE 3.5.15

com.jidesoft.marker
Class Marker

java.lang.Object
  extended by com.jidesoft.marker.Marker
Direct Known Subclasses:
Marker

public class Marker
extends Object

Marker represents a range of continuous items used by the MarkerModel. It has a start offset and an end offset. By default, there are two types of markers - error and warning. But you can always define your own types of markers. You can also associate a tooltip with a marker. The tooltip will be shown when user mouse moves over the marker stripe.


Field Summary
static String PROPERTY_ENABLED
           
static String PROPERTY_END_OFFSET
           
static String PROPERTY_START_OFFSET
           
static String PROPERTY_TOOLTIP_TEXT
           
static String PROPERTY_TYPE
           
static int TYPE_CUSTOM_STYLE
          The custom marker type start at 0x80, so that you could set a style for those marker types.
static int TYPE_ERROR
          Problem which prevents the tool's normal completion.
static int TYPE_MANDATORY_WARNING
          Problem similar to a warning, but is mandated by the tool's specification.
static int TYPE_NOTE
          Informative message from the tool.
static int TYPE_OTHER
          Diagnostic which does not fit within the other kinds.
static int TYPE_WARNING
          Problem which does not usually prevent the tool from completing normally.
 
Constructor Summary
Marker(int startOffset, int endOffset, int type, String tooltip)
          Creates a Marker.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Support for reporting property changes for all properties.
 int getEndOffset()
          Gets the end offset.
 PropertyChangeListener[] getPropertyChangeListeners()
          Returns an array of all the property change listeners registered on this class.
 int getStartOffset()
          Gets the start offset.
 String getToolTipText()
          Gets the tooltip text.
 int getType()
          Gets the type.
 boolean isEnabled()
          Gets the flag if the marker is enabled.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void setEnabled(boolean enabled)
          Sets the flag indicating if the marker is enabled.
 void setEndOffset(int endOffset)
          Sets the end offset.
 void setStartOffset(int startOffset)
          Sets the start offset.
 void setToolTipText(String tooltipText)
          Sets the tooltip text.
 void setType(int type)
          Sets the type.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_ERROR

public static final int TYPE_ERROR
Problem which prevents the tool's normal completion.

See Also:
Constant Field Values

TYPE_WARNING

public static final int TYPE_WARNING
Problem which does not usually prevent the tool from completing normally.

See Also:
Constant Field Values

TYPE_MANDATORY_WARNING

public static final int TYPE_MANDATORY_WARNING
Problem similar to a warning, but is mandated by the tool's specification. For example, the Java™ Language Specification, 3rd Ed. mandates warnings on certain unchecked operations and the use of deprecated methods.

See Also:
Constant Field Values

TYPE_NOTE

public static final int TYPE_NOTE
Informative message from the tool.

See Also:
Constant Field Values

TYPE_OTHER

public static final int TYPE_OTHER
Diagnostic which does not fit within the other kinds.

See Also:
Constant Field Values

TYPE_CUSTOM_STYLE

public static final int TYPE_CUSTOM_STYLE
The custom marker type start at 0x80, so that you could set a style for those marker types.

See Also:
Constant Field Values

PROPERTY_ENABLED

public static final String PROPERTY_ENABLED
See Also:
Constant Field Values

PROPERTY_START_OFFSET

public static final String PROPERTY_START_OFFSET
See Also:
Constant Field Values

PROPERTY_END_OFFSET

public static final String PROPERTY_END_OFFSET
See Also:
Constant Field Values

PROPERTY_TYPE

public static final String PROPERTY_TYPE
See Also:
Constant Field Values

PROPERTY_TOOLTIP_TEXT

public static final String PROPERTY_TOOLTIP_TEXT
See Also:
Constant Field Values
Constructor Detail

Marker

public Marker(int startOffset,
              int endOffset,
              int type,
              String tooltip)
Creates a Marker.

Parameters:
startOffset - the index of the start element in the component
endOffset - the index of the end element in the component
type - the marker type
tooltip - the tooltip to show
Method Detail

getStartOffset

public int getStartOffset()
Gets the start offset.

Returns:
the start offset.

setStartOffset

public void setStartOffset(int startOffset)
Sets the start offset.

Parameters:
startOffset - the start offset

getEndOffset

public int getEndOffset()
Gets the end offset.

Returns:
the end offset.

setEndOffset

public void setEndOffset(int endOffset)
Sets the end offset.

Parameters:
endOffset - the end offset

getType

public int getType()
Gets the type.

Returns:
the type.

setType

public void setType(int type)
Sets the type.

Parameters:
type - the type

getToolTipText

public String getToolTipText()
Gets the tooltip text.

Returns:
the tooltip text.

setToolTipText

public void setToolTipText(String tooltipText)
Sets the tooltip text.

Parameters:
tooltipText - the tooltip text

isEnabled

public boolean isEnabled()
Gets the flag if the marker is enabled.

Returns:
true if the marker is enabled. Otherwise false.
See Also:
setEnabled(boolean)

setEnabled

public void setEnabled(boolean enabled)
Sets the flag indicating if the marker is enabled.

By default, the value is true.

Parameters:
enabled - the flag

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the property change listener to be added
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners()

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for this class.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners()

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()
Returns an array of all the property change listeners registered on this class.

Returns:
all of this class's PropertyChangeListeners or an empty array if no property change listeners are currently registered
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), removePropertyChangeListener(java.beans.PropertyChangeListener), PropertyChangeSupport.getPropertyChangeListeners()

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Support for reporting property changes for all properties. This method can be called when a property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.

Parameters:
propertyName - the property whose value has changed
oldValue - the property's previous value
newValue - the property's new value

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15