use of com.github.bordertech.wcomponents.Margin in project wcomponents by BorderTech.
the class WPanelTypeExample method buildConfigOptions.
/**
* Set up the UI for the configuration options.
*/
private void buildConfigOptions() {
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
layout.setMargin(new Margin(null, null, Size.LARGE, null));
layout.addField("Select a WPanel Type", panelType);
contentField = layout.addField("Panel content", panelContent);
headingField = layout.addField("heading", tfHeading);
showMenuField = layout.addField("Show menu", showMenu);
showUtilBarField = layout.addField("Show utility bar", showUtilBar);
layout.addField((WLabel) null, applyConfigButton);
add(layout);
}
use of com.github.bordertech.wcomponents.Margin in project wcomponents by BorderTech.
the class WTabSetRenderer_Test method testRenderedWithMargins.
@Test
public void testRenderedWithMargins() throws IOException, SAXException, XpathException {
WTabSet tabSet = new WTabSet();
tabSet.addTab(new WText("1"), "1", TabMode.CLIENT);
assertXpathNotExists("//ui:tabset/ui:margin", tabSet);
Margin margin = new Margin(0);
tabSet.setMargin(margin);
assertXpathNotExists("//ui:tabset/ui:margin", tabSet);
margin = new Margin(Size.SMALL);
tabSet.setMargin(margin);
assertSchemaMatch(tabSet);
assertXpathEvaluatesTo("sm", "//ui:tabset/ui:margin/@all", tabSet);
assertXpathEvaluatesTo("", "//ui:tabset/ui:margin/@north", tabSet);
assertXpathEvaluatesTo("", "//ui:tabset/ui:margin/@east", tabSet);
assertXpathEvaluatesTo("", "//ui:tabset/ui:margin/@south", tabSet);
assertXpathEvaluatesTo("", "//ui:tabset/ui:margin/@west", tabSet);
}
use of com.github.bordertech.wcomponents.Margin in project wcomponents by BorderTech.
the class WTableRenderer_Test method testRenderedWithMargins.
@Test
public void testRenderedWithMargins() throws IOException, SAXException, XpathException {
WTable table = new WTable();
table.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
assertXpathNotExists("//ui:table/ui:margin", table);
Margin margin = new Margin(0);
table.setMargin(margin);
assertXpathNotExists("//ui:table/ui:margin", table);
margin = new Margin(Size.SMALL);
table.setMargin(margin);
assertXpathEvaluatesTo("sm", "//ui:table/ui:margin/@all", table);
assertXpathEvaluatesTo("", "//ui:table/ui:margin/@north", table);
assertXpathEvaluatesTo("", "//ui:table/ui:margin/@east", table);
assertXpathEvaluatesTo("", "//ui:table/ui:margin/@south", table);
assertXpathEvaluatesTo("", "//ui:table/ui:margin/@west", table);
margin = new Margin(Size.SMALL, Size.MEDIUM, Size.LARGE, Size.XL);
table.setMargin(margin);
assertXpathEvaluatesTo("", "//ui:table/ui:margin/@all", table);
assertXpathEvaluatesTo("sm", "//ui:table/ui:margin/@north", table);
assertXpathEvaluatesTo("med", "//ui:table/ui:margin/@east", table);
assertXpathEvaluatesTo("lg", "//ui:table/ui:margin/@south", table);
assertXpathEvaluatesTo("xl", "//ui:table/ui:margin/@west", table);
}
use of com.github.bordertech.wcomponents.Margin in project wcomponents by BorderTech.
the class WFieldLayoutRenderer_Test method testRenderedWithMargins.
@Test
public void testRenderedWithMargins() throws IOException, SAXException, XpathException {
WFieldLayout layout = new WFieldLayout();
assertXpathNotExists("//ui:fieldlayout/ui:margin", layout);
Margin margin = new Margin(0);
layout.setMargin(margin);
assertXpathNotExists("//ui:fieldlayout/ui:margin", layout);
margin = new Margin(Size.SMALL);
layout.setMargin(margin);
assertSchemaMatch(layout);
assertXpathEvaluatesTo("sm", "//ui:fieldlayout/ui:margin/@all", layout);
assertXpathEvaluatesTo("", "//ui:fieldlayout/ui:margin/@north", layout);
assertXpathEvaluatesTo("", "//ui:fieldlayout/ui:margin/@east", layout);
assertXpathEvaluatesTo("", "//ui:fieldlayout/ui:margin/@south", layout);
assertXpathEvaluatesTo("", "//ui:fieldlayout/ui:margin/@west", layout);
margin = new Margin(Size.SMALL, Size.MEDIUM, Size.LARGE, Size.XL);
layout.setMargin(margin);
assertSchemaMatch(layout);
assertXpathEvaluatesTo("", "//ui:fieldlayout/ui:margin/@all", layout);
assertXpathEvaluatesTo("sm", "//ui:fieldlayout/ui:margin/@north", layout);
assertXpathEvaluatesTo("med", "//ui:fieldlayout/ui:margin/@east", layout);
assertXpathEvaluatesTo("lg", "//ui:fieldlayout/ui:margin/@south", layout);
assertXpathEvaluatesTo("xl", "//ui:fieldlayout/ui:margin/@west", layout);
}
use of com.github.bordertech.wcomponents.Margin in project wcomponents by BorderTech.
the class WFieldSetRenderer_Test method testRenderedWithMargins.
@Test
public void testRenderedWithMargins() throws IOException, SAXException, XpathException {
WFieldSet fieldSet = new WFieldSet("");
assertXpathNotExists("//ui:fieldset/ui:margin", fieldSet);
Margin margin = new Margin(0);
fieldSet.setMargin(margin);
assertXpathNotExists("//ui:fieldset/ui:margin", fieldSet);
margin = new Margin(Size.SMALL);
fieldSet.setMargin(margin);
assertSchemaMatch(fieldSet);
assertXpathEvaluatesTo("sm", "//ui:fieldset/ui:margin/@all", fieldSet);
assertXpathEvaluatesTo("", "//ui:fieldset/ui:margin/@north", fieldSet);
assertXpathEvaluatesTo("", "//ui:fieldset/ui:margin/@east", fieldSet);
assertXpathEvaluatesTo("", "//ui:fieldset/ui:margin/@south", fieldSet);
assertXpathEvaluatesTo("", "//ui:fieldset/ui:margin/@west", fieldSet);
margin = new Margin(Size.SMALL, Size.MEDIUM, Size.LARGE, Size.XL);
fieldSet.setMargin(margin);
assertSchemaMatch(fieldSet);
assertXpathEvaluatesTo("", "//ui:fieldset/ui:margin/@all", fieldSet);
assertXpathEvaluatesTo("sm", "//ui:fieldset/ui:margin/@north", fieldSet);
assertXpathEvaluatesTo("med", "//ui:fieldset/ui:margin/@east", fieldSet);
assertXpathEvaluatesTo("lg", "//ui:fieldset/ui:margin/@south", fieldSet);
assertXpathEvaluatesTo("xl", "//ui:fieldset/ui:margin/@west", fieldSet);
}
Aggregations