Class AbstractIdeEclipseEditor<R extends Model,​RE extends java.lang.Enum<RE>,​O>

  • Type Parameters:
    R - Root Model type.
    O - Change operations type.
    All Implemented Interfaces:
    org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, 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
    Direct Known Subclasses:
    SectionEditor, WoofEditor

    public abstract class AbstractIdeEclipseEditor<R extends Model,​RE extends java.lang.Enum<RE>,​O>
    extends org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor
    Author:
    Daniel Sagenschneider
    • Constructor Detail

      • AbstractIdeEclipseEditor

        public AbstractIdeEclipseEditor​(java.lang.Class<R> rootModelType,
                                        java.util.function.Function<R,​O> createOperations)
        Instantiate with default AdaptedEditorModule.
        Parameters:
        rootModelType - Root Model type.
        createOperations - Function to create the operations from the root Model.
    • Method Detail

      • translateStyle

        public static java.lang.String translateStyle​(java.lang.String rawStyle,
                                                      AbstractItem<?,​?,​?,​?,​?,​?> item)
        Translates the style with the details of the item being rendered.
        Parameters:
        rawStyle - Raw style to be translated.
        item - AbstractItem.
        Returns:
        Ready to use translate.
      • launch

        public static void launch​(java.io.File configurationFile)
        Convenience method to launch the AbstractIdeEclipseEditor implementation outside the IWorkbench.
        Parameters:
        configurationFile - File containing the configuration.
      • getPaletteIndicatorStyleId

        public java.lang.String getPaletteIndicatorStyleId()
        Obtains the IPreferenceStore identifier for the palette indicator styling.
        Returns:
        IPreferenceStore identifier for the palette indicator styling.
      • getPaletteStyleId

        public java.lang.String getPaletteStyleId()
        Obtains the IPreferenceStore identifier for the palette styling.
        Returns:
        IPreferenceStore identifier for the palette styling.
      • getEditorStyleId

        public java.lang.String getEditorStyleId()
        Obtains the IPreferenceStore identifier for the editor styling.
        Returns:
        IPreferenceStore identifier for the editor styling.
      • setSelectOnly

        public void setSelectOnly​(SelectOnly selectOnly)
        Instantiate.
        Parameters:
        selectOnly - SelectOnly.
      • fileName

        public abstract java.lang.String fileName()
        Obtains the default file name for the editor.
        Returns:
        Default file name for the editor.
        See Also:
        AbstractNewWizard
      • prototype

        public abstract R prototype()
        Obtains root prototype.
        Returns:
        Root prototype.
      • paletteStyle

        public java.lang.String paletteStyle()
        Allows overriding the palette styling.
        Returns:
        Palette styling. May be null for default styling.
      • paletteIndicatorStyle

        public java.lang.String paletteIndicatorStyle()
        Allows overriding the palette indicator styling.
        Returns:
        Palette indicator styling. May be null for default styling.
      • editorStyle

        public java.lang.String editorStyle()
        Allows overriding the editor styling.
        Returns:
        Editor styling. May be null for defaulting styling.
      • createOperations

        public O createOperations​(R model)
        Creates the operations for the root Model.
        Parameters:
        model - Root Model.
        Returns:
        Operations.
      • getCanvas

        public javafx.embed.swt.FXCanvas getCanvas()
        Overrides:
        getCanvas in class org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor
      • getContentViewer

        public final org.eclipse.gef.mvc.fx.viewer.IViewer getContentViewer()
        Overrides:
        getContentViewer in class org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor
      • hookViewers

        protected final void hookViewers()
        Overrides:
        hookViewers in class org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor
      • activate

        protected final void activate()
        Overrides:
        activate in class org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor
      • setInput

        protected final void setInput​(org.eclipse.ui.IEditorInput input)
        Overrides:
        setInput in class org.eclipse.ui.part.EditorPart
      • setSite

        protected final void setSite​(org.eclipse.ui.IWorkbenchPartSite site)
        Overrides:
        setSite in class org.eclipse.ui.part.WorkbenchPart
      • doSave

        public final void doSave​(org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        doSave in interface org.eclipse.ui.ISaveablePart
        Specified by:
        doSave in class org.eclipse.ui.part.EditorPart
      • isSaveAsAllowed

        public boolean isSaveAsAllowed()
        Specified by:
        isSaveAsAllowed in interface org.eclipse.ui.ISaveablePart
        Specified by:
        isSaveAsAllowed in class org.eclipse.ui.part.EditorPart
      • doSaveAs

        public void doSaveAs()
        Specified by:
        doSaveAs in interface org.eclipse.ui.ISaveablePart
        Specified by:
        doSaveAs in class org.eclipse.ui.part.EditorPart
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.eclipse.ui.IWorkbenchPart
        Overrides:
        dispose in class org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor