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.Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Marker(int startOffset,
int endOffset,
int type,
String tooltip)
Creates a
Marker . |
Modifier and Type | Method and Description |
---|---|
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() |
public static final int TYPE_ERROR
public static final int TYPE_WARNING
public static final int TYPE_MANDATORY_WARNING
public static final int TYPE_NOTE
public static final int TYPE_OTHER
public static final int TYPE_CUSTOM_STYLE
public static final String PROPERTY_ENABLED
public static final String PROPERTY_START_OFFSET
public static final String PROPERTY_END_OFFSET
public static final String PROPERTY_TYPE
public static final String PROPERTY_TOOLTIP_TEXT
public Marker(int startOffset, int endOffset, int type, String tooltip)
Marker
.startOffset
- the index of the start element in the componentendOffset
- the index of the end element in the componenttype
- the marker typetooltip
- the tooltip to showpublic int getStartOffset()
public void setStartOffset(int startOffset)
startOffset
- the start offsetpublic int getEndOffset()
public void setEndOffset(int endOffset)
endOffset
- the end offsetpublic int getType()
public void setType(int type)
type
- the typepublic String getToolTipText()
public void setToolTipText(String tooltipText)
tooltipText
- the tooltip textpublic boolean isEnabled()
setEnabled(boolean)
public void setEnabled(boolean enabled)
enabled
- the flagpublic void addPropertyChangeListener(PropertyChangeListener listener)
listener
is null
, no exception is thrown and no action is performed.listener
- the property change listener to be addedremovePropertyChangeListener(java.beans.PropertyChangeListener)
,
getPropertyChangeListeners()
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- the PropertyChangeListener to be removedaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
getPropertyChangeListeners()
public PropertyChangeListener[] getPropertyChangeListeners()
PropertyChangeListener
s or an empty array if no property change
listeners are currently registeredaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.beans.PropertyChangeListener)
,
PropertyChangeSupport.getPropertyChangeListeners()
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
propertyName
- the property whose value has changedoldValue
- the property's previous valuenewValue
- the property's new value