Java Doc for AddRemoveBase.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » component » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.component 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.rave.web.ui.component.SelectorBase
   com.sun.rave.web.ui.component.Selector
      com.sun.rave.web.ui.component.ListSelectorBase
         com.sun.rave.web.ui.component.ListSelector
            com.sun.rave.web.ui.component.AddRemoveBase

All known Subclasses:   com.sun.rave.web.ui.component.AddRemove,
AddRemoveBase
abstract public class AddRemoveBase extends com.sun.rave.web.ui.component.ListSelector (Code)

About this tag

This tag renders two listboxes (one for available options, one for selected options) together with buttons to move the options between the lists, and optionally to order the selected options. Use the items attribute to associate the component with an array, collection or map of com.sun.rave.web.ui.model.Option and the selected attribute to associate the component with a model object that represents the selected items. The model object must be an array of objects, whose values must be represented by the values on the com.sun.rave.web.ui.model.Options.

Component layout and Facet structure

The component can be laid out using either horizonal layout (the default) or vertical layout (if the vertical attribute is set to true). In the diagrams below, facet child components are shown as light blue. Non-facet areas are violet.

Horizontal layout

In horizontal layout, the component label (or header) may be shown either above the component (if the labelOnTopattribute is true) or next to the component as shown in the diagram.

header  
availableLabel
 
        addButton        
      addAllButton      
     removeButton     
   removeAllButton  
    moveUpButton    
  moveDownButton  
selectedLabel
 
footer
Vertical layout
header
availableLabel
        addButton                 addAllButton              removeButton           removeAllButton  
selectedLabel
    moveUpButton         moveDownButton  
footer

Facets

  • addButton: Use this facet to replace the standard "Add" button. If you use a facet to replace this component, the JSF ID of this component should be the ID given to the AddRemove component with _addButton appended at the end. If you wish to use the JavaScript function associated with the default button, use the add() function. See the section on JavaScript for details.
  • removeButton: Use this facet to replace the standard "Remove" button. If you use a facet to replace this component, the JSF ID of this component should be the ID given to the AddRemove component with _removeButton appended at the end. If you wish to use the JavaScript function associated with the default button, use the remove() function. See the section on JavaScript for details.
  • addAllButton: Use this facet to replace the standard "Add All" button. If you use a facet to replace this component, the JSF ID of this component should be the ID given to the AddRemove component with _addAllButton appended at the end. If you wish to use the JavaScript function associated with the default button, use the addAll() function. See the section on JavaScript for details.
  • removeAllButton: Use this facet to replace the standard "Remove All" button. If you use a facet to replace this component, the JSF ID of this component should be the ID given to the AddRemove component with _removeAllButton appended at the end. If you wish to use the JavaScript function associated with the default button, use the removeAll() function. See the section on JavaScript for details.
  • moveUpButton: Use this facet to replace the standard "Move Up" button. If you use a facet to replace this component, the JSF ID of this component should be the ID given to the AddRemove component with _moveUpButton appended at the end. If you wish to use the JavaScript function associated with the default button, use the moveUp() function. See the section on JavaScript for details.
  • moveDownButton: Use this facet to replace the standard "Move Down" button. If you use a facet to replace this component, the JSF ID of this component should be the ID given to the AddRemove component with _moveDownButton appended at the end. If you wish to use the JavaScript function associated with the default button, use the moveDown() function. See the section on JavaScript for details.
  • header: Use this facet to create a header for the component. The facet will replace the component label.
  • footer: Use this facet to create a footer for the component.

Client-side JavaScript functions

