Class TemplateModelEditorPart
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.ui.part.WorkbenchPart
-
- org.eclipse.ui.part.EditorPart
-
- org.eclipse.emfforms.spi.editor.GenericEditor
-
- org.eclipse.emf.ecp.view.template.tooling.editor.TemplateModelEditorPart
-
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable
,org.eclipse.core.runtime.IExecutableExtension
,org.eclipse.emf.edit.domain.IEditingDomainProvider
,org.eclipse.ui.ide.IGotoMarker
,org.eclipse.ui.IEditorPart
,org.eclipse.ui.ISaveablePart
,org.eclipse.ui.IWorkbenchPart
,org.eclipse.ui.IWorkbenchPart2
,org.eclipse.ui.IWorkbenchPart3
,org.eclipse.ui.part.IWorkbenchPartOrientation
public class TemplateModelEditorPart extends GenericEditor
EditorPart for the Template Model Editor.- Author:
- Eugen Neufeld
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TemplateModelEditorPart.DmrSelectorPreReplaceProcessor
DmrToSegmentsMigrator.PreReplaceProcessor
for the legacy dmr migration which extracts the root EClass from a legacy dmr and sets it to its containingVTDomainModelReferenceSelector
.
-
Constructor Summary
Constructors Constructor Description TemplateModelEditorPart()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TreeMasterDetailComposite
createTreeMasterDetail(org.eclipse.swt.widgets.Composite composite, java.lang.Object editorInput, CreateElementCallback createElementCallback)
This method creates a tree master detail.void
dispose()
protected boolean
enableValidation()
VTViewTemplate
getTemplate()
Gives access to the template model which is the input of the editor.void
init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
protected org.eclipse.emf.ecore.resource.ResourceSet
loadResource(org.eclipse.ui.IEditorInput editorInput)
Creates a resource set and loads all required resources for the editor input.protected java.lang.Object
modifyEditorInput(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Allows to modify the input object for the editor.protected void
refreshTreeAfterResourceChange()
Called after a resource change to refresh the tree master detail of the editor.void
reveal(org.eclipse.emf.ecore.EObject objectToReveal)
The given element will be revealed in the tree of the editor.-
Methods inherited from class org.eclipse.emfforms.spi.editor.GenericEditor
adjustErrorMarker, createDiangosticCache, createPartControl, createRootView, createTreeViewerBuilder, customizeTree, deleteMarkers, doSave, doSaveAs, getCommandStack, getContextId, getCreateElementCallback, getDiagnosticCache, getEditingDomain, getEditorTitle, getNotifierFromEditorInput, getResourceLoadOptions, getResourceSaveOptions, getResourceSet, getRootView, getToolbarActions, gotoMarker, handleDetailActivated, handleResourceChange, hasShortcuts, isClosing, isDirty, isEditable, isSaveAsAllowed, postSave, preSave, readToolbarActions, reloadResources, removeResources, reveal, setClosing, setFocus, verifyEditorResource
-
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
-
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
-
-
-
Method Detail
-
init
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException
- Specified by:
init
in interfaceorg.eclipse.ui.IEditorPart
- Overrides:
init
in classGenericEditor
- Throws:
org.eclipse.ui.PartInitException
-
loadResource
protected org.eclipse.emf.ecore.resource.ResourceSet loadResource(org.eclipse.ui.IEditorInput editorInput) throws org.eclipse.ui.PartInitException
Description copied from class:GenericEditor
Creates a resource set and loads all required resources for the editor input.- Overrides:
loadResource
in classGenericEditor
- Parameters:
editorInput
- the editor input- Returns:
- the resource set
- Throws:
org.eclipse.ui.PartInitException
- if the resource could not be loaded
-
refreshTreeAfterResourceChange
protected void refreshTreeAfterResourceChange()
Description copied from class:GenericEditor
Called after a resource change to refresh the tree master detail of the editor. By default only the tree is refreshed. If the tree's input is not this editor's resource but only derived from it, this method should be overridden to reset the tree's input.- Overrides:
refreshTreeAfterResourceChange
in classGenericEditor
-
modifyEditorInput
protected java.lang.Object modifyEditorInput(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Description copied from class:GenericEditor
Allows to modify the input object for the editor.- Overrides:
modifyEditorInput
in classGenericEditor
- Parameters:
resourceSet
- the resourceSet which is the default editor input- Returns:
- the object to set as the input
-
createTreeMasterDetail
protected TreeMasterDetailComposite createTreeMasterDetail(org.eclipse.swt.widgets.Composite composite, java.lang.Object editorInput, CreateElementCallback createElementCallback)
Description copied from class:GenericEditor
This method creates a tree master detail. Override this method if you want to customize the tree.- Overrides:
createTreeMasterDetail
in classGenericEditor
- Parameters:
composite
- the parent compositeeditorInput
- the editor inputcreateElementCallback
- the create element callback to add- Returns:
- the
TreeMasterDetailComposite
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.ui.IWorkbenchPart
- Overrides:
dispose
in classGenericEditor
-
getTemplate
public VTViewTemplate getTemplate()
Gives access to the template model which is the input of the editor.- Returns:
- the
VTViewTemplate
-
reveal
public void reveal(org.eclipse.emf.ecore.EObject objectToReveal)
The given element will be revealed in the tree of the editor.- Overrides:
reveal
in classGenericEditor
- Parameters:
objectToReveal
- the object to reveal
-
enableValidation
protected boolean enableValidation()
- Overrides:
enableValidation
in classGenericEditor
- Returns:
- whether a diagnostic cache should be managed.
-
-