com.levigo.util.swing.componentdecorator
Class NonFocusedInfo

java.lang.Object
  extended by com.levigo.util.swing.componentdecorator.NonFocusedInfo

public class NonFocusedInfo
extends Object

A decorator allowing a JTextComponent to be out-fitted with a disabled text which is shown while the component is not focused.

Author:
hennejg

Method Summary
static NonFocusedInfo decorate(ComboBoxEditor editor, String text)
          Decorate the given ComboBoxEditor with the given non-focused text.
static NonFocusedInfo decorate(ComboBoxEditor editor, String text, boolean justOnce)
          Decorate the given ComboBoxEditor with the given non-focused text.
static NonFocusedInfo decorate(JTextComponent comp, String text)
          Decorate the given JTextComponent with the given non-focused text.
static NonFocusedInfo decorate(JTextComponent comp, String text, boolean justOnce)
          Decorate the given JTextComponent with the given non-focused text.
protected  void disableInfo()
          Disable non-focused info.
protected  void enableInfo()
          Enable non-focused info.
 void setNonFocusedText(String text)
          Set the text shown while the component is not focused.
 void undecorate()
          Undecorate the previously decorated component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

disableInfo

protected void disableInfo()
Disable non-focused info.


enableInfo

protected void enableInfo()
Enable non-focused info.


decorate

public static NonFocusedInfo decorate(JTextComponent comp,
                                      String text)
Decorate the given JTextComponent with the given non-focused text.

Parameters:
comp -
text -
Returns:
a handle which can be used to uninstall this decorator.

decorate

public static NonFocusedInfo decorate(JTextComponent comp,
                                      String text,
                                      boolean justOnce)
Decorate the given JTextComponent with the given non-focused text.

Parameters:
comp -
text -
justOnce - whether to decorate just once, i.e. don't redisplay the hint when the focus is lost.
Returns:
a handle which can be used to uninstall this decorator.

decorate

public static NonFocusedInfo decorate(ComboBoxEditor editor,
                                      String text)
Decorate the given ComboBoxEditor with the given non-focused text.

Parameters:
editor -
text -
Returns:
a handle which can be used to uninstall this decorator.

decorate

public static NonFocusedInfo decorate(ComboBoxEditor editor,
                                      String text,
                                      boolean justOnce)
Decorate the given ComboBoxEditor with the given non-focused text.

Parameters:
editor -
text -
justOnce - whether to decorate just once, i.e. don't redisplay the hint when the focus is lost.
Returns:
a handle which can be used to uninstall this decorator.

undecorate

public void undecorate()
Undecorate the previously decorated component.


setNonFocusedText

public void setNonFocusedText(String text)
Set the text shown while the component is not focused.

Parameters:
text -


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.