本文整理汇总了Java中com.google.gwt.dom.client.TableElement类的典型用法代码示例。如果您正苦于以下问题:Java TableElement类的具体用法?Java TableElement怎么用?Java TableElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TableElement类属于com.google.gwt.dom.client包,在下文中一共展示了TableElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEmptyTHTag
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testEmptyTHTag() {
String tableStr = "<tbody>" +
"<tr>" +
"<th></th>" +
"<th></th>" +
"</tr>" +
"<tr>" +
"<td>row1col1</td>" +
"<td>row1col2</td>" +
"</tr>" +
"<tr>" +
"<td>row2col1</td>" +
"<td>row2col2</td>" +
"</tr>" +
"</tbody>";
TableElement table = createTable(tableStr);
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.LESS_EQ_10_CELLS, TableClassifier.sReason);
}
示例2: testAllWhitespacedTHTag
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testAllWhitespacedTHTag() {
String tableStr = "<tbody>" +
"<tr>" +
"<th> </th>" +
"<th> </th>" +
"</tr>" +
"<tr>" +
"<td>row1col1</td>" +
"<td>row1col2</td>" +
"</tr>" +
"<tr>" +
"<td>row2col1</td>" +
"<td>row2col2</td>" +
"</tr>" +
"</tbody>";
TableElement table = createTable(tableStr);
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.LESS_EQ_10_CELLS, TableClassifier.sReason);
}
示例3: testWideTable
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testWideTable() {
TableElement table = createDefaultTableWithNoTH();
int rootWidth = mRoot.getOffsetWidth();
int width = (int) ((0.95 * rootWidth) + 1.0);
table.setAttribute("style", "width:" + width + "px");
assertEquals(rootWidth, mRoot.getOffsetWidth());
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.MORE_95_PERCENT_DOC_WIDTH, TableClassifier.sReason);
// Test same wide table with viewport meta.
Element meta = TestUtil.createMetaName("viewport", "width=device-width");
mHead.appendChild(meta);
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.LESS_EQ_10_CELLS, TableClassifier.sReason);
meta.removeFromParent();
}
示例4: test5Cols
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void test5Cols() {
String tableStr = "<tbody>" +
"<tr>" +
"<td>row1col1</td>" +
"<td>row1col2</td>" +
"<td>row1col3</td>" +
"<td>row1col4</td>" +
"<td>row1col5</td>" +
"</tr>" +
"<tr>" +
"<td>row2col1</td>" +
"<td>row2col2</td>" +
"<td>row2col3</td>" +
"<td>row2col4</td>" +
"<td>row2col5</td>" +
"</tr>" +
"</tbody>";
TableElement table = createTable(tableStr);
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.MORE_EQ_5_COLS, TableClassifier.sReason);
}
示例5: createDefaultTableWithTH
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
private TableElement createDefaultTableWithTH() {
String tableStr = "<tbody>" +
"<tr>" +
"<th>heading1</th>" +
"<th>heading2</th>" +
"</tr>" +
"<tr>" +
"<td>row1col1</td>" +
"<td>row1col2</td>" +
"</tr>" +
"<tr>" +
"<td>row2col1</td>" +
"<td>row2col2</td>" +
"</tr>" +
"</tbody>";
TableElement table = createTable(tableStr);
mBody.appendChild(table);
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.CAPTION_THEAD_TFOOT_COLGROUP_COL_TH,
TableClassifier.sReason);
return table;
}
示例6: createDefaultTableWithNoTH
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
private TableElement createDefaultTableWithNoTH() {
String tableStr = "<tbody>" +
"<tr>" +
"<td>row1col1</td>" +
"<td>row1col2</td>" +
"</tr>" +
"<tr>" +
"<td>row2col1</td>" +
"<td>row2col2</td>" +
"</tr>" +
"</tbody>";
TableElement table = createTable(tableStr);
mBody.appendChild(table);
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.LESS_EQ_10_CELLS, TableClassifier.sReason);
return table;
}
示例7: displayQuireItem
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
private void displayQuireItem(com.google.gwt.dom.client.Document htmldoc,
TableElement table, Element item) {
TableRowElement tr = table.insertRow(-1);
TableCellElement td1 = tr.insertCell(-1);
TableCellElement td2 = tr.insertCell(-1);
TableCellElement td3 = tr.insertCell(-1);
td1.setInnerText(item.getAttribute("n"));
NodeList l = item.getElementsByTagName("locus");
if (l.getLength() > 0) {
Element locus = (Element) l.item(0);
td2.appendChild(displayLocus(htmldoc, locus));
for (Node n = locus.getNextSibling(); n != null; n = n
.getNextSibling()) {
td3.appendChild(displayDescription(htmldoc, n));
}
}
}
示例8: testInputElement
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testInputElement() {
Element input = Document.get().createTextInputElement();
mBody.appendChild(input);
TableElement table = createDefaultTableWithTH();
input.appendChild(table);
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.INSIDE_EDITABLE_AREA, TableClassifier.sReason);
}
示例9: testContentEditableAttribute
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testContentEditableAttribute() {
Element div = TestUtil.createDiv(0);
mBody.appendChild(div);
div.setAttribute("contenteditable", "true");
TableElement table = createDefaultTableWithTH();
div.appendChild(table);
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.INSIDE_EDITABLE_AREA, TableClassifier.sReason);
}
示例10: testRoleGridNested
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testRoleGridNested() {
TableElement table = createDefaultTableWithNoTH();
TableElement nestedTable = createDefaultNestedTableWithNoTH(table);
nestedTable.setAttribute("role", "grid");
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.NESTED_TABLE, TableClassifier.sReason);
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(nestedTable));
assertEquals(TableClassifier.Reason.ROLE_TABLE, TableClassifier.sReason);
}
示例11: testRoleGridCellNested
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testRoleGridCellNested() {
TableElement table = createDefaultTableWithNoTH();
TableElement nestedTable = createDefaultNestedTableWithNoTH(table);
setRoleForFirstElement(nestedTable, "TD", "gridcell");
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.NESTED_TABLE, TableClassifier.sReason);
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(nestedTable));
assertEquals(TableClassifier.Reason.ROLE_DESCENDANT, TableClassifier.sReason);
}
示例12: testRoleLandmark
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testRoleLandmark() {
TableElement table = createDefaultTableWithNoTH();
// Test landmark role in <table> element.
table.setAttribute("role", "application");
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.ROLE_TABLE, TableClassifier.sReason);
// Test landmark role in table's descendant.
table.removeAttribute("role");
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.LESS_EQ_10_CELLS, TableClassifier.sReason);
setRoleForFirstElement(table, "TR", "navigation");
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.ROLE_DESCENDANT, TableClassifier.sReason);
}
示例13: testCaptionTag
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testCaptionTag() {
String caption = "<caption>Testing Caption</caption>";
TableElement table = createDefaultTableWithNoTH();
table.setInnerHTML(caption + table.getInnerHTML());
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.CAPTION_THEAD_TFOOT_COLGROUP_COL_TH,
TableClassifier.sReason);
}
示例14: testEmptyCaptionTag
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testEmptyCaptionTag() {
String caption = "<caption></caption>";
TableElement table = createDefaultTableWithNoTH();
table.setInnerHTML(caption + table.getInnerHTML());
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.LESS_EQ_10_CELLS, TableClassifier.sReason);
}
示例15: testAllWhitespacedCaptionTag
import com.google.gwt.dom.client.TableElement; //导入依赖的package包/类
public void testAllWhitespacedCaptionTag() {
String caption = "<caption> </caption>";
TableElement table = createDefaultTableWithNoTH();
table.setInnerHTML(caption + table.getInnerHTML());
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.LESS_EQ_10_CELLS, TableClassifier.sReason);
}