Class AbstractFilePickList<T extends IFilePickItem>
- java.lang.Object
-
- org.pentaho.mantle.client.solutionbrowser.filepicklist.AbstractFilePickList<T>
-
- Direct Known Subclasses:
FavoritePickList
,RecentPickList
public abstract class AbstractFilePickList<T extends IFilePickItem> extends Object
-
-
Constructor Summary
Constructors Constructor Description AbstractFilePickList()
AbstractFilePickList(com.google.gwt.json.client.JSONArray jsonFilePickList)
AbstractFilePickList(ArrayList<T> filePickList)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(int index, T pickListItem)
If the object is already in the list it will be removed first and the index adjusted accordingly.void
add(T pickListItem)
void
addPickListListener(IFilePickListListener<T> listener)
void
clear()
abstract boolean
contains(String fileNameWithPath)
boolean
contains(T pickListItem)
void
fireItemsChangedEvent()
ArrayList<T>
getFilePickList()
int
getMaxSize()
void
reloadFavorites(T pickListItem, String command)
void
reloadRecents(T pickListItem, String command)
T
remove(int index)
void
remove(T pickListItem)
void
removePickListListener(IFilePickListListener<T> listener)
void
save(String settingName)
Convert the FilePickList to JSON and save it to a user settingvoid
setFilePickList(ArrayList<T> filePickList)
void
setMaxSize(int maxSize)
int
size()
String
stringify()
com.google.gwt.json.client.JSONArray
toJson()
String
toString()
helper method for debugging.
-
-
-
Method Detail
-
contains
public abstract boolean contains(String fileNameWithPath)
-
toJson
public com.google.gwt.json.client.JSONArray toJson()
- Returns:
- JSONArray representation of list suitable for storage
-
size
public int size()
-
add
public void add(T pickListItem)
-
add
public void add(int index, T pickListItem)
If the object is already in the list it will be removed first and the index adjusted accordingly. If maxSize is positive and adding the item would exceed maxSize, then the item will not be added.- Parameters:
index
-pickListItem
-
-
remove
public void remove(T pickListItem)
-
remove
public T remove(int index)
-
clear
public void clear()
-
contains
public boolean contains(T pickListItem)
-
fireItemsChangedEvent
public void fireItemsChangedEvent()
-
addPickListListener
public void addPickListListener(IFilePickListListener<T> listener)
-
removePickListListener
public void removePickListListener(IFilePickListListener<T> listener)
-
stringify
public String stringify()
- Returns:
- serialize to JSON String suitable for storage
-
toString
public String toString()
helper method for debugging. Usestringify()
for formal JSON conversion.
-
getMaxSize
public int getMaxSize()
- Returns:
- the maxSize
-
setMaxSize
public void setMaxSize(int maxSize)
- Parameters:
maxSize
- Set Maximum number of entries in list, 0 = unlimited
-
save
public void save(String settingName)
Convert the FilePickList to JSON and save it to a user setting- Parameters:
settingName
-
-
-