EGF Engine
Release 0.1.0

org.eclipse.egf.pde.util
Class ExtensionHelper

java.lang.Object
  extended by org.eclipse.egf.pde.util.ExtensionHelper

public class ExtensionHelper
extends Object

Provides helpful methods to deal with Extension used in plug-in file.


Constructor Summary
ExtensionHelper()
           
 
Method Summary
static IPluginExtension createExtension(String extensionPointId_p, IPluginModelBase pluginModelBase_p)
          Create a new extension into given plug-in model object.
static IPluginElement createPluginElement(IPluginParent parent_p, String name_p)
          Create a plug-in element and add it into parent.
static IPluginElement[] getPluginElement(IPluginParent parent_p, String nodeName_p)
          Get the IPluginElement instances for given parameters.
static IPluginElement getPluginElement(IPluginParent parent_p, String attributeId_p, String attributeIdValue_p)
          Get an IPluginElement instance for given parameters.
static IPluginExtension[] getPluginExtension(IExtensions extensionPart_p, String fullyQualifiedExtensionPointId_p)
          Get a list of IPluginExtension matching given extension-point id.
static boolean removePluginElement(IPluginParent parent_p, String elementId_p, String elementIdValue_p)
          Remove an IPluginElement element from an IPluginParent for given parameters.
static boolean removePluginExtension(IExtensions extensionPart_p, String extensionPointId_p, String elementId_p, String elementIdValue_p)
          Remove an IPluginExtension from an IExtensions object for given extension-point id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionHelper

public ExtensionHelper()
Method Detail

createExtension

public static IPluginExtension createExtension(String extensionPointId_p,
                                               IPluginModelBase pluginModelBase_p)
Create a new extension into given plug-in model object.

Parameters:
extensionPointId_p - the fully qualified extension-point id.
pluginModelBase_p -
Returns:
an IPluginExtension instance or null if a creation error occurs.

createPluginElement

public static IPluginElement createPluginElement(IPluginParent parent_p,
                                                 String name_p)
Create a plug-in element and add it into parent.

Parameters:
parent_p -
Returns:
an IPluginElement instance or null if a creation error occurs.

getPluginExtension

public static IPluginExtension[] getPluginExtension(IExtensions extensionPart_p,
                                                    String fullyQualifiedExtensionPointId_p)
Get a list of IPluginExtension matching given extension-point id.

Parameters:
extensionPart_p - extension part where is stored all extensions and extension-points.
fullyQualifiedExtensionPointId_p - fully qualified extension-point id (with the id of plug-in that hosts that one.)
Returns:
a not null array of IPluginExtension.

removePluginExtension

public static boolean removePluginExtension(IExtensions extensionPart_p,
                                            String extensionPointId_p,
                                            String elementId_p,
                                            String elementIdValue_p)
Remove an IPluginExtension from an IExtensions object for given extension-point id.

Parameters:
extensionPart_p -
extensionPointId_p - the fully qualified extension-point id.

getPluginElement

public static IPluginElement getPluginElement(IPluginParent parent_p,
                                              String attributeId_p,
                                              String attributeIdValue_p)
Get an IPluginElement instance for given parameters.
The research looks up for a child with an attribute equals to attributeId_p and its value set to attributeIdValue_p.

Parameters:
parent_p -
attributeId_p. -
attributeIdValue_p -
Returns:
a IPluginElement instance or null if not found.

getPluginElement

public static IPluginElement[] getPluginElement(IPluginParent parent_p,
                                                String nodeName_p)
Get the IPluginElement instances for given parameters.
The research looks up for children with a name equals to nodeName_p.

Parameters:
parent_p -
nodeName_p -
Returns:
a not null array of IPluginElement.

removePluginElement

public static boolean removePluginElement(IPluginParent parent_p,
                                          String elementId_p,
                                          String elementIdValue_p)
Remove an IPluginElement element from an IPluginParent for given parameters.
If elementId_p is provided (ie not null), the research looks up for a child with a name equals to value_p.
Otherwise, the research looks up for a child with an attribute equals to attributeId_p and its value set to value_p.

Parameters:
parent_p -
elementId_p -
elementIdValue_p -
Returns:
true if the element is successfully removed; false otherwise.

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.