com.pvx.ooadide.eventmanager
Class ResourceManager

java.lang.Object
  extended by com.pvx.ooadide.eventmanager.ResourceManager

public class ResourceManager
extends java.lang.Object

Provides access to resources in Eclipse for ProvideX programs

Since:
1.0
Version:
1.24, 01/01/2007
Author:
Jarett Smith

Constructor Summary
ResourceManager()
           
 
Method Summary
static void addToPropertyUpdateList(java.lang.String filePath, java.lang.String pref, java.lang.String value)
           
static void doUpdateProps()
           
static java.lang.String getDefaultPvxExePath()
          Returns a path to the ProvideX executable associated with the specified file
static java.lang.String getDefaultPvxExePath(java.lang.String filePath)
          Returns a path to the ProvideX executable associated with the specified file
static java.util.ArrayList getDependentPlugins()
           
static org.eclipse.core.resources.IFile getFile(java.lang.String filePath)
          Returns the File for the specified path
static java.lang.String getFilesPvxExePath(java.lang.String filePath)
           
static org.eclipse.core.resources.IContainer getFolder(java.lang.String folderPath)
          Returns the IContainer folder for specified path
 java.lang.String getPathToSelectedResourceInNavigator()
          This method will return the string value of the first resources selected
static org.eclipse.core.resources.IProject getProject(java.lang.String projectName)
          Returns a handle to the project resource with the given name which is a child of this root.
static java.lang.String getProperty(org.eclipse.core.resources.IResource file, java.lang.String pref)
          Returns the value of the persistent property of this resource identified by the given key, or null if this resource has no such property.
static java.lang.String getRequestSocket()
           
static org.eclipse.core.resources.IResource getResource(java.lang.String filePath)
          Returns the Resource for the specified path
 org.eclipse.core.resources.IResource getSelectedResourceInNavigator()
          This method will return the first resources selected
 org.eclipse.jface.viewers.TreeSelection getSelectedTreeResourcesInNavigator()
          This method enables retrieve of all selected resources
static java.lang.String getWorkspace()
           
static boolean isResourceInSourceDirectory(org.eclipse.core.resources.IResource resource)
          Returns true if the specified resource is located in a Project's input directory
static boolean isValidPvxExtension(java.lang.String extension)
          Returns true if the specified extension is associated with the ProvideX Editor
static boolean setProperty(org.eclipse.core.resources.IResource file, java.lang.String pref, java.lang.String value)
          Sets the value of the persistent property of this resource identified by the given key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

getProject

public static final org.eclipse.core.resources.IProject getProject(java.lang.String projectName)
Returns a handle to the project resource with the given name which is a child of this root. The given name must be a valid path segment as defined by IPath.isValidSegment(String).

Note: This method deals exclusively with resource handles, independent of whether the resources exist in the workspace. With the exception of validating that the name is a valid path segment, validation checking of the project name is not done when the project handle is constructed; rather, it is done automatically as the project is created.

Parameters:
name - the name of the project
Returns:
a project resource handle

getPathToSelectedResourceInNavigator

public java.lang.String getPathToSelectedResourceInNavigator()
This method will return the string value of the first resources selected

Returns:
String the first resource selected

getSelectedTreeResourcesInNavigator

public org.eclipse.jface.viewers.TreeSelection getSelectedTreeResourcesInNavigator()
This method enables retrieve of all selected resources

Returns:
TreeSelection all of the selected resources

getSelectedResourceInNavigator

public org.eclipse.core.resources.IResource getSelectedResourceInNavigator()
This method will return the first resources selected

Returns:
IResource the first resource selected

getFolder

public static final org.eclipse.core.resources.IContainer getFolder(java.lang.String folderPath)
Returns the IContainer folder for specified path

Returns:
IContainer or null if the folder does not exist

getResource

public static final org.eclipse.core.resources.IResource getResource(java.lang.String filePath)
Returns the Resource for the specified path

Returns:
IResource or null if the resource does not exist

getFile

public static final org.eclipse.core.resources.IFile getFile(java.lang.String filePath)
Returns the File for the specified path

Returns:
File or null if the File does not exist

getProperty

public static final java.lang.String getProperty(org.eclipse.core.resources.IResource file,
                                                 java.lang.String pref)
Returns the value of the persistent property of this resource identified by the given key, or null if this resource has no such property.

Parameters:
file - the target file
pref - the qualified name of the property
Returns:
the string value of the property, or null if this resource has no such property
Throws:
org.eclipse.core.runtime.CoreException - if this method fails. Reasons include:
  • This resource does not exist.
  • This resource is not local.
  • This resource is a project that is not open.

setProperty

public static final boolean setProperty(org.eclipse.core.resources.IResource file,
                                        java.lang.String pref,
                                        java.lang.String value)
Sets the value of the persistent property of this resource identified by the given key. If the supplied value is null, the persistent property is removed from this resource. The change is made immediately on disk.

Persistent properties are intended to be used by plug-ins to store resource-specific information that should be persisted across platform sessions. The value of a persistent property is a string that must be short - 2KB or less in length. Unlike session properties, persistent properties are stored on disk and maintained across workspace shutdown and restart.

Parameters:
file - the resource to set the property on
pref - the name of the property
value - the string value of the property, or null if the property is to be removed
Throws:
org.eclipse.core.runtime.CoreException - if this method fails. Reasons include:
  • This resource does not exist.
  • This resource is not local.
  • This resource is a project that is not open.
  • Resource changes are disallowed during certain types of resource change event notification. See IResourceChangeEvent for more details.

isValidPvxExtension

public static final boolean isValidPvxExtension(java.lang.String extension)
Returns true if the specified extension is associated with the ProvideX Editor


addToPropertyUpdateList

public static final void addToPropertyUpdateList(java.lang.String filePath,
                                                 java.lang.String pref,
                                                 java.lang.String value)

doUpdateProps

public static final void doUpdateProps()

getFilesPvxExePath

public static java.lang.String getFilesPvxExePath(java.lang.String filePath)

getDefaultPvxExePath

public static java.lang.String getDefaultPvxExePath(java.lang.String filePath)
Returns a path to the ProvideX executable associated with the specified file


getDefaultPvxExePath

public static java.lang.String getDefaultPvxExePath()
Returns a path to the ProvideX executable associated with the specified file


isResourceInSourceDirectory

public static boolean isResourceInSourceDirectory(org.eclipse.core.resources.IResource resource)
Returns true if the specified resource is located in a Project's input directory


getWorkspace

public static java.lang.String getWorkspace()

getRequestSocket

public static java.lang.String getRequestSocket()

getDependentPlugins

public static java.util.ArrayList getDependentPlugins()