Java Reference
In-Depth Information
classes org.eclipse.gmf.runtime.diagram.ui.geoshapes.internal.
providers.GeoshapeViewProvider and org.eclipse.gmf.runtime.
diagram.ui.providers.internal.DiagramViewProvider , respectively.
10.4.2 EditPartService
An EditPartService is used to create EditPart s that act as a controller for
the notation view and domain element. A corresponding EditPartProvider
supplies a createGraphicEditPart() method for this purpose, essentially
replacing GEF's EditPartFactory.createEditPart(View) method. The
main participants in the service are shown in Figure 10-26. The role of
an EditPart in GMF is no different than in GEF, except for the fact that
createGraphicEditPart() returns an instance of IGraphicEditPart . This
GMF runtime interface extends the GEF GraphicalEditPart interface to pro-
vide support for EditPart s that use EMF EObject instances as their model.
Again, here model is the View object in the notation model, which maintains a
reference to the domain (semantic) model element. All EditPart s used in the
GMF runtime should extend the abstract or g.eclipse.gmf.runtime.
diagram.ui.editparts.GraphicalEditPart class. This class provides a
getNotationView() method to return the View model element, in addition to
a resolveSemanticElement() method to return the referenced domain model
element.
Provider s are implemented by the Toolsmith, just as EditPartFactory
was supplied using GEF. Provider s can provide EditParts for new or exist-
ing model element types, although it's more efficient to swap out EditPolicies on
an EditPart using the EditPolicyService .
EditPartProviders Extension-Point
Identifier: org.eclipse.gmf.runtime.diagram.ui.
editpartProviders
Description: The EditPartService is a factory for EditPart s, given a
model and a context. An EditPartProvider extends the service by providing
for new EditPart s or existing ones using a different combination of a model
and a context.
Configuration markup:
<!ELEMENT extension (editpartProvider+)>
<!ELEMENT editpartProvider (Priority , object* , context*)>
<!ATTLIST editpartProvider
class CDATA #REQUIRED>
Search WWH ::




Custom Search