24.08.2015 Views

Oxygen XML Author plugin 13.2.0

Oxygen XML Author plugin 13.2.0

Oxygen XML Author plugin 13.2.0

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Author</strong> Developer Guide | 222just parses the value of the width attribute. The methods must return null for the tables / cells that do not have aspecified 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 getCellWidth(<strong>Author</strong>Element cellElement, intcolNumberStart,int colSpan) {List toReturn = null;int size = colWidthSpecs.size();if (size >= colNumberStart && size >= colNumberStart + colSpan) {toReturn = new ArrayList(colSpan);for (int i = colNumberStart; i < colNumberStart + colSpan; i ++) {// Add the column widthstoReturn.add(colWidthSpecs.get(i));}}return toReturn;}6. Methods commitTableWidthModification and commitColumnWidthModifications are used tocommit changes made to the width of the table or its columns when using the mouse drag gestures.public void commitTableWidthModification(<strong>Author</strong>DocumentControllerauthorDocumentController,int newTableWidth, String tableCellsTagName) throws <strong>Author</strong>OperationException{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 <strong>Author</strong>OperationException("Cannot find the element representingthe table.");}}}}public void commitColumnWidthModifications(<strong>Author</strong>DocumentControllerauthorDocumentController,WidthRepresentation[] colWidths, String tableCellsTagName) throws<strong>Author</strong>OperationException {

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!