Package org.csstudio.opibuilder.util
Class ResourceUtil
java.lang.Object
org.csstudio.opibuilder.util.ResourceUtil
Utility functions for resources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IPathbuildAbsolutePath(AbstractWidgetModel model, IPath relativePath) Build the absolute path from the file path (without the file name part) of the widget model and the relative path.static IPathbuildRelativePath(IPath refPath, IPath fullPath) Build the relative path from a reference path.static IEditorInputeditorInputFromPath(IPath path) static CursorReturns the cursor used during pv copy action.static FileReturns the absolute file represented by thepathif such file exists.static IFilegetIFileFromIPath(IPath path) Get the IFile from IPath.static InputStreamgetInputStreamFromEditorInput(IEditorInput editorInput) Returns a stream which can be used to read this editors input data.static IPathgetPathFromString(String input) Returns IPath from String.static IPathgetPathInEditor(IEditorInput input) static StringgetScreenshotFile(org.eclipse.gef.GraphicalViewer viewer) static ImagegetScreenshotImage(org.eclipse.gef.GraphicalViewer viewer) Get screenshot image from GraphicalViewerstatic booleanisExistingLocalFile(IPath path) static booleanisExistingWorkspaceFile(IPath path) static booleanisExsitingFile(IPath absolutePath, boolean runInUIJob) If the file on path is an existing file in workspace, local file system or available URL.static InputStreampathToInputStream(IPath path) Return theInputStreamof the file that is available on the specified path.static IPathworkspacePathToSysPath(IPath path) Convert workspace path to OS system path.
-
Constructor Details
-
ResourceUtil
public ResourceUtil()
-
-
Method Details
-
getCopyPvCursor
Returns the cursor used during pv copy action.- Returns:
- the cursor
-
getFile
Returns the absolute file represented by thepathif such file exists. If it does not exist null is returned.- Parameters:
path- the path for which the file is requested- Returns:
- the absolute file
- Throws:
Exception- in case of an error
-
pathToInputStream
Return theInputStreamof the file that is available on the specified path.- Parameters:
path- TheIPathto the file in the workspace, the local file system, or a platform URL- Returns:
- The corresponding
InputStream. Nevernull - Throws:
Exception
-
getInputStreamFromEditorInput
Returns a stream which can be used to read this editors input data.- Parameters:
editorInput-- Returns:
- a stream which can be used to read this editors input data
-
isExistingWorkspaceFile
- Parameters:
path- the file path- Returns:
- true if the file path is an existing workspace file.
-
isExistingLocalFile
-
buildAbsolutePath
Build the absolute path from the file path (without the file name part) of the widget model and the relative path.- Parameters:
model- the widget modelrelativePath- the relative path- Returns:
- the absolute path.
-
buildRelativePath
Build the relative path from a reference path.- Parameters:
refPath- the reference path which does not include the file name.fullPath- the absolute full path which includes the file name.- Returns:
- the relative to path to refPath.
-
getPathInEditor
-
getPathFromString
Returns IPath from String. -
workspacePathToSysPath
Convert workspace path to OS system path.- Parameters:
path- the workspace path- Returns:
- the corresponding system path. null if it is not exist.
-
isExsitingFile
If the file on path is an existing file in workspace, local file system or available URL.- Parameters:
runInUIJob- true if this method should run as an UI Job. If it is true, this method must be called in UI thread.
-
editorInputFromPath
-
getScreenshotImage
Get screenshot image from GraphicalViewer- Parameters:
viewer- the GraphicalViewer- Returns:
- the screenshot image
-
getScreenshotFile
- Throws:
Exception
-
getIFileFromIPath
Get the IFile from IPath.- Parameters:
path- Path to file in workspace- Returns:
- the IFile.
nullif no IFile on the path, file does not exist, internal error.
-