Class DtGranularEditorPage<M extends org.eclipse.emf.ecore.EObject>
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.ui.part.WorkbenchPart
-
- org.eclipse.ui.part.EditorPart
-
- org.eclipse.ui.forms.editor.FormPage
-
- com._1c.g5.v8.dt.md.ui.editor.base.DtGranularEditorPage<M>
-
- All Implemented Interfaces:
IDtEditor<M>
,IDtGranularEditorPage<M>
,IGotoSelection
,org.eclipse.core.runtime.IAdaptable
,org.eclipse.core.runtime.IExecutableExtension
,org.eclipse.ui.forms.editor.IFormPage
,org.eclipse.ui.IEditorPart
,org.eclipse.ui.ISaveablePart
,org.eclipse.ui.IShowEditorInput
,org.eclipse.ui.IWorkbenchPart
,org.eclipse.ui.IWorkbenchPart2
,org.eclipse.ui.IWorkbenchPart3
,org.eclipse.ui.part.IShowInSource
,org.eclipse.ui.part.IWorkbenchPartOrientation
- Direct Known Subclasses:
AbstractDtGranularEditorAefPage
,DtGranularEditorEmbeddedEditorPage
,DtGranularEditorSingleSectionPage
,RightsEditorRestrictionTemplatesPage
,RightsEditorRightsPage
public abstract class DtGranularEditorPage<M extends org.eclipse.emf.ecore.EObject> extends org.eclipse.ui.forms.editor.FormPage implements IDtGranularEditorPage<M>
Base class for all DT granular editor pages.
-
-
Field Summary
Fields Modifier and Type Field Description protected ISelection
activeSelection
Active selection on the pageprotected IDerivedDataManagerProvider
derivedDataManagerProvider
protected IBmModelManager
modelManager
protected IResourceLookup
resourceLookup
protected static String
SECTION_ID_PATTERN
The sections pattern.
-
Constructor Summary
Constructors Modifier Constructor Description protected
DtGranularEditorPage(String id, String title)
Instantiates a new DT granular editor page.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
activate()
Performs necessary actions when this page is activated (i.protected void
createFormContent(org.eclipse.ui.forms.IManagedForm managedForm)
protected abstract void
createPageControls(org.eclipse.ui.forms.IManagedForm managedForm)
Creates the controls of this page.protected org.eclipse.swt.widgets.Layout
createPageLayout()
void
deactivate()
Performs necessary actions when this page is deactivated (i.void
dispose()
protected org.eclipse.emf.ecore.EStructuralFeature
getActiveFeature()
Returns the active feature.protected ISelection
getActiveSelection()
Returns the active selection.IEditingContext
getApiEditingContext()
Returns theIEditingContext
instance associated with the editor.protected org.eclipse.emf.ecore.EStructuralFeature
getDefaultFeature()
Returns the default pages feature.IBmEditingContext
getEditingContext()
DtGranularEditor<M>
getEditor()
IDtEditorInput<M>
getEditorInput()
protected EditorPageDescriptor
getEditorPageDescriptor()
Returns editor page descriptor.protected EventGate
getEventGate()
Returns the event gate of this page.protected String
getHelpContextId()
Returns help context id to bind help to.M
getModel()
protected String
getPageTitle()
Returns the page title.protected String
getPageTitle(org.eclipse.emf.ecore.EObject modelObject)
Returns the page title based on the provided model object.static String
getSectionID(String pageID, String sectionName)
This method create section IDorg.eclipse.ui.part.ShowInContext
getShowInContext()
protected Collection<String>
getWaitingPartsId()
Returns parts ids array to be waited before creating control.void
gotoSelection(ISelection selection)
Sets selection to the editorvoid
init(org.eclipse.ui.IEditorSite site, IDtEditorInput<M> input)
Initializes the editor.void
initialize(org.eclipse.ui.forms.editor.FormEditor editor)
protected void
onEventGateClosed()
Performs necessary actions when the event gate manager transitions into CLOSED state.protected String
pathSeparetor()
Returns granual editor page title path separator.protected void
refresh()
Fully refreshes the contents of the page as if it was just opened for the first time.void
setActiveFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Sets the active feature of the editor.void
setActiveSelection(ISelection selection, DtEditorSelectionProcessingPolicy policy)
Sets the active selection of the editor.void
setDefaultFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Sets the default feature of the page.void
setFocus()
void
showEditorInput(IDtEditorInput<M> editorInput)
Shows the editor input.void
showEditorInput(org.eclipse.ui.IEditorInput editorInput)
protected boolean
waitDerivedData()
Waits when dependent derivid data of the editor will finish computation.protected boolean
waitDerivedData(org.eclipse.emf.ecore.EObject model)
Waits when dependent derivid data of the editor will finish computation.-
Methods inherited from class org.eclipse.ui.forms.editor.FormPage
canLeaveThePage, createPartControl, doSave, doSaveAs, getId, getIndex, getManagedForm, getPartControl, getTitleImage, init, isActive, isDirty, isEditor, isSaveAsAllowed, selectReveal, setActive, setIndex
-
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, 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, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.ui.forms.editor.IFormPage
canLeaveThePage, getId, getIndex, getManagedForm, getPartControl, isActive, isEditor, selectReveal, setActive, setIndex
-
-
-
-
Field Detail
-
SECTION_ID_PATTERN
protected static final String SECTION_ID_PATTERN
The sections pattern.
How usage:String.format(SECTION_ID_PATTERN, "PageID","sectionName")
- See Also:
- Constant Field Values
-
derivedDataManagerProvider
@Inject protected IDerivedDataManagerProvider derivedDataManagerProvider
-
resourceLookup
@Inject protected IResourceLookup resourceLookup
-
modelManager
@Inject protected IBmModelManager modelManager
-
activeSelection
protected ISelection activeSelection
Active selection on the page
-
-
Method Detail
-
getSectionID
public static String getSectionID(String pageID, String sectionName)
This method create section ID- Parameters:
pageID
- the page id for which creating section, cannot benull
sectionName
- the section name, cannot benull
- Returns:
- the section id, cannot be
null
-
initialize
public void initialize(org.eclipse.ui.forms.editor.FormEditor editor)
- Specified by:
initialize
in interfaceorg.eclipse.ui.forms.editor.IFormPage
- Overrides:
initialize
in classorg.eclipse.ui.forms.editor.FormPage
-
getEditor
public DtGranularEditor<M> getEditor()
- Specified by:
getEditor
in interfaceorg.eclipse.ui.forms.editor.IFormPage
- Overrides:
getEditor
in classorg.eclipse.ui.forms.editor.FormPage
-
getEditorInput
public IDtEditorInput<M> getEditorInput()
- Specified by:
getEditorInput
in interfaceIDtEditor<M extends org.eclipse.emf.ecore.EObject>
- Specified by:
getEditorInput
in interfaceorg.eclipse.ui.IEditorPart
- Overrides:
getEditorInput
in classorg.eclipse.ui.part.EditorPart
-
setDefaultFeature
public void setDefaultFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Description copied from interface:IDtGranularEditorPage
Sets the default feature of the page. Initial focus will be set to the corresponding field.- Specified by:
setDefaultFeature
in interfaceIDtGranularEditorPage<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
feature
- feature to set.
-
setActiveFeature
public void setActiveFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Description copied from interface:IDtEditor
Sets the active feature of the editor.- Specified by:
setActiveFeature
in interfaceIDtEditor<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
feature
- the feature active at this moment, ornull
if there is no active feature.
-
setActiveSelection
public void setActiveSelection(ISelection selection, DtEditorSelectionProcessingPolicy policy)
Description copied from interface:IDtEditor
Sets the active selection of the editor.- Specified by:
setActiveSelection
in interfaceIDtEditor<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
selection
- selection active at this moment.policy
- selection processing policy.
-
showEditorInput
public void showEditorInput(IDtEditorInput<M> editorInput)
Description copied from interface:IDtEditor
Shows the editor input.- Specified by:
showEditorInput
in interfaceIDtEditor<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
editorInput
- the editor input to show, cannot benull
.- See Also:
IShowEditorInput.showEditorInput(org.eclipse.ui.IEditorInput)
-
showEditorInput
public void showEditorInput(org.eclipse.ui.IEditorInput editorInput)
- Specified by:
showEditorInput
in interfaceorg.eclipse.ui.IShowEditorInput
-
init
public void init(org.eclipse.ui.IEditorSite site, IDtEditorInput<M> input) throws org.eclipse.ui.PartInitException
Description copied from interface:IDtEditor
Initializes the editor.- Specified by:
init
in interfaceIDtEditor<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
site
- the editor site, cannot benull
.input
- the editor input, cannot benull
.- Throws:
org.eclipse.ui.PartInitException
- if this editor was not initialized successfully- See Also:
IEditorPart.init(IEditorSite, org.eclipse.ui.IEditorInput)
-
getEditingContext
public IBmEditingContext getEditingContext()
- Specified by:
getEditingContext
in interfaceIDtEditor<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- BM editing context associated with the editor.
-
getApiEditingContext
public IEditingContext getApiEditingContext()
Description copied from interface:IDtEditor
Returns theIEditingContext
instance associated with the editor.- Specified by:
getApiEditingContext
in interfaceIDtEditor<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- the
IEditingContext
instance associated with the editor, can benull
if the editor is not initialized or it is already disposed.
-
getModel
public M getModel()
-
setFocus
public void setFocus()
- Specified by:
setFocus
in interfaceorg.eclipse.ui.IWorkbenchPart
- Overrides:
setFocus
in classorg.eclipse.ui.forms.editor.FormPage
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.ui.IWorkbenchPart
- Overrides:
dispose
in classorg.eclipse.ui.forms.editor.FormPage
-
gotoSelection
public void gotoSelection(ISelection selection)
Description copied from interface:IGotoSelection
Sets selection to the editor- Specified by:
gotoSelection
in interfaceIGotoSelection
- Parameters:
selection
- actual selection, can benull
-
getShowInContext
public org.eclipse.ui.part.ShowInContext getShowInContext()
- Specified by:
getShowInContext
in interfaceorg.eclipse.ui.part.IShowInSource
-
activate
public void activate()
Description copied from interface:IDtGranularEditorPage
Performs necessary actions when this page is activated (i. e. becomes visible and active).- Specified by:
activate
in interfaceIDtGranularEditorPage<M extends org.eclipse.emf.ecore.EObject>
-
deactivate
public void deactivate()
Description copied from interface:IDtGranularEditorPage
Performs necessary actions when this page is deactivated (i. e. ceases to be visible and active).- Specified by:
deactivate
in interfaceIDtGranularEditorPage<M extends org.eclipse.emf.ecore.EObject>
-
getActiveFeature
protected org.eclipse.emf.ecore.EStructuralFeature getActiveFeature()
Returns the active feature.- Returns:
- the active feature or
null
.
-
getActiveSelection
protected ISelection getActiveSelection()
Returns the active selection.- Returns:
- the active selection or
null
.
-
refresh
protected void refresh()
Fully refreshes the contents of the page as if it was just opened for the first time.
-
onEventGateClosed
protected void onEventGateClosed()
Performs necessary actions when the event gate manager transitions into CLOSED state.
-
waitDerivedData
protected boolean waitDerivedData()
Waits when dependent derivid data of the editor will finish computation.- Returns:
true
if waiting of computation is finishing well, otherwisefalse
.
-
waitDerivedData
protected boolean waitDerivedData(org.eclipse.emf.ecore.EObject model)
Waits when dependent derivid data of the editor will finish computation.- Parameters:
model
- the model object, cannot benull
- Returns:
true
if waiting of computation is finishing well, otherwisefalse
.
-
createFormContent
protected final void createFormContent(org.eclipse.ui.forms.IManagedForm managedForm)
- Overrides:
createFormContent
in classorg.eclipse.ui.forms.editor.FormPage
-
getHelpContextId
protected String getHelpContextId()
Returns help context id to bind help to.- Returns:
- help context id or
null
if no help is needed
-
getWaitingPartsId
protected Collection<String> getWaitingPartsId()
Returns parts ids array to be waited before creating control. Override in successors.- Returns:
- array of parts ids
-
getPageTitle
protected String getPageTitle()
Returns the page title.- Returns:
- this page title, never
null
-
getPageTitle
protected String getPageTitle(org.eclipse.emf.ecore.EObject modelObject)
Returns the page title based on the provided model object.- Parameters:
modelObject
- the model object, cannot benull
- Returns:
- the page title, never
null
-
pathSeparetor
protected String pathSeparetor()
Returns granual editor page title path separator.- Returns:
- granual editor page title path separator, never
null
-
createPageLayout
protected org.eclipse.swt.widgets.Layout createPageLayout()
- Returns:
- layout for this page.
-
createPageControls
protected abstract void createPageControls(org.eclipse.ui.forms.IManagedForm managedForm)
Creates the controls of this page.- Parameters:
managedForm
- managed form that will contain the controls.
-
getEventGate
protected EventGate getEventGate()
Returns the event gate of this page. It is created on first call.- Returns:
- the event gate of the page
-
getEditorPageDescriptor
protected EditorPageDescriptor getEditorPageDescriptor()
Returns editor page descriptor.- Returns:
- editorPageDescriptor, the editor page descriptor, can be
null
-
getDefaultFeature
protected org.eclipse.emf.ecore.EStructuralFeature getDefaultFeature()
Returns the default pages feature.- Returns:
- the default pages feature, or
null
if there is no default feature.
-
-