Oxygen XML Editor 14.2 Author API

ro.sync.ecss.extensions.api.table.operations
Class AuthorTableOperationsHandler

java.lang.Object
  extended by ro.sync.ecss.extensions.api.table.operations.AuthorTableOperationsHandler
Direct Known Subclasses:
DITAAuthorTableOperationsHandler, DITAMapAuthorTableOperationsHandler, DocbookAuthorTableOperationsHandler, TEIAuthorTableOperationsHandler, XHTMLAuthorTableOperationsHandler

@API(type=EXTENDABLE,
     src=PUBLIC)
public class AuthorTableOperationsHandler
extends java.lang.Object

Handler for Author table operations. It should be implemented when the author extension being developed offers support for editing data in tabular form.

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.


Constructor Summary
AuthorTableOperationsHandler()
           
 
Method Summary
 TableColumnSpecificationInformation getColumnSpecification(AuthorAccess access, AuthorElement tableElement, int columnIndex)
          Returns the column specification information of a table column.
 AuthorElement getTableElementContainingOffset(AuthorAccess access, int offset)
          Returns the element representing the table that contains the given offset.
 boolean handleDeleteColumn(AuthorTableDeleteColumnArguments arguments)
          Handles delete column operation.
 boolean handleDeleteRow(AuthorTableDeleteRowArguments arguments)
          Handles delete row operation.
 boolean handleInsertColumn(AuthorTableInsertColumnArguments arguments)
          Handles insert column operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorTableOperationsHandler

public AuthorTableOperationsHandler()
Method Detail

handleInsertColumn

public boolean handleInsertColumn(AuthorTableInsertColumnArguments arguments)
                           throws AuthorOperationException
Handles insert column operation.
This method is called when pasting or dropping content for which the SelectionInterpretationMode.TABLE_COLUMN interpretation mode was imposed.

The SelectionInterpretationMode.TABLE_COLUMN interpretation mode is already set by default by the application when a table column is selected. It can be also imposed from the AuthorSelectionModel.setSelectionInterpretationMode(SelectionInterpretationMode) method, for any selection content.
For instance, when two paragraphs are copied, the clipboard object contains a list with two Author document fragments (one for each paragraph). If the selection interpretation mode is imposed to SelectionInterpretationMode.TABLE_COLUMN, when pasting the fragments this method is called. The fragments array are included in the argument object.

Parameters:
arguments - The arguments for insert column operation like: the offset where the column is inserted, the array containing the cells fragments that compose an Author table column, information about column width specification, the Author access.
Returns:
true if the insert column operation succeeds.
Throws:
AuthorOperationException - An insert column operation exception. If the AuthorOperationException.isOperationRejectedOnPurpose() method of this exception returns true, the exception is presented to the user.

handleDeleteColumn

public boolean handleDeleteColumn(AuthorTableDeleteColumnArguments arguments)
                           throws AuthorOperationException
Handles delete column operation.
This method is called when deleting content (by drag and drop or cut operations) for which the SelectionInterpretationMode.TABLE_COLUMN interpretation mode was imposed.

The SelectionInterpretationMode.TABLE_COLUMN interpretation mode is already set by default by the application when a table column is selected. It can be also imposed from the AuthorSelectionModel.setSelectionInterpretationMode(SelectionInterpretationMode) method, for any selection content.
For instance, when two paragraphs are copied, the clipboard object contains a list with two Author document fragments (one for each paragraph). If the selection interpretation mode is imposed to SelectionInterpretationMode.TABLE_COLUMN, when deleting the fragments this method is called. The fragments array are included in the argument object.

Parameters:
arguments - The arguments for delete column operation (like the Author access and the column cells start and end offsets).
Returns:
true if the delete column operation succeeds.
Throws:
AuthorOperationException - A delete column operation exception. If the AuthorOperationException.isOperationRejectedOnPurpose() method of this exception returns true, the exception is presented to the user.

handleDeleteRow

public boolean handleDeleteRow(AuthorTableDeleteRowArguments arguments)
                        throws AuthorOperationException
Handles delete row operation.
This method is called when deleting content (by drag and drop or cut operations) for which the SelectionInterpretationMode.TABLE_ROW interpretation mode was imposed.

The SelectionInterpretationMode.TABLE_ROW interpretation mode is already set by default by the application when a table row is selected. It can be also imposed from the AuthorSelectionModel.setSelectionInterpretationMode(SelectionInterpretationMode) method, for any selection content.
For instance, when two paragraphs are copied, the clipboard object contains a list with two Author document fragments (one for each paragraph). If the selection interpretation mode is imposed to SelectionInterpretationMode.TABLE_ROW, when deleting the fragments this method is called. The fragments array are included in the argument object.

Parameters:
arguments - The arguments for delete row operation (like the Author access and the content interval of the row element that must be deleted).
Returns:
true if the delete row operation succeeds.
Throws:
AuthorOperationException - A delete row operation exception. If the AuthorOperationException.isOperationRejectedOnPurpose() method of this exception returns true, the exception is presented to the user.

getTableElementContainingOffset

public AuthorElement getTableElementContainingOffset(AuthorAccess access,
                                                     int offset)
Returns the element representing the table that contains the given offset. This method can be used to obtain the closest table that contains the given offset.

Parameters:
access - Access to Author operations.
offset - The offset to search the parent table element for.
Returns:
The table node that contains the given offset.

getColumnSpecification

public TableColumnSpecificationInformation getColumnSpecification(AuthorAccess access,
                                                                  AuthorElement tableElement,
                                                                  int columnIndex)
Returns the column specification information of a table column.
This information is requested when a column is copied or dragged and it can be used when the column must be inserted in the document (on paste or drop). The column specification is send as an argument to the handleInsertColumn(AuthorTableInsertColumnArguments) method.

Parameters:
access - Access to Author operations.
tableElement - The table that contains the column.
columnIndex - The column index, 0 based.
Returns:
The column specification element. It can be null if there is no specification for this column.

Oxygen XML Editor 14.2 Author API

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