Search in sources :

Example 16 with FlowLayout

use of com.github.bordertech.wcomponents.layout.FlowLayout in project wcomponents by BorderTech.

the class FlowLayoutRenderer_Test method testHVGaps.

// Test that use of deprecated two-gap constructors output the expected gap
@Test
public void testHVGaps() throws IOException, SAXException, XpathException {
    WPanel panel = new WPanel();
    String expected;
    for (FlowLayout.Alignment a : FlowLayout.Alignment.values()) {
        panel.setLayout(new FlowLayout(a, 3, 16));
        assertSchemaMatch(panel);
        expected = a == FlowLayout.VERTICAL ? BIG_GAP.toString() : GAP.toString();
        assertXpathEvaluatesTo(expected, "//ui:panel/ui:flowlayout/@gap", panel);
    }
}
Also used : FlowLayout(com.github.bordertech.wcomponents.layout.FlowLayout) WPanel(com.github.bordertech.wcomponents.WPanel) Test(org.junit.Test)

Example 17 with FlowLayout

use of com.github.bordertech.wcomponents.layout.FlowLayout in project wcomponents by BorderTech.

the class FlowLayoutRenderer_Test method testHVGapsWithContentAlign.

@Test
public void testHVGapsWithContentAlign() throws IOException, SAXException, XpathException {
    WPanel panel = new WPanel();
    String expected;
    for (FlowLayout.Alignment a : FlowLayout.Alignment.values()) {
        for (FlowLayout.ContentAlignment c : FlowLayout.ContentAlignment.values()) {
            panel.setLayout(new FlowLayout(a, 3, 16, c));
            assertSchemaMatch(panel);
            expected = a == FlowLayout.VERTICAL ? BIG_GAP.toString() : GAP.toString();
            assertXpathEvaluatesTo(expected, "//ui:panel/ui:flowlayout/@gap", panel);
        }
    }
}
Also used : FlowLayout(com.github.bordertech.wcomponents.layout.FlowLayout) WPanel(com.github.bordertech.wcomponents.WPanel) Test(org.junit.Test)

Aggregations

FlowLayout (com.github.bordertech.wcomponents.layout.FlowLayout)17 WPanel (com.github.bordertech.wcomponents.WPanel)16 WHeading (com.github.bordertech.wcomponents.WHeading)7 Test (org.junit.Test)7 WLabel (com.github.bordertech.wcomponents.WLabel)4 ExplanatoryText (com.github.bordertech.wcomponents.examples.common.ExplanatoryText)4 WButton (com.github.bordertech.wcomponents.WButton)3 WFieldLayout (com.github.bordertech.wcomponents.WFieldLayout)3 WText (com.github.bordertech.wcomponents.WText)3 WTextField (com.github.bordertech.wcomponents.WTextField)3 Action (com.github.bordertech.wcomponents.Action)2 ActionEvent (com.github.bordertech.wcomponents.ActionEvent)2 Margin (com.github.bordertech.wcomponents.Margin)2 WAjaxControl (com.github.bordertech.wcomponents.WAjaxControl)2 WCheckBox (com.github.bordertech.wcomponents.WCheckBox)2 WDateField (com.github.bordertech.wcomponents.WDateField)2 WFieldSet (com.github.bordertech.wcomponents.WFieldSet)2 WImage (com.github.bordertech.wcomponents.WImage)2 Size (com.github.bordertech.wcomponents.Size)1 WCheckBoxSelect (com.github.bordertech.wcomponents.WCheckBoxSelect)1