ehsbe CommonsTM
Version 1.1.0rc3

com.ehsbe.commons.gui
Class Hints

java.lang.Object
  extended by com.ehsbe.commons.gui.Hints

public class Hints
extends Object

A utitlity class, which applies hints to a text if neccessary.

Version:
$Revision: 432 $
Author:
Jens Elkner

Nested Class Summary
static class Hints.Option
          some options, which are used to manipulate the labels text with hints
 
Constructor Summary
Hints(JComponent client)
          Create a new Hints.
 
Method Summary
 void add(Hints.Option... opt)
          Add the given options to the label.
 String getOriginalText()
          Get the real aka original label text.
 String getText()
          Get the decorated text.
 void remove(Hints.Option... opt)
          Remove the given options from the label.
 void setColor(Hints.Option option, Color color)
          Set the color to be used for drawing the symbol for the given option.
 void setSymbol(Hints.Option option, String symbol)
          Set the symbol to use for the given option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hints

public Hints(JComponent client)
Create a new Hints.

Parameters:
client - the component to decorate
Method Detail

add

public void add(Hints.Option... opt)
Add the given options to the label.

If a change in the hint options occures, the client gets revalidated.

Parameters:
opt - options to add. Ignored if null.

remove

public void remove(Hints.Option... opt)
Remove the given options from the label.

If a change in the hint options occures, the client gets revalidated.

Parameters:
opt - options to remove. Ignored if null.

setSymbol

public void setSymbol(Hints.Option option,
                      String symbol)
Set the symbol to use for the given option.

The client gets revalidated.

Parameters:
option - option for which the symbol should be set.
symbol - symbol to set. If null, the default will be used instead.

setColor

public void setColor(Hints.Option option,
                     Color color)
Set the color to be used for drawing the symbol for the given option. The client gets revalidated.

Parameters:
option - option for which the color should be used
color - color to use. If null, the default will be used instead.

getText

public String getText()
Get the decorated text.

Returns:
null if not set, the decorated text otherwise.

getOriginalText

public String getOriginalText()
Get the real aka original label text.

Returns:
null if not set, the text otherwise.

ehsbe CommonsTM
Version 1.1.0rc3

Copyright ©2005-2009 EHSBE, Walther-Rathenau-Str. 58, 39104 Magdeburg, Sachsen-Anhalt, Germany. All Rights Reserved.