|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICPListIterator
Iterator interface for iterating through entries This iterator interface uses the .net style iterator where the index of the iterator starts at -1. A call to Next() is required to advance to the first element. Example use: while (iter.Next()) { Object entry = iter.GetEntry(); } The interface is implemented by two different types of classes. First, ASCompoundList, which is used by the NavigationModel when creating lists of links. These are the same lists that are returneed from methods on the different NavigationPages. They are populated by ListEntry object, objects that store different parts of a link, such as page id, community id, label or image. Cast the result from GetEntry or GetEntryAtIndex to ListEntry. Example: Getting the Community ID from every community a user is member of CommunityNavPage commP = (CommunityNavPage)m_model.GetPageSpecificMethods(); ICPListIterator cpList = commP.GetMyCommunities(false); // only communities, no actions while ( cpList.Next() ) { ListEntry entry = (ListEntry)cpList.GetEntry(); int nCommunityID = entry.GetCommunityID() ... } The second type of classes are the mediators. Mediators are simply helper classes that formats an ListEntry objects from an ICPListIterator list to a specific format. For example, CListURLFullLinkMediator creates HTMLAnchor objects with image, label and url for each link. Example: CommunityNavPage commP = (CommunityNavPage)m_model.GetPageSpecificMethods(); ICPListIterator cpList = commP.GetMyCommunities(true); // both actions and communities ICPListIterator mediator = new CListURLFullLinkMediator(m_asOwner, cpList); mediator.SetLabelMaxLength(50); //set the maximum label length to 50 characters while (mediator.Next()) { HTMLAnchor anchor = (HTMLAnchor) mediator.GetEntry(); ... }
ASCompoundList
,
NavigationPage
,
ListEntry
,
CListURLTemplateLinkMediator
,
CListURLFullLinkMediator
Method Summary | |
---|---|
java.lang.Object |
GetEntry()
Get the current entry in the list. |
java.lang.Object |
GetEntryAtIndex(int nIndex)
Get the entry at a specific index |
ICPListEntryIterator |
GetList()
Get an iterator, the index is set to before the first element, call Next() to advance to first entry. |
boolean |
Next()
Advances the iterator to next element. |
void |
SetLabelMaxLength(int nMaxLength)
Set the truncation width for all subsequent entries, can be altered between entries during an iteration |
void |
SetShowImages(boolean bShow)
Set to display images for subsequent entries in the list, can be altered between entries during an iteration |
Method Detail |
---|
java.lang.Object GetEntry()
java.lang.Object GetEntryAtIndex(int nIndex)
nIndex
- Index of the entry
ICPListEntryIterator GetList()
boolean Next()
void SetLabelMaxLength(int nMaxLength)
nMaxLength
- Character position to truncate atvoid SetShowImages(boolean bShow)
bShow
- true to show images (default), false to no show images in entries
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |