EGF Engine
Release 0.1.0

org.eclipse.egf.pde.internal.ui.util
Class PDEModelUtility

java.lang.Object
  extended by org.eclipse.egf.pde.internal.ui.util.PDEModelUtility

public class PDEModelUtility
extends Object

Your one stop shop for performing changes to your plug-in models.


Field Summary
static String F_BUILD
           
static String F_FRAGMENT
           
static String F_MANIFEST
           
static String F_MANIFEST_FP
           
static String F_PLUGIN
           
static String F_PROPERTIES
           
 
Constructor Summary
PDEModelUtility()
           
 
Method Summary
static void connect(PDEFormEditor editor)
          PDE editors should call this during their creation.
static void disconnect(PDEFormEditor editor)
          PDE editors should call this when they are closing down.
static IPluginModelBase getActivePluginModel()
          Returns an IPluginModelBase from the active ManifestEditor or null if no manifest editor is open.
static BuildEditor getOpenBuildPropertiesEditor(IProject project)
          Returns an open BuildEditor that is associated with this project.
static ManifestEditor getOpenManifestEditor(IProject project)
          Returns an open ManifestEditor that is associated with this project.
static IEditingModel getOpenModel(IDocument doc)
           
static SchemaEditor getOpenSchemaEditor(IFile file)
          Get the open schema editor rooted at the specified underlying file
static SiteEditor getOpenUpdateSiteEditor(IProject project)
          Returns an open SiteEditor that is associated with this project.
static void modifyModel(ModelModification modification, IProgressMonitor monitor)
          Modify a model based on the specifications provided by the ModelModification parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

F_MANIFEST

public static final String F_MANIFEST
See Also:
Constant Field Values

F_MANIFEST_FP

public static final String F_MANIFEST_FP
See Also:
Constant Field Values

F_PLUGIN

public static final String F_PLUGIN
See Also:
Constant Field Values

F_FRAGMENT

public static final String F_FRAGMENT
See Also:
Constant Field Values

F_PROPERTIES

public static final String F_PROPERTIES
See Also:
Constant Field Values

F_BUILD

public static final String F_BUILD
See Also:
Constant Field Values
Constructor Detail

PDEModelUtility

public PDEModelUtility()
Method Detail

connect

public static void connect(PDEFormEditor editor)
PDE editors should call this during their creation. Currently the pde editor superclass (PDEFormEditor) connects during its createPages method and so this method does not need to be invoked anywhere else.

Parameters:
editor - the editor to connect to

disconnect

public static void disconnect(PDEFormEditor editor)
PDE editors should call this when they are closing down.

Parameters:
editor - the pde editor to disconnect from

getOpenManifestEditor

public static ManifestEditor getOpenManifestEditor(IProject project)
Returns an open ManifestEditor that is associated with this project.

Parameters:
project -
Returns:
null if no ManifestEditor is open for this project

getOpenBuildPropertiesEditor

public static BuildEditor getOpenBuildPropertiesEditor(IProject project)
Returns an open BuildEditor that is associated with this project.

Parameters:
project -
Returns:
null if no BuildEditor is open for this project

getOpenUpdateSiteEditor

public static SiteEditor getOpenUpdateSiteEditor(IProject project)
Returns an open SiteEditor that is associated with this project.

Parameters:
project -
Returns:
null if no SiteEditor is open for this project

getOpenSchemaEditor

public static SchemaEditor getOpenSchemaEditor(IFile file)
Get the open schema editor rooted at the specified underlying file

Parameters:
file -
Returns:
editor if found or null

getActivePluginModel

public static IPluginModelBase getActivePluginModel()
Returns an IPluginModelBase from the active ManifestEditor or null if no manifest editor is open.

Returns:
the active IPluginModelBase

getOpenModel

public static IEditingModel getOpenModel(IDocument doc)
Parameters:
doc -
Returns:

modifyModel

public static void modifyModel(ModelModification modification,
                               IProgressMonitor monitor)
Modify a model based on the specifications provided by the ModelModification parameter. A model will be searched for in the open editors, if it is found changes will be applied and the editor will be saved. If no model is found one will be created and text edit operations will be generated / applied. NOTE: If a MANIFEST.MF file is specified in the ModelModification a BundlePluginModel will be searched for / created and passed to ModelModification#modifyModel(IBaseModel). (not a BundleModel - which can be retreived from the BundlePluginModel)

Parameters:
modification -
monitor -
Throws:
CoreException

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.