Class TextEditor

    • Field Detail

      • fEncodingSupport

        protected DefaultEncodingSupport fEncodingSupport
        The encoding support for the editor.
        Since:
        2.0
    • Method Detail

      • initializeEditor

        protected void initializeEditor()
        Initializes this editor. Subclasses may re-implement. If sub-classes do not change the contract, this method should not be extended, i.e. do not call super.initializeEditor() in order to avoid the temporary creation of objects that are immediately overwritten by subclasses. This method configures the editor but does not define a SourceViewerConfiguration. When only interested in providing a custom source viewer configuration, subclasses may extend this method.
        Overrides:
        initializeEditor in class AbstractDecoratedTextEditor
      • dispose

        public void dispose()
        Description copied from class: AbstractTextEditor
        The AbstractTextEditor implementation of this IWorkbenchPart method may be extended by subclasses. Subclasses must call super.dispose().

        Note that many methods may return null after the editor is disposed.

        Specified by:
        dispose in interface IWorkbenchPart
        Overrides:
        dispose in class AbstractDecoratedTextEditor
      • installEncodingSupport

        protected void installEncodingSupport()
        Installs the encoding support on the given text editor.

        Subclasses may override to install their own encoding support or to disable the default encoding support.

        Since:
        2.1
      • getStatusHeader

        protected String getStatusHeader​(IStatus status)
        Description copied from class: StatusTextEditor
        Returns a header for the given status
        Overrides:
        getStatusHeader in class StatusTextEditor
        Parameters:
        status - the status whose message is returned
        Returns:
        a header for the given status
      • getStatusBanner

        protected String getStatusBanner​(IStatus status)
        Description copied from class: StatusTextEditor
        Returns a banner for the given status.
        Overrides:
        getStatusBanner in class StatusTextEditor
        Parameters:
        status - the status whose message is returned
        Returns:
        a banner for the given status
      • getStatusMessage

        protected String getStatusMessage​(IStatus status)
        Description copied from class: StatusTextEditor
        Returns a message for the given status.
        Overrides:
        getStatusMessage in class StatusTextEditor
        Parameters:
        status - the status whose message is returned
        Returns:
        a message for the given status
      • doSetInput

        protected void doSetInput​(IEditorInput input)
                           throws CoreException
        Description copied from class: AbstractTextEditor
        Called directly from setInput and from within a workspace runnable from init, this method does the actual setting of the editor input. Closes the editor if input is null. Disconnects from any previous editor input and its document provider and connects to the new one.

        Subclasses may extend.

        Overrides:
        doSetInput in class AbstractDecoratedTextEditor
        Parameters:
        input - the input to be set
        Throws:
        CoreException - if input cannot be connected to the document provider
      • getAdapter

        public <T> T getAdapter​(Class<T> adapter)
        Description copied from class: WorkbenchPart
        Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

        Clients may implement this method but should generally call Adapters.adapt(Object, Class, boolean) rather than invoking it directly. Subclasses may override this method (however, if they do so, they should invoke the method on their superclass to ensure that the Platform's adapter manager is consulted).

        Specified by:
        getAdapter in interface IAdaptable
        Overrides:
        getAdapter in class AbstractDecoratedTextEditor
        Type Parameters:
        T - the class type
        Parameters:
        adapter - the adapter class to look up
        Returns:
        a object of the given class, or null if this object does not have an adapter for the given class