com.microfocus.awm.core

## Class TaurusUtility

- java.lang.Object
- - com.microfocus.awm.core.TaurusUtility

-     public class TaurusUtility
      extends java.lang.Object

  Contains several helper methods to execute various AWM related operations, e.g. reading contents of a file descriptor ( `readFile(FileDescriptor, IExecutionContext)`, checking enabled conditions ( `checkEnabledCondition(REnabledConditionBase, int, IExecutionContext)` ), etc.
  Author:
    Micro Focus

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `FILE_SEPARATOR` "file.separator" Java Property.
    `static java.lang.String` | `LINE_SEPARATOR` "line.separator" Java property.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaurusUtility()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addLines(java.util.List<java.lang.Integer> pLineList, java.util.Map<Property,IPropertyValue> pPropertyMap)` Searches for the special property EditMarkerLineNo and adds the property value to the given list of line numbers.
    `static java.lang.String` | `applyXMLEscapeCharacters(java.lang.String pText)` Replaces certain characters with XML escape sequences for the given text.
    `static void` | `associatePropertyGroup(IElement pElement, org.eclipse.core.resources.IFile pFile)` Associate the property group corresponding to the giving element to the giving file.
    `static boolean` | `checkEnabledCondition(REnabledConditionBase pEnabledCond, IExecutionContext pContext)` Deprecated. use `evaluateEnabledCondition(REnabledConditionBase, IExecutionContext)` instead
    `static boolean` | `checkEnabledCondition(REnabledConditionBase pEnabledCond, int pSelCount, IExecutionContext pContext)` Deprecated. use `evaluateEnabledCondition(REnabledConditionBase, int, IExecutionContext)` instead
    `static boolean` | `checkEnabledCondition(REnabledConditionBase pEnabledCond, IResource[] pResources, ISystemImage pImg)` Deprecated. use `evaluateEnabledCondition(REnabledConditionBase, com.microfocus.awm.model.IResource[], ISystemImage)` instead
    `static java.util.List<java.lang.Integer>` | `checkLineProp(IElementListEntry pElementListEntry)` Checks for the element list entry, its parent and its children if the edit marker line property is set.
    `static void` | `clearActiveApplicationFileCache(org.eclipse.core.runtime.IProgressMonitor pMonitor)` Deletes the active application file cache
    `static void` | `clearApplicationPropertyCache(ITaurusApplication pApplication)` Clears the active application property cache
    `static boolean` | `containsReference(java.lang.String pValue)` Checks whether the given value contains a reference.
    `static void` | `createStatusMessage(java.lang.String pMsg, java.lang.String pPluginID, int pSeverity)` Creates an IStatus, visible to the user (Problems View).
    `static java.lang.String` | `createStructuredContents(FileDescriptor pTargetStructure, IPropertyData pPropData)` Creates a structured document from a file descriptor structure and `IPropertyData`.
    `static void` | `deletePropertyGroup(IElement pElement)` Removes a property group from the given element.
    `static boolean` | `doLocalSyntaxCheck(IElement pElement, org.eclipse.core.resources.IFile file)` Perform the local syntax check to a giving element.
    `static void` | `downloadCopyBooks(IElement pElement, FileDescriptor pFileDescr, java.lang.String pLanguageCategory, IExecutionContext pContext)` Download the copybooks from host.
    `static IEnabledConditionEvaluationResult` | `evaluateEnabledCondition(REnabledConditionBase pEnabledCond, IExecutionContext pContext)` Evaluates an enabled condition on the given context.
    `static IEnabledConditionEvaluationResult` | `evaluateEnabledCondition(REnabledConditionBase pEnabledCond, int pSelCount, IExecutionContext pContext)` Evaluates an enabled condition on the given context.
    `static IEnabledConditionEvaluationResult` | `evaluateEnabledCondition(REnabledConditionBase pEnabledCond, IResource[] pResources, ISystemImage pImg)` Calls `evaluateEnabledCondition(REnabledConditionBase, int, IExecutionContext)` for every given resource.
    `static ITaurusApplication` | `getActiveApplication()` Gets the currently active application.
    `static org.eclipse.core.resources.IFolder` | `getActiveApplicationFileCache()` Returns the internal file cache folder of the given application.
    `static boolean` | `getBooleanValue(Property pProperty, java.lang.String pParameterValue)` Returns `true` under following conditions: The given value equals (ignore case) `true` or `1` Or if the value equals (ignore case) the true-value of the given `Property` Returns `false` under following conditions: The given value equals (ignore case) `false` or `0` Or if the value equals (ignore case) the false-value of the given property
    `static org.eclipse.core.resources.IResource` | `getEclipseResource(java.lang.String pResourcePath)` Tries to get an Eclipse resource from the given path.
    `static org.eclipse.core.resources.IFolder` | `getInternalFileBackUp()` Returns the internal file backUp folder of the given application.
    `static org.eclipse.core.resources.IFolder` | `getInternalFileCache()` Returns a folder within the internal TAURUS project which can be used to store files.
    `static org.eclipse.core.resources.IProject` | `getInternalTaurusProject()`
    `static java.lang.String` | `getLinkedPropertyValue(LinkedProperty pLinkedProperty, IExecutionContext pContext)` Get the value of the given linked property
    `static java.lang.String` | `getPropertyGroupName(IElement pElement)` Gets the property group name of the element.
    `static java.lang.String` | `getSystemFolderName()` Gets the name of the system folder within the internal project from the currently loaded application.
    `static java.lang.String` | `getTableViewIDFromElementList(IElementList pElementList, IExecutionContext pContext)` Gets the table view ID of the giving `IElementList`.
    `static java.lang.String` | `getTableViewLabelElementList(IElementList pElementList, IExecutionContext pContext)` Gets the table view label of the giving `IElementList`.
    `static org.eclipse.core.resources.IFolder` | `getTaurusApplFolder()` Returns the workspace folder of the currently loaded application.
    `static ITaurusSystem` | `getTaurusSystem(java.lang.String pHostName, int pPort)` Returns an `ITaurusSystem` for the given host name and IP or `null` if no TAURUS System exists for these connection parameters.
    `static org.eclipse.core.resources.IFile` | `getWorkspaceFile(FileDescriptor pWsFileDescriptor, IExecutionContext pContext)` Returns the physical representation of the File Descriptor, if there is one.
    `static boolean` | `isTaurusDebugEnabled()` Checks for the debug flag of the TAURUS Plug-In.
    `static void` | `logError(java.lang.String pString, java.lang.Exception pE)` Deprecated. Use `AWMLoggingUtility.logError(String, Exception)` instead.
    `static void` | `logError(java.lang.String pString, java.lang.Exception pE, int pSeverity)` Deprecated. Use `AWMLoggingUtility.logError(String, Exception, int)` instead.
    `static IErrorFeedbackFileContent` | `parseErrorFeedbackFile(FileDescriptor pFileDescr, IExecutionContext pContext)` Parses an error feedback XML file.
    `static IGetDataResponse` | `readFile(FileDescriptor pFileDescr, IExecutionContext pContext)` Transfers a remote file using an extension point eventually replacing context or system variables (e.g.
    `static java.lang.String` | `readFileToString(FileDescriptor pFileDescr, IExecutionContext pContext)` Reads a file descriptor using `readFile(FileDescriptor, IExecutionContext)` and converts the returned data stream into a string using the code page from the `IGetDataResponse`.
    `static IPropertyData` | `readStructuredContents(java.lang.String pStructuredContents, FileDescriptor pStructuredFileDescriptor)` Parses structured contents based on a file descriptor structure.
    `static void` | `refreshEncodingSettings()` Refreshes the encoding settings of the internal project folder.
    `static boolean` | `refreshLinkedElement(java.lang.String pResourceID, java.lang.String[] pLinkedElementTypeIDs, EChangedKind pKind)` Refreshes linked elements in all AWM views.
    `static boolean` | `refreshRenamedLinkedElement(java.lang.String pOldResourceID, java.lang.String pNewResourceID, java.lang.String pNewName, java.lang.String[] pLinkedElementTypeIDs, boolean pRefreshElement, org.eclipse.core.runtime.IProgressMonitor pMon)` Refreshes renamed linked elements in all AWM views.
    `static java.lang.String` | `resolveReference(java.lang.String pValue, IExecutionContext pContext)` This method needs a TAURUS application to be loaded.
    `static java.lang.String` | `resolveReference(TAURUSConfiguration pTauConf, java.lang.String pValue, IExecutionContext pContext)` Resolves the reference to a Property and returns its Value from the given IExecutionContext.
    `static IPropertyGroupManager` | `searchForPropertyGroupManager()` Uses the `com.microfocus.awm.errorfeedback` extension point to find a property group manager.
    `static org.eclipse.core.resources.IMarker` | `setIMarkers(org.eclipse.core.resources.IFile pFile, java.util.List<java.lang.Integer> pLineNoList)` Sets IMarkers in the given file.
    `static java.lang.String[]` | `split(java.lang.String pString, java.lang.String pDelimiter)` Splits this string around matches of the given delimiter.
    `static java.lang.String[]` | `streamToLines(java.io.InputStream pIs)` Converts the given input stream into an array of lines.
    `static java.lang.String` | `streamToString(java.io.InputStream pIs)` Converts the given input stream to a string using UTF-8 encoding.
    `static java.lang.String` | `streamToString(java.io.InputStream pIs, java.nio.charset.Charset pCharset)` Converts the given input stream to a string.
    `static void` | `traceMessage(java.lang.String pMsg)` Deprecated. Use `AWMLoggingUtility.traceMessage(String)` instead.
    `static void` | `traceMessage(java.lang.String pMsg, boolean pForceTrace)` Deprecated. Use `AWMLoggingUtility.traceMessage(String, boolean)` instead.
    `static void` | `traceMessage(java.lang.String pMsg, int pSeverity)` Deprecated. Use `AWMLoggingUtility.traceMessage(String, int)` instead.
    `static void` | `traceMessage(java.lang.String pMsg, int pSeverity, boolean pForce)` Deprecated. Use `AWMLoggingUtility.traceMessage(String, int, boolean)` instead.
    `static void` | `traceStatus(org.eclipse.core.runtime.IStatus pStatus, boolean pForce)` Deprecated. Use `AWMLoggingUtility.traceStatus(IStatus, boolean)` instead.
    `static void` | `writeFile(java.io.InputStream pIS, FileDescriptor pFileDescr, IExecutionContext pContext, org.eclipse.core.runtime.IProgressMonitor pMon)` Sets the content of a file.

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

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

- - ### Field Detail

    - #### LINE_SEPARATOR

          public static final java.lang.String LINE_SEPARATOR

      "line.separator" Java property.
      See Also:
        `System.getProperty(String)`

    - #### FILE_SEPARATOR

          public static final java.lang.String FILE_SEPARATOR

      "file.separator" Java Property.
      See Also:
        `System.getProperty(String)`

  - ### Constructor Detail

    - #### TaurusUtility

          public TaurusUtility()

  - ### Method Detail

    - #### readFile

          public static IGetDataResponse readFile(FileDescriptor pFileDescr,
                                                  IExecutionContext pContext)
                                           throws java.io.IOException

      Transfers a remote file using an extension point eventually replacing context or system variables (e.g. &userid.) in the file and return the content of the file as input stream.
      Parameters:
        `pFileDescr` - file descriptor of the file to be transfered
        `pContext` - execution context; needed for the context variable replacement; can be null if no replacement is necessary
      Returns:
        content of the file as input stream
      Throws:
        `java.io.IOException` - when the file could not be read

    - #### readFileToString

          public static java.lang.String readFileToString(FileDescriptor pFileDescr,
                                                          IExecutionContext pContext)
                                                   throws java.io.IOException

      Reads a file descriptor using `readFile(FileDescriptor, IExecutionContext)` and converts the returned data stream into a string using the code page from the `IGetDataResponse`.
      Parameters:
        `pFileDescr` - file descriptor of the file to be transfered
        `pContext` - execution context; needed for the context variable replacement; can be null if no replacement is necessary
      Returns:
        decoded contents of the file
      Throws:
        `java.io.IOException` - when the file could not be read

    - #### associatePropertyGroup

          public static void associatePropertyGroup(IElement pElement,
                                                    org.eclipse.core.resources.IFile pFile)
                                             throws TaurusCoreException,
                                                    TaurusToolException

      Associate the property group corresponding to the giving element to the giving file.
      Parameters:
        `pElement` - the element which corresponding property group will be searched.
        `pFile` - the local file on which the property group will be associated
      Throws:
        `TaurusCoreException` - if an exception occurs during property group association process
        `TaurusToolException` - cannot occur anymore

    - #### doLocalSyntaxCheck

          public static boolean doLocalSyntaxCheck(IElement pElement,
                                                   org.eclipse.core.resources.IFile file)
                                            throws TaurusException

      Perform the local syntax check to a giving element.
      Parameters:
        `pElement` - the element
        `file` - the file containing the element contents
      Returns:
        true if the local syntax check was successfully executed
      Throws:
        `TaurusException` - if the local syntax check fails

    - #### parseErrorFeedbackFile

          public static IErrorFeedbackFileContent parseErrorFeedbackFile(FileDescriptor pFileDescr,
                                                                         IExecutionContext pContext)
                                                                  throws TaurusException

      Parses an error feedback XML file.
      Parameters:
        `pFileDescr` - the file descriptor for the XML file
        `pContext` - the execution context
      Returns:
        information contained in the error feedback file
      Throws:
        `TaurusCoreException` - error reading the error feedback file
        `TaurusException` - if no extension was found for parsing the file, the file could not be found/read or the parsing itself failed.

    - #### createStatusMessage

          public static void createStatusMessage(java.lang.String pMsg,
                                                 java.lang.String pPluginID,
                                                 int pSeverity)

      Creates an IStatus, visible to the user (Problems View).
      Parameters:
        `pMsg` - The message to be displayed
        `pPluginID` - The ID of the calling Plug-In (can be anything but `null`)
        `pSeverity` - The severity of the message ( `IStatus.ERROR, IStatus.WARNING, IStatus.INFO`)

    - #### downloadCopyBooks

          public static void downloadCopyBooks(IElement pElement,
                                               FileDescriptor pFileDescr,
                                               java.lang.String pLanguageCategory,
                                               IExecutionContext pContext)
                                        throws TaurusException

      Download the copybooks from host.
      Parameters:
        `pElement` - element whose property 'PropertyGroup' will be associated with the corresponding file
        `pFileDescr` - file descriptor pointing to the file that contains the copybooks to be down loaded
        `pLanguageCategory` - category for the property group to be associated with the element's resource
        `pContext` - execution context
      Throws:
        `TaurusException` - if a Taurus exception occurs

    - #### deletePropertyGroup

          public static void deletePropertyGroup(IElement pElement)
                                          throws TaurusCoreException,
                                                 org.eclipse.core.runtime.CoreException

      Removes a property group from the given element.
      Parameters:
        `pElement` - the element
      Throws:
        `TaurusCoreException` - if deleting the property group fails
        `org.eclipse.core.runtime.CoreException` - if deleting the property group fails

    - #### searchForPropertyGroupManager

          public static IPropertyGroupManager searchForPropertyGroupManager()
                                                                     throws TaurusCoreException

      Uses the `com.microfocus.awm.errorfeedback` extension point to find a property group manager.
      Returns:
        the property group manager
      Throws:
        `TaurusCoreException` - if no property group manager extension was found

    - #### getPropertyGroupName

          public static java.lang.String getPropertyGroupName(IElement pElement)

      Gets the property group name of the element. Only returns the property value of an element property with the attribute `Special Property = Property_Group` (not the name of an associated property group). Returns `null` if no property group property is set.
      Parameters:
        `pElement` - the element
      Returns:
        the property group name or `null`
      See Also:
        `ESpecialProperties.PROPERTY_GROUP`

    - #### writeFile

          public static void writeFile(java.io.InputStream pIS,
                                       FileDescriptor pFileDescr,
                                       IExecutionContext pContext,
                                       org.eclipse.core.runtime.IProgressMonitor pMon)
                                throws java.io.IOException,
                                       TaurusCoreException

      Sets the content of a file.
      Parameters:
        `pIS` - the new content
        `pFileDescr` - file descriptor
        `pContext` - execution context
        `pMon` - a progress monitor
      Throws:
        `java.io.IOException` - if an I/O exception occurs while trying to write the file
        `TaurusCoreException` - if no file descriptor reader extension point was found for the given file

    - #### isTaurusDebugEnabled

          public static boolean isTaurusDebugEnabled()

      Checks for the debug flag of the TAURUS Plug-In.
      Returns:
        `true` if both debug flags of the `com.microfocus.awm` Plug-In have been enabled

    - #### traceMessage

          @Deprecated
          public static void traceMessage(java.lang.String pMsg,
                                                       int pSeverity)

      Deprecated. Use `AWMLoggingUtility.traceMessage(String, int)` instead.
      Creates a log message if AWM debugging is turned on.

      Same as calling `traceMessage(pMsg, pSeverity, false)`.

      Parameters:
        `pMsg` - the message to log.
        `pSeverity` - `IStatus.INFO`, `IStatus.WARNING` or `IStatus.ERROR`
      See Also:
        `traceMessage(String)`

    - #### traceMessage

          @Deprecated
          public static void traceMessage(java.lang.String pMsg,
                                                       int pSeverity,
                                                       boolean pForce)

      Deprecated. Use `AWMLoggingUtility.traceMessage(String, int, boolean)` instead.
      Creates a log message if AWM debugging is turned on or the force flag is set to `true`.
      Parameters:
        `pMsg` - the message to log.
        `pSeverity` - `IStatus.INFO`, `IStatus.WARNING` or `IStatus.ERROR`
        `pForce` - whether to trace the message even if debug is disabled

    - #### traceStatus

          @Deprecated
          public static void traceStatus(org.eclipse.core.runtime.IStatus pStatus,
                                                      boolean pForce)

      Deprecated. Use `AWMLoggingUtility.traceStatus(IStatus, boolean)` instead.
      Logs an `IStatus` if AWM debugging is turned on or the force flag is set to `true`.
      Parameters:
        `pStatus` - the status to log
        `pForce` - whether to trace the message even if debug is disabled

    - #### traceMessage

          @Deprecated
          public static void traceMessage(java.lang.String pMsg)

      Deprecated. Use `AWMLoggingUtility.traceMessage(String)` instead.
      Creates a log message if AWM debugging is turned on.

      Same as calling `traceMessage(pMsg, IStatus.INFO, false)`.

      Parameters:
        `pMsg` - the message to log.

    - #### traceMessage

          @Deprecated
          public static void traceMessage(java.lang.String pMsg,
                                                       boolean pForceTrace)

      Deprecated. Use `AWMLoggingUtility.traceMessage(String, boolean)` instead.
      Creates a log message if AWM debugging is turned on or the force flag is set to `true`.

      Same as calling `traceMessage(pMsg, IStatus.INFO, pForceTrace)`.

      Parameters:
        `pMsg` - the message to log.
        `pForceTrace` - option to force the tracing

    - #### streamToString

          public static java.lang.String streamToString(java.io.InputStream pIs)
                                                 throws java.io.IOException

      Converts the given input stream to a string using UTF-8 encoding.
      Parameters:
        `pIs` - the input stream
      Returns:
        the encoded stream
      Throws:
        `java.io.IOException` - if reading the stream fails

    - #### streamToString

          public static java.lang.String streamToString(java.io.InputStream pIs,
                                                        java.nio.charset.Charset pCharset)
                                                 throws java.io.IOException

      Converts the given input stream to a string.
      Parameters:
        `pIs` - the input stream
        `pCharset` - the encoding character set
      Returns:
        the encoded stream
      Throws:
        `java.io.IOException` - if reading the stream fails

    - #### streamToLines

          public static java.lang.String[] streamToLines(java.io.InputStream pIs)

      Converts the given input stream into an array of lines.

      Warning: Does not throw an exception if errors occur but pops up an error dialog.

      Parameters:
        `pIs` - the input stream
      Returns:
        an array of lines

    - #### getInternalTaurusProject

          public static org.eclipse.core.resources.IProject getInternalTaurusProject()
                                                                              throws TaurusCoreException

      Returns:
        the TAURUS Eclipse project, which is used by TAURUS for caching all persistent data.
      Throws:
        `TaurusCoreException` - if the project could not be retrieved or created

    - #### getInternalFileCache

          public static org.eclipse.core.resources.IFolder getInternalFileCache()
                                                                         throws TaurusCoreException

      Returns a folder within the internal TAURUS project which can be used to store files. The folder will never be deleted or cleared by TAURUS, so cache files must be deleted manually.
      Returns:
        an existing `IFolder`
      Throws:
        `TaurusCoreException` - if the folder (or the internal TAURUS project) could not be created

    - #### getInternalFileBackUp

          public static org.eclipse.core.resources.IFolder getInternalFileBackUp()
                                                                          throws TaurusCoreException

      Returns the internal file backUp folder of the given application.
      Returns:
        an existing `IFolder`
      Throws:
        `TaurusCoreException` - if the folder (or TAURUS application folder) could not be created

    - #### getActiveApplicationFileCache

          public static org.eclipse.core.resources.IFolder getActiveApplicationFileCache()
                                                                                  throws TaurusCoreException

      Returns the internal file cache folder of the given application.
      Returns:
        an existing `IFolder`
      Throws:
        `TaurusCoreException` - if the folder (or TAURUS application folder) could not be created

    - #### getTaurusApplFolder

          public static org.eclipse.core.resources.IFolder getTaurusApplFolder()
                                                                        throws TaurusCoreException

      Returns the workspace folder of the currently loaded application. Creates the folder if it does not exist and returns `null` if no application is currently loaded.
      Returns:
        folder of the loaded application or `null` if no application is loaded
      Throws:
        `TaurusCoreException` - when getting/creating the application folder fails (e.g. workspace is out of sync)

    - #### resolveReference

          public static java.lang.String resolveReference(java.lang.String pValue,
                                                          IExecutionContext pContext)

      This method needs a TAURUS application to be loaded. Resolves the reference to a Property and returns its Value from the given IExecutionContext. If the Property could not be found the Reference will be returned without changes.
      Parameters:
        `pValue` - a String containing (possible) references
        `pContext` - the `IExecutionContext` which shall be used for resolving property references
      Returns:
        the resolved reference or the given or the unaltered String, if there was no reference to resolve
      See Also:
        `resolveReference(TAURUSConfiguration, String, IExecutionContext)`

    - #### containsReference

          public static boolean containsReference(java.lang.String pValue)

      Checks whether the given value contains a reference.
      Parameters:
        `pValue` - the value to check
      Returns:
        `true` only if the given value contains a reference

    - #### resolveReference

          public static java.lang.String resolveReference(TAURUSConfiguration pTauConf,
                                                          java.lang.String pValue,
                                                          IExecutionContext pContext)

      Resolves the reference to a Property and returns its Value from the given IExecutionContext. If the Property could not be found the Reference will be returned without changes.
      Parameters:
        `pTauConf` - the model
        `pValue` - a String containing (possible) references
        `pContext` - the `IExecutionContext` which shall be used for resolving property references
      Returns:
        the resolved reference or the given or the unaltered String, if there was no reference to resolve

    - #### checkEnabledCondition

          @Deprecated
          public static boolean checkEnabledCondition(REnabledConditionBase pEnabledCond,
                                                                   int pSelCount,
                                                                   IExecutionContext pContext)

      Deprecated. use `evaluateEnabledCondition(REnabledConditionBase, int, IExecutionContext)` instead
      Checks an enabled condition on the given context.
      Parameters:
        `pEnabledCond` - the enabled condition
        `pSelCount` - the number of selected items (only relevant for `RSelectionEnabledCondition` and `RSelectionVisibleCondition`)
        `pContext` - the `IExecutionContext`
      Returns:
        `true` if the condition was satisfied, `false` otherwise
      See Also:
        `checkEnabledCondition(REnabledConditionBase, com.microfocus.awm.model.IResource[], ISystemImage)`

    - #### evaluateEnabledCondition

          public static IEnabledConditionEvaluationResult evaluateEnabledCondition(REnabledConditionBase pEnabledCond,
                                                                                   int pSelCount,
                                                                                   IExecutionContext pContext)

      Evaluates an enabled condition on the given context.
      Parameters:
        `pEnabledCond` - the enabled condition
        `pSelCount` - the number of selected items (only relevant for `RSelectionEnabledCondition` and `RSelectionVisibleCondition`)
        `pContext` - the `IExecutionContext`
      Returns:
        an `IEnabledConditionEvaluationResult` instance. It contains information whether the enabled condition is satisfied.
      See Also:
        `checkEnabledCondition(REnabledConditionBase, com.microfocus.awm.model.IResource[], ISystemImage)`

    - #### checkEnabledCondition

          @Deprecated
          public static boolean checkEnabledCondition(REnabledConditionBase pEnabledCond,
                                                                   IExecutionContext pContext)

      Deprecated. use `evaluateEnabledCondition(REnabledConditionBase, IExecutionContext)` instead
      Checks an enabled condition on the given context.
      Parameters:
        `pEnabledCond` - the enabled condition
        `pContext` - the `IExecutionContext`
      Returns:
        `true` if the condition was fulfilled, `false` otherwise

    - #### evaluateEnabledCondition

          public static IEnabledConditionEvaluationResult evaluateEnabledCondition(REnabledConditionBase pEnabledCond,
                                                                                   IExecutionContext pContext)

      Evaluates an enabled condition on the given context.
      Parameters:
        `pEnabledCond` - the enabled condition
        `pContext` - the `IExecutionContext`
      Returns:
        an `IEnabledConditionEvaluationResult` instance. It contains information whether the enabled condition is satisfied.

    - #### checkEnabledCondition

          @Deprecated
          public static boolean checkEnabledCondition(REnabledConditionBase pEnabledCond,
                                                                   IResource[] pResources,
                                                                   ISystemImage pImg)

      Deprecated. use `evaluateEnabledCondition(REnabledConditionBase, com.microfocus.awm.model.IResource[], ISystemImage)` instead
      Calls `#checkEnabledCondition(REnabledConditionBase, com.microfocus.awm.model.IResource[], IExecutionContext)` for every given resource. Returns `false` as soon as one check is negative (`false`).
      Parameters:
        `pEnabledCond` - the enabled condition
        `pResources` - the selected resources (only relevant for `RSelectionEnabledCondition` and `RSelectionVisibleCondition`)
        `pImg` - the `ISystemImage`
      Returns:
        `true` if the condition was fulfilled, `false` otherwise

    - #### evaluateEnabledCondition

          public static IEnabledConditionEvaluationResult evaluateEnabledCondition(REnabledConditionBase pEnabledCond,
                                                                                   IResource[] pResources,
                                                                                   ISystemImage pImg)

      Calls `evaluateEnabledCondition(REnabledConditionBase, int, IExecutionContext)` for every given resource. Returns `false` as soon as one check is negative (`false`).
      Parameters:
        `pEnabledCond` - the enabled condition
        `pResources` - the selected resources (only relevant for `RSelectionEnabledCondition` and `RSelectionVisibleCondition`)
        `pImg` - the `ISystemImage`
      Returns:
        an `IEnabledConditionEvaluationResult` which represents the evaluation result. The evaluation result will be satisfied if the check is positive for all given resources and not satisfied as soon as one check fails.

    - #### getSystemFolderName

          public static java.lang.String getSystemFolderName()

      Gets the name of the system folder within the internal project from the currently loaded application.
      Returns:
        the system folder name

    - #### getWorkspaceFile

          public static org.eclipse.core.resources.IFile getWorkspaceFile(FileDescriptor pWsFileDescriptor,
                                                                          IExecutionContext pContext)
                                                                   throws TaurusCoreException

      Returns the physical representation of the File Descriptor, if there is one.
      Parameters:
        `pWsFileDescriptor` - file descriptor with type `EFileTypes.WORKSPACE_FILE`
        `pContext` - the context
      Returns:
        an existing IFile or `null`, if the File Descriptor does not point at a Workspace file or the file does not exist.
      Throws:
        `TaurusCoreException` - if the file descriptor does not contain a valid physical name or the workspace file does not exist

    - #### split

          public static java.lang.String[] split(java.lang.String pString,
                                                 java.lang.String pDelimiter)

      Splits this string around matches of the given delimiter.
      Parameters:
        `pString` - the string
        `pDelimiter` - the delimiter to be used. Several characters will be used as one delimiter.
      Returns:
        the splitted string

    - #### getTaurusSystem

          public static ITaurusSystem getTaurusSystem(java.lang.String pHostName,
                                                      int pPort)
                                               throws TaurusCoreException

      Returns an `ITaurusSystem` for the given host name and IP or `null` if no TAURUS System exists for these connection parameters.
      Parameters:
        `pHostName` - the host name of the desired TAURUS System
        `pPort` - the used port for the TAURUS System
      Returns:
        an `ITaurusSystem` or `null`
      Throws:
        `TaurusCoreException` - if an exception occurs while loading the systems

    - #### getActiveApplication

          public static ITaurusApplication getActiveApplication()

      Gets the currently active application.
      Returns:
        the active application

    - #### checkLineProp

          public static java.util.List<java.lang.Integer> checkLineProp(IElementListEntry pElementListEntry)

      Checks for the element list entry, its parent and its children if the edit marker line property is set.
      Parameters:
        `pElementListEntry` - element list entry to be checked
      Returns:
        list of line numbers which should be marked by an IMarker in the editor

    - #### addLines

          public static void addLines(java.util.List<java.lang.Integer> pLineList,
                                      java.util.Map<Property,IPropertyValue> pPropertyMap)

      Searches for the special property EditMarkerLineNo and adds the property value to the given list of line numbers.
      Parameters:
        `pLineList` - list of line numbers
        `pPropertyMap` - property map in which the EditMarkerLineNo property is searched

    - #### refreshEncodingSettings

          public static void refreshEncodingSettings()
                                              throws TaurusCoreException

      Refreshes the encoding settings of the internal project folder.

      The encoding settings are located under the following path:
      `[internal project]\.settings\org.eclipse.core.resources.prefs`

      Throws:
        `TaurusCoreException` - if getting the internal project fails
      See Also:
        `getInternalTaurusProject()`

    - #### setIMarkers

          public static org.eclipse.core.resources.IMarker setIMarkers(org.eclipse.core.resources.IFile pFile,
                                                                       java.util.List<java.lang.Integer> pLineNoList)
                                                                throws org.eclipse.core.runtime.CoreException

      Sets IMarkers in the given file.
      Parameters:
        `pFile` - file
        `pLineNoList` - list of line numbers at which IMarkers should be set
      Returns:
        first IMarker set in the file
      Throws:
        `org.eclipse.core.runtime.CoreException` - if deleting old markers or setting new ones fails

    - #### logError

          @Deprecated
          public static void logError(java.lang.String pString,
                                                   java.lang.Exception pE)

      Deprecated. Use `AWMLoggingUtility.logError(String, Exception)` instead.
      Logs an Error with the given messages, which will be visible in the Eclipse Error Log View.
      Parameters:
        `pString` - a user-readable message
        `pE` - the exception
      See Also:
        `logError(String, Exception, int)`

    - #### logError

          @Deprecated
          public static void logError(java.lang.String pString,
                                                   java.lang.Exception pE,
                                                   int pSeverity)

      Deprecated. Use `AWMLoggingUtility.logError(String, Exception, int)` instead.
      Logs an Error with the given messages and severity, which will be visible in the Eclipse Error Log View.
      Parameters:
        `pString` - a user-readable message
        `pE` - the exception
        `pSeverity` - the severity (`IStatus` constants)
      See Also:
        `logError(String, Exception)`

    - #### getBooleanValue

          public static boolean getBooleanValue(Property pProperty,
                                                java.lang.String pParameterValue)
                                         throws TaurusToolException

      Returns `true` under following conditions:
    - The given value equals (ignore case) `true` or `1`
    - Or if the value equals (ignore case) the true-value of the given `Property`
      Returns `false` under following conditions:
    - The given value equals (ignore case) `false` or `0`
    - Or if the value equals (ignore case) the false-value of the given property

Parameters:
  `pProperty` - the property
  `pParameterValue` - the value (e.g. `true`, `0`, `NO`, etc.)
Returns:
  the resolved boolean value
Throws:
  `TaurusToolException` - if the given value is neither `true/false`, `0/1` or one of the properties true/false values.
See Also:
  `Property.getTrueValue()`, `Property.getFalseValue()`

- #### getTableViewIDFromElementList

      public static java.lang.String getTableViewIDFromElementList(IElementList pElementList,
                                                                   IExecutionContext pContext)

  Gets the table view ID of the giving `IElementList`. The ID will first be searched in the modeled action descriptor of the giving element list and then in its element list structure.
  Parameters:
    `pElementList` - the element list which ID will be get
    `pContext` - the context used to get the element list ID
  Returns:
    the element list ID or `null` if no label has been modeled

- #### getTableViewLabelElementList

      public static java.lang.String getTableViewLabelElementList(IElementList pElementList,
                                                                  IExecutionContext pContext)

  Gets the table view label of the giving `IElementList`. The label will first be searched in the modeled action descriptor of the giving element list and then in its element list structure.
  Parameters:
    `pElementList` - the element list which label will be get
    `pContext` - the context used to get the element list label
  Returns:
    the element list label or `null` if no label has been modeled

- #### getEclipseResource

      public static org.eclipse.core.resources.IResource getEclipseResource(java.lang.String pResourcePath)

  Tries to get an Eclipse resource from the given path.
  Parameters:
    `pResourcePath` - the resource path (can be an absolute file path or a workspace relative path)
  Returns:
    the resolved resource or `null` if no resource with such an ID exists

- #### getLinkedPropertyValue

      public static java.lang.String getLinkedPropertyValue(LinkedProperty pLinkedProperty,
                                                            IExecutionContext pContext)

  Get the value of the given linked property
  Parameters:
    `pLinkedProperty` - the linked property
    `pContext` - the execution context can be `null.`
  Returns:
    the value of a linked property

- #### clearActiveApplicationFileCache

      public static void clearActiveApplicationFileCache(org.eclipse.core.runtime.IProgressMonitor pMonitor)
                                                  throws TaurusCoreException,
                                                         org.eclipse.core.runtime.CoreException

  Deletes the active application file cache
  Parameters:
    `pMonitor` - a progress monitor
  Throws:
    `TaurusCoreException` - error getting the ActiveApplicationFileCache
    `org.eclipse.core.runtime.CoreException` - error while refreshing local changes

- #### clearApplicationPropertyCache

      public static void clearApplicationPropertyCache(ITaurusApplication pApplication)
                                                throws TaurusCoreException

  Clears the active application property cache
  Parameters:
    `pApplication` - the application which cache should be cleared
  Throws:
    `TaurusCoreException` - error getting the ActiveApplicationFileCache

- #### applyXMLEscapeCharacters

      public static java.lang.String applyXMLEscapeCharacters(java.lang.String pText)

  Replaces certain characters with XML escape sequences for the given text. This can be used before values are stored in XML.

  The following characters are replaced with corresponding escape sequences:

  Character | Result
  --- | ---
  < |
  > |
  & |
  " |
  ' |

  Parameters:
    `pText` - the text to convert
  Returns:
    the converted text. If none of the characters in the table above are contained, the text will be unchanged.

- #### refreshLinkedElement

      public static boolean refreshLinkedElement(java.lang.String pResourceID,
                                                 java.lang.String[] pLinkedElementTypeIDs,
                                                 EChangedKind pKind)
                                          throws TaurusCoreException

  Refreshes linked elements in all AWM views.

  This method causes refreshes of AWM views. If this method is executed from a none UI thread, the views most commonly execute the refresh operation in a synchronous UI thread.
  It is recommended to use `TaurusUIUtility#refreshLinkedElement(String, String[], EChangedKind)` which will refresh AWM views in the background (asynchronously), effectively preventing potential UI conflicts.

  Note: The change kind `EChangedKind.ADDED` has two requirements in order to be processed successfully:
  1. The linked element type must have an `ILinkedElementIdentificator` associated to it.
  2. The parent of the added element must be a linked element type included in the given array of linked element type IDs.
  If one of these requirements is not guaranteed, the caller should resolve the parent object manually and call this method with the parent ID and the kind `EChangedKind.CHANGED`.

  Note about resource identifiers:
  It is recommended to use only one key property in ID definitions of linked elements. Otherwise AWM concatenates key properties using underscore (`_`) as separator. In this case, resource ID parameters must be formatted like this:

  `[resource ID segment 1]_[resource ID segment 2]`...

  Parameters:
    `pResourceID` - the identifier of the resource that needs to be refreshed. See note about "Resource Identifier" above.
    `pLinkedElementTypeIDs` - array of linked element type IDs which elements can be identified by the given resource ID
    `pKind` - the kind of change that occurred to the resource. Uses `IResourceDelta` constants
  Returns:
    returns `true` when an element with the given ID was found and `false` when it was not. Always returns `false` if no AWM application is loaded.
  Throws:
    `TaurusCoreException` - if an exception occurs while refreshing the target AWM element. Does not throw an exception if the changed element has not been found (returns `false` in that case).
  See Also:
    `refreshRenamedLinkedElement(String, String, String, String[], boolean, IProgressMonitor)`

- #### refreshRenamedLinkedElement

      public static boolean refreshRenamedLinkedElement(java.lang.String pOldResourceID,
                                                        java.lang.String pNewResourceID,
                                                        java.lang.String pNewName,
                                                        java.lang.String[] pLinkedElementTypeIDs,
                                                        boolean pRefreshElement,
                                                        org.eclipse.core.runtime.IProgressMonitor pMon)
                                                 throws TaurusException

  Refreshes renamed linked elements in all AWM views.

  See `refreshLinkedElement(String, String[], EChangedKind)` for an important note on resource identifier parameters.

  Parameters:
    `pOldResourceID` - old identifier of the renamed resource
    `pNewResourceID` - new identifier of the renamed resource
    `pNewName` - the new element name to be set as property value of the `Element Name` property.
    `pLinkedElementTypeIDs` - array of linked element type IDs which elements can be identified by the given resource ID
    `pRefreshElement` - whether to call the new element's `Get All Properties` action after it has been created. Does nothing, if the element does not have a `Get All Properties` action. Refreshing all properties might reduce performance of rename operations.
    `pMon` - a progress monitor
  Returns:
    `true` if the renamed resource could be updated
  Throws:
    `TaurusException` - if an exception occurs while trying to refresh the new element's properties
  See Also:
    `RElementProperty.isElementName()`

- #### createStructuredContents

      public static java.lang.String createStructuredContents(FileDescriptor pTargetStructure,
                                                              IPropertyData pPropData)
                                                       throws TaurusCoreException

  Creates a structured document from a file descriptor structure and `IPropertyData`.
  Parameters:
    `pTargetStructure` - the `FileDescriptor` which is used to retrieve the file descriptor structure `FileDescriptor.getFileStructure()`
    `pPropData` - the `IPropertyData` which is used to create the file content.
  Returns:
    a `String` containing the file contents.
  Throws:
    `TaurusCoreException` - if an exception occurs while creating the structured content.
  See Also:
    `IStructureType.createStructure(FileDescriptor, IPropertyData)`

- #### readStructuredContents

      public static IPropertyData readStructuredContents(java.lang.String pStructuredContents,
                                                         FileDescriptor pStructuredFileDescriptor)
                                                  throws TaurusCoreException

  Parses structured contents based on a file descriptor structure.
  Parameters:
    `pStructuredContents` - the structured contents
    `pStructuredFileDescriptor` - a file descriptor containing the structure for the given contents
  Returns:
    the parsed `IPropertyData`
  Throws:
    `TaurusCoreException` - if the given file descriptor is unstructured or parsing the file fails
  See Also:
    `IStructureType.readStructure(FileDescriptor, String)`

Copyright © 2015 Micro Focus GmbH. All rights reserved.