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, HtmlDocumentPreviewEditorPage, HtmlDocumentTextEditorPage, HtmlDocumentWysiwygEditorPage, RightsEditorRestrictionTemplatesPage, RightsEditorRightsPage, TemplateEditorActiveDocumentPage

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
    Active selection on the page
     
    protected IBmModelManager
     
    protected IResourceLookup
     
    protected static final String
    The sections pattern.

    Fields inherited from interface org.eclipse.ui.IEditorPart

    PROP_DIRTY, PROP_INPUT

    Fields inherited from interface org.eclipse.ui.IWorkbenchPart

    PROP_TITLE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Instantiates a new DT granular editor page.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Performs necessary actions when this page is activated (i. e. becomes visible and active).
    protected final 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
     
    void
    Performs necessary actions when this page is deactivated (i. e. ceases to be visible and active).
    void
     
    protected org.eclipse.emf.ecore.EStructuralFeature
    Returns the active feature.
    protected ISelection
    Returns the active selection.
    Returns the IEditingContext instance associated with the editor.
    protected org.eclipse.emf.ecore.EStructuralFeature
    Returns the default pages feature.
     
     
     
    Returns editor page descriptor.
    protected EventGate
    Returns the event gate of this page.
    protected String
    Returns help context id to bind help to.
     
    protected String
    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 ID
    org.eclipse.ui.part.ShowInContext
     
    protected Collection<String>
    Returns parts ids array to be waited before creating control.
    void
    Sets selection to the editor
    void
    init(org.eclipse.ui.IEditorSite site, IDtEditorInput<M> input)
    Initializes the editor.
    void
    initialize(org.eclipse.ui.forms.editor.FormEditor editor)
     
    protected void
    Performs necessary actions when the event gate manager transitions into CLOSED state.
    protected String
    Returns granual editor page title path separator.
    protected void
    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
    Sets the active selection of the editor.
    void
    setDefaultFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
    Sets the default feature of the page.
    void
     
    void
    Shows the editor input.
    void
    showEditorInput(org.eclipse.ui.IEditorInput editorInput)
     
    protected boolean
    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.core.runtime.IAdaptable

    getAdapter

    Methods inherited from interface org.eclipse.ui.IEditorPart

    getEditorSite, init

    Methods inherited from interface org.eclipse.ui.forms.editor.IFormPage

    canLeaveThePage, getId, getIndex, getManagedForm, getPartControl, isActive, isEditor, selectReveal, setActive, setIndex

    Methods inherited from interface org.eclipse.ui.ISaveablePart

    doSave, doSaveAs, isDirty, isSaveAsAllowed, isSaveOnCloseNeeded

    Methods inherited from interface org.eclipse.ui.IWorkbenchPart

    addPropertyListener, createPartControl, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
  • Field Details

    • SECTION_ID_PATTERN

      protected static final String SECTION_ID_PATTERN
      The sections pattern.
      How usage: String.format(SECTION_ID_PATTERN, "PageID","sectionName")
      See Also:
    • derivedDataManagerProvider

      @Inject protected IDerivedDataManagerProvider derivedDataManagerProvider
    • resourceLookup

      @Inject protected IResourceLookup resourceLookup
    • modelManager

      @Inject protected IBmModelManager modelManager
    • activeSelection

      protected ISelection activeSelection
      Active selection on the page
  • Constructor Details

    • DtGranularEditorPage

      protected DtGranularEditorPage(String id, String title)
      Instantiates a new DT granular editor page.
      Parameters:
      id - ID of this page.
      title - title of this page.
  • Method Details

    • getSectionID

      public static String getSectionID(String pageID, String sectionName)
      This method create section ID
      Parameters:
      pageID - the page id for which creating section, cannot be null
      sectionName - the section name, cannot be null
      Returns:
      the section id, cannot be null
    • initialize

      public void initialize(org.eclipse.ui.forms.editor.FormEditor editor)
      Specified by:
      initialize in interface org.eclipse.ui.forms.editor.IFormPage
      Overrides:
      initialize in class org.eclipse.ui.forms.editor.FormPage
    • getEditor

      public DtGranularEditor<M> getEditor()
      Specified by:
      getEditor in interface org.eclipse.ui.forms.editor.IFormPage
      Overrides:
      getEditor in class org.eclipse.ui.forms.editor.FormPage
    • getEditorInput

      public IDtEditorInput<M> getEditorInput()
      Specified by:
      getEditorInput in interface IDtEditor<M extends org.eclipse.emf.ecore.EObject>
      Specified by:
      getEditorInput in interface org.eclipse.ui.IEditorPart
      Overrides:
      getEditorInput in class org.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 interface IDtGranularEditorPage<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 interface IDtEditor<M extends org.eclipse.emf.ecore.EObject>
      Parameters:
      feature - the feature active at this moment, or null 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 interface IDtEditor<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 interface IDtEditor<M extends org.eclipse.emf.ecore.EObject>
      Parameters:
      editorInput - the editor input to show, cannot be null.
      See Also:
      • IShowEditorInput.showEditorInput(org.eclipse.ui.IEditorInput)
    • showEditorInput

      public void showEditorInput(org.eclipse.ui.IEditorInput editorInput)
      Specified by:
      showEditorInput in interface org.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 interface IDtEditor<M extends org.eclipse.emf.ecore.EObject>
      Parameters:
      site - the editor site, cannot be null.
      input - the editor input, cannot be null.
      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 interface IDtEditor<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 the IEditingContext instance associated with the editor.
      Specified by:
      getApiEditingContext in interface IDtEditor<M extends org.eclipse.emf.ecore.EObject>
      Returns:
      the IEditingContext instance associated with the editor, can be null if the editor is not initialized or it is already disposed.
    • getModel

      public M getModel()
      Specified by:
      getModel in interface IDtEditor<M extends org.eclipse.emf.ecore.EObject>
      Returns:
      the sessioned model being edited.
    • setFocus

      public void setFocus()
      Specified by:
      setFocus in interface org.eclipse.ui.IWorkbenchPart
      Overrides:
      setFocus in class org.eclipse.ui.forms.editor.FormPage
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.eclipse.ui.IWorkbenchPart
      Overrides:
      dispose in class org.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 interface IGotoSelection
      Parameters:
      selection - actual selection, can be null
    • getShowInContext

      public org.eclipse.ui.part.ShowInContext getShowInContext()
      Specified by:
      getShowInContext in interface org.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 interface IDtGranularEditorPage<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 interface IDtGranularEditorPage<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, otherwise false.
    • 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 be null
      Returns:
      true if waiting of computation is finishing well, otherwise false.
    • createFormContent

      protected final void createFormContent(org.eclipse.ui.forms.IManagedForm managedForm)
      Overrides:
      createFormContent in class org.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 be null
      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.