org.alfresco.web.ui.repo.component
Class UIMultiValueEditor

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by org.alfresco.web.ui.repo.component.UIMultiValueEditor
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class UIMultiValueEditor
extends javax.faces.component.UIInput

This component wraps a standard component to give it multi value capabilities. A list of existing values are available, items can be removed from this list or new items added to the list. To add new items the component dynamically shows the child component this one wraps.


Nested Class Summary
static class UIMultiValueEditor.MultiValueEditorEvent
          Class representing an action relevant to the ChildAssociationEditor component.
 
Field Summary
static int ACTION_ADD
           
static int ACTION_NONE
           
static int ACTION_REMOVE
           
static int ACTION_SELECT
           
static java.lang.String ACTION_SEPARATOR
           
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Constructor Summary
UIMultiValueEditor()
          Default constructor
 
Method Summary
 void broadcast(javax.faces.event.FacesEvent event)
           
 void encodeChildren(javax.faces.context.FacesContext context)
           
 boolean getAddingNewItem()
          Determines whether the component is adding a new item
 java.lang.String getFamily()
           
 java.lang.Object getLastItemAdded()
          Returns the last item added by the user
 java.lang.String getNoSelectedItemsMsg()
          Returns the message to display when no items have been selected, if one hasn't been set it defaults to the message in the bundle under key 'no_selected_items'.
 boolean getReadOnly()
          Determines whether the component is in read only mode
 boolean getRendersChildren()
           
 java.lang.String getSelectedItemsMsg()
          Returns the message to display for the selected items, if one hasn't been set it defaults to the message in the bundle under key 'selected_items'.
 java.lang.String getSelectItemMsg()
          Returns the message to display for select an item, if one hasn't been set it defaults to the message in the bundle under key 'select_an_item'.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setLastItemAdded(java.lang.Object lastItemAdded)
          Sets the last item to be added by the user
 void setNoSelectedItemsMsg(java.lang.String noSelectedItemsMsg)
          Sets the no selected items message to display in the UI
 void setReadOnly(boolean readOnly)
          Sets the read only mode for the component
 void setSelectedItemsMsg(java.lang.String selectedItemsMsg)
          Sets the selected items message to display in the UI
 void setSelectItemMsg(java.lang.String selectItemMsg)
          Sets the select an item message to display in the UI
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getSubmittedValue, getValidator, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, setConverter
 

Field Detail

ACTION_SEPARATOR

public static final java.lang.String ACTION_SEPARATOR
See Also:
Constant Field Values

ACTION_NONE

public static final int ACTION_NONE
See Also:
Constant Field Values

ACTION_REMOVE

public static final int ACTION_REMOVE
See Also:
Constant Field Values

ACTION_SELECT

public static final int ACTION_SELECT
See Also:
Constant Field Values

ACTION_ADD

public static final int ACTION_ADD
See Also:
Constant Field Values
Constructor Detail

UIMultiValueEditor

public UIMultiValueEditor()
Default constructor

Method Detail

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class javax.faces.component.UIInput
See Also:
UIComponent.getFamily()

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIInput
See Also:
StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIInput
See Also:
StateHolder.saveState(javax.faces.context.FacesContext)

getLastItemAdded

public java.lang.Object getLastItemAdded()
Returns the last item added by the user

Returns:
The last item added

setLastItemAdded

public void setLastItemAdded(java.lang.Object lastItemAdded)
Sets the last item to be added by the user

Parameters:
lastItemAdded - The last item added

getSelectedItemsMsg

public java.lang.String getSelectedItemsMsg()
Returns the message to display for the selected items, if one hasn't been set it defaults to the message in the bundle under key 'selected_items'.

Returns:
The message

setSelectedItemsMsg

public void setSelectedItemsMsg(java.lang.String selectedItemsMsg)
Sets the selected items message to display in the UI

Parameters:
selectedItemsMsg - The message

getNoSelectedItemsMsg

public java.lang.String getNoSelectedItemsMsg()
Returns the message to display when no items have been selected, if one hasn't been set it defaults to the message in the bundle under key 'no_selected_items'.

Returns:
The message

setNoSelectedItemsMsg

public void setNoSelectedItemsMsg(java.lang.String noSelectedItemsMsg)
Sets the no selected items message to display in the UI

Parameters:
noSelectedItemsMsg - The message

getSelectItemMsg

public java.lang.String getSelectItemMsg()
Returns the message to display for select an item, if one hasn't been set it defaults to the message in the bundle under key 'select_an_item'.

Returns:
The message

setSelectItemMsg

public void setSelectItemMsg(java.lang.String selectItemMsg)
Sets the select an item message to display in the UI

Parameters:
selectItemMsg - The message

getReadOnly

public boolean getReadOnly()
Determines whether the component is in read only mode

Returns:
true if the component is in read only mode

setReadOnly

public void setReadOnly(boolean readOnly)
Sets the read only mode for the component

Parameters:
readOnly - true to set read only mode

getAddingNewItem

public boolean getAddingNewItem()
Determines whether the component is adding a new item

Returns:
true if we are adding a new item

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Overrides:
broadcast in class javax.faces.component.UIInput
Throws:
javax.faces.event.AbortProcessingException
See Also:
UIComponent.broadcast(javax.faces.event.FacesEvent)

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context)
                    throws java.io.IOException
Overrides:
encodeChildren in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.component.UIComponentBase
See Also:
UIComponent.getRendersChildren()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.