com.microfocus.awm.model

## Interface IElementDirectory

- All Known Implementing Classes:
    ElementDirectory

      public interface IElementDirectory

  The interface is used for managing all `IElement`s and `IElementListEntry`s known by a `ITaurusApplication`.

  An `ITaurusApplication` does not know all the children at the beginning. `IElement`s and `IElementListEntry`s become cached right after the creation. They are created for example by expanding the Tree in the Team Developer Tree View or by opening or expanding filters.

  The `IElementListDirectory` handles the caching and loading of `IElementListEntry`s and `IElement`s. It is intended to use the eb_elementsinlists.xml and the et_elements.xml-file in the workspace for caching `IElementListEntry`s and `IElement`s.

  The singleton instance can be acquired with `TaurusFactory.getElementDirectory()`.

  This interface is not intended to be implemented by clients.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addElement(IElement pElement)` Add an element to the TAURUS element directory.
    `boolean` | `addElementList(IElement pElement, java.lang.String pElementListID)` Add the list id to the list of element lists in which the element is contained.
    `boolean` | `addElementListEntries(IElementListEntry pElementListEntry, IElement pElement)` Deprecated. Do not use. Not required anymore. Element list entries are automatically maintained in the directory.
    `void` | `addElementListEntry(IElementListEntry pEntry)` Adds a new `IElementListEntry` to the cache.
    `void` | `addObserver(java.util.Observer pObserver)` Add the given observer to this class.
    `boolean` | `changeElementType(IElement pElement, ElementType pNewElementType)` Changes the element type of the given element.
    `void` | `deleteElementListMap()` Remove the eb_elementsinlists.xml-file from the workspace.
    `void` | `deleteElements()` Remove the et_elements.xml-file from the active application's folder.
    `void` | `deleteObserver(java.util.Observer pObserver)` delete the given observer for this class
    `IElement` | `getElement(java.lang.String pElementId)` Get the element with the given ID from the TAURUS element directory.
    `IElement` | `getElementForFile(org.eclipse.core.resources.IFile pFile)` Deprecated. not used anymore. There is no safe way to get an element from a physical file.
    `IElement` | `getElementForPath(org.eclipse.core.runtime.IPath pFullPath)` Deprecated. not used anymore. There is no safe way to get an element from a physical file.
    `java.util.Map<java.lang.String,IElementListEntry>` | `getElementListEntries()`
    `java.util.Set<IElementListEntry>` | `getElementListEntries(IElement pElement)` Gets element list entries that belong to the given element.
    `IElementListEntry` | `getElementListEntry(java.lang.String pID)` Returns a cached `IElementListEntry` or `null` if no entry with the given ID was found.
    `java.util.Set<IElement>` | `getElements(ElementType pElementTyp)` Get all elements for the specified type.
    `void` | `loadElementListMap()` Load the eb_elementsinlists.xml-file from the workspace which contains the references between elements and element lists in which they are contained.
    `void` | `loadElements()` Load the et_elements.xml file from the workspace.
    `void` | `removeElement(IElement pElement)` Remove the given element from the TAURUS element directory and all element lists in which it is contained.
    `void` | `saveElementListMap()` Save the eb_elementsinlists.xml-file in the workspace which contains the references between elements and element lists in which they are contained.
    `void` | `saveElements()` Save the et_elements.xml file to the workspace.

- - ### Method Detail

    - #### addElement

          boolean addElement(IElement pElement)

      Add an element to the TAURUS element directory.
      Parameters:
        `pElement` - element to be added
      Returns:
        if the element was successfully added to the directory

    - #### addElementList

          boolean addElementList(IElement pElement,
                                 java.lang.String pElementListID)

      Add the list id to the list of element lists in which the element is contained.
      Parameters:
        `pElement` - TAURUS element
        `pElementListID` - element list id
      Returns:
        if the element list was added successfully to the directory

    - #### removeElement

          void removeElement(IElement pElement)
                      throws TaurusCoreException

      Remove the given element from the TAURUS element directory and all element lists in which it is contained.
      Parameters:
        `pElement` - TAURUS element to be removed
      Throws:
        `TaurusCoreException` - if the element could not be removed or the cache could not be updated

    - #### addElementListEntries

          @Deprecated
          boolean addElementListEntries(IElementListEntry pElementListEntry,
                                                     IElement pElement)

      Deprecated. Do not use. Not required anymore. Element list entries are automatically maintained in the directory.
      Add the given element list entry in the element list entries map.
      Parameters:
        `pElementListEntry` - element list entry
        `pElement` - corresponding element of the element list entry
      Returns:
        `true` if the given element list entry has been added in the element list map and `false` otherwise

    - #### addObserver

          void addObserver(java.util.Observer pObserver)

      Add the given observer to this class.
      Parameters:
        `pObserver` - observer

    - #### deleteObserver

          void deleteObserver(java.util.Observer pObserver)

      delete the given observer for this class
      Parameters:
        `pObserver` - observer

    - #### getElementListEntries

          java.util.Set<IElementListEntry> getElementListEntries(IElement pElement)

      Gets element list entries that belong to the given element.

      Note: Modifying the set will not have any effect on the element list cache.

      Parameters:
        `pElement` - the element to get element list entries from
      Returns:
        a set of element list entries belonging to the element

    - #### getElement

          IElement getElement(java.lang.String pElementId)
                       throws TaurusCoreException

      Get the element with the given ID from the TAURUS element directory.
      Parameters:
        `pElementId` - the element's id
      Returns:
        TAURUS element
      Throws:
        `TaurusCoreException` - if loading the element cache fails

    - #### getElements

          java.util.Set<IElement> getElements(ElementType pElementTyp)

      Get all elements for the specified type.
      Parameters:
        `pElementTyp` - element type
      Returns:
        all elements for the specified type

    - #### saveElements

          void saveElements()
                     throws TaurusCoreException

      Save the et_elements.xml file to the workspace.
      Throws:
        `TaurusCoreException` - if saving the element cache fails

    - #### loadElements

          void loadElements()
                     throws TaurusCoreException

      Load the et_elements.xml file from the workspace.
      Throws:
        `TaurusCoreException` - if loading the element cache fails

    - #### saveElementListMap

          void saveElementListMap()
                           throws TaurusCoreException

      Save the eb_elementsinlists.xml-file in the workspace which contains the references between elements and element lists in which they are contained.
      Throws:
        `TaurusCoreException` - if saving the element list cache fails

    - #### loadElementListMap

          void loadElementListMap()
                           throws TaurusCoreException

      Load the eb_elementsinlists.xml-file from the workspace which contains the references between elements and element lists in which they are contained.
      Throws:
        `TaurusCoreException` - if loading the element list cache fails

    - #### getElementForFile

          @Deprecated
          IElement getElementForFile(org.eclipse.core.resources.IFile pFile)
                                           throws TaurusCoreException

      Deprecated. not used anymore. There is no safe way to get an element from a physical file.
      Returns the Taurus element belonging to the given file in the internal Taurus project.
      Parameters:
        `pFile` - file in the internal Taurus project
      Returns:
        Taurus element belonging to the given file in the internal Taurus project
      Throws:
        `TaurusCoreException` - if loading the element cache fails

    - #### getElementForPath

          @Deprecated
          IElement getElementForPath(org.eclipse.core.runtime.IPath pFullPath)
                                           throws TaurusCoreException

      Deprecated. not used anymore. There is no safe way to get an element from a physical file.
      Returns the Taurus element belonging to the given path in the internal Taurus project.
      Parameters:
        `pFullPath` - full path in the internal Taurus project
      Returns:
        Taurus element belonging to the given path in the internal Taurus project
      Throws:
        `TaurusCoreException` - if loading the element cache fails

    - #### changeElementType

          boolean changeElementType(IElement pElement,
                                    ElementType pNewElementType)

      Changes the element type of the given element.
      Parameters:
        `pElement` - the element
        `pNewElementType` - the new element type
      Returns:
        `true` if the element type was successfully changed

    - #### deleteElements

          void deleteElements()
                       throws TaurusCoreException

      Remove the et_elements.xml-file from the active application's folder.
      Throws:
        `TaurusCoreException` - if updating the cache fails

    - #### deleteElementListMap

          void deleteElementListMap()
                             throws TaurusCoreException

      Remove the eb_elementsinlists.xml-file from the workspace.
      Throws:
        `TaurusCoreException` - if updating the element list cache fails

    - #### getElementListEntry

          IElementListEntry getElementListEntry(java.lang.String pID)

      Returns a cached `IElementListEntry` or `null` if no entry with the given ID was found.
      Parameters:
        `pID` - an ID of an element list entry
      Returns:
        the found element list entry or `null`

    - #### getElementListEntries

          java.util.Map<java.lang.String,IElementListEntry> getElementListEntries()

      Returns:
        the map of all cached element list entries.

    - #### addElementListEntry

          void addElementListEntry(IElementListEntry pEntry)

      Adds a new `IElementListEntry` to the cache. This is necessary if any `IElementListEntry` is created (usually done in the constructor).
      Parameters:
        `pEntry` - the entry to be added to the directory

Copyright © 2015 Micro Focus GmbH. All rights reserved.