edu.cmu.hcii.calo.view.PlaceholderTextField Class Reference

List of all members.

Detailed Description

A text field that displays placeholder text when it is empty and not focused.

Author:
Brian Ellis


Public Member Functions

 PlaceholderTextField ()
 Constructs a PlaceholderTextField with a blank placeholder text and no initial text.
 PlaceholderTextField (Document doc, String text, int columns)
 Constructs a PlaceholderTextField with the given document, text, and width expressed in columns.
 PlaceholderTextField (int columns)
 Constructs a PlaceholderTextField with a blank placeholder text, no initial text, and the given width expressed in columns.
 PlaceholderTextField (String text)
 Constructs a PlaceholderTextField with a blank placeholder text and the given initial text.
 PlaceholderTextField (String text, int columns)
 Constructs a PlaceholderTextField with a blank placeholder text, the given initial text, and the given width expressed in columns.
String getPlaceholderText ()
 Gets the placeholder text for this field.
void setPlaceholderText (String placeholderText)
 Sets the placeholder text for this field to the given string.

Static Protected Attributes

static final Color PLACEHOLDER_TEXT_COLOR = Color.GRAY
 The color of the placeholder text.

Private Member Functions

void displayPlaceholderText ()
 Displays the placeholder text in the text field, setting the foreground color correctly, if and only if the field is empty.
void setup ()
 Sets up the visual appearance of this field.

Private Attributes

String placeholderText = ""
 The placeholder text.
Color actualForeground
 The actual foreground color of the text in the field when it's focused.

Static Private Attributes

static final long serialVersionUID = -798004097970200065L
 Prevent serialization collisions.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.view.PlaceholderTextField.PlaceholderTextField (  ) 

Constructs a PlaceholderTextField with a blank placeholder text and no initial text.

edu.cmu.hcii.calo.view.PlaceholderTextField.PlaceholderTextField ( Document  doc,
String  text,
int  columns 
)

Constructs a PlaceholderTextField with the given document, text, and width expressed in columns.

Parameters:
doc the document
text the text
columns the width

edu.cmu.hcii.calo.view.PlaceholderTextField.PlaceholderTextField ( int  columns  ) 

Constructs a PlaceholderTextField with a blank placeholder text, no initial text, and the given width expressed in columns.

Parameters:
columns the width

edu.cmu.hcii.calo.view.PlaceholderTextField.PlaceholderTextField ( String  text  ) 

Constructs a PlaceholderTextField with a blank placeholder text and the given initial text.

Parameters:
text the text

edu.cmu.hcii.calo.view.PlaceholderTextField.PlaceholderTextField ( String  text,
int  columns 
)

Constructs a PlaceholderTextField with a blank placeholder text, the given initial text, and the given width expressed in columns.

Parameters:
text the text
columns the width


Member Function Documentation

String edu.cmu.hcii.calo.view.PlaceholderTextField.getPlaceholderText (  ) 

Gets the placeholder text for this field.

Returns:
the placeholder text

void edu.cmu.hcii.calo.view.PlaceholderTextField.setPlaceholderText ( String  placeholderText  ) 

Sets the placeholder text for this field to the given string.

Parameters:
placeholderText the placeholder text to set

void edu.cmu.hcii.calo.view.PlaceholderTextField.displayPlaceholderText (  )  [private]

Displays the placeholder text in the text field, setting the foreground color correctly, if and only if the field is empty.

void edu.cmu.hcii.calo.view.PlaceholderTextField.setup (  )  [private]

Sets up the visual appearance of this field.


Member Data Documentation

final Color edu.cmu.hcii.calo.view.PlaceholderTextField.PLACEHOLDER_TEXT_COLOR = Color.GRAY [static, protected]

The color of the placeholder text.

final long edu.cmu.hcii.calo.view.PlaceholderTextField.serialVersionUID = -798004097970200065L [static, private]

Prevent serialization collisions.

String edu.cmu.hcii.calo.view.PlaceholderTextField.placeholderText = "" [private]

The placeholder text.

Color edu.cmu.hcii.calo.view.PlaceholderTextField.actualForeground [private]

The actual foreground color of the text in the field when it's focused.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:22 2007 for CALO by  doxygen 1.5.2