Interface WSTextEditorPage

    • Method Detail

      • getDocument

        javax.swing.text.Document getDocument()
        Get the edited document. For eclipse, the returned instance is an javax.swing.text.Document adapter over the Eclipse native document.
        Returns:
        The edited document.
      • getTextComponent

        java.lang.Object getTextComponent()
        Get the internal text component which is currently used for editing.
        Returns:
        for the stand alone version, a javax.swing.JTextArea and for the eclipse implementation a org.eclipse.swt.custom.StyledText.
        Since:
        12
      • getXMLSchemaManager

        WSTextXMLSchemaManager getXMLSchemaManager()
        Get the schema manager used to ask useful information about allowed elements and the context of the current offset.
        Returns:
        the XML Schema Manager used to ask useful information about allowed elements and the context of the current offset. Only available for opened XML files.
        Since:
        12.1
      • beginCompoundUndoableEdit

        void beginCompoundUndoableEdit()
        Begin a compound undoable edit operation. This is useful if you make modifications through the API and want Oxygen to undo in a single step. This should be used like:
        try{
          beginCompoundUndoableEdit();
          //YOUR CODE HERE
         } finally{
          endCompoundUndoableEdit();
         }
         
        Since:
        12.2
      • endCompoundUndoableEdit

        void endCompoundUndoableEdit()
        End a compound undoable edit operation. This is useful if you make modifications through the API and want Oxygen to undo in a single step. This should be used like:
        try{
          beginCompoundUndoableEdit();
          //YOUR CODE HERE
         } finally{
          endCompoundUndoableEdit();
         }
         
        Since:
        12.2
      • getLineOfOffset

        int getLineOfOffset​(int offset)
                     throws javax.swing.text.BadLocationException
        Converts an offset position (a position between the characters of the text) to the line number that contains the offset. If the offset is between two lines, then the number of the line after is returned. The line number returned is indexed in 1.
        Parameters:
        offset - Offset in document.
        Returns:
        The line which contains the specified offset. 1 based.
        Throws:
        javax.swing.text.BadLocationException - When the offset is not valid.
        Since:
        14
      • getColumnOfOffset

        int getColumnOfOffset​(int offset)
                       throws javax.swing.text.BadLocationException
        Converts an offset position (a position between the characters of the text) to the column number in the line that contains the offset.
        Parameters:
        offset - The offset that is to be checked.
        Returns:
        The column in the line that contains the offset.
        Throws:
        javax.swing.text.BadLocationException - Bad Location Exception.
        Since:
        14
      • getOffsetOfLineStart

        int getOffsetOfLineStart​(int lineNumber)
                          throws javax.swing.text.BadLocationException
        Gets the offset of the start of the specified line (return >=0). The line number is indexed in 1.
        Parameters:
        lineNumber - The number of the line. Indexed in 1.
        Returns:
        The offset of the start of the specified line.
        Throws:
        javax.swing.text.BadLocationException - When line does not exist.
        java.lang.IllegalArgumentException - If the line number is out of range.
        Since:
        14
      • getOffsetOfLineEnd

        int getOffsetOfLineEnd​(int lineNumber)
                        throws javax.swing.text.BadLocationException
        Gets the offset of the end of the specified line (return >=0). This will be equal to the start offset of the next line, if there is one. The line number is indexed in 1.
        Parameters:
        lineNumber - The number of the line. Indexed in 1.
        Returns:
        The offset of the end of the specified line.
        Throws:
        javax.swing.text.BadLocationException - If the line number is out of range.
        Since:
        14
      • addPopUpMenuCustomizer

        void addPopUpMenuCustomizer​(TextPopupMenuCustomizer popUpCustomizer)
        Add the pop-up menu customizer which can be used to customize the pop-up menu (add/remove actions) before showing it in the Text page. If the customizer is already added, it will not be added again.
        Parameters:
        popUpCustomizer - the pop-up menu customizer.
        Since:
        14.1
      • removePopUpMenuCustomizer

        void removePopUpMenuCustomizer​(TextPopupMenuCustomizer popUpCustomizer)
        Remove the pop-up menu customizer which is used to customize the pop-up menu (add/remove actions) before showing it in the Text page.
        Parameters:
        popUpCustomizer - the pop-up menu customizer.
        Since:
        14.1
      • getActionsProvider

        TextActionsProvider getActionsProvider()
        Provides access to actions already defined in the Text page like: Undo, Redo, etc.
        Returns:
        access to actions already defined in the Text page.
        Since:
        14.2
      • addExternalContentCompletionProvider

        void addExternalContentCompletionProvider​(ExternalContentCompletionProvider ccProvider)
        Add a content completion provider, that can be used to display additional content completion proposals. Not implemented in the Oxygen Eclipse Plug-in.
        Parameters:
        ccProvider - The content completion provider.
        Since:
        22.1
      • removeExternalContentCompletionProvider

        void removeExternalContentCompletionProvider​(ExternalContentCompletionProvider ccProvider)
        Remove a content completion provider that was added to the current editor. Not implemented in the Oxygen Eclipse Plug-in.
        Parameters:
        ccProvider - The content completion provider to be removed.
        Since:
        22.1
      • addQuickAssistProcessor

        void addQuickAssistProcessor​(SimpleQuickAssistProcessor processor)
        Register a quick assist processor. This allow you to provide quick custom quick assist proposals in the current editor page quick assist menu.
        Parameters:
        processor - The processor to be registered.
        Since:
        26.1

        *********************************
        EXPERIMENTAL - Subject to change
        ********************************

        Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.

      • removeQuickAssistProcessor

        void removeQuickAssistProcessor​(SimpleQuickAssistProcessor processor)
        The processor to be unregistered.
        Parameters:
        processor - The processor to be unregistered.
        Since:
        26.1

        *********************************
        EXPERIMENTAL - Subject to change
        ********************************

        Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.