本文整理汇总了Java中com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div类的典型用法代码示例。如果您正苦于以下问题:Java Div类的具体用法?Java Div怎么用?Java Div使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Div类属于com.webfirmframework.wffweb.tag.html.stylesandsemantics包,在下文中一共展示了Div类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFindOneTagAssignableToTagThrowsInvalidTagException
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test (expected = InvalidTagException.class)
public void testFindOneTagAssignableToTagThrowsInvalidTagException() {
Html html = new Html(null) {{
new Head(this) {{
new TitleTag(this){{
new NoTag(this, "some title");
}};
}};
new Body(this, new Id("one")) {{
new Div(this);
}};
}};
html.appendChild(new Div(null));
TagRepository.findOneTagAssignableToTag(NoTag.class, html);
}
示例2: testFindOneTagAssignableToTagThrowsInvalidTagException2
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test (expected = InvalidTagException.class)
public void testFindOneTagAssignableToTagThrowsInvalidTagException2() {
Html html = new Html(null) {{
new Head(this) {{
new TitleTag(this){{
new NoTag(this, "some title");
}};
}};
new Body(this, new Id("one")) {{
new Div(this);
}};
}};
html.appendChild(new Div(null));
TagRepository.findOneTagAssignableToTag(Blank.class, html);
}
示例3: testBlankAbstractHtmlCollectionOfAbstractHtml
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testBlankAbstractHtmlCollectionOfAbstractHtml() {
Div div = new Div(null, new Id("one")) {
{
List<Div> children = new LinkedList<Div>();
children.add(new Div(null, new Id("two")));
new Blank(this, children);
}
};
Assert.assertEquals("<div id=\"one\"><div id=\"two\"></div></div>",
div.toHtmlString());
// fail("Not yet implemented");
}
示例4: testAddChildAbstractHtml
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testAddChildAbstractHtml() {
Div div = new Div(null, new Id("one")) {
{
Blank blank = new Blank(this);
Div child = new Div(null, new Id("two")) {
{
new Div(this, new Id("three"));
}
};
blank.addChild(child);
}
};
Assert.assertEquals("<div id=\"one\"><div id=\"two\"><div id=\"three\"></div></div></div>",
div.toHtmlString());
// fail("Not yet implemented");
}
示例5: testNoTagAbstractHtmlCollectionOfAbstractHtml
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testNoTagAbstractHtmlCollectionOfAbstractHtml() {
Div div = new Div(null, new Id("one")) {
{
List<Div> children = new LinkedList<Div>();
children.add(new Div(null, new Id("two")));
new NoTag(this, children);
}
};
Assert.assertEquals("<div id=\"one\"><div id=\"two\"></div></div>",
div.toHtmlString());
// fail("Not yet implemented");
}
示例6: testAddChildAbstractHtml
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testAddChildAbstractHtml() {
Div div = new Div(null, new Id("one")) {
{
NoTag noTag = new NoTag(this);
Div child = new Div(null, new Id("two")) {
{
new Div(this, new Id("three"));
}
};
noTag.addChild(child);
}
};
Assert.assertEquals(
"<div id=\"one\"><div id=\"two\"><div id=\"three\"></div></div></div>",
div.toHtmlString());
// fail("Not yet implemented");
}
示例7: testGetIdBasedJsObject
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testGetIdBasedJsObject() {
final Form form = new Form(null) {
{
new Input(this, new Id("name1"));
new Div(this, new Id("excluded")){{new Input(this, new Id("name2"));}};
new Input(this, new Id("name3"));
new Div(this){{new Input(this, new Id("name4"));}};
new Div(this){{new Input(this, new Id("name4"));}};
new Div(this){{new Input(this, new Id("name4"));}};
new Div(this){{new Input(this, new Id("name5"), new Type(Type.TEXT));}};
new Div(this){{new Input(this, new Id("name6"), new Type(Type.CHECKBOX));}};
new Div(this){{new Input(this, new Id("name7"), new Type(Type.RADIO));}};
new TextArea(this, new Id("included"));
}
};
final String jsObjectForNames = form.getIdBasedJsObject();
Assert.assertEquals("{name1:document.getElementById('name1').value,name3:document.getElementById('name3').value,included:document.getElementById('included').value,name7:document.getElementById('name7').checked,name6:document.getElementById('name6').checked,name5:document.getElementById('name5').value,name4:document.getElementById('name4').value,name2:document.getElementById('name2').value}", jsObjectForNames);
}
示例8: testGetIdBasedJsObjectPlus
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testGetIdBasedJsObjectPlus() {
final Form form = new Form(null) {
{
new Button(this, new Id("name1"));
new Div(this, new Id("excluded")){{new Input(this, new Id("name2"));}};
new Input(this, new Id("name3"));
new Div(this){{new Input(this, new Id("name4"));}};
new Div(this){{new Input(this, new Id("name4"));}};
new Div(this){{new Input(this, new Id("name4"));}};
new Div(this){{new Input(this, new Id("name5"), new Type(Type.TEXT));}};
new Div(this){{new Input(this, new Id("name6"), new Type(Type.CHECKBOX));}};
new Div(this){{new Input(this, new Id("name7"), new Type(Type.RADIO));}};
new TextArea(this, new Id("included"));
}
};
final String jsObjectForNames = form.getIdBasedJsObjectPlus(Arrays.asList(TagNameConstants.BUTTON));
Assert.assertEquals("{name1:document.getElementById('name1').value,name3:document.getElementById('name3').value,included:document.getElementById('included').value,name7:document.getElementById('name7').checked,name6:document.getElementById('name6').checked,name5:document.getElementById('name5').value,name4:document.getElementById('name4').value,name2:document.getElementById('name2').value}", jsObjectForNames);
}
示例9: testTestOwnerTag
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@SuppressWarnings("serial")
@Test
public void testTestOwnerTag() {
final Name name = new Name("somename");
Html html = new Html(null, name) {
{
Div div1 = new Div(this, name);
Div div2 = new Div(this, name);
assertTrue(Arrays.asList(name.getOwnerTags()).contains(div1));
assertTrue(Arrays.asList(name.getOwnerTags()).contains(div2));
}
};
assertTrue(Arrays.asList(name.getOwnerTags()).contains(html));
}
示例10: testGetNameBasedJsObjectSetOfString
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testGetNameBasedJsObjectSetOfString() {
final Form form = new Form(null) {
{
new Input(this, new Name("name1"));
new Div(this){{new Input(this, new Name("name2"));}};
new Input(this, new Name("name3"));
new Div(this){{new Input(this, new Name("name4"));}};
}
};
final String jsObjectForNames = form.getNameBasedJsObject(
new HashSet<String>(Arrays.asList("input")));
Assert.assertEquals("{name1:name1.value,name3:name3.value,name4:name4.value,name2:name2.value}", jsObjectForNames);
}
示例11: testGetNameBasedJsObjectSetOfString2
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testGetNameBasedJsObjectSetOfString2() {
final Form form = new Form(null) {
{
new Input(this, new Name("name1"));
new Div(this){{new Input(this, new Name("name2"));}};
new Input(this, new Name("name3"));
new Div(this){{new Input(this, new Name("name4"));}};
new Div(this){{new Input(this, new Name("name4"));}};
new Div(this){{new Input(this, new Name("name4"));}};
}
};
final String jsObjectForNames = form.getNameBasedJsObject(
new HashSet<String>(Arrays.asList("input")));
Assert.assertEquals("{name1:name1.value,name3:name3.value,name4:name4.value,name2:name2.value}", jsObjectForNames);
}
示例12: testGetNameBasedJsObjectSetOfString3
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testGetNameBasedJsObjectSetOfString3() {
final Form form = new Form(null) {
{
new Input(this, new Name("name1"));
new Div(this, new Name("excluded")){{new Input(this, new Name("name2"));}};
new Input(this, new Name("name3"));
new Div(this){{new Input(this, new Name("name4"));}};
new Div(this){{new Input(this, new Name("name4"));}};
new Div(this){{new Input(this, new Name("name4"));}};
new TextArea(this, new Name("excluded"));
}
};
final String jsObjectForNames = form.getNameBasedJsObject(
new HashSet<String>(Arrays.asList("input")));
Assert.assertEquals("{name1:name1.value,name3:name3.value,name4:name4.value,name2:name2.value}", jsObjectForNames);
}
示例13: testGetNameBasedJsObject
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testGetNameBasedJsObject() {
final Form form = new Form(null) {
{
new Input(this, new Name("name1"));
new Div(this, new Name("excluded")){{new Input(this, new Name("name2"));}};
new Input(this, new Name("name3"));
new Div(this){{new Input(this, new Name("name4"));}};
new Div(this){{new Input(this, new Name("name4"));}};
new Div(this){{new Input(this, new Name("name4"));}};
new Div(this){{new Input(this, new Name("name5"), new Type(Type.TEXT));}};
new Div(this){{new Input(this, new Name("name6"), new Type(Type.CHECKBOX));}};
new Div(this){{new Input(this, new Name("name7"), new Type(Type.RADIO));}};
new TextArea(this, new Name("included"));
}
};
final String jsObjectForNames = form.getNameBasedJsObject();
Assert.assertEquals("{name1:name1.value,name3:name3.value,included:included.value,name7:name7.checked,name6:name6.checked,name5:name5.value,name4:name4.value,name2:name2.value}", jsObjectForNames);
}
示例14: testGetChildText
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testGetChildText() {
TextArea textArea = new TextArea(null) {
{
new NoTag(this, "one");
new Div(this) {
{
new NoTag(this, "two");
}
};
new NoTag(this, "three");
}
};
assertEquals("one<div>two</div>three", textArea.getChildText());
assertEquals("<textarea>one<div>two</div>three</textarea>", textArea.toHtmlString());
assertEquals("", new TextArea(null).getChildText());
}
示例15: testPerformanceAsInnerClassFormat
import com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div; //导入依赖的package包/类
@Test
public void testPerformanceAsInnerClassFormat() {
try {
long before = System.currentTimeMillis();
Div div = new Div(null) {
{
for (int i = 0; i < 100000; i++) {
new Div(this);
}
}
};
String htmlString = div.toHtmlString();
long after = System.currentTimeMillis();
System.out.println("testPerformanceAsInnerClassFormat "
+ htmlString.length() + " tag bytes generation took "
+ (after - before) + " ms");
} catch (Exception e) {
e.printStackTrace();
}
}