com.arsdigita.cms.ui.category
Class PurposeForm

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.FormSection
              extended bycom.arsdigita.bebop.Form
                  extended bycom.arsdigita.cms.ui.category.PurposeForm
All Implemented Interfaces:
com.arsdigita.bebop.util.BebopConstants, com.arsdigita.toolbox.ui.Cancellable, Cloneable, com.arsdigita.bebop.Component, com.arsdigita.bebop.Container, EventListener, com.arsdigita.bebop.event.FormProcessListener, com.arsdigita.bebop.event.FormValidationListener, com.arsdigita.util.Lockable

public class PurposeForm
extends com.arsdigita.bebop.Form
implements com.arsdigita.bebop.event.FormProcessListener, com.arsdigita.bebop.event.FormValidationListener, com.arsdigita.toolbox.ui.Cancellable

Form which assigns purposes to a category Displays two listboxes for assigning purposes to categories, with two submit buttons to move purposes back and forth. The left listbox displays all available purposes which have not been assigned to the current category. The right listbox displays all purposes assigned to the current category.

Version:
$Id: //cms/dev/src/com/arsdigita/cms/ui/category/PurposeForm.java#16 $
Author:
Scott Seago (scott@arsdigita.com)

Nested Class Summary
protected static class PurposeForm.PurposeMap
          A convenience method that abstracts SequentialMap to deal with categories
 
Field Summary
static String ASSIGN
           
static String ASSIGNED
           
static String FILLER_OPTION
           
static String FREE
           
static String REMOVE
           
static int SELECT_HEIGHT
           
static int SELECT_WIDTH
           
 
Fields inherited from class com.arsdigita.bebop.Form
GET, POST, versionId
 
Fields inherited from class com.arsdigita.bebop.FormSection
m_formModel, m_panel
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.event.FormProcessListener
versionId
 
Fields inherited from interface com.arsdigita.bebop.event.FormValidationListener
versionId
 
Fields inherited from interface com.arsdigita.toolbox.ui.Cancellable
versionId
 
Fields inherited from interface com.arsdigita.bebop.util.BebopConstants
BEBOP_BORDER, BEBOP_BOXPANEL, BEBOP_CELL, BEBOP_CHECKBOX, BEBOP_CHECKBOXGROUP, BEBOP_COLUMNPANEL, BEBOP_DATE, BEBOP_DATETIME, BEBOP_DHTMLEDITOR, BEBOP_FORMERRORS, BEBOP_FORMWIDGET, BEBOP_GRIDPANEL, BEBOP_LIST, BEBOP_MULTISELECT, BEBOP_OPTION, BEBOP_PAD, BEBOP_PADFRAME, BEBOP_PANELROW, BEBOP_PORTAL, BEBOP_PORTLET, BEBOP_RADIO, BEBOP_RADIOGROUP, BEBOP_SEG_BODY, BEBOP_SEG_HEADER, BEBOP_SEG_PANEL, BEBOP_SEGMENT, BEBOP_SELECT, BEBOP_TABLE, BEBOP_TABLEBODY, BEBOP_TABLEROW, BEBOP_TEXTAREA
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
PurposeForm(CategoryRequestLocal category)
          Construct a new PurposeForm component
 
Method Summary
protected  void addAssignButton(com.arsdigita.bebop.Container c)
           
protected  void addRemoveButton(com.arsdigita.bebop.Container c)
           
protected  void addSubmitButtons(com.arsdigita.bebop.Container c)
           
 void assignPurpose(com.arsdigita.bebop.PageState state, com.arsdigita.categorization.CategoryPurpose purpose)
          Assign a purpose, moving it from the list on the left to the list on the right
 PurposeForm.PurposeMap getAssignedPurposes(com.arsdigita.bebop.PageState s)
           
 com.arsdigita.bebop.form.Submit getCancelButton()
          Fetch the cancel button.
protected  void initAssignedPurposes(com.arsdigita.bebop.PageState state, PurposeForm.PurposeMap map)
          Populate a PurposeForm.PurposeMap with all purposes which are assigned to the catgegory.
 boolean isCancelled(com.arsdigita.bebop.PageState state)
           
 void process(com.arsdigita.bebop.event.FormSectionEvent e)
           
 void setAssignedCaption(String caption)
          Set the caption of the assigned categories label
 void setUnassignedCaption(String caption)
          Set the caption of the unassigned categories label
 void unassignPurpose(com.arsdigita.bebop.PageState state, com.arsdigita.categorization.CategoryPurpose purpose)
          Unassign a purpose, moving it from the list on the right to the list on the left
 void validate(com.arsdigita.bebop.event.FormSectionEvent e)
           
 
