Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EMF/SinglePageEditor"
(→Class definition) |
(→Class definition) |
||
Line 32: | Line 32: | ||
The generated file has the following class definition: | The generated file has the following class definition: | ||
+ | <source lang="java"> | ||
/** | /** | ||
* This is an example of a Library model editor. | * This is an example of a Library model editor. | ||
Line 40: | Line 41: | ||
public class LibraryEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, | public class LibraryEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, | ||
IMenuListener, IViewerProvider, IGotoMarker { | IMenuListener, IViewerProvider, IGotoMarker { | ||
+ | |||
+ | </source> | ||
As you can see the Editor is a subclass of EditorPart (in this case MultiPageEditorPart even this is a singe page editor). | As you can see the Editor is a subclass of EditorPart (in this case MultiPageEditorPart even this is a singe page editor). |
Revision as of 13:33, 2 January 2011
This page gives you an overview of an unmodified EMF (single page) editor (inc. a wizard) generated with EMF 2.6
The example is created based on the Generating an EMF Model example. You can find the source code and in this context the "library.editor" plugin / project e.g. here.
Usually the example and the default setup of the genmodel produces a multiple page editor. For the generation of a singel page editor you have to set the attribute "Multiple Page Editor" to false. This attribute is on package level, in this case the Library package.
Contents
Files
Classes
The code generator produces just the following 4 classes:
- LibraryEditor - The editor class itself.
- LibraryActionBarContributor - The ActionBarContributor of the editor.
- LibraryModelWizard - The wizard implementation ( find in File | New | Other... )
- LibraryEditorPlugin - The plugin class. A subclass of EMFPlugin.
Other Files
The related plug-in files files are created be the generator too.
- plugin.xml
- plugin.properties
- build.properties
- META-INF/MANIFEST.MF
- icons/*
LibraryEditor
Class definition
The generated file has the following class definition:
/** * This is an example of a Library model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class LibraryEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
As you can see the Editor is a subclass of EditorPart (in this case MultiPageEditorPart even this is a singe page editor).
- IEditingDomainProvider
- ISelectionProvider
- IMenuListener
- IViewerProvider
- IGotoMarker
to be continued ... :)
LibraryActionBarContributor
TODO