|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.uiinfrastructure.editor.EditorHelperModel com.plumtree.uiinfrastructure.expandablelist.ExpListModel
public abstract class ExpListModel
This class contains the state of the Expandable List. The data contained in that Model are printed out by the associated View: ExpListView. The repost actions will be handled by the ExpListControl class. That class extends the Editor Framework plug-in section classes so it can be added to any Editor page pretty easily. (see template 7) The Expandable List Framework is abstract and has to be extended in order to be used. Note that the Expandable List uses the Array Wrapper Framework to actually store the data and facilitate the implementation of the sorting requirements.
Field Summary | |
---|---|
static int |
EXPLIST_COLUMN_COLSPAN
Colspan for the HTML cell. |
static int |
EXPLIST_COLUMN_ENABLESORT
Flag to know if the link to sort by that column should be enabled. |
static int |
EXPLIST_COLUMN_ID
Key (as an Integer) to get back the column ID from m_arrExpListColInfo |
static int |
EXPLIST_COLUMN_INVALID
MES- Flag to know how many flags there are- how many columns |
static int |
EXPLIST_COLUMN_TITLE
Key (as a String) to get back the column title from m_arrExpListColInfo |
static int |
EXPLIST_COLUMN_WIDTH
Key (as a String) to get back the column width from m_arrExpListColInfo |
static int |
EXPLIST_SORTEDARRAY_PROPID_INDEX
We are defining here a column ID for the Growable Sorted Array objects. |
protected java.lang.Object[][] |
m_arrExpListColInfo
Array of column titles, associated column IDs and column width |
protected boolean |
m_bAddButtonDisabled
DCA - Variable to show add button or not. |
protected boolean |
m_bCheckBoxesDisabled
DCA - Variable to show check boxes or not. |
protected boolean |
m_bEnableMoveRowActions
Set this flag to true if you want to display the move up and down buttons at the end of each row. |
protected boolean |
m_bIsReadOnly
Special mode to have a read-only expandable list: all actions are hidden. |
protected boolean |
m_bWrapColumnHeaders
JF- Wrap attribute for the column headers |
protected PTImageType |
m_imgAddIcon
The add icon. |
protected PTImageType |
m_imgDeleteIcon
The delete icon. |
protected int |
m_nListKey
This key is used when there is more than one expandable list on the same Display Page. |
int |
m_nNextIndex
To keep track of the next available index. |
protected PTGrowableSortedArrayWrapper |
m_saData
This is where we store the data displayed on the list. |
protected java.lang.String |
m_sAddIconAlt
Alt text for the add icon. |
protected java.lang.String |
m_sAddLabel
Text to display next to the add icon. |
protected java.lang.String |
m_sDeleteIconAlt
Alt text for the delete icon. |
protected java.lang.String |
m_sDelRowConfirmMsg
JF- COnfirmation message to display when the user deletes a row. |
protected java.lang.String |
m_sEmptyListAlert
Message to display as a JavaScript alert if the list is empty. |
protected java.lang.String |
m_sInstructions
Instructions to display when the list is empty. |
protected java.lang.String |
m_sMainMessage
Main message to display when the list is empty (in red). |
protected java.lang.String |
m_sSectionTitle
The section main title. |
protected java.lang.String |
m_sTableInstructions
JF- List instructions. |
static int |
MAX_ROWS
Max number of items per page. |
static int |
MOVEACTION_DOWN
Will move the corresponding item one row down. |
static int |
MOVEACTION_FIRST
Will move the corresponding item to the top of the list. |
static int |
MOVEACTION_LAST
Will move the corres ponding item to the bottom of the list. |
static int |
MOVEACTION_UP
Will move the corresponding item one row up. |
protected AActivitySpace |
parent
Associated AS class |
Fields inherited from class com.plumtree.uiinfrastructure.editor.EditorHelperModel |
---|
m_asOwner |
Constructor Summary | |
---|---|
ExpListModel()
|
Method Summary | |
---|---|
abstract void |
AddRowsOnRepost(XPHashtable _htFormData)
Will be called each time the add action is performed. |
void |
DeleteRowsOnRepost(XPHashtable _htFormData)
Gets the array of checked rows and delete them from the list. |
void |
DisableAddButton()
DCA - Choose not to display add button |
void |
DisableCheckBoxes()
DCA - Disable check boxes. |
void |
EnablePagination(java.lang.String _sModelStorageName)
Enables the pagination. |
PTImageType |
GetAddIcon()
Returns icon for the add action. |
java.lang.String |
GetAddIconAlt()
Returns the alt text for the add icon. |
java.lang.String |
GetAddLabel()
Returns the String to display next to the add icon. |
java.lang.String |
GetAlertMessageForEmptyList()
Returns the message to display by the JavaScript when the list is empty. |
int[] |
GetArrayOfObjToDelete(XPHashtable _htFormData)
ROB: Make the available for other models. |
java.lang.Object[][] |
GetArrExpListColInfo()
Returns the array of column titles, associated column IDs and column width. |
int |
GetCurrentLowerObjectCount()
This method returns the current lower count for which objects to display. |
int |
GetCurrentUpperObjectCount()
This method returns the current upper count for which objects to display. |
PTImageType |
GetDeleteIcon()
Returns icon for the delete action. |
java.lang.String |
GetDeleteIconAlt()
Returns the alt text for the delete icon. |
java.lang.String |
GetDelRowConfirmMsg()
JF- Returns the confirmation message to display when the user tries to delete a row. |
java.lang.String |
GetEmptyListInstructions()
Returns the secondary String to display when the String is empty. |
java.lang.String |
GetEmptyListMainMessage()
Returns the main String to diplay when the list is empty. |
boolean |
GetEnableMoveRowActions()
Returns true if the move up and down buttons should be displayed. |
boolean |
GetIsListReadOnly()
Returns the value of the m_bIsReadOnly member variable. |
PTGrowableSortedArrayWrapper |
GetItems()
Returns the array of data. |
int |
GetListKey()
Returns the key of the expandable list. |
int |
GetMainColumnSort()
Returns the column ID of the primary sorted column. |
int |
GetMainColumnSortDirection()
Returns the sort direction of the primary sorted column. |
java.lang.String |
GetModelStorageName()
Returns the storage key of this Model. |
protected int |
GetMoveAction(XPHashtable _htFormData)
Helper method to retrieve the move action type from the form data. |
int |
GetNumObjects()
This method returns the total number of objects available for display. |
int |
GetPaginationSize()
This is the number of objects displayed per page. |
IPTGrowableSortedArrayWrapperRO |
GetReadOnlyItems()
Returns a read-only interface of the data. |
protected int |
GetRowIndex(XPHashtable _htFormData)
Helper method to retrieve the row index from the form data. |
java.lang.String |
GetSectionTitle()
Returns the section title. |
java.lang.String |
GetTableInstructions()
JF- Returns table intructions |
int |
GetUniqueInt(int _nValue)
Creates dynamically a unique int and returns it. |
java.lang.String |
GetUniqueString(java.lang.String _sName)
Creates dynamically a unique name with the list key and returns it. |
XPSortedDictionary |
GetUnusedProperties()
|
boolean |
GetWrapColumnHeaders()
JF- Returns the wrap attribute for the column headers. |
void |
InitializeExpandableList(java.lang.String _sSectionTitle,
java.lang.Object[][] _arrExpListColInfo,
PTImageType _imgAddIcon,
java.lang.String _sAddLabel,
int _nListKey)
Initializes the expandable list. |
void |
InitializeReadOnlyExpandableList(java.lang.String _sSectionTitle,
java.lang.Object[][] _arrExpListColInfo,
int _nListKey)
Initializes the read-only expandable list. |
abstract void |
InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
Will be called when this class is initalized. |
boolean |
IsAddButtonDisabled()
DCA - Check if add button is to be displayed |
boolean |
IsCheckBoxesDisabled()
DCA - Check to see if check boxes has been disabled. |
boolean |
IsPaginationEnabled()
Returns true if the pagination is enabled for this expandable list. |
void |
ModifyRow(XPHashtable _htFormData)
Action for modifying a row |
protected void |
MoveDown(int _nRowIndex)
Moves the row identified by the index in argument, one row down. |
protected void |
MoveFirst(int _nRowIndex)
Moves the row identified by the index in argument, to the top of the list. |
protected void |
MoveLast(int _nRowIndex)
Moves the row identified by the index in argument, to the last position of the list. |
void |
MoveRow(XPHashtable _htFormData)
Gets the row index back and the move action back. |
protected void |
MoveUp(int _nRowIndex)
Moves the row identified by the index in argument, one row up. |
void |
ReverseCurrentSort()
Reverses the sort of the primary sorted column. |
protected abstract int |
SaveRow(PTGrowableSortedArrayWrapper _saData,
int _nRowIndex,
XPHashtable _htFormData)
Will be called each ime there is a repost to save the data on the list. |
int |
SaveSection(XPHashtable _htFormData)
Saves the data when a repost occurs. |
void |
SetAddIcon(PTImageType _imgAddIcon)
The delete icon will be set by default to add.gif. |
void |
SetAddIconAlt(java.lang.String _sAddIconAlt)
Sets the value of the alt text for the add icon. |
void |
SetDeleteIcon(PTImageType _imgDeleteIcon)
The delete icon will be set by default to delete.gif. |
void |
SetDeleteIconAlt(java.lang.String _sDeleteIconAlt)
Sets the value of the alt text for the delete icon. |
void |
SetDelRowConfirmMsg(java.lang.String _sDelRowConfirmMsg)
JF- Sets the confirmation message to display when the user tried to delete a row. |
void |
SetEmptyListMessages(java.lang.String _sMainMessage,
java.lang.String _sInstructions)
Sets messages to display when the list is empty. |
java.lang.String |
SetEnableEmptyListClientValidation(java.lang.String _sEmptyListAlert)
Enable the JavaScript validation to ensure that the list is not empty. |
void |
SetEnableMoveRowActions(boolean _bEnableMoveRowActions)
Set this flag to true if you want to display the move up and down buttons at the end of each row. |
void |
SetIsListReadOnly(boolean _bIsReadOnly)
Changes the value of the m_bIsReadOnly member variable. |
void |
SetListKey(int _nListKey)
Sets a new value for this list key. |
void |
SetPagination(int nPaginationID,
int nPaginationLowerBound,
int nPaginationUpperBound)
This is used by the PaginationControl to set which objects should be displayed. |
void |
SetSectionTitle(java.lang.String _sSectionTitle)
Sets the section title. |
void |
SetTableInstructions(java.lang.String _sTableInstructions)
JF- Sets table intructions. |
void |
SetWrapColumnHeaders(boolean _bWrapColumnHeaders)
JF- Sets the wrap cell attribute for the column headers. |
void |
SortByColumn(XPHashtable _htFormData)
Gets the column ID back from the form data and resort the array by that column ID, ascending. |
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorHelperModel |
---|
CleanupAllData, CleanupTempData, Create, GetName, Init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IModel |
---|
CleanupAllData, CleanupTempData, Init |
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IManagedObject |
---|
Create |
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IMVCObject |
---|
GetName |
Field Detail |
---|
public static final int EXPLIST_COLUMN_ID
public static final int EXPLIST_COLUMN_TITLE
public static final int EXPLIST_COLUMN_WIDTH
public static final int EXPLIST_COLUMN_COLSPAN
public static final int EXPLIST_COLUMN_ENABLESORT
public static final int EXPLIST_COLUMN_INVALID
public static final int EXPLIST_SORTEDARRAY_PROPID_INDEX
public static final int MOVEACTION_FIRST
public static final int MOVEACTION_UP
public static final int MOVEACTION_DOWN
public static final int MOVEACTION_LAST
public int m_nNextIndex
protected AActivitySpace parent
protected PTGrowableSortedArrayWrapper m_saData
protected boolean m_bWrapColumnHeaders
protected PTImageType m_imgAddIcon
protected PTImageType m_imgDeleteIcon
protected java.lang.String m_sAddIconAlt
protected java.lang.String m_sAddLabel
protected java.lang.String m_sDeleteIconAlt
protected java.lang.String m_sEmptyListAlert
protected java.lang.String m_sInstructions
protected java.lang.String m_sMainMessage
protected java.lang.String m_sSectionTitle
protected java.lang.Object[][] m_arrExpListColInfo
protected boolean m_bAddButtonDisabled
protected boolean m_bCheckBoxesDisabled
protected boolean m_bEnableMoveRowActions
protected boolean m_bIsReadOnly
protected java.lang.String m_sTableInstructions
protected java.lang.String m_sDelRowConfirmMsg
protected int m_nListKey
public static final int MAX_ROWS
Constructor Detail |
---|
public ExpListModel()
Method Detail |
---|
public abstract void AddRowsOnRepost(XPHashtable _htFormData)
_htFormData
- Form datapublic void DeleteRowsOnRepost(XPHashtable _htFormData)
_htFormData
- public void DisableAddButton()
public void DisableCheckBoxes()
public void SetWrapColumnHeaders(boolean _bWrapColumnHeaders)
_bWrapColumnHeaders
- public boolean GetWrapColumnHeaders()
GetWrapColumnHeaders
in interface IExpListModelRO
GetWrapColumnHeaders()
public java.lang.String GetTableInstructions()
GetTableInstructions
in interface IExpListModelRO
com.plumtree.uiinfrastructure.expandablelist.ExpListModel#GetTableIntructions()
public void SetTableInstructions(java.lang.String _sTableInstructions)
_sTableInstructions
- public java.lang.String GetDelRowConfirmMsg()
GetDelRowConfirmMsg
in interface IExpListModelRO
GetWrapColumnHeaders()
public void SetDelRowConfirmMsg(java.lang.String _sDelRowConfirmMsg)
m_sDelRowConfirmMsg
- public PTImageType GetAddIcon()
GetAddIcon
in interface IExpListModelRO
GetAddIcon()
public java.lang.String GetAddIconAlt()
GetAddIconAlt
in interface IExpListModelRO
GetAddIconAlt()
public java.lang.String GetAddLabel()
GetAddLabel
in interface IExpListModelRO
GetAddLabel()
public java.lang.String GetAlertMessageForEmptyList()
GetAlertMessageForEmptyList
in interface IExpListModelRO
GetAlertMessageForEmptyList()
public java.lang.Object[][] GetArrExpListColInfo()
GetArrExpListColInfo
in interface IExpListModelRO
GetArrExpListColInfo()
public int[] GetArrayOfObjToDelete(XPHashtable _htFormData)
_htFormData
-
public PTImageType GetDeleteIcon()
GetDeleteIcon
in interface IExpListModelRO
GetDeleteIcon()
public java.lang.String GetDeleteIconAlt()
GetDeleteIconAlt
in interface IExpListModelRO
GetDeleteIconAlt()
public java.lang.String GetEmptyListInstructions()
GetEmptyListInstructions
in interface IExpListModelRO
GetEmptyListInstructions()
public java.lang.String GetEmptyListMainMessage()
GetEmptyListMainMessage
in interface IExpListModelRO
GetEmptyListMainMessage()
public boolean GetEnableMoveRowActions()
GetEnableMoveRowActions
in interface IExpListModelRO
GetEnableMoveRowActions()
public boolean GetIsListReadOnly()
GetIsListReadOnly
in interface IExpListModelRO
com.plumtree.uiinfrastructure.expandablelist.ExpListModel#GetListAccessFlag()
public PTGrowableSortedArrayWrapper GetItems()
public int GetListKey()
GetListKey
in interface IExpListModelRO
GetListKey()
public void SetListKey(int _nListKey)
_nListKey
- public int GetMainColumnSort()
GetMainColumnSort
in interface IExpListModelRO
GetMainColumnSort()
public int GetMainColumnSortDirection()
GetMainColumnSortDirection
in interface IExpListModelRO
GetMainColumnSortDirection()
public IPTGrowableSortedArrayWrapperRO GetReadOnlyItems()
GetReadOnlyItems
in interface IExpListModelRO
GetReadOnlyItems()
public java.lang.String GetSectionTitle()
GetSectionTitle
in interface IExpListModelRO
GetSectionTitle()
public int GetUniqueInt(int _nValue)
GetUniqueInt
in interface IExpListModelRO
_nValue
-
com.plumtree.uiinfrastructure.expandablelist.ExpListModel#GetUniqueInt()
public java.lang.String GetUniqueString(java.lang.String _sName)
GetUniqueString
in interface IExpListModelRO
_sName
-
com.plumtree.uiinfrastructure.expandablelist.ExpListModel#GetUniqueInputName()
public void InitializeExpandableList(java.lang.String _sSectionTitle, java.lang.Object[][] _arrExpListColInfo, PTImageType _imgAddIcon, java.lang.String _sAddLabel, int _nListKey)
_sSectionTitle
- Main title._arrExpListColInfo
- Information about columns: title, ID and
width._imgAddIcon
- Icon for the add action._sAddLabel
- Text to display next to the add icon._nListKey
- In case you have multiple Expandable Lists on the same
DP, they should have a different key (otherwise, just set it to
1).public void InitializeReadOnlyExpandableList(java.lang.String _sSectionTitle, java.lang.Object[][] _arrExpListColInfo, int _nListKey)
_sSectionTitle
- Main title._arrExpListColInfo
- Information about columns: title, ID and
width._nListKey
- In case you have multiple Expandable Lists on the same
DP, they should have a different key (otherwise, just set it to
1).public abstract void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
_saData
- public boolean IsAddButtonDisabled()
IsAddButtonDisabled
in interface IExpListModelRO
IsAddButtonDisabled()
public boolean IsCheckBoxesDisabled()
IsCheckBoxesDisabled
in interface IExpListModelRO
IsCheckBoxesDisabled()
public void ModifyRow(XPHashtable _htFormData)
_htFormData
- public void MoveRow(XPHashtable _htFormData)
_htFormData
- public void ReverseCurrentSort()
public int SaveSection(XPHashtable _htFormData)
SaveSection
in class EditorHelperModel
_htFormData
-
public void SetAddIcon(PTImageType _imgAddIcon)
__imgAddIcon
- public void SetAddIconAlt(java.lang.String _sAddIconAlt)
_sAddIconAlt
- public void SetDeleteIcon(PTImageType _imgDeleteIcon)
_imgDeleteIcon
- public void SetDeleteIconAlt(java.lang.String _sDeleteIconAlt)
_sDeleteIconAlt
- public void SetEmptyListMessages(java.lang.String _sMainMessage, java.lang.String _sInstructions)
_sMainMessage
- Main message to display in red._sInstructions
- Instructions on what to do.public java.lang.String SetEnableEmptyListClientValidation(java.lang.String _sEmptyListAlert)
_sEmptyListAlert
-
public void SetEnableMoveRowActions(boolean _bEnableMoveRowActions)
_bEnableMoveRowActions
- public void SetIsListReadOnly(boolean _bIsReadOnly)
_bIsReadOnly
- public void SetSectionTitle(java.lang.String _sSectionTitle)
_sSectionTitle
- public void SortByColumn(XPHashtable _htFormData)
_htFormData
- protected int GetMoveAction(XPHashtable _htFormData)
_htFormData
-
protected int GetRowIndex(XPHashtable _htFormData)
_htFormData
-
protected void MoveDown(int _nRowIndex)
_nRowIndex
- Index of the row to move.protected void MoveFirst(int _nRowIndex)
_nRowIndex
- Index of the row to move.protected void MoveLast(int _nRowIndex)
_nRowIndex
- Index of the row to move.protected void MoveUp(int _nRowIndex)
_nRowIndex
- Index of the row to move.protected abstract int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
_saData
- _nRowIndex
- _htFormData
-
public void SetPagination(int nPaginationID, int nPaginationLowerBound, int nPaginationUpperBound)
IPaginationModel
SetPagination
in interface IPaginationModel
nPaginationID
- Unique ID of objects to paginate (usually class
id) when there are multiple pagination sections per page.nPaginationLowerBound
- The starting count for objects to displaynPaginationUpperBound
- The ending count for objects to display.com.plumtree.uiinfrastructure.form.pagination.IPaginationModel#SetPagination()
public int GetCurrentLowerObjectCount()
IPaginationModelRO
GetCurrentLowerObjectCount
in interface IPaginationModelRO
IPaginationModelRO.GetCurrentLowerObjectCount()
public int GetCurrentUpperObjectCount()
IPaginationModelRO
GetCurrentUpperObjectCount
in interface IPaginationModelRO
IPaginationModelRO.GetCurrentUpperObjectCount()
public int GetNumObjects()
IPaginationModelRO
GetNumObjects
in interface IPaginationModelRO
IPaginationModelRO.GetNumObjects()
public int GetPaginationSize()
IPaginationModelRO
GetPaginationSize
in interface IPaginationModelRO
IPaginationModelRO.GetPaginationSize()
public java.lang.String GetModelStorageName()
GetModelStorageName
in interface IExpListModelRO
GetModelStorageName()
public void EnablePagination(java.lang.String _sModelStorageName)
_sModelStorageName
- Storage name of the Expandable List Model.public boolean IsPaginationEnabled()
IsPaginationEnabled
in interface IExpListModelRO
IsPaginationEnabled()
public XPSortedDictionary GetUnusedProperties()
GetUnusedProperties
in interface IExpListModelRO
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |