|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.gwt.wysiwyg.client.plugin.table.util.TableUtils
public final class TableUtils
Utility class designed to ease HTML tables manipulation.
| Field Summary | |
|---|---|
static java.lang.String |
BODY_NODENAME
HTML tag defining the root node of the area being edited. |
static java.lang.String |
CELL_DEFAULTHTML
HTML to be inserted in newly created table cells. |
static java.lang.String |
COL_HNODENAME
HTML tag defining a table heading cell. |
static java.lang.String |
COL_NODENAME
HTML tag defining a table cell. |
static java.lang.String |
ROW_NODENAME
HTML tag defining a table row. |
static java.lang.String |
TABLE_NODENAME
HTML tag defining a table. |
static java.lang.String |
TBODY_NODENAME
HTML tag defining a table body. |
| Constructor Summary | |
|---|---|
TableUtils()
|
|
| Method Summary | |
|---|---|
com.google.gwt.dom.client.Node |
getCaretNode(Document doc)
Get the node in which the caret is currently positioned. |
com.google.gwt.dom.client.TableCellElement |
getCell(com.google.gwt.dom.client.Node node)
Browse node ancestors and return the first table cell element (TD or TH). |
static TableUtils |
getInstance()
Get the instance in use. |
com.google.gwt.dom.client.TableCellElement |
getNextCellInColumn(com.google.gwt.dom.client.TableCellElement cell)
Get next cell in cell's column. |
com.google.gwt.dom.client.TableCellElement |
getNextCellInRow(com.google.gwt.dom.client.TableCellElement cell)
Get next cell in cell's row. |
com.google.gwt.dom.client.TableCellElement |
getPreviousCellInColumn(com.google.gwt.dom.client.TableCellElement cell)
Get previous cell in cell's column. |
com.google.gwt.dom.client.TableCellElement |
getPreviousCellInRow(com.google.gwt.dom.client.TableCellElement cell)
Get previous cell in cell's row. |
Range |
getRange(Document doc)
Inspect a Document to get the currently selected Range. |
com.google.gwt.dom.client.TableRowElement |
getRow(com.google.gwt.dom.client.Node node)
Browse node ancestors and return the first table row element. |
com.google.gwt.dom.client.TableElement |
getTable(com.google.gwt.dom.client.Node node)
Browse node ancestors and return the first table element. |
void |
insertCol(Document doc,
boolean insertBefore)
Insert a column in the currently edited table. |
com.google.gwt.dom.client.TableRowElement |
insertRow(Document doc,
boolean insertBefore)
Insert a row in the currently edited table. |
boolean |
isHeaderRow(com.google.gwt.dom.client.TableRowElement row)
Determine if the row is a header row. |
void |
putCaretInNode(RichTextArea rta,
com.google.gwt.dom.client.Node node)
Put caret in the given HTML node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BODY_NODENAME
public static final java.lang.String TABLE_NODENAME
public static final java.lang.String TBODY_NODENAME
public static final java.lang.String ROW_NODENAME
public static final java.lang.String COL_NODENAME
public static final java.lang.String COL_HNODENAME
public static final java.lang.String CELL_DEFAULTHTML
| Constructor Detail |
|---|
public TableUtils()
| Method Detail |
|---|
public static TableUtils getInstance()
public Range getRange(Document doc)
doc - Document to inspect.
public com.google.gwt.dom.client.Node getCaretNode(Document doc)
doc - Document to get the caret from.
public void putCaretInNode(RichTextArea rta,
com.google.gwt.dom.client.Node node)
rta - wysiwyg RichTextAreanode - the node to put the caret in.public com.google.gwt.dom.client.TableElement getTable(com.google.gwt.dom.client.Node node)
node - the Node to inspect.
public com.google.gwt.dom.client.TableRowElement getRow(com.google.gwt.dom.client.Node node)
node - the Node to inspect.
public boolean isHeaderRow(com.google.gwt.dom.client.TableRowElement row)
row - the row to inspect.
public com.google.gwt.dom.client.TableCellElement getCell(com.google.gwt.dom.client.Node node)
node - the node to inspect.
public com.google.gwt.dom.client.TableCellElement getNextCellInRow(com.google.gwt.dom.client.TableCellElement cell)
cell - currently edited cell.
public com.google.gwt.dom.client.TableCellElement getPreviousCellInRow(com.google.gwt.dom.client.TableCellElement cell)
cell - currently edited cell.
public com.google.gwt.dom.client.TableCellElement getNextCellInColumn(com.google.gwt.dom.client.TableCellElement cell)
cell - currently edited cell.
public com.google.gwt.dom.client.TableCellElement getPreviousCellInColumn(com.google.gwt.dom.client.TableCellElement cell)
cell - currently edited cell.
public com.google.gwt.dom.client.TableRowElement insertRow(Document doc,
boolean insertBefore)
doc - the Document to get the selection from.insertBefore - indicates the creation position relatively to the currently edited row.
public void insertCol(Document doc,
boolean insertBefore)
doc - the Document to get the selection from.insertBefore - indicates the creation position relatively to the currently edited column.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||