com.arsdigita.portalserver
Class ColorPicker

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.FormSection
              extended bycom.arsdigita.portalserver.ColorPicker
All Implemented Interfaces:
Cloneable, com.arsdigita.bebop.Component, com.arsdigita.bebop.Container, com.arsdigita.util.Lockable

public class ColorPicker
extends com.arsdigita.bebop.FormSection

This class represents a drop-in FormSection for color selection. The class includes a title label describing what the color refers to, a radiogroup for the color choices, and a text input field for use when the available pallette does not include a desired color. Note: All color values are represented within the class by strings of the type "#FFCA04". Neither the input on the text field, or the addColor method are checked for proper format - care must be taken by the user to maintain the proper string representation.

The ColorPicker class includes a built in default group of 12 colors. If the developer would rather supply their own colors, clearColors() can be called, and then the internal radioGroup populated with colors provided by a radioGroup using the addOptionGroup() method.

The getValue() method for this class checks first if the text field is null. If not, its value is returned. If null, the radiogroup is then checked for its value and returned.

Author:
Jim Parsons

Field Summary
 
Fields inherited from class com.arsdigita.bebop.FormSection
m_formModel, m_panel, versionId
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
ColorPicker(String name)
           
ColorPicker(String name, String defaultValue)
           
 
Method Summary
 void addOptionGroup(com.arsdigita.bebop.form.RadioGroup rgroup)
           
 void clearColors()
           
 String getValue(com.arsdigita.bebop.PageState ps)
           
 
Methods inherited from class com.arsdigita.bebop.FormSection
add, add, addCancelListener, addInitListener, addProcessListener, addSubmissionListener, addValidationListener, children, contains, createInitListener, createProcessListener, createSubmissionListener, createValidationListener, fireCancel, fireInit, fireProcess, fireSubmitted, fireValidate, forwardInit, forwardProcess, forwardSubmission, forwardValidation, generateXML, get, getModel, getPanel, indexOf, isEmpty, lock, process, register, removeCancelListener, removeInitListener, removeProcessListener, removeSubmissionListener, removeValidationListener, respond, size
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, register, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.Component
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked
 

Constructor Detail

ColorPicker

public ColorPicker(String name)

ColorPicker

public ColorPicker(String name,
                   String defaultValue)
Method Detail

getValue

public String getValue(com.arsdigita.bebop.PageState ps)

clearColors

public void clearColors()

addOptionGroup

public void addOptionGroup(com.arsdigita.bebop.form.RadioGroup rgroup)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2343 UTC