com.wewebu.ow.server.app
Class OwDefaultComboModel

java.lang.Object
  extended by com.wewebu.ow.server.app.OwDefaultComboModel
All Implemented Interfaces:
OwComboModel

public class OwDefaultComboModel
extends Object
implements OwComboModel

Default implementation for combo box model.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.0.0.0

Field Summary
 
Fields inherited from interface com.wewebu.ow.server.app.OwComboModel
EMPTY_VALUE
 
Constructor Summary
OwDefaultComboModel(boolean allowEmptyItem_p, boolean allowNotInList_p, String value_p, List items_p)
          Constructor
OwDefaultComboModel(boolean allowEmptyItem_p, boolean allowNotInList_p, String value_p, List items_p, String emptyDisplayValue_p)
          Constructor
OwDefaultComboModel(boolean allowEmptyItem_p, boolean allowNotInList_p, String value_p, String[] values_p, String[] displayNames_p)
          Constructor
OwDefaultComboModel(boolean allowEmptyItem_p, boolean allowNotInList_p, String value_p, String[] values_p, String[] displayNames_p, String emptyDisplayValue_p)
          Constructor
OwDefaultComboModel(String value_p, List items_p)
          Constructor
OwDefaultComboModel(String value_p, String[] values_p, String[] displayNames_p)
          Constructor
 
Method Summary
 OwComboItem[] getAllItems()
          Get all items.
 OwComboItem getItemAt(int position_p)
          Return the OwComboItem object at the specified position.
 OwComboItem getSelectedItem()
          Return the selected OwComboItem object.
 int getSize()
          Get the number of items in this model.
 boolean hasItemOutOfRange()
          Specify if the model has an item that is out of range.
 boolean isSelectedItem(OwComboItem item_p)
          Check if the given item is the selected one.
 void setSelectedItem(OwComboItem item_p)
          Set the given item as selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwDefaultComboModel

public OwDefaultComboModel(String value_p,
                           String[] values_p,
                           String[] displayNames_p)
Constructor

Parameters:
value_p - - the selected value.
values_p - - the array of available values.
displayNames_p - - the array of available display values.

OwDefaultComboModel

public OwDefaultComboModel(boolean allowEmptyItem_p,
                           boolean allowNotInList_p,
                           String value_p,
                           String[] values_p,
                           String[] displayNames_p,
                           String emptyDisplayValue_p)
Constructor

Parameters:
allowEmptyItem_p - - flag that specify if empty item is allowed.
allowNotInList_p - - flag that specify if items that are not item list are allowed.
value_p - - the selected value.
values_p - - the array of available values.
displayNames_p - - the array of available display values.
emptyDisplayValue_p - - the display value for empty item.

OwDefaultComboModel

public OwDefaultComboModel(boolean allowEmptyItem_p,
                           boolean allowNotInList_p,
                           String value_p,
                           String[] values_p,
                           String[] displayNames_p)
Constructor

Parameters:
allowEmptyItem_p - - flag that specify if empty item is allowed.
allowNotInList_p - - flag that specify if items that are not item list are allowed.
value_p - - the selected value.
values_p - - the array of available values.
displayNames_p - - the array of available display values.

OwDefaultComboModel

public OwDefaultComboModel(boolean allowEmptyItem_p,
                           boolean allowNotInList_p,
                           String value_p,
                           List items_p,
                           String emptyDisplayValue_p)
Constructor

Parameters:
allowEmptyItem_p - - flag that specify if empty item is allowed.
allowNotInList_p - - flag that specify if items that are not item list are allowed.
value_p - - the selected value.
items_p - - the list with OwComboItem objects.
emptyDisplayValue_p - - the display value for empty item.

OwDefaultComboModel

public OwDefaultComboModel(boolean allowEmptyItem_p,
                           boolean allowNotInList_p,
                           String value_p,
                           List items_p)
Constructor

Parameters:
allowEmptyItem_p - - flag that specify if empty item is allowed.
allowNotInList_p - - flag that specify if items that are not item list are allowed.
value_p - - the selected value.
items_p - - the list with OwComboItem objects.

OwDefaultComboModel

public OwDefaultComboModel(String value_p,
                           List items_p)
Constructor

Parameters:
value_p - - the selected value.
items_p - - the list with OwComboItem objects.
Method Detail

getAllItems

public OwComboItem[] getAllItems()
Description copied from interface: OwComboModel
Get all items.

Specified by:
getAllItems in interface OwComboModel
Returns:
- an array of OwComboItem objects.

getItemAt

public OwComboItem getItemAt(int position_p)
Description copied from interface: OwComboModel
Return the OwComboItem object at the specified position. Can be null.

Specified by:
getItemAt in interface OwComboModel
Parameters:
position_p - - the position in the list

getSelectedItem

public OwComboItem getSelectedItem()
Description copied from interface: OwComboModel
Return the selected OwComboItem object. Can be null.

Specified by:
getSelectedItem in interface OwComboModel

getSize

public int getSize()
Description copied from interface: OwComboModel
Get the number of items in this model.

Specified by:
getSize in interface OwComboModel
Returns:
the number of items.

hasItemOutOfRange

public boolean hasItemOutOfRange()
Description copied from interface: OwComboModel
Specify if the model has an item that is out of range. E.g: if a choice list has 3 values in the ECM, and one of the values is stored as a property for an object, and than the stored value is removed from choice list, that value is no longer in the choice range.

Specified by:
hasItemOutOfRange in interface OwComboModel
Returns:
true if this model has an item out of range.

isSelectedItem

public boolean isSelectedItem(OwComboItem item_p)
Description copied from interface: OwComboModel
Check if the given item is the selected one.

Specified by:
isSelectedItem in interface OwComboModel
Parameters:
item_p - - the given OwComboItem object
Returns:
- true if the given item is selected.

setSelectedItem

public void setSelectedItem(OwComboItem item_p)
Description copied from interface: OwComboModel
Set the given item as selected.

Specified by:
setSelectedItem in interface OwComboModel
Parameters:
item_p - - the OwComboItem


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.