Enum OneClickListManager
- All Implemented Interfaces:
Workspace
,Serializable
,Comparable<OneClickListManager>
,java.lang.constant.Constable
public enum OneClickListManager extends Enum<OneClickListManager> implements Workspace
Singleton class to manage global lists that can be used globally across
many tables. This class also provides for notification of changes to the
underlying lists.
Note: Currently only string lists are supported
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OneClickListManager.ListEventSource
static interface
OneClickListManager.OneClickManagerListener
Listener contract for changes to underlying lists -
Enum Constant Summary
Enum Constants Enum Constant Description DEFAULT
-
Method Summary
Modifier and Type Method Description void
addList(String listName, Collection<String> listContents)
Add a list to the collection with unpinned and unsorted attributesvoid
addList(String listName, Collection<String> listContents, boolean pinned, boolean sorted, boolean upperCase, OneClickListManager.ListEventSource source)
Add a new list to the managed set.void
addList(String listName, Collection<String> listContents, boolean pinned, boolean sorted, OneClickListManager.ListEventSource source)
Add a new list to the managed set.void
addList(String listName, Collection<String> listContents, OneClickListManager.ListEventSource listEventSource)
Add a list to the collection with unpinned and unsorted attributesvoid
addListener(OneClickListManager.OneClickManagerListener listener)
Register for notification of change to the underlying listsorg.jdom2.Element
exportShare(Collection<OneClickList> lists)
Exports for a shareable workspace.OneClickList
getList(String listName)
Get the list associated with a particular name, or null if no set with that name existedCollection<String>
getListNames()
Get a collection of all the list names that are currently maintainedCollection<OneClickList>
getLists()
Get all the lists that are currently maintainedorg.jdom2.Element
getWorkspaceInfo()
Serialize the class into an element to be stored in the workspacevoid
importShare(org.jdom2.Element workspaceInfo)
Imports one click lists from a shared workspace.void
removeList(String listName)
Remove a list from the set of managed lists.void
removeList(String listName, OneClickListManager.ListEventSource source)
Remove a list from the set of managed lists.void
removeListener(OneClickListManager.OneClickManagerListener listener)
Deregister for notification of change to the underlying listsvoid
renameList(String origName, String newName, OneClickListManager.ListEventSource source)
Rename a list and notify observersvoid
setListPinned(String listName, boolean pinned)
Set the Pinned state of a list.void
setListPinned(String listName, boolean pinned, OneClickListManager.ListEventSource source)
Set the Pinned state of a list.void
setListSorted(String listName, boolean sorted)
void
setListSorted(String listName, boolean sorted, OneClickListManager.ListEventSource source)
Mark if the list is sorted or not.void
setWorkspaceInfo(org.jdom2.Element workspaceInfo)
Restore the class to the state defined by the data persisted in workspaceInfostatic OneClickListManager
valueOf(String name)
Returns the enum constant of this type with the specified name.static OneClickListManager[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
addListener
Register for notification of change to the underlying lists- Parameters:
listener
- The observer to notify of changes
-
removeListener
Deregister for notification of change to the underlying lists- Parameters:
listener
- The observer to remove from notification of changes
-
renameList
public void renameList(String origName, String newName, OneClickListManager.ListEventSource source)Rename a list and notify observers- Parameters:
origName
- The name of the list being renamednewName
- The new name of the list
-
addList
public void addList(String listName, Collection<String> listContents, boolean pinned, boolean sorted, boolean upperCase, OneClickListManager.ListEventSource source)Add a new list to the managed set. If a list with the same name already exists it will be replaced. The managed lists will contain no duplications and will maintain the same ordering.- Parameters:
listName
- The name of the list to add or updatelistContents
- A set containing the listpinned
- Whether the list is pinned or notsorted
- Whether the list is sorted or not
-
addList
public void addList(String listName, Collection<String> listContents, boolean pinned, boolean sorted, OneClickListManager.ListEventSource source)Add a new list to the managed set. If a list with the same name already exists it will be replaced. The managed lists will contain no duplications and will maintain the same ordering.- Parameters:
listName
- The name of the list to add or updatelistContents
- A set containing the listpinned
- Whether the list is pinned or notsorted
- Whether the list is sorted or not
-
addList
Add a list to the collection with unpinned and unsorted attributes- Parameters:
listName
- The name of the listlistContents
- The contents of the list
-
addList
public void addList(String listName, Collection<String> listContents, OneClickListManager.ListEventSource listEventSource)Add a list to the collection with unpinned and unsorted attributes- Parameters:
listName
- The name of the listlistContents
- The contents of the list
-
getList
Get the list associated with a particular name, or null if no set with that name existed- Parameters:
listName
- The name of the list to retrieve- Returns:
- A Set containing all the strings in the list, or null if the list did not exist
-
removeList
Remove a list from the set of managed lists.- Parameters:
listName
- the name of the list to removesource
- where the event came from
-
removeList
Remove a list from the set of managed lists.- Parameters:
listName
- the name of the list to remove
-
setListPinned
Set the Pinned state of a list. A Pinned list will always appear at the top of the list of lists when displayed.- Parameters:
listName
- The name of the listpinned
- The pinned state to set
-
setListPinned
public void setListPinned(String listName, boolean pinned, OneClickListManager.ListEventSource source)Set the Pinned state of a list. A Pinned list will always appear at the top of the list of lists when displayed.- Parameters:
listName
- The name of the listpinned
- The pinned state to setsource
- The source of the event
-
setListSorted
-
setListSorted
public void setListSorted(String listName, boolean sorted, OneClickListManager.ListEventSource source)Mark if the list is sorted or not. This method will NOT perform a sort- Parameters:
listName
- The name of the listsorted
- Whether the list has been sorted or not
-
getListNames
Get a collection of all the list names that are currently maintained- Returns:
- A set of the names of each unique list being managed
-
getLists
Get all the lists that are currently maintained- Returns:
- A set of the names of each unique list being managed
-
getWorkspaceInfo
public org.jdom2.Element getWorkspaceInfo()Description copied from interface:Workspace
Serialize the class into an element to be stored in the workspace- Specified by:
getWorkspaceInfo
in interfaceWorkspace
- Returns:
- An
Element
containing the data to persist.
-
setWorkspaceInfo
public void setWorkspaceInfo(org.jdom2.Element workspaceInfo)Description copied from interface:Workspace
Restore the class to the state defined by the data persisted in workspaceInfo- Specified by:
setWorkspaceInfo
in interfaceWorkspace
- Parameters:
workspaceInfo
- AnElement
containing the persisted state.
-
exportShare
Exports for a shareable workspace.- Parameters:
lists
- the lists to export- Returns:
- An
Element
containing the data to persist.
-
importShare
public void importShare(org.jdom2.Element workspaceInfo)Imports one click lists from a shared workspace.- Parameters:
workspaceInfo
- the element containing the shared workspace
-