net.sf.ant4eclipse.tools.pdesupport
Class TargetPlatform

java.lang.Object
  extended by net.sf.ant4eclipse.tools.pdesupport.TargetPlatform

public final class TargetPlatform
extends java.lang.Object

The target platform contains all the plugins from both the workspace and the target location (against which the workspace plugins will be compiled and tested).


Nested Class Summary
static class TargetPlatform.Key
           Key to store instances of TargetPlatform in a map.
 
Field Summary
static java.lang.String DEFAULT_PLUGIN_DIRECTORY
          the constant that defines the default plugin directory
 
Method Summary
 java.lang.String flushPluginsToString()
           Flushes all the plugin descriptors in a string.
 PluginDescriptor[] getAllPluginDescriptors()
           Returns all the PluginDescritpors that resides in the workspace (as plugin projects) or in the target platfrom location (as plugins).
 PluginDescriptor getNewestPluginDescriptor(java.lang.String symbolicName, boolean returnImmediatelyIfFoundInWorkspace)
           
 PluginDescriptor getNewestPluginFromTargetLocation(java.lang.String symbolicName)
           Returns the plugin desciptor of the plugin with the given symbolic name from the target platform location.
 PluginDescriptor getNewestPluginFromWorkspace(java.lang.String symbolicName)
           Returns the plugin desciptor of the plugin project with the given symbolic name from the workspace.
 java.io.File getTargetLocation()
           Returns the location of the target platform.
 PluginDescriptor[] getTargetPlatformPluginDescriptors()
           Returns a list of PluginDescriptors which represent the plugins found in the target platform location.
 Workspace getWorkspace()
           Returns the associated workspace instance.
 EclipseProject[] getWorkspacePluginProjects()
           Returns all the EclipseProjects that resides in the workspace.
 void initialise()
           Initialises the TargetPlatform.
 boolean isContainedInTargetLocation(java.lang.String symbolicName)
           Returns true, if the target platform location contains a plugin project with the given symbolic name, false otherwise.
 boolean isContainedInTargetLocation(java.lang.String symbolicName, Version version)
           Returns true, if the target platform location contains a plugin project with the given symbolic name and the given version, false otherwise.
 boolean isContainedInWorkspace(java.lang.String symbolicName)
           Returns true, if the workspace contains a plugin project with the given symbolic name, false otherwise.
 boolean isContainedInWorkspace(java.lang.String symbolicName, Version version)
           Returns true, if the target platform location contains a plugin project with the given symbolic name and the given version, false otherwise.
 boolean isInitialised()
           Returns whether or not the platform is initialised.
 void refresh()
           Refreshes the TargetPlatform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PLUGIN_DIRECTORY

public static final java.lang.String DEFAULT_PLUGIN_DIRECTORY
the constant that defines the default plugin directory

See Also:
Constant Field Values
Method Detail

getTargetLocation

public java.io.File getTargetLocation()

Returns the location of the target platform.

Returns:
The location of the target platform.

getWorkspace

public Workspace getWorkspace()

Returns the associated workspace instance.

Returns:
the associated workspace instance.

initialise

public void initialise()
                throws FileParserException

Initialises the TargetPlatform. All Plugins from both the target location and the workspace are reed. If the target platfrom already has been initialised, the method returns immediately.

Throws:
FileParserException - thrown if a Exception occurs while parsing the project files.

refresh

public void refresh()
             throws FileParserException

Refreshes the TargetPlatform. All Plugins from both the target location and the workspace are reed.

Throws:
FileParserException - thrown if a Exception occurs while parsing the project files.

isInitialised

public boolean isInitialised()

Returns whether or not the platform is initialised.

Returns:
true if the platform is initialised, false otherwise.

getTargetPlatformPluginDescriptors

public PluginDescriptor[] getTargetPlatformPluginDescriptors()
                                                      throws FileParserException

Returns a list of PluginDescriptors which represent the plugins found in the target platform location.

Returns:
list of PluginDescriptors which represent the plugins found in the target platform location.
Throws:
FileParserException

