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

  • Direct Known Subclasses:
    ActivityEditor, SectionEditor, WoofEditor

    public abstract class AbstractAdaptedIdeEditor<R extends Model,​RE extends java.lang.Enum<RE>,​O>
    extends java.lang.Object
    Abstract adapted IDE editor.
    Author:
    Daniel Sagenschneider
    • Constructor Detail

      • AbstractAdaptedIdeEditor

        public AbstractAdaptedIdeEditor​(java.lang.Class<R> rootModelType,
                                        java.util.function.Function<R,​O> createOperations,
                                        EnvironmentBridge envBridge)

        Instantiate to capture AdaptedEditorModule.

        Allows for alternate AdaptedEditorModule implementation.

        Parameters:
        rootModelType - Root Model type.
        createOperations - Function to create the operations from the root Model.
        envBridge - EnvironmentBridge.
    • 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.
      • getPaletteIndicatorStyleId

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

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

        public java.lang.String getEditorStyleId()
        Obtains the preference identifier for the editor styling.
        Returns:
        Preference identifier for the editor styling.
      • setDragLatency

        public void setDragLatency​(int dragLatency)
        Specifies the drag latency.
        Parameters:
        dragLatency - Drag latency.
      • setSelectOnly

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

        public void setModel​(R model)
        Specifies the Model.
        Parameters:
        model - Model.
      • fileName

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

        public abstract R newFileRoot()
        Provides root Model for new file.
        Returns:
        Root Model for new file.
      • newFileContent

        public java.lang.String newFileContent()
                                        throws java.lang.Exception
        Obtains the new file content.
        Returns:
        New file content.
        Throws:
        java.lang.Exception - If fails to generate new file content.
      • 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.
      • initNonOsgiEnvironment

        public void initNonOsgiEnvironment()
        Initialises for non OSGi environment.
      • init

        public void init​(com.google.inject.Module overrideModule,
                         java.util.function.Function<com.google.inject.Injector,​org.eclipse.gef.mvc.fx.domain.IDomain> initialiser)
        Initialise the AbstractAdaptedIdeEditor.
        Parameters:
        overrideModule - Optional override Module.
        initialiser - Initialiser with the Injector to return the IDomain.