com.microfocus.awm.model.internal

## Class ElementListDirectory

- java.lang.Object
- - java.util.Observable
  - - com.microfocus.awm.model.internal.TaurusDirectory
    - - com.microfocus.awm.model.internal.ElementListDirectory

- All Implemented Interfaces:
    IElementListDirectory

      public class ElementListDirectory
      extends TaurusDirectory
      implements IElementListDirectory

  Central store for all loaded ElementLists.

  Copyright (C) Micro Focus

- - ### Field Summary

    - ### Fields inherited from class com.microfocus.awm.model.internal.TaurusDirectory

      `ATTRIBUTE_CHILD_RESOURCE_ID, ELEMENT_CHILD_RESOURCE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addElementListDependency(IElementList pElementList, IElementList pPrevElementList)` Add an element list id to the map which contains the sequential dependency between element lists.
    `void` | `addElementListEntries(IElementList pElementList, java.util.List<IElementListEntry> pElementListEntries, boolean pRefreshList)` Add the given element list entry list to the given element list at the given position.
    `void` | `addElementListEntry(IElementList pElementList, IElementListEntry pElementListEntry, boolean pRefreshList)` Add the given element list entry to the given element list.
    `void` | `addElementListEntry(IElementList pElementList, IElementListEntry pElementListEntry, int pIndex, boolean pRefreshList)` Add the given element list entry to the given element list at the given position.
    `void` | `addList(IElementList pElementList, java.lang.String pPrevListID, boolean pNotify)` add a new element list to the element list map and maintain the related internal data structures
    `void` | `addList(IElementList pElementList, java.lang.String pPrevListID, java.lang.String pTableViewSecondaryId, boolean pNotify)` Add a new element list to the element list map and table view secondary id map and maintain the related internal data structures.
    `void` | `addResourceActionList(ActionDescriptor pActionDescriptor, IResource pIResource, java.lang.String pElementListID)` Deprecated.
    `boolean` | `containsKey(IElementListKey pKey)` Check of the element list directory contains the given logical element list key.
    `void` | `deleteElementLists()` Delete all li_....xml files belonging to the active application from the workspace.
    `boolean` | `elementListExists(IElementListKey pKey)` Check if the element list to the given logical key exists physically.
    `IElementListKey` | `getElementListKey(java.lang.String pElementlistID)` Get the key under which the given element list id is stored in the element list directory.
    `java.util.List<IElementList>` | `getElementLists()` Gets a list of all `IElementList`.
    `java.util.List<IElementList>` | `getElementLists(IResource pResource)` Gets element lists which were created with the given resource.
    `java.lang.String` | `getFirstListID()` return the first key of the element list map
    `static ElementListDirectory` | `getInstance()` singleton method getInstance
    `java.lang.String` | `getLastListID()` return the last key of the element list map
    `IElementList` | `getList(IElementListKey pKey)` Returns the element list for the given logical element list key.
    `IElementList` | `getList(java.lang.String pElementListID)` Returns the `IElementList` for the given ID or `null` if no element list with the given ID exists.
    `IElementList` | `getNextList(IElementList pEleList)` Gets the element list which follows the given element list.
    `java.lang.String` | `getNextListID(java.lang.String pElementListID)` get the key of the next entry in element list map
    `IElementList` | `getPreviousList(IElementList pEleList)` Gets the element list which precedes the given element list.
    `java.lang.String` | `getPreviousListID(java.lang.String pElementListID)` get the key of the previous entry in element list map
    `IResource` | `getResource(java.lang.String pElementListID)` return the TAURUS resource to which the corresponding element list is associated
    `IElementList` | `getSelectedList()` Gets the element list which is currently selected in a table view.
    `IElementList` | `loadElementList(java.lang.String pElementListID)` Load the element list belonging to the given element list id from the workspace.
    `void` | `loadElementListDependency()` Load the lm_elementlists.xml-file from the workspace containing the sequential dependencies between the element lists.
    `void` | `notifyObservers(java.lang.Object pData)`
    `void` | `notifyObservers(TaurusNotification pTaurusNotification)` Sets the changed flag of this observable and notifies observers.
    `void` | `notifyRefresh()` Deprecated.
    `void` | `removeElementListEntries(IElementList pElementList, java.util.List<IElementListEntry> pElementListEntries, boolean pRefreshList)` Remove the given element list entry list from the given element list.
    `void` | `removeElementListEntry(IElementList pElementList, IElementListEntry pElementListEntry, boolean pRefreshList)` Remove the given element list entry from the given element list.
    `void` | `removeList(IElementList pElementList)` remove an element list from the element list map and maintain the related internal data structures
    `void` | `removeLists(IResource pResource)` Remove all element lists belonging to the given TAURUS resource.
    `IElementList` | `restoreList(ActionDescriptor pAct, IResource pRes)` Tries to restore a Element List for the given parameters.
    `void` | `saveElementList(IElementList pElementList)` Save the li_....xml file for the given element list id to the workspace.
    `void` | `saveElementListDependency()` Save the lm_elementlists.xml-file to the workspace containing the sequential dependencies between the element lists.
    `void` | `saveElementLists()` Save all element lists of the element list directory to the workspace.
    `void` | `setSelectedListID(java.lang.String pElementListID)` Sets the ID of the element list which is (or should be) selected in the main table view.
    `void` | `showList(IElementList pElementList)` Notify the observers of the element list directory of a change in the element list with the given element list id.
    `void` | `showList(IElementList pElementList, java.lang.String pTableViewSecondaryId)` Show the given element list in the table view with given secondary id.

    - ### Methods inherited from class com.microfocus.awm.model.internal.TaurusDirectory

      `addChild, getResourceID, saveChildren`

    - ### Methods inherited from class java.util.Observable

      `addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.microfocus.awm.model.IElementListDirectory

      `addObserver, deleteObserver`

- - ### Method Detail

    - #### getInstance

          public static ElementListDirectory getInstance()

      singleton method getInstance
      Returns:
        the single instance of the class

    - #### addList

          public void addList(IElementList pElementList,
                              java.lang.String pPrevListID,
                              boolean pNotify)
                       throws TaurusCoreException

      add a new element list to the element list map and maintain the related internal data structures
      Specified by:
        `addList` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list to be stored
        `pPrevListID` - ID of the list that should be the predecessor of the new list
        `pNotify` - whether observers should be notified about the action
      Throws:
        `TaurusCoreException` - if the element list could not be recovered

    - #### addList

          public void addList(IElementList pElementList,
                              java.lang.String pPrevListID,
                              java.lang.String pTableViewSecondaryId,
                              boolean pNotify)

      Description copied from interface: `IElementListDirectory`
      Add a new element list to the element list map and table view secondary id map and maintain the related internal data structures.
      Specified by:
        `addList` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list to be added to the TAURUS element list directory and table view directory
        `pPrevListID` - element list which precedes this element list in the element list directory; maybe null, in this case the element list is added to the end of the element list directory
        `pTableViewSecondaryId` - secondary id of the table view in which the element list will be mapped, if `null`, the element list will be added to the main table view
        `pNotify` - whether the observer of this `class` will be notified

    - #### addElementListEntry

          public void addElementListEntry(IElementList pElementList,
                                          IElementListEntry pElementListEntry,
                                          boolean pRefreshList)

      Description copied from interface: `IElementListDirectory`
      Add the given element list entry to the given element list.
      Specified by:
        `addElementListEntry` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list
        `pElementListEntry` - element list entry
        `pRefreshList` - `true`, if the observers of the element list directory should be notified for a refresh; otherwise `false`

    - #### addElementListEntry

          public void addElementListEntry(IElementList pElementList,
                                          IElementListEntry pElementListEntry,
                                          int pIndex,
                                          boolean pRefreshList)

      Description copied from interface: `IElementListDirectory`
      Add the given element list entry to the given element list at the given position.
      Specified by:
        `addElementListEntry` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list
        `pElementListEntry` - element list entry
        `pIndex` - position in the element list at which the element list entry should be added
        `pRefreshList` - `true`, if the observers of the element list directory should be notified for a refresh; otherwise `false`

    - #### removeElementListEntry

          public void removeElementListEntry(IElementList pElementList,
                                             IElementListEntry pElementListEntry,
                                             boolean pRefreshList)
                                      throws TaurusCoreException

      Description copied from interface: `IElementListDirectory`
      Remove the given element list entry from the given element list.
      Specified by:
        `removeElementListEntry` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list
        `pElementListEntry` - element list entry
        `pRefreshList` - `true`, if the observers of the element list directory should be notified for a refresh; otherwise `false`
      Throws:
        `TaurusCoreException` - if the deletion fails

    - #### addElementListEntries

          public void addElementListEntries(IElementList pElementList,
                                            java.util.List<IElementListEntry> pElementListEntries,
                                            boolean pRefreshList)

      Description copied from interface: `IElementListDirectory`
      Add the given element list entry list to the given element list at the given position.
      Specified by:
        `addElementListEntries` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list
        `pElementListEntries` - list of element list entries
        `pRefreshList` - `true`, if the observers of the element list directory should be notified for a refresh; otherwise `false`

    - #### removeElementListEntries

          public void removeElementListEntries(IElementList pElementList,
                                               java.util.List<IElementListEntry> pElementListEntries,
                                               boolean pRefreshList)

      Description copied from interface: `IElementListDirectory`
      Remove the given element list entry list from the given element list.
      Specified by:
        `removeElementListEntries` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list
        `pElementListEntries` - list of element list entries
        `pRefreshList` - `true`, if the observers of the element list directory should be notified for a refresh; otherwise `false`

    - #### showList

          public void showList(IElementList pElementList)

      Description copied from interface: `IElementListDirectory`
      Notify the observers of the element list directory of a change in the element list with the given element list id.
      Specified by:
        `showList` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - the `ElementList`

    - #### notifyRefresh

          @Deprecated
          public void notifyRefresh()

      Deprecated.
      Description copied from interface: `IElementListDirectory`
      Notifies observing views to refresh.
      Specified by:
        `notifyRefresh` in interface `IElementListDirectory`

    - #### addResourceActionList

          @Deprecated
          public void addResourceActionList(ActionDescriptor pActionDescriptor,
                                                         IResource pIResource,
                                                         java.lang.String pElementListID)

      Deprecated.
      Description copied from interface: `IElementListDirectory`
      Add the given element list id to the map with the key of the given action id and resource id.
      Specified by:
        `addResourceActionList` in interface `IElementListDirectory`
      Parameters:
        `pActionDescriptor` - action of the map's key
        `pIResource` - resource of the map's key
        `pElementListID` - element list to be added

    - #### removeList

          public void removeList(IElementList pElementList)

      remove an element list from the element list map and maintain the related internal data structures
      Specified by:
        `removeList` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - key under which the element list is stored

    - #### removeLists

          public void removeLists(IResource pResource)

      Description copied from interface: `IElementListDirectory`
      Remove all element lists belonging to the given TAURUS resource.
      Specified by:
        `removeLists` in interface `IElementListDirectory`
      Parameters:
        `pResource` - TAURUS resource for which the element list are to be deleted

    - #### getElementLists

          public java.util.List<IElementList> getElementLists(IResource pResource)

      Description copied from interface: `IElementListDirectory`
      Gets element lists which were created with the given resource.
      Specified by:
        `getElementLists` in interface `IElementListDirectory`
      Parameters:
        `pResource` - the resource
      Returns:
        a list of element lists (can be empty)

    - #### addElementListDependency

          public void addElementListDependency(IElementList pElementList,
                                               IElementList pPrevElementList)

      Description copied from interface: `IElementListDirectory`
      Add an element list id to the map which contains the sequential dependency between element lists.
      Specified by:
        `addElementListDependency` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list to be added
        `pPrevElementList` - element list which precedes the element list id to be added; can be `null`, in this case the element list id is added at the end of the dependency map

    - #### setSelectedListID

          public void setSelectedListID(java.lang.String pElementListID)

      Description copied from interface: `IElementListDirectory`
      Sets the ID of the element list which is (or should be) selected in the main table view.
      Specified by:
        `setSelectedListID` in interface `IElementListDirectory`
      Parameters:
        `pElementListID` - the ID of the selected element list

    - #### getPreviousListID

          public java.lang.String getPreviousListID(java.lang.String pElementListID)

      get the key of the previous entry in element list map
      Specified by:
        `getPreviousListID` in interface `IElementListDirectory`
      Parameters:
        `pElementListID` - actual key to the element list map
      Returns:
        previous key if the element list map contains more than one entry otherwise `null`

    - #### getNextListID

          public java.lang.String getNextListID(java.lang.String pElementListID)

      get the key of the next entry in element list map
      Specified by:
        `getNextListID` in interface `IElementListDirectory`
      Parameters:
        `pElementListID` - actual key to the element list map
      Returns:
        next key if the element list map contains more than one entry otherwise `null`

    - #### getPreviousList

          public IElementList getPreviousList(IElementList pEleList)

      Gets the element list which precedes the given element list.
      Specified by:
        `getPreviousList` in interface `IElementListDirectory`
      Parameters:
        `pEleList` - an element list
      Returns:
        the previous element list relative to the given list or `null` if there is none.

    - #### getNextList

          public IElementList getNextList(IElementList pEleList)

      Gets the element list which follows the given element list.
      Specified by:
        `getNextList` in interface `IElementListDirectory`
      Parameters:
        `pEleList` - an element list
      Returns:
        the next element list relative to the given list or `null` if there is none.

    - #### getList

          public IElementList getList(java.lang.String pElementListID)

      Returns the `IElementList` for the given ID or `null` if no element list with the given ID exists.
      Specified by:
        `getList` in interface `IElementListDirectory`
      Parameters:
        `pElementListID` - the ID of an element list.
      Returns:
        an IElementList or `null`

    - #### getResource

          public IResource getResource(java.lang.String pElementListID)

      return the TAURUS resource to which the corresponding element list is associated
      Specified by:
        `getResource` in interface `IElementListDirectory`
      Parameters:
        `pElementListID` - key in the element list map
      Returns:
        TAURUS resource to which the corresponding element list is associated

    - #### getSelectedList

          public IElementList getSelectedList()

      Description copied from interface: `IElementListDirectory`
      Gets the element list which is currently selected in a table view.
      Specified by:
        `getSelectedList` in interface `IElementListDirectory`
      Returns:
        the selected element list or `null`

    - #### getElementListKey

          public IElementListKey getElementListKey(java.lang.String pElementlistID)

      Description copied from interface: `IElementListDirectory`
      Get the key under which the given element list id is stored in the element list directory.
      Specified by:
        `getElementListKey` in interface `IElementListDirectory`
      Parameters:
        `pElementlistID` - the element list's id
      Returns:
        key under which the given element list id is stored in the element list directory

    - #### containsKey

          public boolean containsKey(IElementListKey pKey)

      Description copied from interface: `IElementListDirectory`
      Check of the element list directory contains the given logical element list key.
      Specified by:
        `containsKey` in interface `IElementListDirectory`
      Parameters:
        `pKey` - logical element list key
      Returns:
        `true`, if the element list directory contains the given key, otherwise `false`

    - #### getList

          public IElementList getList(IElementListKey pKey)

      Description copied from interface: `IElementListDirectory`
      Returns the element list for the given logical element list key.
      Specified by:
        `getList` in interface `IElementListDirectory`
      Parameters:
        `pKey` - logical element list key
      Returns:
        the element list with the given key or `null`, if the element list directory does not contain a list with the given key

    - #### elementListExists

          public boolean elementListExists(IElementListKey pKey)

      Description copied from interface: `IElementListDirectory`
      Check if the element list to the given logical key exists physically.
      Specified by:
        `elementListExists` in interface `IElementListDirectory`
      Parameters:
        `pKey` - logical element list key
      Returns:
        `true`, if the element list exists physically, otherwise `false`

    - #### getFirstListID

          public java.lang.String getFirstListID()

      return the first key of the element list map
      Specified by:
        `getFirstListID` in interface `IElementListDirectory`
      Returns:
        first key of the element list map `null` if the element list map is empty

    - #### getLastListID

          public java.lang.String getLastListID()

      return the last key of the element list map
      Specified by:
        `getLastListID` in interface `IElementListDirectory`
      Returns:
        last key of the element list map null if the element list map is empty

    - #### loadElementList

          public IElementList loadElementList(java.lang.String pElementListID)

      Description copied from interface: `IElementListDirectory`
      Load the element list belonging to the given element list id from the workspace.
      Specified by:
        `loadElementList` in interface `IElementListDirectory`
      Parameters:
        `pElementListID` - id of the element list
      Returns:
        the element list with the given ID or `null`

    - #### saveElementList

          public void saveElementList(IElementList pElementList)
                               throws TaurusCoreException

      Description copied from interface: `IElementListDirectory`
      Save the li_....xml file for the given element list id to the workspace.
      Specified by:
        `saveElementList` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - element list
      Throws:
        `TaurusCoreException` - if saving the element lists into cache fails

    - #### saveElementLists

          public void saveElementLists()
                                throws TaurusCoreException

      Description copied from interface: `IElementListDirectory`
      Save all element lists of the element list directory to the workspace.
      Specified by:
        `saveElementLists` in interface `IElementListDirectory`
      Throws:
        `TaurusCoreException` - if saving the element lists fails

    - #### loadElementListDependency

          public void loadElementListDependency()
                                         throws TaurusCoreException

      Description copied from interface: `IElementListDirectory`
      Load the lm_elementlists.xml-file from the workspace containing the sequential dependencies between the element lists.
      Specified by:
        `loadElementListDependency` in interface `IElementListDirectory`
      Throws:
        `TaurusCoreException` - if loading the element list dependencies fails

    - #### saveElementListDependency

          public void saveElementListDependency()
                                         throws TaurusCoreException

      Description copied from interface: `IElementListDirectory`
      Save the lm_elementlists.xml-file to the workspace containing the sequential dependencies between the element lists.
      Specified by:
        `saveElementListDependency` in interface `IElementListDirectory`
      Throws:
        `TaurusCoreException` - if saving the element list dependencies fails

    - #### deleteElementLists

          public void deleteElementLists()
                                  throws TaurusCoreException

      Description copied from interface: `IElementListDirectory`
      Delete all li_....xml files belonging to the active application from the workspace.
      Specified by:
        `deleteElementLists` in interface `IElementListDirectory`
      Throws:
        `TaurusCoreException` - if deleting the element list cache fails

    - #### notifyObservers

          public void notifyObservers(java.lang.Object pData)

      Overrides:
        `notifyObservers` in class `java.util.Observable`

    - #### restoreList

          public IElementList restoreList(ActionDescriptor pAct,
                                          IResource pRes)

      Description copied from interface: `IElementListDirectory`
      Tries to restore a Element List for the given parameters. Does not create a new Element List if none exists (`null` will be returned in that case).
      Specified by:
        `restoreList` in interface `IElementListDirectory`
      Parameters:
        `pAct` - the `ActionDescriptor` which creates the Element List
        `pRes` - the parent `IResource` of the Element List
      Returns:
        the cached element list or `null` if the element list didn't exist in the cache
      See Also:
        `IElementListKey`

    - #### getElementLists

          public java.util.List<IElementList> getElementLists()

      Description copied from interface: `IElementListDirectory`
      Gets a list of all `IElementList`.
      Specified by:
        `getElementLists` in interface `IElementListDirectory`
      Returns:
        a list of all element lists, which can be empty.

    - #### notifyObservers

          public void notifyObservers(TaurusNotification pTaurusNotification)

      Description copied from class: `TaurusDirectory`
      Sets the changed flag of this observable and notifies observers.
      Specified by:
        `notifyObservers` in interface `IElementListDirectory`
      Overrides:
        `notifyObservers` in class `TaurusDirectory`
      Parameters:
        `pTaurusNotification` - the notification. Can be `null` (not recommended).
      See Also:
        `Observable.notifyObservers(Object)`

    - #### showList

          public void showList(IElementList pElementList,
                               java.lang.String pTableViewSecondaryId)

      Description copied from interface: `IElementListDirectory`
      Show the given element list in the table view with given secondary id.
      Specified by:
        `showList` in interface `IElementListDirectory`
      Parameters:
        `pElementList` - the element list to show
        `pTableViewSecondaryId` - the secondary id of the table view in which the list will be shown, if `null` the list will be shown in the main table view

Copyright © 2015 Micro Focus GmbH. All rights reserved.