EGF Engine
Release 0.1.0

org.eclipse.egf.pde
Class EgfPdeActivator

java.lang.Object
  extended by AbstractUIPlugin
      extended by org.eclipse.egf.common.ui.activator.AbstractUIActivator
          extended by org.eclipse.egf.pde.EgfPdeActivator

public class EgfPdeActivator
extends AbstractUIActivator

The activator class controls the plug-in life cycle


Field Summary
static String MANIFEST_FILE_NAME
          Constant that defines the bundle manifest file name.
static String PLUGIN_FILE_NAME
          Constant that defines the Plug-in file name.
 
Constructor Summary
EgfPdeActivator()
           
 
Method Summary
 void addEntryInBinaryBuild(IProject project_p, String entryName_p)
          Add an entry with specified entry name in the binary build for given project.
 void convertToFactoryComponent(String pluginId_p)
          Convert identified plug-in to a factory component.
 void convertToFactoryComponent(String pluginId_p, boolean makeItOptional_p)
          Convert identified plug-in to a factory component by adding specific properties (extensions).
 boolean convertToPlugin(String projectName_p)
          Convert named project to a valid plug-in project.
 IContextExtensionFactory getContextExtensionHelper()
          Get a context extension helper.
 IContractElementRefExtensionFactory getContractElementRefExtensionHelper()
          Get a contract element reference extension helper.
 IContractExtensionFactory getContractExtensionHelper()
          Get a contract extension helper.
static EgfPdeActivator getDefault()
          Returns the shared instance
 FactoryComponent getFactoryComponent(IProject project_p)
          Return the factory component for given project.
 IFactoryComponentExtensionFactory getFactoryComponentExtensionHelper()
          Get a factory component extension helper.
 FactoryComponent getFactoryComponentForPluginId(String pluginId_p)
          Return the factory component contained by given plug-in id.
protected  FactoryComponent getFactoryComponentForProject(IProject project_p)
          Get the related factory component from the factory component registry for given project.
 String getFactoryComponentId(IProject project_p)
          Get factory component id declared in given project.
 IFactoryComponentInvocationExtensionFactory getFactoryComponentInvocationExtensionHelper()
          Get a factory component invocation extension helper.
 Collection<FactoryComponent> getFactoryComponentsInTargetPlatform()
          Get all factory components in the target platform referenced by the current running Eclipse IDE instance.
 Collection<FactoryComponent> getFactoryComponentsInWorkspace()
          Get the collection of existing factory components in current workspace.
 IFile getFile(IPluginModelBase pluginModelBase_p)
          Get the plug-in file from an IPluginModelBase element.
 IFile getFile(IProject project_p)
          Get the plug-in file for given project.
 IFile getFile(String factoryComponentId_p)
          Get the plug-in file where factory component is stored.
 IMappingExtensionFactory getMappingExtensionHelper()
          Get a mapping extension helper.
 IPluginChangesCommandRunner getPluginChangesCommandRunner()
          Get the plug-in changes command runner that is able to execute IPluginChangesCommand commands.
 String getPluginIdForFactoryComponent(String factoryComponentId_p)
          Get the plug-in id for the given factory component located in the workspace only.
 IPluginModelBase getPluginModelBase(IProject project_p)
          Get the plug-in model base for given project.
protected  IPluginModelBase getPluginModelForFactoryComponent(FactoryComponent factoryComponent_p)
          Return the plug-in model for given factory component.
 IPluginModelBase getPluginModelForFactoryComponent(String factoryComponentId_p)
          Get the plug-in model for given factory component id.
 Collection<IProject> getPluginProjects()
          Get all plug-in projects located in the workspace.
 IProductionPlanExtensionFactory getProductionPlanExtensionHelper()
          Get a production plan extension helper.
 IProject getProjectForFactoryComponent(String factoryComponentId_p)
          Get the project that hosts given factory component.
 ITaskFactoryExtensionFactory getTaskFactoryExtensionHelper()
          Get a task factory extension helper.
 boolean isPluginFile(IResource resource_p)
          Is the given file the plug-in file hosts in an IProject.
 void start(BundleContext context_p)
           
 void stop(BundleContext context_p)
           
 
Methods inherited from class org.eclipse.egf.common.ui.activator.AbstractUIActivator
createImageDescriptor, getImage, getImageDescriptor, getPluginID, getWorkbenchDisplay, log, log, log, log, log, log, log, newErrorStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLUGIN_FILE_NAME

public static final String PLUGIN_FILE_NAME
Constant that defines the Plug-in file name.

See Also:
Constant Field Values

MANIFEST_FILE_NAME

public static final String MANIFEST_FILE_NAME
Constant that defines the bundle manifest file name.

See Also:
Constant Field Values
Constructor Detail

EgfPdeActivator

public EgfPdeActivator()
Method Detail

start

public void start(BundleContext context_p)
           throws Exception
Throws:
Exception
See Also:
org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)

stop

public void stop(BundleContext context_p)
          throws Exception
Throws:
Exception
See Also:
org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)

getDefault

public static EgfPdeActivator getDefault()
Returns the shared instance

Returns:
the shared instance

getFactoryComponentExtensionHelper

public IFactoryComponentExtensionFactory getFactoryComponentExtensionHelper()
Get a factory component extension helper.

Returns:

getContractExtensionHelper

public IContractExtensionFactory getContractExtensionHelper()
Get a contract extension helper.

Returns:

getContractElementRefExtensionHelper

public IContractElementRefExtensionFactory getContractElementRefExtensionHelper()
Get a contract element reference extension helper.

