Class CALSAndHTMLShowTablePropertiesBase
- java.lang.Object
-
- ro.sync.ecss.extensions.commons.table.properties.ShowTablePropertiesBaseOperation
-
- ro.sync.ecss.extensions.commons.table.properties.CALSAndHTMLShowTablePropertiesBase
-
- All Implemented Interfaces:
AuthorOperation
,Extension
- Direct Known Subclasses:
CALSShowTableProperties
,DocbookHTMLShowTablePropertiesOperationBase
@API(type=INTERNAL, src=PUBLIC) public abstract class CALSAndHTMLShowTablePropertiesBase extends ShowTablePropertiesBaseOperation
Base class for edit properties on CALS and HTML tables.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
HORIZONTAL_ALIGN_VALUES
Array with common possible values for horizontal alignmentstatic java.lang.String[]
VERTICAL_ALIGN_VALUES
Array with common possible values for vertical alignment-
Fields inherited from class ro.sync.ecss.extensions.commons.table.properties.ShowTablePropertiesBaseOperation
authorAccess, tableHelper
-
Fields inherited from interface ro.sync.ecss.extensions.api.AuthorOperation
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
-
-
Constructor Summary
Constructors Constructor Description CALSAndHTMLShowTablePropertiesBase(TablePropertiesHelper helper)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
computeFragmentMoveInsideHeader(java.util.List<AuthorDocumentFragment> fragments, java.util.List<javax.swing.text.Position> offsets, TabInfo tabInfo, java.util.List<AuthorElement> nodesToModify, AuthorElement currentNode)
Computes the fragment and position, inside header element, for the given node.protected boolean
computeFragmentsToMoveInsideBody(java.util.List<AuthorDocumentFragment> fragments, java.util.List<javax.swing.text.Position> offsets, TabInfo tabInfo, java.util.List<AuthorElement> nodesToModify, AuthorElement currentNode)
Computes the fragment and position, inside body element, for the given node.protected boolean
computeFragmentsToMoveInsideFooter(java.util.List<AuthorDocumentFragment> fragments, java.util.List<javax.swing.text.Position> offsets, TabInfo tabInfo, java.util.List<AuthorElement> nodesToModify, AuthorElement currentNode)
Computes the fragment and position, inside footer element, for the given node.protected java.util.List<TabInfo>
getCategoriesAndProperties(java.util.List<java.lang.Integer[]> selections)
Obtain the categories from the table properties dialog.protected abstract java.util.Map<AuthorElement,java.util.Set<java.lang.Integer>>
getCellIndexes(java.util.List<AuthorElement> cells)
Obtain the indexes for selected cells.protected java.util.List<TableProperty>
getCellsAttributes()
Obtain the value for the given attribute set on the given element.protected abstract java.util.List<AuthorElement>
getColSpecs(java.util.Map<AuthorElement,java.util.Set<java.lang.Integer>> map)
Obtain the colspecs elements for the given cells indexes.protected java.util.List<TableProperty>
getColumnsAttributes()
Obtain the value for the given attribute set on the given element.protected java.util.List<TableProperty>
getRowsAttributesToEdit()
Obtain the attributes qualified name and render string (for rows).protected void
processFragment(AuthorElement currentNode, java.util.List<AuthorDocumentFragment> fragments, boolean moveToHeader)
Process the fragments and add them to the fragments to insert.-
Methods inherited from class ro.sync.ecss.extensions.commons.table.properties.ShowTablePropertiesBaseOperation
checkRowSpans, doOperation, getArguments, getAttrProperty, getCommonValue, getDescription, getElementsWithModifiedAttributes, getFragmentsAndOffsetsToInsert, getHelpPageID, getSelectedTab, getTableAttribute, getTableInformation, showTableProperties
-
-
-
-
Constructor Detail
-
CALSAndHTMLShowTablePropertiesBase
public CALSAndHTMLShowTablePropertiesBase(TablePropertiesHelper helper)
Constructor.- Parameters:
helper
- The table helper.
-
-
Method Detail
-
getCategoriesAndProperties
protected java.util.List<TabInfo> getCategoriesAndProperties(java.util.List<java.lang.Integer[]> selections)
Description copied from class:ShowTablePropertiesBaseOperation
Obtain the categories from the table properties dialog. The categories maps the tab name to the list of properties that will be modified in the corresponding tab panel. Every property will be modified using a combobox/radios which will contain the possible values for that property. The label string for the combobox/radios group will be the provided render string of the property or the property name, if a render string is not provided.- Specified by:
getCategoriesAndProperties
in classShowTablePropertiesBaseOperation
- Parameters:
selections
- The currently selected nodes or the node at caret position.- Returns:
- A list of tab info objects containing the tab names and the corresponding properties list.
- See Also:
ShowTablePropertiesBaseOperation.getCategoriesAndProperties(java.util.List)
-
getCellsAttributes
protected java.util.List<TableProperty> getCellsAttributes()
Obtain the value for the given attribute set on the given element.- Returns:
- A list with allowed attributes.
-
computeFragmentsToMoveInsideFooter
protected boolean computeFragmentsToMoveInsideFooter(java.util.List<AuthorDocumentFragment> fragments, java.util.List<javax.swing.text.Position> offsets, TabInfo tabInfo, java.util.List<AuthorElement> nodesToModify, AuthorElement currentNode) throws AuthorOperationException
Description copied from class:ShowTablePropertiesBaseOperation
Computes the fragment and position, inside footer element, for the given node.- Specified by:
computeFragmentsToMoveInsideFooter
in classShowTablePropertiesBaseOperation
- Parameters:
fragments
- A list with already computed fragments. The new fragment will be added to this list.offsets
- A list with positions where the given fragments will be inserted.tabInfo
- The current edited tab info.nodesToModify
- A list containing all the nodes that will be deleted.currentNode
- The node to be checked if it should be moved.- Returns:
true
if the parent of the given node parent should be also deleted.- Throws:
AuthorOperationException
- If the new parent fragment could not be inserted.- See Also:
ShowTablePropertiesBaseOperation.computeFragmentsToMoveInsideFooter(java.util.List, java.util.List, ro.sync.ecss.extensions.commons.table.properties.TabInfo, java.util.List, ro.sync.ecss.extensions.api.node.AuthorElement)
-
computeFragmentMoveInsideHeader
protected boolean computeFragmentMoveInsideHeader(java.util.List<AuthorDocumentFragment> fragments, java.util.List<javax.swing.text.Position> offsets, TabInfo tabInfo, java.util.List<AuthorElement> nodesToModify, AuthorElement currentNode) throws AuthorOperationException
Description copied from class:ShowTablePropertiesBaseOperation
Computes the fragment and position, inside header element, for the given node.- Specified by:
computeFragmentMoveInsideHeader
in classShowTablePropertiesBaseOperation
- Parameters:
fragments
- A list with already computed fragments. The new fragment will be added to this list.offsets
- A list with positions where the given fragments will be inserted.tabInfo
- The current edited tab info.nodesToModify
- A list containing all the nodes that will be deleted.currentNode
- The node to be checked if it should be moved.- Returns:
true
if the parent of the given node parent should be also deleted.- Throws:
AuthorOperationException
- If the new parent fragment could not be inserted.
-
computeFragmentsToMoveInsideBody
protected boolean computeFragmentsToMoveInsideBody(java.util.List<AuthorDocumentFragment> fragments, java.util.List<javax.swing.text.Position> offsets, TabInfo tabInfo, java.util.List<AuthorElement> nodesToModify, AuthorElement currentNode) throws AuthorOperationException
Description copied from class:ShowTablePropertiesBaseOperation
Computes the fragment and position, inside body element, for the given node.- Specified by:
computeFragmentsToMoveInsideBody
in classShowTablePropertiesBaseOperation
- Parameters:
fragments
- A list with already computed fragments. The new fragment will be added to this list.offsets
- A list with positions where the given fragments will be inserted.tabInfo
- The current edited tab info.nodesToModify
- A list containing all the nodes that will be deleted.currentNode
- The node to be checked if it should be moved.- Returns:
true
if the parent of the given node parent should be also deleted.- Throws:
AuthorOperationException
- If the new parent fragment could not be inserted.- See Also:
ShowTablePropertiesBaseOperation.computeFragmentsToMoveInsideBody(java.util.List, java.util.List, ro.sync.ecss.extensions.commons.table.properties.TabInfo, java.util.List, ro.sync.ecss.extensions.api.node.AuthorElement)
-
processFragment
protected void processFragment(AuthorElement currentNode, java.util.List<AuthorDocumentFragment> fragments, boolean moveToHeader) throws javax.swing.text.BadLocationException
Process the fragments and add them to the fragments to insert.- Parameters:
currentNode
- The current row node.fragments
- The list with fragment which will be inserted.moveToHeader
-true
if the current node is moved from body/footer to header.- Throws:
javax.swing.text.BadLocationException
-
getRowsAttributesToEdit
protected java.util.List<TableProperty> getRowsAttributesToEdit()
Obtain the attributes qualified name and render string (for rows).- Returns:
- A list with attributes to edit.
-
getColumnsAttributes
protected java.util.List<TableProperty> getColumnsAttributes()
Obtain the value for the given attribute set on the given element.- Returns:
- A list with allowed attributes.
-
getColSpecs
protected abstract java.util.List<AuthorElement> getColSpecs(java.util.Map<AuthorElement,java.util.Set<java.lang.Integer>> map)
Obtain the colspecs elements for the given cells indexes.- Parameters:
map
- A map containing the table elements and cells indexes.- Returns:
- A list with the colspecs elements for the given cells indexes.
-
getCellIndexes
protected abstract java.util.Map<AuthorElement,java.util.Set<java.lang.Integer>> getCellIndexes(java.util.List<AuthorElement> cells)
Obtain the indexes for selected cells.- Parameters:
cells
- The selected cells.- Returns:
- A map containing the cell indexes based on the parent tgroup.
-
-