When the component is rendered, a JavaScript object corresponding to the component is created. The name of the variable is AddRemove_ followed by the component's DOM id where the colons have been replaced by underscores. For example, if the id of the component is listform:addremove then the JavaScript variable name will be AddRemove_listform_addremove. To manipulate the component on the client side, you may invoke functions on the JavaScript object. With reference to the id above, to add all elements on the available list that the user has selected, invoke AddRemove_listform_addremove.add().

  • add(): the highlighted items on the available list are moved to the selected list.
  • addAll(): all non-disabled items on the available list are moved to the selected list.
  • remove(): the highlighted items on the selected list are moved to the available list.
  • removeAll(): all non-disabled items on the selected list are moved to the available list.
  • moveUp(): the highlighted items on the selected list are moved up one position.
  • moveDown(): the highlighted items on the selected list are moved down one position.
  • updateButtons(): this function ensures that the buttons are enabled/disabled based on the current selections in the lists. Invoke this function if you programmatically modify the selections on the available or selected list using client-side scripts. You do not need to invoke it when using any of the functions listed above, as they already invoke this function at the end.

Configuring the AddRemove tag

Examples

The component gets the options from a managed bean called AirportBean. The selections are stored in another managed bean (AirportSelectionBean). The selectAll attribute indicates that the Add All and Remove All buttons should be shown. A label for the component as a whole (label) is shown next to the component (labelOnTop is false). Labels have been specified for the list of available items and for the list of selected items. The sorted attribute indicates that the options on the list will be shown in alphabetical order.

 <ui:addRemove id="list"
 items="#{AirportBean.airports}"
 selected="#{AirportSelectionBean.airportSel}"
 label="Select airports"
 availableItemsLabel="Available Airports"
 selectedItemsLabel="Selected Airports"
 selectAll="true"
 sorted="true"
 labelOnTop="false"/>
 

As in the previous example, with the following exceptions: The component is rendered using vertical layout (in this case, the main component label is always rendered above the component). The moveButtons attribute indicates that the Move Up and Move Down buttons should be shown.

 
 <ui:addRemove id="list"
 items="#{AirportBean.airports}"
 selected="#{AirportSelectionBean.airportSel}"
 label="Select some names"
 availableItemsLabel="Available Names"
 selectedItemsLabel="Selected Names"
 selectAll="true"
 moveButtons="true"
 vertical="true"/>
 

Auto-generated component class. Do NOT modify; all changes will be lost!




Constructor Summary
public  AddRemoveBase()
    

Method Summary
public  StringgetAvailableItemsLabel()
    
public  StringgetFamily()
    

Return the identifier of the component family to which this component belongs.

public  StringgetSelectedItemsLabel()
    
public  StringgetToolTip()
    
public  booleanisDuplicateSelections()
    
public  booleanisMoveButtons()
    
public  booleanisSelectAll()
    
public  booleanisSorted()
    

If true, the items on the available options list are shown in alphabetical order.

public  booleanisVertical()
    
public  voidrestoreState(FacesContext _context, Object _state)
    
public  ObjectsaveState(FacesContext _context)
    
public  voidsetAvailableItemsLabel(String availableItemsLabel)
    
public  voidsetDuplicateSelections(boolean duplicateSelections)
    
public  voidsetMoveButtons(boolean moveButtons)
    
public  voidsetSelectAll(boolean selectAll)
    
public  voidsetSelectedItemsLabel(String selectedItemsLabel)
    
public  voidsetSorted(boolean sorted)
    

If true, the items on the available options list are shown in alphabetical order.

public  voidsetToolTip(String toolTip)
    
public  voidsetVertical(boolean vertical)
    


Constructor Detail
AddRemoveBase
public AddRemoveBase()(Code)

Construct a new AddRemoveBase.





Method Detail
getAvailableItemsLabel
public String getAvailableItemsLabel()(Code)

The label for the available list




getFamily
public String getFamily()(Code)

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.




getSelectedItemsLabel
public String getSelectedItemsLabel()(Code)

The label for the selected list




getToolTip
public String getToolTip()(Code)

Display the text as a tooltip for this component




isDuplicateSelections
public boolean isDuplicateSelections()(Code)

Set this attribute to true if the component should allow items from the available list to be added more than one to the selected list, that is, if the selected list should allow duplicate entries.




isMoveButtons
public boolean isMoveButtons()(Code)

Show the Move Up and Move Down buttons




isSelectAll
public boolean isSelectAll()(Code)

Show the Add All and Remove All buttons




isSorted
public boolean isSorted()(Code)