Returns:

getProductionPlanExtensionHelper

public IProductionPlanExtensionFactory getProductionPlanExtensionHelper()
Get a production plan extension helper.

Returns:

getFactoryComponentInvocationExtensionHelper

public IFactoryComponentInvocationExtensionFactory getFactoryComponentInvocationExtensionHelper()
Get a factory component invocation extension helper.

Returns:

getTaskFactoryExtensionHelper

public ITaskFactoryExtensionFactory getTaskFactoryExtensionHelper()
Get a task factory extension helper.

Returns:

getContextExtensionHelper

public IContextExtensionFactory getContextExtensionHelper()
Get a context extension helper.

Returns:

getMappingExtensionHelper

public IMappingExtensionFactory getMappingExtensionHelper()
Get a mapping extension helper.

Returns:

getPluginModelForFactoryComponent

protected IPluginModelBase getPluginModelForFactoryComponent(FactoryComponent factoryComponent_p)
Return the plug-in model for given factory component.

Parameters:
factoryComponent_p -
Returns:
null if given factory component has no IPluginModelBase adapter registered.

getPluginModelBase

public IPluginModelBase getPluginModelBase(IProject project_p)
Get the plug-in model base for given project.

Parameters:
project_p -
Returns:
an IPluginModelBase instance or null if the project is not a plug-in.

getFile

public IFile getFile(String factoryComponentId_p)
Get the plug-in file where factory component is stored.

Parameters:
factoryComponentId_p -
Returns:
null if file does not exist.

getFile

public IFile getFile(IPluginModelBase pluginModelBase_p)
Get the plug-in file from an IPluginModelBase element.

Parameters:
pluginModelBase_p -
Returns:
null if file does not exist.

getFile

public IFile getFile(IProject project_p)
Get the plug-in file for given project.

Parameters:
project_p -
Returns:
null if file does not exist.

isPluginFile

public boolean isPluginFile(IResource resource_p)
Is the given file the plug-in file hosts in an IProject.

Parameters:
resource_p -
Returns:
true if given resource is the plug-in file (plugin.xml); false otherwise.

getFactoryComponentId

public String getFactoryComponentId(IProject project_p)
Get factory component id declared in given project.

Parameters:
project_p -
Returns:
the id or null if no factory component is declared in given project.

getPluginIdForFactoryComponent

public String getPluginIdForFactoryComponent(String factoryComponentId_p)
Get the plug-in id for the given factory component located in the workspace only.

Parameters:
factoryComponentId_p -
Returns:
the plug-in id or null if not found.

getPluginModelForFactoryComponent

public IPluginModelBase getPluginModelForFactoryComponent(String factoryComponentId_p)
Get the plug-in model for given factory component id.
Look up is performed through the workspace.

Parameters:
factoryComponentId_p -
Returns:

getProjectForFactoryComponent

public IProject getProjectForFactoryComponent(String factoryComponentId_p)
Get the project that hosts given factory component.
Look up is performed through the workspace.

Parameters:
factoryComponentId_p -
Returns:
the project that hosts given factory component or null if not found in workspace.
Thus, given factory component is a deployed factory component located into the platform (either the eclipse platform itself or an extension location).

getFactoryComponentsInWorkspace

public Collection<FactoryComponent> getFactoryComponentsInWorkspace()
Get the collection of existing factory components in current workspace.

Returns:
a not null collection.

getFactoryComponentsInTargetPlatform

public Collection<FactoryComponent> getFactoryComponentsInTargetPlatform()
Get all factory components in the target platform referenced by the current running Eclipse IDE instance.
DO NOT USE : Experimental.

Returns:

getPluginProjects

public Collection<IProject> getPluginProjects()
Get all plug-in projects located in the workspace.

Returns:
a not null collection.

getFactoryComponentForPluginId

public FactoryComponent getFactoryComponentForPluginId(String pluginId_p)
Return the factory component contained by given plug-in id.

Parameters:
pluginId_p -
Returns:
null if the given plug-in does not contain an FactoryComponent.

getFactoryComponent

public FactoryComponent getFactoryComponent(IProject project_p)
Return the factory component for given project.

Parameters:
project_p -
Returns:
null if the project does not contain a factory component.

getFactoryComponentForProject

protected FactoryComponent getFactoryComponentForProject(IProject project_p)
Get the related factory component from the factory component registry for given project.

Parameters:
project_p -
Returns:
null if not found.

getPluginChangesCommandRunner

public IPluginChangesCommandRunner getPluginChangesCommandRunner()
Get the plug-in changes command runner that is able to execute IPluginChangesCommand commands.

Returns:
a not null object.

addEntryInBinaryBuild

public void addEntryInBinaryBuild(IProject project_p,
                                  String entryName_p)
Add an entry with specified entry name in the binary build for given project.


convertToFactoryComponent

public void convertToFactoryComponent(String pluginId_p)
Convert identified plug-in to a factory component.

Parameters:
pluginId_p - That includes required dependencies (set as mandatory in this case).

convertToFactoryComponent

public void convertToFactoryComponent(String pluginId_p,
                                      boolean makeItOptional_p)
Convert identified plug-in to a factory component by adding specific properties (extensions).

Parameters:
pluginId_p -
makeItOptional_p - Converting to a FC also implies new dependencies. Maybe those should be optional (true) or remain mandatory (false).

convertToPlugin

public boolean convertToPlugin(String projectName_p)
Convert named project to a valid plug-in project.

Parameters:
projectName_p -
Returns:

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.