Interface IEmbeddedEditor

  • All Known Implementing Classes:
    EmbeddedXtextSourceEditor

    public interface IEmbeddedEditor
    Represents an embedded editor.
    Author:
    Holger Eichelberger
    • Method Detail

      • getViewer

        org.eclipse.jface.viewers.Viewer getViewer()
        Returns the actual viewer implementing the editor.
        Returns:
        the actiall viewer
      • setContent

        boolean setContent​(java.lang.String[] content)
        Changes the content of the embedded editor.
        Parameters:
        content - the actual editable content in terms of prefix not to be shown [0], content to be displayed [1] and postfix not to be shown[2]
        Returns:
        whether the operation was successful (true) or not (false)
      • refresh

        void refresh()
        Refreshes the editor.
      • removeValidationStateListener

        void removeValidationStateListener​(IEmbeddedEditor.IValidationStateListener listener)
        Removes the given validation state listener.
        Parameters:
        listener - the listener to be removed
      • addDocumentStateListener

        void addDocumentStateListener​(IEmbeddedEditor.IDocumentStateListener listener)
        Adds a document state listener.
        Parameters:
        listener - the listener to be added
      • removeDocumentStateListener

        void removeDocumentStateListener​(IEmbeddedEditor.IDocumentStateListener listener)
        Removes the given document state listener.
        Parameters:
        listener - the listener to be removed
      • doSave

        boolean doSave()
        Save the editor content to the original resource if content changed.
        Returns:
        true if the content was saved, false else
      • setModelListener

        void setModelListener​(AbstractModelChangeListener modelListener)
        Defines the model listener being called in doSave().
        Parameters:
        modelListener - the model listener (null for ignore it)
      • getEditableContent

        java.lang.String getEditableContent()
        Returns the editable content in this editor.
        Returns:
        the editable content
      • getContent

        java.lang.String getContent()
        Returns the full content of the editor, including potential context such as prefix and postfix.
        Returns:
        the full content
      • setEditable

        void setEditable​(boolean editable)
        Changes whether the editor is enabled for editing.
        Parameters:
        editable - true if editing is enabled, false if only viewing is supported