org.openide.awt 7.8.1

org.openide.awt
Class StatusDisplayer

java.lang.Object
  extended by org.openide.awt.StatusDisplayer

public abstract class StatusDisplayer
extends Object

Permits control of a status line. The default instance may correspond to the NetBeans status line in the main window.

Since:
3.14

Nested Class Summary
static interface StatusDisplayer.Message
          Handle for 'important' status line messages.
 
Field Summary
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.
 
Constructor Summary
protected StatusDisplayer()
          Subclass constructor.
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPORTANCE_ANNOTATION

public static final int IMPORTANCE_ANNOTATION
Default message 'importance' for file annotations.

See Also:
Constant Field Values

IMPORTANCE_INCREMENTAL_FIND

public static final int IMPORTANCE_INCREMENTAL_FIND
Default message 'importance' for messages from incremental find.

See Also:
Constant Field Values

IMPORTANCE_FIND_OR_REPLACE

public static final int IMPORTANCE_FIND_OR_REPLACE
Default message 'importance' for messages from find and replace actions.

See Also:
Constant Field Values

IMPORTANCE_ERROR_HIGHLIGHT

public static final int IMPORTANCE_ERROR_HIGHLIGHT
Default message 'importance' for error and warning messages on current line.

See Also:
Constant Field Values
Constructor Detail

StatusDisplayer

protected StatusDisplayer()
Subclass constructor.

Method Detail

getDefault

public static StatusDisplayer getDefault()
Get the default status displayer.

Returns:
the default instance from lookup

getStatusText

public abstract String getStatusText()
Get the currently displayed text.

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.

Returns:
some text

setStatusText

public abstract void setStatusText(String text)
Show text in the status line. Can be called at any time, but remember the text may not be updated until the AWT event queue is ready for it - so if you are hogging the event queue the text will not appear until you release it (finish your work or display a modal dialog, for example).

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).

Parameters:
text - the text to be shown
See Also:
setStatusText(String,int)

setStatusText

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).

Parameters:
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.
Returns:
Handle associated with given status line text.
Throws:
IllegalArgumentException - If importance <= 0
Since:
7.5

addChangeListener

public abstract void addChangeListener(ChangeListener l)
Add a listener for when the text changes.

Parameters:
l - a listener

removeChangeListener

public abstract void removeChangeListener(ChangeListener l)
Remove a listener for the text.

Parameters:
l - a listener

org.openide.awt 7.8.1

Built on September 27 2009.  |  Portions Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.