JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.field
Class JCPromptHelper

java.lang.Object
  |
  +--com.klg.jclass.field.JCPromptHelper
All Implemented Interfaces:
ContainerListener, EventListener, FocusListener

public class JCPromptHelper
extends Object
implements ContainerListener, FocusListener

This class allows the user to display the tool tip text in a specific prompt label of any container whenever that field component gains focus, and to remove the text when the field loses focus.
Note: This helper is not restricted to finding JCFieldComponents that are immediate children of the specified container.


Field Summary
protected  JLabel prompt
           
 
Constructor Summary
JCPromptHelper(Container container)
          Constructs a prompt helper class on the specified container.
JCPromptHelper(Container container, JLabel prompt)
          Constructs a Prompt Helper on the specified container, with the specified label as the target for the tool tip text of the Field components contained within the container.
 
Method Summary
protected  void addChild(Component c)
           
 void componentAdded(ContainerEvent e)
          This method is internal.
 void componentRemoved(ContainerEvent e)
          This method is internal.
 void focusGained(FocusEvent e)
          Sets the tool tip text when the field gains focus.
 void focusLost(FocusEvent e)
          Removes the tool tip text when the field loses focus.
 JLabel getPromptLabel()
          Returns the prompt label being used.
protected  void removeChild(Component c)
           
 void setPromptLabel(JLabel prompt)
          Sets the prompt label to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prompt

protected JLabel prompt
Constructor Detail

JCPromptHelper

public JCPromptHelper(Container container,
                      JLabel prompt)
Constructs a Prompt Helper on the specified container, with the specified label as the target for the tool tip text of the Field components contained within the container.

Parameters:
container -
prompt -

JCPromptHelper

public JCPromptHelper(Container container)
Constructs a prompt helper class on the specified container.
Note: For this constructor to be useful, the setPromptLabel method must be called in its future.

Parameters:
container -
Method Detail

setPromptLabel

public void setPromptLabel(JLabel prompt)
Sets the prompt label to use. If this is not specified either by invoking it in this method or in the constructor, then this class will not be useful.

Parameters:
prompt -

getPromptLabel

public JLabel getPromptLabel()
Returns the prompt label being used.

Returns:
prompt label being used

addChild

protected void addChild(Component c)

componentAdded

public void componentAdded(ContainerEvent e)
This method is internal. You should not have to call this method.

Specified by:
componentAdded in interface ContainerListener
Parameters:
e -

removeChild

protected void removeChild(Component c)

componentRemoved

public void componentRemoved(ContainerEvent e)
This method is internal. You should not have to call this method.

Specified by:
componentRemoved in interface ContainerListener
Parameters:
e -

focusGained

public void focusGained(FocusEvent e)
Sets the tool tip text when the field gains focus.

Specified by:
focusGained in interface FocusListener
Parameters:
e -

focusLost

public void focusLost(FocusEvent e)
Removes the tool tip text when the field loses focus.

Specified by:
focusLost in interface FocusListener
Parameters:
e -

Copyright © 2004 Quest Software Inc..
All rights reserved.