Oxygen XML Editor 14.2 Author API

ro.sync.exml.workspace.api.editor.page.text
Interface WSTextEditorPage

All Superinterfaces:
WSEditorPage, WSTextBasedEditorPage
All Known Subinterfaces:
WSXMLTextEditorPage

@API(type=NOT_EXTENDABLE,
     src=PUBLIC)
public interface WSTextEditorPage
extends WSTextBasedEditorPage

Text editor page access.

Since:
11.2

Method Summary
 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.
 void beginCompoundUndoableEdit()
          Begin a compound undoable edit operation.
 void endCompoundUndoableEdit()
          End a compound undoable edit operation.
 TextActionsProvider getActionsProvider()
          Provides access to actions already defined in the Text page like: Undo, Redo, etc.
 int getColumnOfOffset(int offset)
          Converts an offset position (a position between the characters of the text) to the column number in the line that contains the offset.
 javax.swing.text.Document getDocument()
          Get the edited document.
 int getLineOfOffset(int offset)
          Converts an offset position (a position between the characters of the text) to the line number that contains the offset.
 int getOffsetOfLineEnd(int lineNumber)
          Gets the offset of the end of the specified line (return >=0).
 int getOffsetOfLineStart(int lineNumber)
          Gets the offset of the start of the specified line (return >=0).
 java.lang.Object getTextComponent()
          Get the internal text component which is currently used for editing.
 WSTextXMLSchemaManager getXMLSchemaManager()
          Get the schema manager used to ask useful information about allowed elements and the context of the current offset.
 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.
 
Methods inherited from interface ro.sync.exml.workspace.api.editor.page.WSTextBasedEditorPage
deleteSelection, getCaretOffset, getLocationOnScreenAsPoint, getLocationRelativeToEditorFromScreen, getSelectedText, getSelectionEnd, getSelectionStart, getStartEndOffsets, getWordAtCaret, hasSelection, isEditable, modelToViewRectangle, select, selectWord, setCaretPosition, setEditable, viewToModelOffset
 

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

*********************************
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.


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

*********************************
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.


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

*********************************
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.


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

*********************************
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.


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

*********************************
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.


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

*********************************
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.


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

*********************************
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.


Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.