com.microfocus.awm.model.internal

## Class Element

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

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

      public class Element
      extends Resource
      implements IElement

  Main implementation of `IElement`.

  Copyright (C) Micro Focus

  Author:
    Micro Focus

- - ### Field Summary

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

      `_ID, _name`

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

      `ID_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Element(java.lang.String pElementId, ElementType pElementType)` Basic constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete()` Removes this resource and all its children resources from cache.
    `java.util.Map<Property,IPropertyValue>` | `getAllPropertyValues()` Get all property values of this resource.
    `IElementList` | `getChildren(boolean pRefresh, org.eclipse.core.runtime.IProgressMonitor pMon)` Deprecated.
    `IElementList` | `getChildrenElementList()` Gets the element list of children that is created during `getChildren(boolean, IProgressMonitor, IElementListEntry)`.
    `java.util.Set<IElementListEntry>` | `getElementListEntries()` Gets all element list entries for this element.
    `java.lang.String` | `getElementSuffix()` Gets the suffix of this element.
    `ElementType` | `getElementType()` Gets the element type of this element.
    `java.lang.String` | `getName()` Gets the name of the resource.
    `java.lang.String` | `getPropertySetName()` Get the propertySet name that has been associated with the element.
    `java.lang.String` | `getTreeViewLabel()` Deprecated.
    `boolean` | `isRefreshAllPropertyRequired()` Check if a refresh of all property values of this resource is necessary.
    `void` | `refreshAllProperties(IExecutionContext pContext, org.eclipse.core.runtime.IProgressMonitor pMon)` Executes the "GetAllProperties" action of the corresponding Element Type to refresh the Properties of this IElement.
    `void` | `removeChildren()` Removes the local cached children.
    `void` | `setElementType(ElementType pElementType)` Sets the element type of this element.
    `void` | `setName(java.lang.String pELementName)` Sets the name of the resource.
    `void` | `setPropertySetName(java.lang.String pName)` Set the propertySet'name that have been associated to the element.
    `void` | `setRefreshAllPropertyRequired(boolean pRefreshAllPropertyRequired)` Sets the flag whether executing the `getAllProperties` action is required.
    `java.lang.String` | `toString()`

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

      `addChildResource, addPropertyValue, addResourceChild, equals, getChildrenResources, getID, getParentResource, getPropertyValue, getPropertyValueFromHierarchy, getResourceChildren, getValueOfLinkedProperty, hashCode, removeProperty, removeResourceChild, 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, addResourceChild, getChildrenResources, getID, getParentResource, getPropertyValue, getPropertyValueFromHierarchy, getResourceChildren, removeResourceChild, setPropertyValues`

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

      `getAdapter`

- - ### Constructor Detail

    - #### Element

          public Element(java.lang.String pElementId,
                         ElementType pElementType)

      Basic constructor.
      Parameters:
        `pElementId` - the element ID
        `pElementType` - the element type

  - ### Method Detail

    - #### getElementType

          public ElementType getElementType()

      Description copied from interface: `IElement`
      Gets the element type of this element.
      Specified by:
        `getElementType` in interface `IElement`
      Returns:
        the `ElementType`

    - #### setElementType

          public void setElementType(ElementType pElementType)

      Description copied from interface: `IElement`
      Sets the element type of this element. This is used internally and should not be called by clients.
      Specified by:
        `setElementType` in interface `IElement`
      Parameters:
        `pElementType` - the new element type

    - #### setName

          public void setName(java.lang.String pELementName)

      Description copied from interface: `IResource`
      Sets the name of the resource.
      Specified by:
        `setName` in interface `IResource`
      Overrides:
        `setName` in class `Resource`
      Parameters:
        `pELementName` - the new resource name

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `IResource`
      Gets the name of the resource.
      Specified by:
        `getName` in interface `IResource`
      Overrides:
        `getName` in class `Resource`
      Returns:
        the resource name

    - #### getElementSuffix

          public java.lang.String getElementSuffix()

      Description copied from interface: `IElement`
      Gets the suffix of this element.
      Specified by:
        `getElementSuffix` in interface `IElement`
      Returns:
        the element suffix

    - #### refreshAllProperties

          public void refreshAllProperties(IExecutionContext pContext,
                                           org.eclipse.core.runtime.IProgressMonitor pMon)
                                    throws TaurusException

      Description copied from interface: `IElement`
      Executes the "GetAllProperties" action of the corresponding Element Type to refresh the Properties of this IElement. Optionally an `IExecutionContext` can be used to include properties for the tool execution.
      Specified by:
        `refreshAllProperties` in interface `IElement`
      Parameters:
        `pContext` - an execution context or `null`
        `pMon` - progress monitor
      Throws:
        `TaurusException` - if an error occurs during refreshing the properties

    - #### isRefreshAllPropertyRequired

          public boolean isRefreshAllPropertyRequired()

      Description copied from interface: `IElement`
      Check if a refresh of all property values of this resource is necessary.
      Specified by:
        `isRefreshAllPropertyRequired` in interface `IElement`
      Returns:
        `true`, if a refresh of all the resource's properties is necessary, `false` otherwise

    - #### getChildren

          @Deprecated
          public IElementList getChildren(boolean pRefresh,
                                                       org.eclipse.core.runtime.IProgressMonitor pMon)
                                                throws TaurusCoreException

      Deprecated.
      Description copied from interface: `IElement`
      Returns a list of elements, if a `getChildren` action was configured in the TAURUS model
      Specified by:
        `getChildren` in interface `IElement`
      Parameters:
        `pRefresh` - whether to refresh the children first (`true`) or return available cached children (`false`)
        `pMon` - progress monitor
      Returns:
        the children of the element or `null`
      Throws:
        `TaurusCoreException` - if an exception occurs while getting the children

    - #### getTreeViewLabel

          @Deprecated
          public java.lang.String getTreeViewLabel()

      Deprecated.
      Description copied from interface: `IElement`
      Returns an element label, which consists of element property values that have the attribute `isTreeViewLabel` set to `true`
      Specified by:
        `getTreeViewLabel` in interface `IElement`
      Returns:
        the tree view label

    - #### 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 `IElement`
      Specified by:
        `delete` in interface `IResource`
      Overrides:
        `delete` in class `Resource`
      Throws:
        `TaurusCoreException` - if the deletion of the resource fails
      See Also:
        `IResource.getChildrenResources()`

    - #### setRefreshAllPropertyRequired

          public void setRefreshAllPropertyRequired(boolean pRefreshAllPropertyRequired)

      Description copied from interface: `IElement`
      Sets the flag whether executing the `getAllProperties` action is required.
      Specified by:
        `setRefreshAllPropertyRequired` in interface `IElement`
      Parameters:
        `pRefreshAllPropertyRequired` - whether executing the `getAllProperties` action is required

    - #### setPropertySetName

          public void setPropertySetName(java.lang.String pName)

      Description copied from interface: `IElement`
      Set the propertySet'name that have been associated to the element.
      Specified by:
        `setPropertySetName` in interface `IElement`
      Parameters:
        `pName` - the property set name

    - #### getPropertySetName

          public java.lang.String getPropertySetName()

      Description copied from interface: `IElement`
      Get the propertySet name that has been associated with the element.
      Specified by:
        `getPropertySetName` in interface `IElement`
      Returns:
        the element propertySet

    - #### getAllPropertyValues

          public java.util.Map<Property,IPropertyValue> getAllPropertyValues()

      Description copied from interface: `IResource`
      Get all property values of this resource.

      Modifying the returned map will have no effect on the resource.

      Specified by:
        `getAllPropertyValues` in interface `IResource`
      Overrides:
        `getAllPropertyValues` in class `Resource`
      Returns:
        all property values of this resource

    - #### removeChildren

          public void removeChildren()
                              throws TaurusCoreException

      Description copied from interface: `IElement`
      Removes the local cached children.
      Specified by:
        `removeChildren` in interface `IElement`
      Throws:
        `TaurusCoreException` - if the children could not be removed due to an exception

    - #### getChildrenElementList

          public IElementList getChildrenElementList()

      Gets the element list of children that is created during `getChildren(boolean, IProgressMonitor, IElementListEntry)`. In comparison to getChildren(...), this method does never execute an action but simply returns the list (or `null` if the element has no children).
      Specified by:
        `getChildrenElementList` in interface `IElement`
      Returns:
        the children element list

    - #### toString

          public java.lang.String toString()

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

    - #### getElementListEntries

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

      Description copied from interface: `IElement`
      Gets all element list entries for this element.

      The returned list should not be modified by clients.

      Specified by:
        `getElementListEntries` in interface `IElement`
      Returns:
        all element list entries of the element

Copyright © 2015 Micro Focus GmbH. All rights reserved.