當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。