Download "user manual"
Transcript
Oxygen XML Editor | Author Mode Customization | 688
3. The method isTableAcceptingWidth should check if the table cells are td.
public boolean isTableAcceptingWidth(String tableCellsTagName) {
return "td".equals(tableCellsTagName);
}
4. The method isTableAndColumnsResizable should check if the table cells are td. This method determines
if the table and its columns can be resized by dragging the edge of a column.
public boolean isTableAndColumnsResizable(String tableCellsTagName) {
return "td".equals(tableCellsTagName);
}
5. Methods getTableWidth and getCellWidth are used to determine the table and column width. The table
layout engine will ask this ro.sync.ecss.extensions.api.AuthorTableColumnWidthProvider
implementation what is the table width for each table element and the cell width for each cell element from the table
that was marked as cell in the CSS using the property display:table-cell. The implementation is simple and
just parses the value of the width attribute. The methods must return null for the tables / cells that do not have a
specified width.
public WidthRepresentation getTableWidth(String tableCellsTagName) {
WidthRepresentation toReturn = null;
if (tableElement != null && "td".equals(tableCellsTagName)) {
AttrValue widthAttr = tableElement.getAttribute("width");
if (widthAttr != null) {
String width = widthAttr.getValue();
if (width != null) {
toReturn = new WidthRepresentation(width, true);
}
}
}
return toReturn;
}
public List<WidthRepresentation> getCellWidth(AuthorElement cellElement, int colNumberStart,
int colSpan) {
List<WidthRepresentation> toReturn = null;
int size = colWidthSpecs.size();
if (size >= colNumberStart && size >= colNumberStart + colSpan) {
toReturn = new ArrayList<WidthRepresentation>(colSpan);
for (int i = colNumberStart; i < colNumberStart + colSpan; i ++) {
// Add the column widths
toReturn.add(colWidthSpecs.get(i));
}
}
return toReturn;
}
6. Methods commitTableWidthModification and commitColumnWidthModifications are used to
commit changes made to the width of the table or its columns when using the mouse drag gestures.
public void commitTableWidthModification(AuthorDocumentController authorDocumentController,
int newTableWidth, String tableCellsTagName) throws AuthorOperationException {
if ("td".equals(tableCellsTagName)) {
if (newTableWidth > 0) {
if (tableElement != null) {
String newWidth = String.valueOf(newTableWidth);
authorDocumentController.setAttribute(
"width",
new AttrValue(newWidth),
tableElement);
} else {
throw new AuthorOperationException("Cannot find the element representing the table.");
}
}
}
}
public void commitColumnWidthModifications(AuthorDocumentController authorDocumentController,
WidthRepresentation[] colWidths, String tableCellsTagName) throws AuthorOperationException {
if ("td".equals(tableCellsTagName)) {
if (colWidths != null && tableElement != null) {
if (colsStartOffset >= 0 && colsEndOffset >= 0 && colsStartOffset < colsEndOffset) {
authorDocumentController.delete(colsStartOffset,
colsEndOffset);
}
Related documents
"user manual"
Oxygen XML Editor 16.1
Oxygen XML Developer Eclipse Plugin 16.1
"user manual"
XML Author 10.3 User Manual for Eclipse
Production Guide - Pawlan Communications
DITA to XSL-FO Transformation
Oxygen XML Author Eclipse Plugin 15.2
Oxygen XML Author 12.2
XML Editor 11.2 User Manual
XML Author 10.3 User Manual
XML Editor 10.3 User Manual for Eclipse