SilverStream
Application Server 3.5

com.sssw.rt.tview
Class AgoColumnButtonCheck

java.lang.Object
 |
 +--com.sssw.rt.tview.AgoColumnBase
       |
       +--com.sssw.rt.tview.AgoColumnButtonCheck

public class AgoColumnButtonCheck
extends AgoColumnBase

AgoColumnButtonCheck is a bound column type that represents the state of a boolean (true/false) value. A "checked" box indicates a true value, while an unchecked box indicates a false value. AgoColumnButtonChecks work independently of one another so multiple checkboxes can represent multiple conditions.


Constructor Summary
AgoColumnButtonCheck(int width, boolean visible, boolean transparent, Color backgroundColor, int borderType)
           
 
Method Summary
 Object getCheckedValue()
          Returns the (constant) value that is written to the database when this checkbox is checked.
 Color getColor()
          Returns the java.awt.Color object used to define the column's text color.
 String getDisplayText()
          Returns the String representing the check box label
 AgoFontIdentifier getFontIdentifier()
          Returns the SilverStream font object (AgoFontIdentifier) for the column's text.
 String getPropertyName()
          Returns the name of the data column whose value will be changed when this button is pressed
 Object getUncheckedValue()
          Returns the (constant) value that is written to the database when the checkbox is unchecked
 void initColumnCheckProperty(String propertyName, AgoFontIdentifier fontid, Color textColor, int alignment)
          Sets up a number of parameters for the checkbox column.
 void setCheckedValue(Object value)
          Sets the value (a constant) that is written to the database when this checkbox is checked.
 void setColor(Color color)
          Sets the column's text color.
 void setDisplayText(String text)
          Sets the text for the check box label.
 void setFontIdentifier(AgoFontIdentifier fontid)
          Assigns the SilverStream font object (AgoFontIdentifier) to the column's text.
 void setPropertyName(String propertyName)
          Sets the name of the data column whose value will be changed when this button is pressed
 void setUncheckedValue(Object value)
          Sets the (constant) value that is written to the database when the checkbox is unchecked
 
Methods inherited from class com.sssw.rt.tview.AgoColumnBase
getAlignment, getBackgroundColor, getBorderType, getDisplayWidth, getHidden, getResizable, getSelectable, getTransparent, getVisible, getWidth, isWidthFixed, setAlignment, setBackgroundColor, setBorderType, setFixedWidth, setHidden, setProportionalWidth, setProportionalWidth, setResizable, setSelectable, setTransparent, setVisible, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgoColumnButtonCheck

public AgoColumnButtonCheck(int width,
                            boolean visible,
                            boolean transparent,
                            Color backgroundColor,
                            int borderType)
Parameters:
width - the column width, in pixels
visible - the "visible" property for the column. Set to false to hide the column. If you hide a column, you might also want to hide any headers associated with the column.
transparent - the "transparent" property for the column. Set to true to make it transparent.
backgroundColor - the java.awt.Color object that specifies the column's background color.
borderType - the symbolic constant that specifies the desired border. See AgoColumnBase for the valid types.
Example:
     AgoColumnButtonCheck benefit1;
     benefit1 = new AgoColumnButtonCheck(100,
                                         true,
                                         false,
                                         Color.white,
                                         AgoColumnBase.BORDER_3D);
See Also:
AgoColumnBase
Method Detail

initColumnCheckProperty

public void initColumnCheckProperty(String propertyName,
                                    AgoFontIdentifier fontid,
                                    Color textColor,
                                    int alignment)
Sets up a number of parameters for the checkbox column.
Parameters:
propertyName - the name of the database column to which this column is bound. The type of the property must be Boolean. If it is not, you must also set the checked and unchecked values directly (using setCheckedValue() and setUncheckedValue()).
fontid - a SilverStream font object (AgoFontIdentifier) for the control's text
textColor - a java.awt.Color object for the control's text
alignment - the alignment constant for the contents of the column. Alignment constants are described in the AgoColumnBase documentation.
Usage:
If the database column to which this control is bound is not Boolean, you must also call the setcheckedValue() and setUncheckedValue() methods to define the values that are written to the database as the control is checked or unchecked by the user. The values specified in setChecked() and setUnchecked() methods must match the datatype of the target column.
Example:
This example shows how to call the initColumnCheckProperty() and the setCheckedValue() and setUncheckedValue() methods.
     AgoColumnButtonCheck benefit1;
     benefit1 = new AgoColumnButtonCheck(100,
                                         true,
                                         false,
                                         Color.white,
                                         AgoColumnBase.BORDER_3D);
     benefit1.initColumnCheckProperty("health",
                                      new AgoFontIdentifier("Dialog", 0, 12),
                                      Color.black,
                                      AgoColumnbase.ALIGN_LEFT);
 
    benefit1.setCheckedValue("Yes");
    benefit1.setUncheckedValue("No");