getWorkspacePluginProjects

public EclipseProject[] getWorkspacePluginProjects()
                                            throws FileParserException

Returns all the EclipseProjects that resides in the workspace.

Returns:
all the EclipseProjects that resides in the workspace.
Throws:
FileParserException

getAllPluginDescriptors

public PluginDescriptor[] getAllPluginDescriptors()
                                           throws FileParserException

Returns all the PluginDescritpors that resides in the workspace (as plugin projects) or in the target platfrom location (as plugins).

Returns:
all the PluginDescritpors that resides in the workspace (as plugin projects) or in the target platfrom location (as plugins).
Throws:
FileParserException

isContainedInWorkspace

public boolean isContainedInWorkspace(java.lang.String symbolicName)
                               throws FileParserException

Returns true, if the workspace contains a plugin project with the given symbolic name, false otherwise.

Parameters:
symbolicName - the symbolic name of the plugin.
Returns:
true, if the workspace contains a plugin project with the given symbolic name, false otherwise.
Throws:
FileParserException

isContainedInTargetLocation

public boolean isContainedInTargetLocation(java.lang.String symbolicName)
                                    throws FileParserException

Returns true, if the target platform location contains a plugin project with the given symbolic name, false otherwise.

Parameters:
symbolicName - the symbolic name of the plugin.
Returns:
true, if the target platform location contains a plugin project with the given symbolic name, false otherwise.
Throws:
FileParserException

isContainedInWorkspace

public boolean isContainedInWorkspace(java.lang.String symbolicName,
                                      Version version)
                               throws FileParserException

Returns true, if the target platform location contains a plugin project with the given symbolic name and the given version, false otherwise.

Parameters:
symbolicName - the symbolic name of the plugin project.
version - the version of the plugin project.
Returns:
true, if the target platform location contains a plugin project with the given symbolic name, false otherwise.
Throws:
FileParserException

isContainedInTargetLocation

public boolean isContainedInTargetLocation(java.lang.String symbolicName,
                                           Version version)
                                    throws FileParserException

Returns true, if the target platform location contains a plugin project with the given symbolic name and the given version, false otherwise.

Parameters:
symbolicName - the symbolic name of the plugin.
version - the version of the plugin.
Returns:
true, if the target platform location contains a plugin project with the given symbolic name, false otherwise.
Throws:
FileParserException

getNewestPluginFromWorkspace

public PluginDescriptor getNewestPluginFromWorkspace(java.lang.String symbolicName)
                                              throws FileParserException

Returns the plugin desciptor of the plugin project with the given symbolic name from the workspace. If more than one plugin project is found, the plugin descriptor of the plugin project with the highest version will be returned. If no plugin project is found, null will be returned.

Parameters:
symbolicName - the symbolic name of the plugin project.
Returns:
the plugin desciptor of the plugin project with the given symbolic name.
Throws:
FileParserException

getNewestPluginFromTargetLocation

public PluginDescriptor getNewestPluginFromTargetLocation(java.lang.String symbolicName)
                                                   throws FileParserException

Returns the plugin desciptor of the plugin with the given symbolic name from the target platform location. If more than one plugin is found, the plugin descriptor of the plugin project with the highest version will be returned. If no plugin project is found, null will be returned.

Parameters:
symbolicName - the symbolic name of the plugin project.
Returns:
the plugin desciptor of the plugin project with the given symbolic name.
Throws:
FileParserException

getNewestPluginDescriptor

public PluginDescriptor getNewestPluginDescriptor(java.lang.String symbolicName,
                                                  boolean returnImmediatelyIfFoundInWorkspace)
                                           throws FileParserException
Parameters:
symbolicName -
returnImmediatelyIfFoundInWorkspace -
Returns:
The newest PluginDescriptor instance associated with the supplied ID.
Throws:
FileParserException

flushPluginsToString

public java.lang.String flushPluginsToString()
                                      throws FileParserException

Flushes all the plugin descriptors in a string.

Returns:
a string containing the plugins.
Throws:
FileParserException