本文整理汇总了Java中com.google.gwt.dom.client.TableElement.setAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java TableElement.setAttribute方法的具体用法?Java TableElement.setAttribute怎么用?Java TableElement.setAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.TableElement
的用法示例。
在下文中一共展示了TableElement.setAttribute方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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);
}
示例3: 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);
}
示例4: testNoBorderAroundCells
import com.google.gwt.dom.client.TableElement; //导入方法依赖的package包/类
public void testNoBorderAroundCells() {
TableElement table = createDefaultTableWithNoTH();
table.setAttribute("style", "border-style:inset");
setAttributeForFirstElement(table, "TD", "style", "border-style:none");
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.LESS_EQ_10_CELLS, TableClassifier.sReason);
}
示例5: testTallTable
import com.google.gwt.dom.client.TableElement; //导入方法依赖的package包/类
public void testTallTable() {
TableElement table = createBigDefaultTableWithNoTH();
// With min-height, the height of mRoot remains the same after resizing the table.
mRoot.getStyle().setProperty("min-height", "200px");
int rootHeight = mRoot.getOffsetHeight();
int height = (int) ((0.90 * rootHeight) + 1.0);
table.setAttribute("style", "height:" + height + "px");
assertEquals(height, table.getOffsetHeight());
assertEquals(rootHeight, mRoot.getOffsetHeight());
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.MORE_90_PERCENT_DOC_HEIGHT, TableClassifier.sReason);
}
示例6: testRolePresentation
import com.google.gwt.dom.client.TableElement; //导入方法依赖的package包/类
public void testRolePresentation() {
TableElement table = createDefaultTableWithTH();
table.setAttribute("role", "presentation");
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.ROLE_TABLE, TableClassifier.sReason);
}
示例7: testRoleGrid
import com.google.gwt.dom.client.TableElement; //导入方法依赖的package包/类
public void testRoleGrid() {
TableElement table = createDefaultTableWithNoTH();
table.setAttribute("role", "grid");
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.ROLE_TABLE, TableClassifier.sReason);
}
示例8: testRoleTreeGrid
import com.google.gwt.dom.client.TableElement; //导入方法依赖的package包/类
public void testRoleTreeGrid() {
TableElement table = createDefaultTableWithNoTH();
table.setAttribute("role", "treegrid");
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.ROLE_TABLE, TableClassifier.sReason);
}
示例9: testDatatableAttribute
import com.google.gwt.dom.client.TableElement; //导入方法依赖的package包/类
public void testDatatableAttribute() {
TableElement table = createDefaultTableWithTH();
table.setAttribute("datatable", "0");
assertEquals(TableClassifier.Type.LAYOUT, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.DATATABLE_0, TableClassifier.sReason);
}
示例10: testSummaryAttribute
import com.google.gwt.dom.client.TableElement; //导入方法依赖的package包/类
public void testSummaryAttribute() {
TableElement table = createDefaultTableWithNoTH();
table.setAttribute("summary", "Testing summary attribute");
assertEquals(TableClassifier.Type.DATA, TableClassifier.table(table));
assertEquals(TableClassifier.Reason.SUMMARY, TableClassifier.sReason);
}