See Also:
AgoColumnBase, AgoFontIdentifier, AgoColumnButtonCheck.setPropertyName(String propertyName), AgoColumnButtonCheck.getCheckedValue(), AgoColumnButtonCheck.getUncheckedValue(), AgoColumnButtonCheck.setCheckedValue(Object value), AgoColumnButtonCheck.setUncheckedValue(Object value)

getFontIdentifier

public final AgoFontIdentifier getFontIdentifier()
Returns the SilverStream font object (AgoFontIdentifier) for the column's text.
Usage:
The AgoFontIdentifier object consists of three parts: a Font Name, a Font Style and a Font Size. The Font Style can be one of these values:
     AgoFontIdentifier.PLAIN
     AgoFontIdentifier.BOLD
     AgoFontIdentifier.ITALIC
     AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC

The Font Name can be one of these values: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats. At runtime, Java translates this value to the appropriate font installed on the system.

The Font Size can be any integer.

Example:
The following code fragment illustrates how to construct a new AgoFontIdentifier object (called newFont) and how to call the getFontIdentifier() method:
     AgoFontIdentifier font;
     font = myColumn.getFontIdentifier();
See Also:
AgoFontIdentifier, AgoColumnButtonCheck.setFontIdentifier(AgoFontIdentifier fontid)

setFontIdentifier

public final void setFontIdentifier(AgoFontIdentifier fontid)
Assigns the SilverStream font object (AgoFontIdentifier) to the column's text.
Parameters:
fontid - specifies the AgoFontIdentifier object that assigns the font for the column
Usage:

Overrides the font values set in the initColumnCheckProperty() method.

The AgoFontIdentifier object consists of three parts: a Font Name, a Font Style and a Font Size.

The Font Name can be one of these values: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats.

At runtime, Java translates this value to the appropriate font installed on the system.

The Font Size can be any integer.

The Font Style can be one of these values:

      AgoFontIdentifier.PLAIN
      AgoFontIdentifier.BOLD
      AgoFontIdentifier.ITALIC
      AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC
Example:
This code fragment illustrates how to construct a new AgoFontIdentifier object (called newFont) and how to call the setFontIdentifier() method:
     AgoFontIdentifier     newFont;
     String                newName;
     int                   newSize;
     int                   newStyle;
           
     newName="TimesRoman";
     newSize=20;
     newStyle=AgoFontIdentifier.ITALIC;
     newFont=new AgoFontIdentifier(newName, newStyle, newSize);
          
     myColumn.setFontIdentifier(newFont);

See Also:
AgoFontIdentifier, AgoColumnButtonCheck.getFontIdentifier()

getColor

public final Color getColor()
Returns the java.awt.Color object used to define the column's text color.
Example:
     Color textColor = myColumn.getColor();
See Also:
AgoColumnButtonCheck.setColor(Color color)

setColor

public final void setColor(Color color)
Sets the column's text color.
Parameters:
color - the java.awt.Color object for the column's text
Usage:
If you change this value at runtime, you must call the AgcView.setAgoViewFormat() method to repaint the view and make the change immediately visible to the user.

Overrides the color set in the initColumnCheckProperty() method.

Example:
       myColumn.setColor(Color.green);
See Also:
AgoColumnButtonCheck.getColor()

getPropertyName

public final String getPropertyName()
Returns the name of the data column whose value will be changed when this button is pressed
Example:
     String propName = health.getPropertyName();
See Also:
AgoColumnButtonCheck.setPropertyName(String propertyName)

setPropertyName

