当前位置: 首页>>代码示例>>Java>>正文


Java Div类代码示例

本文整理汇总了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);
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:17,代码来源:TagRepositoryTest.java

示例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);
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:17,代码来源:TagRepositoryTest.java

示例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");
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:19,代码来源:BlankTest.java

示例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");
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:23,代码来源:BlankTest.java

示例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");
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:19,代码来源:NoTagTest.java

示例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");
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:24,代码来源:NoTagTest.java

示例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);
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:21,代码来源:FormTest.java

示例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);
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:21,代码来源:FormTest.java

示例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));

}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:18,代码来源:AbstractAttributeTest.java

示例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);

}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:19,代码来源:FormTest.java

示例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);

}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:21,代码来源:FormTest.java

示例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);
    
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:22,代码来源:FormTest.java

示例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);
    
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:24,代码来源:FormTest.java

示例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());
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:19,代码来源:TextAreaTest.java

示例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();
    }
}
 
开发者ID:webfirmframework,项目名称:wff,代码行数:27,代码来源:AbstractHtmlTest.java


注:本文中的com.webfirmframework.wffweb.tag.html.stylesandsemantics.Div类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。