Oxygen XML Editor 14.2 Author API

ro.sync.ecss.extensions.commons.table.operations
Class TableOperationsUtil

java.lang.Object
  extended by ro.sync.ecss.extensions.commons.table.operations.TableOperationsUtil

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

Utility class for table operations.


Constructor Summary
TableOperationsUtil()
           
 
Method Summary
static java.lang.String createCellXMLFragment(AuthorAccess authorAccess, AuthorDocumentFragment[] fragments, boolean cellsFragment, java.lang.String cellElementName, int currentFragmentIndex, java.lang.String namespace, AuthorTableHelper tableHelper, java.lang.String... imposedAttributesFragments)
          Create a cell fragment for a specific offset, having the name of the cell and a source fragment from which the attributes and content must be copied.
static java.lang.String getContentFromFragment(AuthorAccess authorAccess, boolean cellsFragment, AuthorDocumentFragment fragment)
          Get the given fragment content.
static AuthorElement getTableElementContainingOffset(int offset, AuthorAccess access, java.lang.String... tableClassValues)
          Returns the element representing the table that contains the given offset and has the given properties (name, class attribute).
static AuthorElement getTableElementContainingOffset(int offset, java.lang.String namespace, AuthorAccess access, java.lang.String... tableElementNames)
          Returns the element representing the table that contains the given offset and has the given properties (name, namespace).
static boolean isIgnoredAttribute(java.lang.String attrName, AuthorTableHelper tableHelper)
          Check if the attribute should be ignored.
static boolean nodeHasProperties(AuthorNode node, java.lang.String name, java.lang.String namespace)
          Check if the node has the given namespace and name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableOperationsUtil

public TableOperationsUtil()
Method Detail

createCellXMLFragment

public static java.lang.String createCellXMLFragment(AuthorAccess authorAccess,
                                                     AuthorDocumentFragment[] fragments,
                                                     boolean cellsFragment,
                                                     java.lang.String cellElementName,
                                                     int currentFragmentIndex,
                                                     java.lang.String namespace,
                                                     AuthorTableHelper tableHelper,
                                                     java.lang.String... imposedAttributesFragments)
                                              throws AuthorOperationException
Create a cell fragment for a specific offset, having the name of the cell and a source fragment from which the attributes and content must be copied.

Parameters:
authorAccess - The author access.
fragments - The list of all content fragments.
cellsFragment - true if the fragments represents cells.
cellElementName - The cell name.
currentFragmentIndex - The index of the fragment that must be used for attributes and content.
namespace - The cell namespace.
tableHelper - Author table helper.
imposedAttributesFragments - Imposed attributes for the created cell. Each fragment has the following form: "attribute_name=\"attribute_value\""
Returns:
The cell fragment.
Throws:
AuthorOperationException

isIgnoredAttribute

public static boolean isIgnoredAttribute(java.lang.String attrName,
                                         AuthorTableHelper tableHelper)
Check if the attribute should be ignored.

Parameters:
attrName - The attribute name.
tableHelper - Author table helper
Returns:
true if the attribute should be ignored.

getContentFromFragment

public static java.lang.String getContentFromFragment(AuthorAccess authorAccess,
                                                      boolean cellsFragment,
                                                      AuthorDocumentFragment fragment)
Get the given fragment content. If the cellsFragment parameter is true, the returned content represent the content of the cell, otherwise the fragment itself.

Parameters:
authorAccess - The author access.
cellsFragment - true if the fragment represent a cell fragment
fragment - The Author fragment.
Returns:
The fragment content.

nodeHasProperties

public static boolean nodeHasProperties(AuthorNode node,
                                        java.lang.String name,
                                        java.lang.String namespace)
Check if the node has the given namespace and name

Parameters:
node - The node to check.
name - The name to compare the node name with.
namespace - The namespace to compare the node namespace with.
Returns:
true if the node has the given namespace and name.

getTableElementContainingOffset

public static AuthorElement getTableElementContainingOffset(int offset,
                                                            AuthorAccess access,
                                                            java.lang.String... tableClassValues)
Returns the element representing the table that contains the given offset and has the given properties (name, class attribute). Used for DITA and DITA Maps table operations.

Parameters:
offset - The offset to search the parent table element for.
access - Access to Author operations.
tableClassValues - Possible table class attributes values.
Returns:
The table element that contains the given offset.

getTableElementContainingOffset

public static AuthorElement getTableElementContainingOffset(int offset,
                                                            java.lang.String namespace,
                                                            AuthorAccess access,
                                                            java.lang.String... tableElementNames)
Returns the element representing the table that contains the given offset and has the given properties (name, namespace).

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

Oxygen XML Editor 14.2 Author API

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