public final void setPropertyName(String propertyName)
Sets the name of the data column whose value will be changed when this button is pressed
Parameters:
propertyName - the data column to bind to
Usage:
The data type of the corresponding data column must be Boolean. If it is not, then you must also call setCheckedValue() and setUncheckedValue(). These methods let you specify a value to write to the database column when the check box is checked or unchecked by the user. The value must be appropriate for the data column data type. Overrides the data column specified in the initColumnCheckProperty() method.
Example:
     AgoColumnButtonCheck benefit1;
     benefit1 = new AgoColumnButtonCheck(100,
                                         true,
                                         false,
                                         Color.white,
                                         AgoColumnBase.BORDER_NONE);
     benefit1.initColumnCheckProperty("health", 
                                      new AgoFontIdentifier("Dialog", 0, 12),
                                      Color.black,
                                      AgoColumnBase.ALIGN_LEFT);
     benefit1.setPropertyName("dental");
     benefit1.setCheckedValue("Yes");
     benefit1.setUncheckedValue("No");

See Also:
AgoColumnButtonCheck.getPropertyName(), AgoColumnButtonCheck.setCheckedValue(Object value), AgoColumnButtonCheck.setUncheckedValue(Object value), AgoColumnButtonCheck.getCheckedValue(), AgoColumnButtonCheck.getUncheckedValue()

getDisplayText

public final String getDisplayText()
Returns the String representing the check box label
Example:
     AgoColumnButtonCheck health = new AgoColumnButtonCheck(120,
                                                            true,
                                                            false,
                                                            Color.green,
                                                            AgoColumnBase.BORDER_3D);
     health.initColumnCheckProperty("health", 
                                     new AgoFontIdentifier("Dialog", 0, 12), 
                                     Color.black, 
                                     AgoColumnBase.ALIGN_LEFT);
     health.setDisplayText("Health Insurance");
     String info = health.getDisplayText();

See Also:
AgoColumnButtonCheck.setDisplayText(String text)

setDisplayText

public final void setDisplayText(String text)
Sets the text for the check box label.
Parameters:
text - the String representing the check box label
Usage:
The label is displayed to the right of the check box. If the column width is shorter than the label, SilverStream displays the number of characters that fit followed by an ellipsis (...)
Example:
     AgoColumnButtonCheck health = new AgoColumnButtonCheck(120,
                                                            true,
                                                             false,
                                                            Color.green,
                                                            AgoColumnBase.BORDER_3D);
     health.initColumnCheckProperty("health",
                                    new AgoFontIdentifier("Dialog", 0, 12), 
                                    Color.black, 
                                    AgoColumnBase.ALIGN_LEFT);
     health.setDisplayText("Health Insurance");
     beneformat.appendColumnFormat(health);
See Also:
AgoColumnButtonCheck.getDisplayText()

getCheckedValue

public final Object getCheckedValue()
Returns the (constant) value that is written to the database when this checkbox is checked.
See Also:
AgoColumnButtonCheck.setCheckedValue(Object value), AgoColumnButtonCheck.setUncheckedValue(Object value), AgoColumnButtonCheck.getUncheckedValue()

setCheckedValue

public final void setCheckedValue(Object value)
Sets the value (a constant) that is written to the database when this checkbox is checked.
Parameters:
value - the value to write to the database
Usage:
This method must be called when you bind the control to a database column whose data type is not a Boolean. It allows you to write a value of the correct data type to the database column. The checkbox will be initially checked if the database value matches the value specified here.
See Also:
AgoColumnButtonCheck.getCheckedValue(), AgoColumnButtonCheck.setUncheckedValue(Object value), AgoColumnButtonCheck.getUncheckedValue()

getUncheckedValue

public final Object getUncheckedValue()
Returns the (constant) value that is written to the database when the checkbox is unchecked
See Also:
AgoColumnButtonCheck.setUncheckedValue(Object value), AgoColumnButtonCheck.setCheckedValue(Object value), AgoColumnButtonCheck.getCheckedValue()

setUncheckedValue

public final void setUncheckedValue(Object value)
Sets the (constant) value that is written to the database when the checkbox is unchecked
Parameters:
value - the constant value to be returned by when the check box is unchecked
See Also:
AgoColumnButtonCheck.getUncheckedValue(), AgoColumnButtonCheck.getCheckedValue(), AgoColumnButtonCheck.setCheckedValue(Object value)

SilverStream
Application Server 3.5