public class TaurusUtility
extends java.lang.Object
readFile(FileDescriptor, IExecutionContext), checking enabled
conditions (
checkEnabledCondition(REnabledConditionBase, int, IExecutionContext)
), etc.| 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 and Description |
|---|
TaurusUtility() |
| 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.
|
static boolean |
checkEnabledCondition(REnabledConditionBase pEnabledCond,
int pSelCount,
IExecutionContext pContext)
Deprecated.
|
static boolean |
checkEnabledCondition(REnabledConditionBase pEnabledCond,
IResource[] pResources,
ISystemImage pImg)
|
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.
|
public static final java.lang.String LINE_SEPARATOR
System.getProperty(String)public static final java.lang.String FILE_SEPARATOR
System.getProperty(String)public static IGetDataResponse readFile(FileDescriptor pFileDescr, IExecutionContext pContext) throws java.io.IOException
pFileDescr - file descriptor of the file to be transferedpContext - execution context; needed for the context variable
replacement; can be null if no replacement is necessaryjava.io.IOException - when the file could not be readpublic static java.lang.String readFileToString(FileDescriptor pFileDescr, IExecutionContext pContext) throws java.io.IOException
readFile(FileDescriptor, IExecutionContext) and converts the
returned data stream into a string using the code page from the
IGetDataResponse.pFileDescr - file descriptor of the file to be transferedpContext - execution context; needed for the context variable
replacement; can be null if no replacement is necessaryjava.io.IOException - when the file could not be readpublic static void associatePropertyGroup(IElement pElement, org.eclipse.core.resources.IFile pFile) throws TaurusCoreException, TaurusToolException
pElement - the element which corresponding property group will be
searched.pFile - the local file on which the property group will be associatedTaurusCoreException - if an exception occurs during property group association
processTaurusToolException - cannot occur anymorepublic static boolean doLocalSyntaxCheck(IElement pElement, org.eclipse.core.resources.IFile file) throws TaurusException
pElement - the elementfile - the file containing the element contentsTaurusException - if the local syntax check failspublic static IErrorFeedbackFileContent parseErrorFeedbackFile(FileDescriptor pFileDescr, IExecutionContext pContext) throws TaurusException
pFileDescr - the file descriptor for the XML filepContext - the execution contextTaurusCoreException - error reading the error feedback fileTaurusException - if no extension was found for parsing the file, the file
could not be found/read or the parsing itself failed.public static void createStatusMessage(java.lang.String pMsg,
java.lang.String pPluginID,
int pSeverity)
pMsg - The message to be displayedpPluginID - The ID of the calling Plug-In (can be anything but
null)pSeverity - The severity of the message (
IStatus.ERROR, IStatus.WARNING, IStatus.INFO)public static void downloadCopyBooks(IElement pElement, FileDescriptor pFileDescr, java.lang.String pLanguageCategory, IExecutionContext pContext) throws TaurusException
pElement - element whose property 'PropertyGroup' will be associated with
the corresponding filepFileDescr - file descriptor pointing to the file that contains the
copybooks to be down loadedpLanguageCategory - category for the property group to be associated with the
element's resourcepContext - execution contextTaurusException - if a Taurus exception occurspublic static void deletePropertyGroup(IElement pElement) throws TaurusCoreException, org.eclipse.core.runtime.CoreException
pElement - the elementTaurusCoreException - if deleting the property group failsorg.eclipse.core.runtime.CoreException - if deleting the property group failspublic static IPropertyGroupManager searchForPropertyGroupManager() throws TaurusCoreException
com.microfocus.awm.errorfeedback extension point to
find a property group manager.TaurusCoreException - if no property group manager extension was foundpublic static java.lang.String getPropertyGroupName(IElement pElement)
Special Property = Property_Group (not the name of an
associated property group). Returns null if no property
group property is set.pElement - the elementnullESpecialProperties.PROPERTY_GROUPpublic static void writeFile(java.io.InputStream pIS,
FileDescriptor pFileDescr,
IExecutionContext pContext,
org.eclipse.core.runtime.IProgressMonitor pMon)
throws java.io.IOException,
TaurusCoreException
pIS - the new contentpFileDescr - file descriptorpContext - execution contextpMon - a progress monitorjava.io.IOException - if an I/O exception occurs while trying to write the fileTaurusCoreException - if no file descriptor reader extension point was found for
the given filepublic static boolean isTaurusDebugEnabled()
true if both debug flags of the
com.microfocus.awm Plug-In have been enabled@Deprecated
public static void traceMessage(java.lang.String pMsg,
int pSeverity)
AWMLoggingUtility.traceMessage(String, int) instead.
Same as calling traceMessage(pMsg, pSeverity, false).
pMsg - the message to log.pSeverity - IStatus.INFO, IStatus.WARNING or
IStatus.ERRORtraceMessage(String)@Deprecated
public static void traceMessage(java.lang.String pMsg,
int pSeverity,
boolean pForce)
AWMLoggingUtility.traceMessage(String, int, boolean) instead.true.pMsg - the message to log.pSeverity - IStatus.INFO, IStatus.WARNING or
IStatus.ERRORpForce - whether to trace the message even if debug is disabled@Deprecated
public static void traceStatus(org.eclipse.core.runtime.IStatus pStatus,
boolean pForce)
AWMLoggingUtility.traceStatus(IStatus, boolean) instead.IStatus if AWM debugging is turned on or the force flag
is set to true.pStatus - the status to logpForce - whether to trace the message even if debug is disabled@Deprecated public static void traceMessage(java.lang.String pMsg)
AWMLoggingUtility.traceMessage(String) instead.
Same as calling traceMessage(pMsg, IStatus.INFO, false).
pMsg - the message to log.@Deprecated
public static void traceMessage(java.lang.String pMsg,
boolean pForceTrace)
AWMLoggingUtility.traceMessage(String, boolean) instead.true.
Same as calling
traceMessage(pMsg, IStatus.INFO, pForceTrace).
pMsg - the message to log.pForceTrace - option to force the tracingpublic static java.lang.String streamToString(java.io.InputStream pIs)
throws java.io.IOException
pIs - the input streamjava.io.IOException - if reading the stream failspublic static java.lang.String streamToString(java.io.InputStream pIs,
java.nio.charset.Charset pCharset)
throws java.io.IOException
pIs - the input streampCharset - the encoding character setjava.io.IOException - if reading the stream failspublic static java.lang.String[] streamToLines(java.io.InputStream pIs)
Warning: Does not throw an exception if errors occur but pops up an error dialog.
pIs - the input streampublic static org.eclipse.core.resources.IProject getInternalTaurusProject()
throws TaurusCoreException
TaurusCoreException - if the project could not be retrieved or createdpublic static org.eclipse.core.resources.IFolder getInternalFileCache()
throws TaurusCoreException
IFolderTaurusCoreException - if the folder (or the internal TAURUS project) could not be
createdpublic static org.eclipse.core.resources.IFolder getInternalFileBackUp()
throws TaurusCoreException
IFolderTaurusCoreException - if the folder (or TAURUS application folder) could not be
createdpublic static org.eclipse.core.resources.IFolder getActiveApplicationFileCache()
throws TaurusCoreException
IFolderTaurusCoreException - if the folder (or TAURUS application folder) could not be
createdpublic static org.eclipse.core.resources.IFolder getTaurusApplFolder()
throws TaurusCoreException
null if no
application is currently loaded.null if no
application is loadedTaurusCoreException - when getting/creating the application folder fails (e.g.
workspace is out of sync)public static java.lang.String resolveReference(java.lang.String pValue,
IExecutionContext pContext)
pValue - a String containing (possible) referencespContext - the IExecutionContext which shall be used for
resolving property referencesresolveReference(TAURUSConfiguration, String, IExecutionContext)public static boolean containsReference(java.lang.String pValue)
pValue - the value to checktrue only if the given value contains a referencepublic static java.lang.String resolveReference(TAURUSConfiguration pTauConf, java.lang.String pValue, IExecutionContext pContext)
pTauConf - the modelpValue - a String containing (possible) referencespContext - the IExecutionContext which shall be used for
resolving property references@Deprecated public static boolean checkEnabledCondition(REnabledConditionBase pEnabledCond, int pSelCount, IExecutionContext pContext)
evaluateEnabledCondition(REnabledConditionBase, int, IExecutionContext) insteadpEnabledCond - the enabled conditionpSelCount - the number of selected items (only relevant for
RSelectionEnabledCondition and
RSelectionVisibleCondition)pContext - the IExecutionContexttrue if the condition was satisfied,
false otherwisecheckEnabledCondition(REnabledConditionBase,
com.microfocus.awm.model.IResource[], ISystemImage)public static IEnabledConditionEvaluationResult evaluateEnabledCondition(REnabledConditionBase pEnabledCond, int pSelCount, IExecutionContext pContext)
pEnabledCond - the enabled conditionpSelCount - the number of selected items (only relevant for
RSelectionEnabledCondition and
RSelectionVisibleCondition)pContext - the IExecutionContextIEnabledConditionEvaluationResult instance. It contains information whether the enabled condition is satisfied.checkEnabledCondition(REnabledConditionBase,
com.microfocus.awm.model.IResource[], ISystemImage)@Deprecated public static boolean checkEnabledCondition(REnabledConditionBase pEnabledCond, IExecutionContext pContext)
evaluateEnabledCondition(REnabledConditionBase, IExecutionContext) insteadpEnabledCond - the enabled conditionpContext - the IExecutionContexttrue if the condition was fulfilled,
false otherwisepublic static IEnabledConditionEvaluationResult evaluateEnabledCondition(REnabledConditionBase pEnabledCond, IExecutionContext pContext)
pEnabledCond - the enabled conditionpContext - the IExecutionContextIEnabledConditionEvaluationResult instance. It contains information whether the enabled condition is satisfied.@Deprecated public static boolean checkEnabledCondition(REnabledConditionBase pEnabledCond, IResource[] pResources, ISystemImage pImg)
evaluateEnabledCondition(REnabledConditionBase, com.microfocus.awm.model.IResource[], ISystemImage) instead#checkEnabledCondition(REnabledConditionBase, com.microfocus.awm.model.IResource[], IExecutionContext)
for every given resource. Returns false as soon as one check
is negative (false).pEnabledCond - the enabled conditionpResources - the selected resources (only relevant for
RSelectionEnabledCondition and
RSelectionVisibleCondition)pImg - the ISystemImagetrue if the condition was fulfilled,
false otherwisepublic static IEnabledConditionEvaluationResult evaluateEnabledCondition(REnabledConditionBase pEnabledCond, IResource[] pResources, ISystemImage pImg)
evaluateEnabledCondition(REnabledConditionBase, int, IExecutionContext)
for every given resource. Returns false as soon as one check
is negative (false).pEnabledCond - the enabled conditionpResources - the selected resources (only relevant for
RSelectionEnabledCondition and
RSelectionVisibleCondition)pImg - the ISystemImageIEnabledConditionEvaluationResult 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.public static java.lang.String getSystemFolderName()
public static org.eclipse.core.resources.IFile getWorkspaceFile(FileDescriptor pWsFileDescriptor, IExecutionContext pContext) throws TaurusCoreException
pWsFileDescriptor - file descriptor with type EFileTypes.WORKSPACE_FILEpContext - the contextnull, if the File Descriptor
does not point at a Workspace file or the file does not exist.TaurusCoreException - if the file descriptor does not contain a valid physical name
or the workspace file does not existpublic static java.lang.String[] split(java.lang.String pString,
java.lang.String pDelimiter)
pString - the stringpDelimiter - the delimiter to be used. Several characters will be used as
one delimiter.public static ITaurusSystem getTaurusSystem(java.lang.String pHostName, int pPort) throws TaurusCoreException
ITaurusSystem for the given host name and IP or
null if no TAURUS System exists for these connection
parameters.pHostName - the host name of the desired TAURUS SystempPort - the used port for the TAURUS SystemITaurusSystem or nullTaurusCoreException - if an exception occurs while loading the systemspublic static ITaurusApplication getActiveApplication()
public static java.util.List<java.lang.Integer> checkLineProp(IElementListEntry pElementListEntry)
pElementListEntry - element list entry to be checkedpublic static void addLines(java.util.List<java.lang.Integer> pLineList,
java.util.Map<Property,IPropertyValue> pPropertyMap)
pLineList - list of line numberspPropertyMap - property map in which the EditMarkerLineNo property is
searchedpublic static void refreshEncodingSettings()
throws TaurusCoreException
The encoding settings are located under the following path:
[internal project]\.settings\org.eclipse.core.resources.prefs
TaurusCoreException - if getting the internal project failsgetInternalTaurusProject()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
pFile - filepLineNoList - list of line numbers at which IMarkers should be setorg.eclipse.core.runtime.CoreException - if deleting old markers or setting new ones fails@Deprecated
public static void logError(java.lang.String pString,
java.lang.Exception pE)
AWMLoggingUtility.logError(String, Exception) instead.pString - a user-readable messagepE - the exceptionlogError(String, Exception, int)@Deprecated
public static void logError(java.lang.String pString,
java.lang.Exception pE,
int pSeverity)
AWMLoggingUtility.logError(String, Exception, int) instead.pString - a user-readable messagepE - the exceptionpSeverity - the severity (IStatus constants)logError(String, Exception)public static boolean getBooleanValue(Property pProperty, java.lang.String pParameterValue) throws TaurusToolException
true under following conditions:
true or
1
Property
false under following conditions:
false or
0
pProperty - the propertypParameterValue - the value (e.g. true, 0,
NO, etc.)TaurusToolException - if the given value is neither true/false,
0/1 or one of the properties true/false values.Property.getTrueValue(),
Property.getFalseValue()public static java.lang.String getTableViewIDFromElementList(IElementList pElementList, IExecutionContext pContext)
IElementList. The ID will
first be searched in the modeled action descriptor of the giving element
list and then in its element list structure.pElementList - the element list which ID will be getpContext - the context used to get the element list IDnull if no label has been
modeledpublic static java.lang.String getTableViewLabelElementList(IElementList pElementList, IExecutionContext pContext)
IElementList. The label
will first be searched in the modeled action descriptor of the giving
element list and then in its element list structure.pElementList - the element list which label will be getpContext - the context used to get the element list labelnull if no label has been
modeledpublic static org.eclipse.core.resources.IResource getEclipseResource(java.lang.String pResourcePath)
pResourcePath - the resource path (can be an absolute file path or a workspace
relative path)null if no resource with
such an ID existspublic static java.lang.String getLinkedPropertyValue(LinkedProperty pLinkedProperty, IExecutionContext pContext)
pLinkedProperty - the linked propertypContext - the execution context can be null.public static void clearActiveApplicationFileCache(org.eclipse.core.runtime.IProgressMonitor pMonitor)
throws TaurusCoreException,
org.eclipse.core.runtime.CoreException
pMonitor - a progress monitorTaurusCoreException - error getting the ActiveApplicationFileCacheorg.eclipse.core.runtime.CoreException - error while refreshing local changespublic static void clearApplicationPropertyCache(ITaurusApplication pApplication) throws TaurusCoreException
pApplication - the application which cache should be clearedTaurusCoreException - error getting the ActiveApplicationFileCachepublic static java.lang.String applyXMLEscapeCharacters(java.lang.String pText)
The following characters are replaced with corresponding escape sequences:
| Character | Result |
|---|---|
| < | |
| > | |
| & | |
| " | |
| ' |
pText - the text to convertpublic static boolean refreshLinkedElement(java.lang.String pResourceID,
java.lang.String[] pLinkedElementTypeIDs,
EChangedKind pKind)
throws TaurusCoreException
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.
EChangedKind.ADDED has two
requirements in order to be processed successfully:
ILinkedElementIdentificator associated to it.
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]...
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 IDpKind - the kind of change that occurred to the resource. Uses
IResourceDelta constantstrue when an element with the given ID was
found and false when it was not. Always returns
false if no AWM application is loaded.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).refreshRenamedLinkedElement(String, String, String, String[],
boolean, IProgressMonitor)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
See refreshLinkedElement(String, String[], EChangedKind) for an
important note on resource identifier parameters.
pOldResourceID - old identifier of the renamed resourcepNewResourceID - new identifier of the renamed resourcepNewName - 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 IDpRefreshElement - 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 monitortrue if the renamed resource could be updatedTaurusException - if an exception occurs while trying to refresh the new
element's propertiesRElementProperty.isElementName()public static java.lang.String createStructuredContents(FileDescriptor pTargetStructure, IPropertyData pPropData) throws TaurusCoreException
IPropertyData.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.String containing the file contents.TaurusCoreException - if an exception occurs while creating the structured content.IStructureType.createStructure(FileDescriptor, IPropertyData)public static IPropertyData readStructuredContents(java.lang.String pStructuredContents, FileDescriptor pStructuredFileDescriptor) throws TaurusCoreException
pStructuredContents - the structured contentspStructuredFileDescriptor - a file descriptor containing the structure for the given
contentsIPropertyDataTaurusCoreException - if the given file descriptor is unstructured or parsing the
file failsIStructureType.readStructure(FileDescriptor, String)Copyright © 2015 Micro Focus GmbH. All rights reserved.