Methods inherited from class com.arsdigita.bebop.Form
addMagicTag, excludeParameterFromExport, generateErrors, generateXML, generateXMLSansState, getAction, getFormData, getName, getProcessInvisible, isRedirecting, process, register, respond, setAction, setEncType, setFormData, setMethod, setName, setOnReset, setOnSubmit, setProcessInvisible, setRedirecting, toString, traverse
 
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, get, getModel, getPanel, indexOf, isEmpty, lock, register, removeCancelListener, removeInitListener, removeProcessListener, removeSubmissionListener, removeValidationListener, size
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, 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, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.Component
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked
 

Field Detail

FREE

public static final String FREE
See Also:
Constant Field Values

ASSIGNED

public static final String ASSIGNED
See Also:
Constant Field Values

ASSIGN

public static final String ASSIGN
See Also:
Constant Field Values

REMOVE

public static final String REMOVE
See Also:
Constant Field Values

SELECT_WIDTH

public static final int SELECT_WIDTH
See Also:
Constant Field Values

SELECT_HEIGHT

public static final int SELECT_HEIGHT
See Also:
Constant Field Values

FILLER_OPTION

public static final String FILLER_OPTION
Constructor Detail

PurposeForm

public PurposeForm(CategoryRequestLocal category)
Construct a new PurposeForm component

Method Detail

addSubmitButtons

protected void addSubmitButtons(com.arsdigita.bebop.Container c)

addAssignButton

protected void addAssignButton(com.arsdigita.bebop.Container c)

addRemoveButton

protected void addRemoveButton(com.arsdigita.bebop.Container c)

setUnassignedCaption

public void setUnassignedCaption(String caption)
Set the caption of the unassigned categories label

Parameters:
caption - the new caption

setAssignedCaption

public void setAssignedCaption(String caption)
Set the caption of the assigned categories label

Parameters:
caption - the new caption

getAssignedPurposes

public PurposeForm.PurposeMap getAssignedPurposes(com.arsdigita.bebop.PageState s)
Parameters:
s - the page state
Returns:
a PurposeForm.PurposeMap of all assigned categories

initAssignedPurposes

protected void initAssignedPurposes(com.arsdigita.bebop.PageState state,
                                    PurposeForm.PurposeMap map)
Populate a PurposeForm.PurposeMap with all purposes which are assigned to the catgegory.

Parameters:
map - The sequential map of all purposes which are assigned to the current category.
state - The page state

assignPurpose

public void assignPurpose(com.arsdigita.bebop.PageState state,
                          com.arsdigita.categorization.CategoryPurpose purpose)
Assign a purpose, moving it from the list on the left to the list on the right

Parameters:
state - the page state
purpose - The purpsoe to add

unassignPurpose

public void unassignPurpose(com.arsdigita.bebop.PageState state,
                            com.arsdigita.categorization.CategoryPurpose purpose)
Unassign a purpose, moving it from the list on the right to the list on the left

Parameters:
state - the page state
purpose - The purpsoe to add

process

public void process(com.arsdigita.bebop.event.FormSectionEvent e)
             throws com.arsdigita.bebop.FormProcessException
Specified by:
process in interface com.arsdigita.bebop.event.FormProcessListener
Throws:
com.arsdigita.bebop.FormProcessException

validate

public void validate(com.arsdigita.bebop.event.FormSectionEvent e)
              throws com.arsdigita.bebop.FormProcessException
Specified by:
validate in interface com.arsdigita.bebop.event.FormValidationListener
Throws:
com.arsdigita.bebop.FormProcessException

getCancelButton

public com.arsdigita.bebop.form.Submit getCancelButton()
Fetch the cancel button.

Returns:
The cancel button

isCancelled

public boolean isCancelled(com.arsdigita.bebop.PageState state)
Specified by:
isCancelled in interface com.arsdigita.toolbox.ui.Cancellable


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