If true, the items on the available options list are shown in alphabetical order. The item on the selected options list are also shown in alphabetical order, unless the moveButtons attribute is true, in which case the user is expected to order the elements.




isVertical
public boolean isVertical()(Code)

Use vertical layout instead of the default horizontal one




restoreState
public void restoreState(FacesContext _context, Object _state)(Code)

Restore the state of this component.




saveState
public Object saveState(FacesContext _context)(Code)

Save the state of this component.




setAvailableItemsLabel
public void setAvailableItemsLabel(String availableItemsLabel)(Code)

The label for the available list


See Also:   AddRemoveBase.getAvailableItemsLabel()



setDuplicateSelections
public void setDuplicateSelections(boolean duplicateSelections)(Code)

Set this attribute to true if the component should allow items from the available list to be added more than one to the selected list, that is, if the selected list should allow duplicate entries.


See Also:   AddRemoveBase.isDuplicateSelections()



setMoveButtons
public void setMoveButtons(boolean moveButtons)(Code)

Show the Move Up and Move Down buttons


See Also:   AddRemoveBase.isMoveButtons()



setSelectAll
public void setSelectAll(boolean selectAll)(Code)

Show the Add All and Remove All buttons


See Also:   AddRemoveBase.isSelectAll()



setSelectedItemsLabel
public void setSelectedItemsLabel(String selectedItemsLabel)(Code)

The label for the selected list


See Also:   AddRemoveBase.getSelectedItemsLabel()



setSorted
public void setSorted(boolean sorted)(Code)

If true, the items on the available options list are shown in alphabetical order. The item on the selected options list are also shown in alphabetical order, unless the moveButtons attribute is true, in which case the user is expected to order the elements.


See Also:   AddRemoveBase.isSorted()



setToolTip
public void setToolTip(String toolTip)(Code)

Display the text as a tooltip for this component


See Also:   AddRemoveBase.getToolTip()



setVertical
public void setVertical(boolean vertical)(Code)

Use vertical layout instead of the default horizontal one


See Also:   AddRemoveBase.isVertical()



