Enum Class OneClickListManager

java.lang.Object
java.lang.Enum<OneClickListManager>
com.illumon.iris.gui.util.oneclick.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
  • Enum Constant Details

  • Method Details

    • values

      public static OneClickListManager[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OneClickListManager valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • addListener

      public void addListener(OneClickListManager.OneClickManagerListener listener)
      Register for notification of change to the underlying lists
      Parameters:
      listener - The observer to notify of changes
    • removeListener

      public void removeListener(OneClickListManager.OneClickManagerListener listener)
      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 renamed
      newName - 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 update
      listContents - A set containing the list
      pinned - Whether the list is pinned or not
      sorted - 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 update
      listContents - A set containing the list
      pinned - Whether the list is pinned or not
      sorted - Whether the list is sorted or not
    • addList

      public void addList(String listName, Collection<String> listContents)
      Add a list to the collection with unpinned and unsorted attributes
      Parameters:
      listName - The name of the list
      listContents - 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 list
      listContents - The contents of the list
    • getList

      public OneClickList getList(String listName)
      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

      public void removeList(String listName, OneClickListManager.ListEventSource source)
      Remove a list from the set of managed lists.
      Parameters:
      listName - the name of the list to remove
      source - where the event came from
    • removeList

      public void removeList(String listName)
      Remove a list from the set of managed lists.
      Parameters:
      listName - the name of the list to remove
    • setListPinned

      public void setListPinned(String listName, boolean pinned)
      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 list
      pinned - 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 list
      pinned - The pinned state to set
      source - The source of the event
    • setListSorted

      public void setListSorted(String listName, boolean sorted)
    • 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 list
      sorted - Whether the list has been sorted or not
    • getListNames

      public Collection<String> 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

      public Collection<OneClickList> 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 interface Workspace
      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 interface Workspace
      Parameters:
      workspaceInfo - An Element containing the persisted state.
    • exportShare

      public org.jdom2.Element exportShare(Collection<OneClickList> lists)
      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