com.microfocus.awm.model.internal

## Class ElementList

- java.lang.Object
- - org.eclipse.core.runtime.PlatformObject
  - - com.microfocus.awm.model.internal.Resource
    - - com.microfocus.awm.model.internal.ElementList

- All Implemented Interfaces:
    IElementList, IResource, org.eclipse.core.runtime.IAdaptable

      public class ElementList
      extends Resource
      implements IElementList

  Base implementation for a list of resources.

  Copyright (C) Micro Focus

- - ### Field Summary

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

      `_ID, _name`

    - ### Fields inherited from interface com.microfocus.awm.model.IElementList

      `ID_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ElementList(ElementListStructure pElementListStructure, ActionDescriptor pAction)` Creates a new list with no parent and a default generated ID.
    `ElementList(ElementListStructure pElementListStructure, ActionDescriptor pAction, IResource pParent)` Creates a new list with a default generated ID.
    `ElementList(ElementListStructure pElemetListStructure, ActionDescriptor pAction, java.lang.String pElementListID)` Creates a new list with no parent.
    `ElementList(ElementListStructure pElemetListStructure, ActionDescriptor pAction, java.lang.String pElementListID, IResource pParent)` creates a new list.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addElementListEntries(java.util.List<IElementListEntry> pElementListEntries)` Add the given list of element list entries to this element list's entry list.
    `void` | `addElementListEntry(IElementListEntry pElementListEntry)` Add the given element list entry to this element list's entry list.
    `void` | `addElementListEntry(IElementListEntry pElementListEntry, int index)` Add the given element list entry to this element list's entry list at the given position.
    `boolean` | `addResourceChild(IResource pRes)` Adds a resource to the list of children resources.
    `void` | `delete()` Removes this resource and all its children resources from cache.
    `void` | `deleteList()` Remove the li_....xml-file belonging to this element list from the workspace.
    `static IElementList` | `emptyElementList(ActionDescriptor pAct)` Convenience method to create a new list with no parent, a generated default ID an a default `ElementListStructure` without any columns
    `ActionDescriptor` | `getAction()` Gets the action descriptor which created this element list.
    `java.util.List<IElementListEntry>` | `getElementListEntries()` Gets the list of element list entries.
    `IElementListEntry` | `getElementListEntry(IElement pElment)` Gets the element list entry of this list for the given element.
    `ElementListStructure` | `getElementListStructure()` Get the element list structure of this element list.
    `IResource` | `getParentResource()` Returns the parent of this resource or `null` if there is none.
    `java.lang.String` | `getParentResourceID()` Used to return the parent resource ID before the resource itself was loaded from cache.
    `IResource` | `getResource()` Returns the resource that was selected when the element list was created.
    `java.lang.String` | `getTableViewID()` Get the id (secondary) of the view where this element list will be shown.
    `java.lang.String` | `getTableViewLabel()` Get the label that will be shown as view part name by loading of this element list.
    `java.lang.String` | `getTitle()` Gets the title of this element list.
    `int` | `indexOf(IElementListEntry pEntry)` Returns the index of the given element list entry or `-1` if it is not in the element list.
    `boolean` | `isTreeDisplay()`
    `boolean` | `isVisible()`
    `void` | `removeElementListEntries(java.util.List<IElementListEntry> pElementListEntries)` Remove the given list of element list entries from this element list's entry list.
    `void` | `removeElementListEntry(IElementListEntry pElementListEntry)` Remove the given element list entry from this element lists's entry list.
    `boolean` | `removeResourceChild(IResource pRes)` Removes a resource of the list of children resources.
    `void` | `setElementListEntries(java.util.List<IElementListEntry> pElementListEntries)` Sets the element list entries of this element list.
    `void` | `setResource(IResource pResource)` Gets the resource that was used to create the element list.
    `void` | `setResource(java.lang.String pResourceID)` Same as `IElementList.setResource(IResource)` but uses the resource ID instead.
    `void` | `setTableViewID(java.lang.String pTableViewID)` Get the (secondary) id of the view where this element list will be shown.
    `void` | `setTableViewLabel(java.lang.String pTableViewLabel)` Set the label that will be showing as view part name by loading of this element list.
    `void` | `setTitle(java.lang.String pTitle)` Sets the title of this element list.
    `void` | `setTreeDisplay(boolean pTreeDisplay)` If set the element list is be displayed in tree format; if not set the element list is displayed as flat table.
    `void` | `setVisible(boolean pShow)` If set to `true` the element list will be shown in table views.
    `java.lang.String` | `toString()`

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

      `addChildResource, addPropertyValue, equals, getAllPropertyValues, getChildrenResources, getID, getName, getPropertyValue, getPropertyValueFromHierarchy, getResourceChildren, getValueOfLinkedProperty, hashCode, removeProperty, setName, setPropertyValues`

    - ### Methods inherited from class org.eclipse.core.runtime.PlatformObject

      `getAdapter`

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

      `getClass, notify, notifyAll, wait, wait, wait`

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

      `addChildResource, addPropertyValue, getAllPropertyValues, getChildrenResources, getID, getName, getPropertyValue, getPropertyValueFromHierarchy, getResourceChildren, setName, setPropertyValues`

    - ### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

      `getAdapter`

- - ### Constructor Detail

    - #### ElementList

          public ElementList(ElementListStructure pElementListStructure,
                             ActionDescriptor pAction)

      Creates a new list with no parent and a default generated ID.
      Parameters:
        `pElementListStructure` - the ElementList's Structure
        `pAction` - the action which created the element list

    - #### ElementList

          public ElementList(ElementListStructure pElementListStructure,
                             ActionDescriptor pAction,
                             IResource pParent)

      Creates a new list with a default generated ID.
      Parameters:
        `pElementListStructure` - the ElementList's Structure
        `pAction` - the action which created the element list
        `pParent` - the resource that was selected when the element list was created or `null` if there was no selected resource (e.g. list was created by global action)

    - #### ElementList

          public ElementList(ElementListStructure pElemetListStructure,
                             ActionDescriptor pAction,
                             java.lang.String pElementListID)

      Creates a new list with no parent.
      Parameters:
        `pElemetListStructure` - the ElementList's Structure
        `pAction` - the action which created the element list
        `pElementListID` - resource ID for this list or `null` for a generated default ID

    - #### ElementList

          public ElementList(ElementListStructure pElemetListStructure,
                             ActionDescriptor pAction,
                             java.lang.String pElementListID,
                             IResource pParent)

      creates a new list.
      Parameters:
        `pElemetListStructure` - the ElementList's Structure
        `pAction` - the action which created the element list
        `pElementListID` - resource ID for this list or `null` for a generated default ID
        `pParent` - the resource that was selected when the element list was created or `null` if there was no selected resource (e.g. list was created by global action)

  - ### Method Detail

    - #### deleteList

          public void deleteList()
                          throws TaurusCoreException

      Description copied from interface: `IElementList`
      Remove the li_....xml-file belonging to this element list from the workspace.
      Specified by:
        `deleteList` in interface `IElementList`
      Throws:
        `TaurusCoreException` - if deleting the list fails

    - #### getElementListStructure

          public ElementListStructure getElementListStructure()

      Description copied from interface: `IElementList`
      Get the element list structure of this element list.
      Specified by:
        `getElementListStructure` in interface `IElementList`
      Returns:
        element list structure of this element list

    - #### setElementListEntries

          public void setElementListEntries(java.util.List<IElementListEntry> pElementListEntries)

      Description copied from interface: `IElementList`
      Sets the element list entries of this element list.
      Specified by:
        `setElementListEntries` in interface `IElementList`
      Parameters:
        `pElementListEntries` - the new element list entries.

    - #### getElementListEntries

          public java.util.List<IElementListEntry> getElementListEntries()

      Description copied from interface: `IElementList`
      Gets the list of element list entries.

      The returned list must not be modified directly since children resources would not be maintained.

      Specified by:
        `getElementListEntries` in interface `IElementList`
      Returns:
        the list of element list entries.

    - #### addElementListEntry

          public void addElementListEntry(IElementListEntry pElementListEntry)

      Description copied from interface: `IElementList`
      Add the given element list entry to this element list's entry list.
      Specified by:
        `addElementListEntry` in interface `IElementList`
      Parameters:
        `pElementListEntry` - element list entry to be added

    - #### addResourceChild

          public boolean addResourceChild(IResource pRes)

      Description copied from interface: `IResource`
      Adds a resource to the list of children resources. Does nothing if the given resource is already a child of this resource.
      Specified by:
        `addResourceChild` in interface `IResource`
      Overrides:
        `addResourceChild` in class `Resource`
      Parameters:
        `pRes` - the `IResource` to be added as child of this resource.
      Returns:
        `true` if an element was added as a result of this call
      See Also:
        `IResource.getResourceChildren()`

    - #### removeResourceChild

          public boolean removeResourceChild(IResource pRes)

      Description copied from interface: `IResource`
      Removes a resource of the list of children resources. Does nothing if the given resource is not a child of this resource.
      Specified by:
        `removeResourceChild` in interface `IResource`
      Overrides:
        `removeResourceChild` in class `Resource`
      Parameters:
        `pRes` - the `IResource` to be added as child of this resource.
      Returns:
        `true` if an element was removed as a result of this call
      See Also:
        `IResource.getResourceChildren()`

    - #### addElementListEntry

          public void addElementListEntry(IElementListEntry pElementListEntry,
                                          int index)

      Description copied from interface: `IElementList`
      Add the given element list entry to this element list's entry list at the given position.
      Specified by:
        `addElementListEntry` in interface `IElementList`
      Parameters:
        `pElementListEntry` - element list entry to be added
        `index` - position at which the element list entry should be added

    - #### addElementListEntries

          public void addElementListEntries(java.util.List<IElementListEntry> pElementListEntries)

      Description copied from interface: `IElementList`
      Add the given list of element list entries to this element list's entry list.
      Specified by:
        `addElementListEntries` in interface `IElementList`
      Parameters:
        `pElementListEntries` - list of element list entries to be added

    - #### removeElementListEntry

          public void removeElementListEntry(IElementListEntry pElementListEntry)

      Description copied from interface: `IElementList`
      Remove the given element list entry from this element lists's entry list.
      Specified by:
        `removeElementListEntry` in interface `IElementList`
      Parameters:
        `pElementListEntry` - element list entry to be removed

    - #### removeElementListEntries

          public void removeElementListEntries(java.util.List<IElementListEntry> pElementListEntries)

      Description copied from interface: `IElementList`
      Remove the given list of element list entries from this element list's entry list.
      Specified by:
        `removeElementListEntries` in interface `IElementList`
      Parameters:
        `pElementListEntries` - list of element list entries to be removed

    - #### getElementListEntry

          public IElementListEntry getElementListEntry(IElement pElment)

      Description copied from interface: `IElementList`
      Gets the element list entry of this list for the given element.
      Specified by:
        `getElementListEntry` in interface `IElementList`
      Parameters:
        `pElment` - the element
      Returns:
        the element list entry or `null` if the list does not have an entry for the given element

    - #### getAction

          public ActionDescriptor getAction()

      Description copied from interface: `IElementList`
      Gets the action descriptor which created this element list.
      Specified by:
        `getAction` in interface `IElementList`
      Returns:
        the action descriptor

    - #### getResource

          public IResource getResource()

      Description copied from interface: `IElementList`
      Returns the resource that was selected when the element list was created. Note that this is different from `IResource.getParentResource()`. This method will return `null` if the element list was created with no selected resource (e.g. through a global action).
      Specified by:
        `getResource` in interface `IElementList`
      Returns:
        The resource that was selected when the element list was created (which can be `null`).

    - #### setResource

          public void setResource(IResource pResource)

      Description copied from interface: `IElementList`
      Gets the resource that was used to create the element list.
      Specified by:
        `setResource` in interface `IElementList`
      Parameters:
        `pResource` - the context resource (can be `null` e.g. if the element list was created by a global action)

    - #### getTitle

          public java.lang.String getTitle()

      Description copied from interface: `IElementList`
      Gets the title of this element list.
      Specified by:
        `getTitle` in interface `IElementList`
      Returns:
        the title

    - #### getTableViewLabel

          public java.lang.String getTableViewLabel()

      Description copied from interface: `IElementList`
      Get the label that will be shown as view part name by loading of this element list.
      Specified by:
        `getTableViewLabel` in interface `IElementList`
      Returns:
        the table view label of this element list

    - #### setTableViewLabel

          public void setTableViewLabel(java.lang.String pTableViewLabel)

      Description copied from interface: `IElementList`
      Set the label that will be showing as view part name by loading of this element list.
      Specified by:
        `setTableViewLabel` in interface `IElementList`
      Parameters:
        `pTableViewLabel` - the view label of this list

    - #### setTitle

          public void setTitle(java.lang.String pTitle)

      Description copied from interface: `IElementList`
      Sets the title of this element list.
      Specified by:
        `setTitle` in interface `IElementList`
      Parameters:
        `pTitle` - the new title

    - #### isVisible

          public boolean isVisible()

      Specified by:
        `isVisible` in interface `IElementList`
      Returns:
        `true` if the element list shall be shown in a table view. `false` otherwise.

    - #### setVisible

          public void setVisible(boolean pShow)

      Description copied from interface: `IElementList`
      If set to `true` the element list will be shown in table views.
      Specified by:
        `setVisible` in interface `IElementList`
      Parameters:
        `pShow` - whether the element list should be displayed in table views

    - #### isTreeDisplay

          public boolean isTreeDisplay()

      Specified by:
        `isTreeDisplay` in interface `IElementList`
      Returns:
        if `true` the element list is be displayed in tree format; if `false` the element list is displayed as flat table.

    - #### setTreeDisplay

          public void setTreeDisplay(boolean pTreeDisplay)

      Description copied from interface: `IElementList`
      If set the element list is be displayed in tree format; if not set the element list is displayed as flat table.
      Specified by:
        `setTreeDisplay` in interface `IElementList`
      Parameters:
        `pTreeDisplay` - whether the element list should be displayed in tree format

    - #### indexOf

          public int indexOf(IElementListEntry pEntry)

      Description copied from interface: `IElementList`
      Returns the index of the given element list entry or `-1` if it is not in the element list.
      Specified by:
        `indexOf` in interface `IElementList`
      Parameters:
        `pEntry` - the `ElementListEntry`
      Returns:
        the index of the given entry or `-1`

    - #### emptyElementList

          public static IElementList emptyElementList(ActionDescriptor pAct)

      Convenience method to create a new list with no parent, a generated default ID an a default `ElementListStructure` without any columns
      Parameters:
        `pAct` - action performed on a resource which generated the element list
      Returns:
        new default element list

    - #### delete

          public void delete()
                      throws TaurusCoreException

      Description copied from interface: `IResource`
      Removes this resource and all its children resources from cache.
      Will not delete the physical resource on the target system.
      Specified by:
        `delete` in interface `IResource`
      Overrides:
        `delete` in class `Resource`
      Throws:
        `TaurusCoreException` - if the deletion of the resource fails
      See Also:
        `IResource.getChildrenResources()`

    - #### setResource

          public void setResource(java.lang.String pResourceID)

      Description copied from interface: `IElementList`
      Same as `IElementList.setResource(IResource)` but uses the resource ID instead. This is useful on startup when the cache is not completely loaded and the resource IDs cannot be resolved.
      Specified by:
        `setResource` in interface `IElementList`
      Parameters:
        `pResourceID` - the ID of an `IResource`

    - #### getParentResource

          public IResource getParentResource()

      Description copied from interface: `IResource`
      Returns the parent of this resource or `null` if there is none.

      Note: Parent/Child relationships will only be maintained if the "Linked Element List" attribute ( `ActionDescriptor.isLinkElementList()`) is set to `true`.

      Specified by:
        `getParentResource` in interface `IResource`
      Overrides:
        `getParentResource` in class `Resource`
      Returns:
        the parent resource or `null`.

    - #### getParentResourceID

          public java.lang.String getParentResourceID()

      Description copied from interface: `IElementList`
      Used to return the parent resource ID before the resource itself was loaded from cache.
      Specified by:
        `getParentResourceID` in interface `IElementList`
      Returns:
        the ID of the parent resource.

    - #### getTableViewID

          public java.lang.String getTableViewID()

      Description copied from interface: `IElementList`
      Get the id (secondary) of the view where this element list will be shown.
      Specified by:
        `getTableViewID` in interface `IElementList`
      Returns:
        the table view id (secondary) of this element list

    - #### setTableViewID

          public void setTableViewID(java.lang.String pTableViewID)

      Description copied from interface: `IElementList`
      Get the (secondary) id of the view where this element list will be shown.
      Specified by:
        `setTableViewID` in interface `IElementList`
      Parameters:
        `pTableViewID` - the view id of this list

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2015 Micro Focus GmbH. All rights reserved.