Fields inherited from com.sun.rave.web.ui.component.ListSelector
final public static String LIST_ID(Code)(Java Doc)
final public static String VALUE_ID(Code)(Java Doc)
protected ArrayList listItems(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.ListSelector
public void checkSelectionModel(FacesContext context)(Code)(Java Doc)
protected ListItem createListItem(Option si)(Code)(Java Doc)
public UIComponent getLabelComponent()(Code)(Java Doc)
public Iterator getListItems(FacesContext context, boolean rulerAtEnd) throws FacesException(Code)(Java Doc)
public Iterator getListItems() throws FacesException(Code)(Java Doc)
protected Option[] getOptions()(Code)(Java Doc)
public String getPrimaryElementID(FacesContext context)(Code)(Java Doc)
public UIComponent getReadOnlyValueComponent()(Code)(Java Doc)
public int getSeparatorLength()(Code)(Java Doc)
public String getValueAsReadOnly(FacesContext context, String separator)(Code)(Java Doc)
public String[] getValueAsStringArray(FacesContext context)(Code)(Java Doc)
public boolean mainListSubmits()(Code)(Java Doc)
protected void markSelectedListItems(java.util.List list, boolean processed)(Code)(Java Doc)
protected void processOptions(Option[] options)(Code)(Java Doc)
protected void processSelections()(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.ListSelectorBase
public String getFamily()(Code)(Java Doc)
public int getRows()(Code)(Java Doc)
public boolean isLabelOnTop()(Code)(Java Doc)
public boolean isSeparators()(Code)(Java Doc)
public boolean isVisible()(Code)(Java Doc)
public void restoreState(FacesContext _context, Object _state)(Code)(Java Doc)
public Object saveState(FacesContext _context)(Code)(Java Doc)
public void setLabelOnTop(boolean labelOnTop)(Code)(Java Doc)
public void setRows(int rows)(Code)(Java Doc)
public void setSeparators(boolean separators)(Code)(Java Doc)
public void setVisible(boolean visible)(Code)(Java Doc)

Fields inherited from com.sun.rave.web.ui.component.Selector
protected ValueTypeEvaluator valueTypeEvaluator(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.Selector
protected boolean compareValues(Object previous, Object value)(Code)(Java Doc)
public Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException(Code)(Java Doc)
public int getLabelLevel()(Code)(Java Doc)
public boolean getRendersChildren()(Code)(Java Doc)
protected String getValueAsReadOnly(FacesContext context)(Code)(Java Doc)
public boolean isMultiple()(Code)(Java Doc)
static void log(String s, Object o)(Code)(Java Doc)
void log(String s)(Code)(Java Doc)
public void setMultiple(boolean multiple)(Code)(Java Doc)
public void setSelected(Object selected)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.SelectorBase
public String getFamily()(Code)(Java Doc)
public Object getItems()(Code)(Java Doc)
public String getLabel()(Code)(Java Doc)
public int getLabelLevel()(Code)(Java Doc)
public String getOnBlur()(Code)(Java Doc)
public String getOnChange()(Code)(Java Doc)
public String getOnClick()(Code)(Java Doc)
public String getOnDblClick()(Code)(Java Doc)
public String getOnFocus()(Code)(Java Doc)
public String getOnKeyDown()(Code)(Java Doc)
public String getOnKeyPress()(Code)(Java Doc)
public String getOnKeyUp()(Code)(Java Doc)
public String getOnMouseDown()(Code)(Java Doc)
public String getOnMouseMove()(Code)(Java Doc)
public String getOnMouseOut()(Code)(Java Doc)
public String getOnMouseOver()(Code)(Java Doc)
public String getOnMouseUp()(Code)(Java Doc)
public String getOnSelect()(Code)(Java Doc)
public Object getSelected()(Code)(Java Doc)
public String getStyle()(Code)(Java Doc)
public String getStyleClass()(Code)(Java Doc)
public int getTabIndex()(Code)(Java Doc)
public String getToolTip()(Code)(Java Doc)
public ValueBinding getValueBinding(String name)(Code)(Java Doc)
public boolean isDisabled()(Code)(Java Doc)
public boolean isReadOnly()(Code)(Java Doc)
public boolean isVisible()(Code)(Java Doc)
public void restoreState(FacesContext _context, Object _state)(Code)(Java Doc)
public Object saveState(FacesContext _context)(Code)(Java Doc)
public void setDisabled(boolean disabled)(Code)(Java Doc)
public void setItems(Object items)(Code)(Java Doc)
public void setLabel(String label)(Code)(Java Doc)
public void setLabelLevel(int labelLevel)(Code)(Java Doc)
public void setOnBlur(String onBlur)(Code)(Java Doc)
public void setOnChange(String onChange)(Code)(Java Doc)
public void setOnClick(String onClick)(Code)(Java Doc)
public void setOnDblClick(String onDblClick)(Code)(Java Doc)
public void setOnFocus(String onFocus)(Code)(Java Doc)
public void setOnKeyDown(String onKeyDown)(Code)(Java Doc)
public void setOnKeyPress(String onKeyPress)(Code)(Java Doc)
public void setOnKeyUp(String onKeyUp)(Code)(Java Doc)
public void setOnMouseDown(String onMouseDown)(Code)(Java Doc)
public void setOnMouseMove(String onMouseMove)(Code)(Java Doc)
public void setOnMouseOut(String onMouseOut)(Code)(Java Doc)
public void setOnMouseOver(String onMouseOver)(Code)(Java Doc)
public void setOnMouseUp(String onMouseUp)(Code)(Java Doc)
public void setOnSelect(String onSelect)(Code)(Java Doc)
public void setReadOnly(boolean readOnly)(Code)(Java Doc)
public void setSelected(Object selected)(Code)(Java Doc)
public void setStyle(String style)(Code)(Java Doc)
public void setStyleClass(String styleClass)(Code)(Java Doc)
public void setTabIndex(int tabIndex)(Code)(Java Doc)
public void setToolTip(String toolTip)(Code)(Java Doc)
public void setValueBinding(String name, ValueBinding binding)(Code)(Java Doc)
public void setVisible(boolean visible)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.