public abstract class StatusDisplayer extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
StatusDisplayer.Message
Handle for 'important' status line messages.
|
Modifier and Type | Field and Description |
---|---|
static int |
IMPORTANCE_ANNOTATION
Default message 'importance' for file annotations.
|
static int |
IMPORTANCE_ERROR_HIGHLIGHT
Default message 'importance' for error and warning messages on current line.
|
static int |
IMPORTANCE_FIND_OR_REPLACE
Default message 'importance' for messages from find and replace actions.
|
static int |
IMPORTANCE_INCREMENTAL_FIND
Default message 'importance' for messages from incremental find.
|
Modifier | Constructor and Description |
---|---|
protected |
StatusDisplayer()
Subclass constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addChangeListener(ChangeListener l)
Add a listener for when the text changes.
|
static StatusDisplayer |
getDefault()
Get the default status displayer.
|
abstract String |
getStatusText()
Get the currently displayed text.
|
abstract void |
removeChangeListener(ChangeListener l)
Remove a listener for the text.
|
abstract void |
setStatusText(String text)
Show text in the status line.
|
StatusDisplayer.Message |
setStatusText(String text,
int importance)
Show text in the status line.
|
public static final int IMPORTANCE_ANNOTATION
public static final int IMPORTANCE_INCREMENTAL_FIND
public static final int IMPORTANCE_FIND_OR_REPLACE
public static final int IMPORTANCE_ERROR_HIGHLIGHT
public static StatusDisplayer getDefault()
public abstract String getStatusText()
Modules should not need to call this method. If you think you really do, please explain why on nbdev. The implementation of the GUI component (if any) which displays the text naturally needs to call it.
public abstract void setStatusText(String text)
Default implementation of status line in NetBeans displays the text in status line and clears it after a while. Also there is no guarantee how long the text will be displayed as it can be replaced with new call to this method at any time.
Note: The text may not show in the status line at all if some
other text with higher importance is currently showing in the status line
as status messages displayed this way have zero importance
.
The message will show when higher-priority message has been cleared (either
explicitly or after garbage collect).
text
- the text to be shownStatusDisplayer.setStatusText(String,int)
public StatusDisplayer.Message setStatusText(String text, int importance)
Show text in the status line. importance
argument
indicates that the text should stay in the status line until it is replaced
with new text by calling setStatusText(String,int)
again with
the same or higher importance value.
The text will be removed from status line when this method's return value is
garbage-collected or explicitly by calling Message.clear(int)
.
text
- The text to be shown until some other text with the same or higher
importance is passed into the status line.importance
- Positive integer defining the 'Importance' of the message
to be displayed, the higher number the higher importance.IllegalArgumentException
- If importance <= 0public abstract void addChangeListener(ChangeListener l)
l
- a listenerpublic abstract void removeChangeListener(ChangeListener l)
l
- a listener