From d9239edac6b2218e616b391e4fa5ba2a59b9b62b Mon Sep 17 00:00:00 2001 From: John McGuinness Date: Sat, 28 Aug 2021 20:34:40 +1000 Subject: [PATCH] Removed usage of BorderLayout from the examples BorderLayout has long been deprecated. So removing all examples helps to discourage its use. --- .../wcomponents/examples/WDialogExample.java | 29 +++- .../examples/layout/BorderLayoutExample.java | 157 ------------------ .../examples/layout/LayoutExample.java | 3 - .../examples/picker/ExampleData.java | 2 - .../RepeaterExampleWithStaticIDs.java | 18 +- .../examples/theme/WDateFieldExample.java | 18 +- .../validation/ValidationContainer.java | 19 ++- .../validation/fields/CoreFields.java | 23 ++- 8 files changed, 80 insertions(+), 189 deletions(-) delete mode 100755 wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/BorderLayoutExample.java diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDialogExample.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDialogExample.java index e7c8cdf79..e95270ef3 100755 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDialogExample.java +++ b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDialogExample.java @@ -2,6 +2,9 @@ import com.github.bordertech.wcomponents.Action; import com.github.bordertech.wcomponents.ActionEvent; +import com.github.bordertech.wcomponents.Margin; +import com.github.bordertech.wcomponents.WColumn; +import com.github.bordertech.wcomponents.WRow; import com.github.bordertech.wcomponents.HeadingLevel; import com.github.bordertech.wcomponents.MessageContainer; import com.github.bordertech.wcomponents.Request; @@ -25,9 +28,7 @@ import com.github.bordertech.wcomponents.WTextField; import com.github.bordertech.wcomponents.WebUtilities; import com.github.bordertech.wcomponents.examples.common.ExplanatoryText; -import com.github.bordertech.wcomponents.layout.BorderLayout; import com.github.bordertech.wcomponents.layout.FlowLayout; -import com.github.bordertech.wcomponents.layout.FlowLayout.Alignment; import com.github.bordertech.wcomponents.util.Util; import com.github.bordertech.wcomponents.validation.Diagnostic; import com.github.bordertech.wcomponents.validation.ValidatingAction; @@ -79,7 +80,7 @@ public class WDialogExample extends WPanel implements MessageContainer { */ @SuppressWarnings("serial") public WDialogExample() { - setLayout(new FlowLayout(Alignment.VERTICAL)); + setLayout(new FlowLayout(com.github.bordertech.wcomponents.layout.FlowLayout.Alignment.VERTICAL)); add(messages); final WPanel outputPanel = new WPanel(WPanel.Type.BOX); @@ -426,13 +427,23 @@ private SelectPersonPanel() { add(searchFS); add(layout); - final WPanel buttonPanel = new WPanel(WPanel.Type.FEATURE); - buttonPanel.setLayout(new BorderLayout()); - buttonPanel.setMargin(new com.github.bordertech.wcomponents.Margin(Size.LARGE, Size.ZERO, Size.ZERO, Size.ZERO)); + final WPanel buttonPanel = new WPanel(Type.FEATURE); + buttonPanel.setMargin(new Margin(Size.LARGE, Size.ZERO, Size.ZERO, Size.ZERO)); add(buttonPanel); - buttonPanel.add(cancelButton, BorderLayout.WEST); - buttonPanel.add(selectButton, BorderLayout.EAST); - buttonPanel.add(searchButton, BorderLayout.EAST); + + final WRow row = new WRow(); + buttonPanel.add(row); + + final WColumn left = new WColumn(50); + final WColumn right = new WColumn(50); + right.setAlignment(WColumn.Alignment.RIGHT); + + row.add(left); + row.add(right); + + left.add(cancelButton); + right.add(selectButton); + right.add(searchButton); add(new WText(MODAL_TEXT + ": this text is for automated testing only")); searchButton.setAjaxTarget(this); diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/BorderLayoutExample.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/BorderLayoutExample.java deleted file mode 100755 index dd6b207b4..000000000 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/BorderLayoutExample.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.github.bordertech.wcomponents.examples.layout; - -import com.github.bordertech.wcomponents.HeadingLevel; -import com.github.bordertech.wcomponents.Size; -import com.github.bordertech.wcomponents.WContainer; -import com.github.bordertech.wcomponents.WHeading; -import com.github.bordertech.wcomponents.WPanel; -import com.github.bordertech.wcomponents.WText; -import com.github.bordertech.wcomponents.layout.BorderLayout; - -/** - *

- * This example demonstrates the {@link BorderLayout} layout.

- * - * @author Yiannis Paschalidis - * @author Mark Reeves - * @since 1.0.0 - */ -public class BorderLayoutExample extends WContainer { - /** - * A small gap. - */ - private static final Size GAP = Size.SMALL; - /** - * A big gap. - */ - private static final Size BIG_GAP = Size.LARGE; - - /** - * Some dummy text. - */ - private static final String DUMMY_TEXT = "

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In tristique pellentesque massa, et placerat" - + " justo ullamcorper vel. Nunc scelerisque, sem ut hendrerit pharetra, tellus erat dictum felis, at facilisis metus odio ac justo. " - + "Curabitur rutrum lacus in nulla iaculis at vestibulum metus facilisis. Aenean id nulla massa. Suspendisse vitae nunc nec urna laoreet " - + "elementum. Duis in orci ac leo elementum sagittis ac non massa. Sed vel massa purus, eu facilisis ipsum.

Maecenas quis mi non " - + "metus scelerisque sagittis quis ac lacus. Fusce faucibus, urna ut viverra vulputate, tellus metus venenatis enim, eget mollis neque " - + "libero a turpis. Nullam convallis, lacus vel gravida suscipit, ipsum ante interdum libero, placerat laoreet dui magna et " - + "odio.\n\nPhasellus interdum placerat risus ut aliquam. In hac habitasse platea dictumst. Pellentesque habitant morbi tristique senectus" - + " et netus et malesuada fames ac turpis egestas.

"; - - /** - * Creates a BorderLayoutExample. - */ - public BorderLayoutExample() { - - add(new WHeading(HeadingLevel.H2, "Border layout - expandable content, no gap")); - // All - fill cells, no gap - WPanel borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout()); - add(borderLayoutPanel); - borderLayoutPanel.add(new BoxComponent("North"), BorderLayout.NORTH); - borderLayoutPanel.add(new BoxComponent("South"), BorderLayout.SOUTH); - borderLayoutPanel.add(new BoxComponent("East"), BorderLayout.EAST); - borderLayoutPanel.add(new BoxComponent("West"), BorderLayout.WEST); - borderLayoutPanel.add(new BoxComponent("Center"), BorderLayout.CENTER); - - - add(new WHeading(HeadingLevel.H2, "Border layout - expandable content, horizontal gap and vertical gap")); - // All - fill cells, with gaps - borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout(GAP, BIG_GAP)); - add(borderLayoutPanel); - borderLayoutPanel.add(new BoxComponent("North"), BorderLayout.NORTH); - borderLayoutPanel.add(new BoxComponent("South"), BorderLayout.SOUTH); - borderLayoutPanel.add(new BoxComponent("East"), BorderLayout.EAST); - borderLayoutPanel.add(new BoxComponent("West"), BorderLayout.WEST); - borderLayoutPanel.add(new BoxComponent("Center"), BorderLayout.CENTER); - - add(new WHeading(HeadingLevel.H2, "Border layout - small content, no gap")); - // All - small content - borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout()); - add(borderLayoutPanel); - borderLayoutPanel.add(new WText("North"), BorderLayout.NORTH); - borderLayoutPanel.add(new WText("South"), BorderLayout.SOUTH); - borderLayoutPanel.add(new WText("East"), BorderLayout.EAST); - borderLayoutPanel.add(new WText("West"), BorderLayout.WEST); - borderLayoutPanel.add(new WText("Center"), BorderLayout.CENTER); - - add(new WHeading(HeadingLevel.H2, "Border layout - large amount of content")); - // All - large amount of text content - borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout()); - add(borderLayoutPanel); - borderLayoutPanel.add(createPanelWithText("North", DUMMY_TEXT), BorderLayout.NORTH); - borderLayoutPanel.add(createPanelWithText("South", DUMMY_TEXT), BorderLayout.SOUTH); - borderLayoutPanel.add(createPanelWithText("East", DUMMY_TEXT), BorderLayout.EAST); - borderLayoutPanel.add(createPanelWithText("West", DUMMY_TEXT), BorderLayout.WEST); - borderLayoutPanel.add(createPanelWithText("Center", DUMMY_TEXT), BorderLayout.CENTER); - - add(new WHeading(HeadingLevel.H2, "Border layout - north only")); - // North only - borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout()); - add(borderLayoutPanel); - borderLayoutPanel.add(createPanelWithText("North", "This panel only has a northern cell. It is completely pointless."), - BorderLayout.NORTH); - - add(new WHeading(HeadingLevel.H2, "Border layout - east/west only")); - // East / west - borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout()); - add(borderLayoutPanel); - borderLayoutPanel.add(createPanelWithText("East", "This is in the eastern cell. Do not do this: use ColumnLayout."), - BorderLayout.EAST); - borderLayoutPanel.add(createPanelWithText("West", "This is in the western cell. Do not do this: use ColumnLayout."), - BorderLayout.WEST); - - add(new WHeading(HeadingLevel.H3, "Border layout - east/west only with gap")); - // East / west with hgap (UC test) - borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout(Size.LARGE, Size.SMALL)); - add(borderLayoutPanel); - borderLayoutPanel.add(createPanelWithText("East", "This is in the eastern cell. Do not do this: use ColumnLayout."), - BorderLayout.EAST); - borderLayoutPanel.add(createPanelWithText("West", "This is in the western cell. Do not do this: use ColumnLayout."), - BorderLayout.WEST); - - add(new WHeading(HeadingLevel.H2, "Border layout - north/center/south only")); - // North / center / south - borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout()); - add(borderLayoutPanel); - borderLayoutPanel.add(createPanelWithText("North", "This is in the northern cell. This borderLayout is useless."), - BorderLayout.NORTH); - borderLayoutPanel.add(createPanelWithText("Center", "This is in the center cell. This borderLayout is useless."), - BorderLayout.CENTER); - borderLayoutPanel.add(createPanelWithText("South", "This is in the southern cell. This borderLayout is useless."), - BorderLayout.SOUTH); - - add(new WHeading(HeadingLevel.H2, "Border layout - north/center/east only")); - // North / center / east - borderLayoutPanel = new WPanel(); - borderLayoutPanel.setLayout(new BorderLayout()); - add(borderLayoutPanel); - borderLayoutPanel.add(createPanelWithText("North", "This is in the northern cell."), BorderLayout.NORTH); - borderLayoutPanel.add(createPanelWithText("Center", "This is in the center cell."), BorderLayout.CENTER); - borderLayoutPanel.add(createPanelWithText("East", "This is in the eastern cell."), BorderLayout.EAST); - } - - /** - * Convenience method to create a WPanel with the given title and text. - * - * @param title the panel title. - * @param text the panel text. - * @return a new WPanel with the given title and text. - */ - private WPanel createPanelWithText(final String title, final String text) { - WPanel panel = new WPanel(WPanel.Type.CHROME); - panel.setTitleText(title); - WText textComponent = new WText(text); - textComponent.setEncodeText(false); - panel.add(textComponent); - - return panel; - } -} diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/LayoutExample.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/LayoutExample.java index 9830b7a69..545cd0432 100755 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/LayoutExample.java +++ b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/LayoutExample.java @@ -4,7 +4,6 @@ import com.github.bordertech.wcomponents.WTabSet; import com.github.bordertech.wcomponents.WTabSet.TabMode; import com.github.bordertech.wcomponents.WTabSet.TabSetType; -import com.github.bordertech.wcomponents.layout.BorderLayout; import com.github.bordertech.wcomponents.layout.ColumnLayout; import com.github.bordertech.wcomponents.layout.FlowLayout; import com.github.bordertech.wcomponents.layout.GridLayout; @@ -13,7 +12,6 @@ * This example demonstrates all of the standard layouts. * * @see GridLayout - * @see BorderLayout * @see FlowLayout * @see ColumnLayout * @@ -30,7 +28,6 @@ public LayoutExample() { add(tabs); tabs.addTab(new ColumnLayoutExample(), "Column layout", TabMode.CLIENT); - tabs.addTab(new BorderLayoutExample(), "Border layout", TabMode.CLIENT); tabs.addTab(new FlowLayoutExample(), "Flow layout", TabMode.CLIENT); tabs.addTab(new GridLayoutExample(), "Grid layout", TabMode.CLIENT); } diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExampleData.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExampleData.java index 591a33432..e22180da2 100755 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExampleData.java +++ b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExampleData.java @@ -85,7 +85,6 @@ import com.github.bordertech.wcomponents.examples.datatable.TreeTableHierarchyExample; import com.github.bordertech.wcomponents.examples.datatable.WDataTableContentExample; import com.github.bordertech.wcomponents.examples.datatable.WDataTableExample; -import com.github.bordertech.wcomponents.examples.layout.BorderLayoutExample; import com.github.bordertech.wcomponents.examples.layout.ColumnLayoutExample; import com.github.bordertech.wcomponents.examples.layout.FlowLayoutExample; import com.github.bordertech.wcomponents.examples.layout.GridLayoutExample; @@ -392,7 +391,6 @@ public final class ExampleData implements Serializable { * Layout examples. */ public static final ExampleData[] LAYOUT_EXAMPLES = new ExampleData[]{ - new ExampleData("Border layout", BorderLayoutExample.class), new ExampleData("Column layout", ColumnLayoutExample.class), new ExampleData("Columns with WRow / WCol", WRowExample.class), new ExampleData("Flow layout", FlowLayoutExample.class), diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/RepeaterExampleWithStaticIDs.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/RepeaterExampleWithStaticIDs.java index 8c8f56424..2bee6b085 100644 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/RepeaterExampleWithStaticIDs.java +++ b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/RepeaterExampleWithStaticIDs.java @@ -12,6 +12,7 @@ import com.github.bordertech.wcomponents.WAjaxControl; import com.github.bordertech.wcomponents.WButton; import com.github.bordertech.wcomponents.WCheckBoxSelect; +import com.github.bordertech.wcomponents.WColumn; import com.github.bordertech.wcomponents.WContainer; import com.github.bordertech.wcomponents.WDataRenderer; import com.github.bordertech.wcomponents.WDecoratedLabel; @@ -22,11 +23,11 @@ import com.github.bordertech.wcomponents.WPanel; import com.github.bordertech.wcomponents.WPhoneNumberField; import com.github.bordertech.wcomponents.WRepeater; +import com.github.bordertech.wcomponents.WRow; import com.github.bordertech.wcomponents.WText; import com.github.bordertech.wcomponents.WTextArea; import com.github.bordertech.wcomponents.WTextField; import com.github.bordertech.wcomponents.WebUtilities; -import com.github.bordertech.wcomponents.layout.BorderLayout; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; @@ -121,12 +122,21 @@ private void createButtonBar() { // Update and reset controls for the repeater. WPanel buttonPanel = new WPanel(WPanel.Type.FEATURE); buttonPanel.setMargin(new Margin(Size.MEDIUM, null, Size.LARGE, null)); - buttonPanel.setLayout(new BorderLayout()); + + final WRow row = new WRow(); + buttonPanel.add(row); + + final WColumn left = new WColumn(50); + final WColumn right = new WColumn(50); + right.setAlignment(WColumn.Alignment.RIGHT); + + row.add(left); + row.add(right); WButton updateButton = new WButton("Update"); updateButton.setImage("/image/document-save-5.png"); updateButton.setImagePosition(WButton.ImagePosition.EAST); - buttonPanel.add(updateButton, BorderLayout.EAST); + right.add(updateButton); WButton resetButton = new WButton("Reset"); resetButton.setImage("/image/edit-undo-8.png"); @@ -137,7 +147,7 @@ public void execute(final ActionEvent event) { repeater.setData(fetchDataList()); } }); - buttonPanel.add(resetButton, BorderLayout.WEST); + left.add(resetButton); add(buttonPanel); add(new WAjaxControl(updateButton, repeater)); add(new WAjaxControl(resetButton, repeater)); diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WDateFieldExample.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WDateFieldExample.java index b29987e5b..63ea39b8a 100755 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WDateFieldExample.java +++ b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WDateFieldExample.java @@ -8,6 +8,7 @@ import com.github.bordertech.wcomponents.WAjaxControl; import com.github.bordertech.wcomponents.WButton; import com.github.bordertech.wcomponents.WCancelButton; +import com.github.bordertech.wcomponents.WColumn; import com.github.bordertech.wcomponents.WContainer; import com.github.bordertech.wcomponents.WDateField; import com.github.bordertech.wcomponents.WFieldLayout; @@ -15,8 +16,8 @@ import com.github.bordertech.wcomponents.WHeading; import com.github.bordertech.wcomponents.WLabel; import com.github.bordertech.wcomponents.WPanel; +import com.github.bordertech.wcomponents.WRow; import com.github.bordertech.wcomponents.WTextField; -import com.github.bordertech.wcomponents.layout.BorderLayout; import com.github.bordertech.wcomponents.layout.FlowLayout; import com.github.bordertech.wcomponents.layout.FlowLayout.Alignment; import com.github.bordertech.wcomponents.subordinate.Disable; @@ -126,14 +127,23 @@ public void execute(final ActionEvent event) { disabledDateField.setDisabled(true); mainLayout.addField("Disabled (today)", disabledDateField); + //do the layout WPanel buttonPanel = new WPanel(WPanel.Type.FEATURE); buttonPanel.setMargin(new Margin(Size.LARGE, null, null, null)); - buttonPanel.setLayout(new BorderLayout()); + final WRow row = new WRow(); + buttonPanel.add(row); + + final WColumn left = new WColumn(50); + final WColumn right = new WColumn(50); + right.setAlignment(WColumn.Alignment.RIGHT); + + row.add(left); + row.add(right); WPanel innerButtonPanel = new WPanel(); innerButtonPanel.setLayout(new FlowLayout(Alignment.LEFT, Size.MEDIUM)); - buttonPanel.add(innerButtonPanel, BorderLayout.CENTER); + left.add(innerButtonPanel); innerButtonPanel.add(setTodayBtn); innerButtonPanel.add(copyDateBtn); innerButtonPanel.add(copyJavaDateBtn); @@ -148,7 +158,7 @@ public void execute(final ActionEvent event) { mainLayout.reset(); } }); - buttonPanel.add(cancelButton, BorderLayout.EAST); + right.add(cancelButton); add(mainLayout); add(buttonPanel); diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/ValidationContainer.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/ValidationContainer.java index e275d9b63..a6061f1b2 100755 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/ValidationContainer.java +++ b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/ValidationContainer.java @@ -6,12 +6,13 @@ import com.github.bordertech.wcomponents.Size; import com.github.bordertech.wcomponents.WButton; import com.github.bordertech.wcomponents.WCardManager; +import com.github.bordertech.wcomponents.WColumn; import com.github.bordertech.wcomponents.WComponent; import com.github.bordertech.wcomponents.WContainer; import com.github.bordertech.wcomponents.WMessageBox; import com.github.bordertech.wcomponents.WMessages; import com.github.bordertech.wcomponents.WPanel; -import com.github.bordertech.wcomponents.layout.BorderLayout; +import com.github.bordertech.wcomponents.WRow; import com.github.bordertech.wcomponents.validation.ValidatingAction; import com.github.bordertech.wcomponents.validation.WValidationErrors; @@ -91,9 +92,19 @@ public void execute(final ActionEvent event) { WPanel buttonPanel = new WPanel(WPanel.Type.FEATURE); mainPanel.add(buttonPanel); buttonPanel.setMargin(new com.github.bordertech.wcomponents.Margin(Size.LARGE, Size.ZERO, Size.ZERO, Size.ZERO)); - buttonPanel.setLayout(new BorderLayout()); - buttonPanel.add(validateBtn, BorderLayout.EAST); - buttonPanel.add(resetBtn, BorderLayout.WEST); + + final WRow row = new WRow(); + buttonPanel.add(row); + + final WColumn left = new WColumn(50); + final WColumn right = new WColumn(50); + right.setAlignment(WColumn.Alignment.RIGHT); + + row.add(left); + row.add(right); + + right.add(validateBtn); + left.add(resetBtn); cardManager.add(successPanel); } diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/fields/CoreFields.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/fields/CoreFields.java index 7ace90375..a26e9de7a 100755 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/fields/CoreFields.java +++ b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/fields/CoreFields.java @@ -8,6 +8,7 @@ import com.github.bordertech.wcomponents.WCancelButton; import com.github.bordertech.wcomponents.WCheckBox; import com.github.bordertech.wcomponents.WCheckBoxSelect; +import com.github.bordertech.wcomponents.WColumn; import com.github.bordertech.wcomponents.WConfirmationButton; import com.github.bordertech.wcomponents.WDateField; import com.github.bordertech.wcomponents.WDropdown; @@ -22,11 +23,11 @@ import com.github.bordertech.wcomponents.WPrintButton; import com.github.bordertech.wcomponents.WRadioButton; import com.github.bordertech.wcomponents.WRadioButtonSelect; +import com.github.bordertech.wcomponents.WRow; import com.github.bordertech.wcomponents.WText; import com.github.bordertech.wcomponents.WTextArea; import com.github.bordertech.wcomponents.WTextField; import com.github.bordertech.wcomponents.examples.common.ExampleLookupTable; -import com.github.bordertech.wcomponents.layout.BorderLayout; import com.github.bordertech.wcomponents.util.DateUtilities; import com.github.bordertech.wcomponents.validator.DateFieldPivotValidator; import com.github.bordertech.wcomponents.validator.RegExFieldValidator; @@ -208,23 +209,33 @@ public CoreFields() { // create the buttons at the bottom. WPanel buttons = new WPanel(WPanel.Type.FEATURE); buttons.setMargin(new com.github.bordertech.wcomponents.Margin(Size.LARGE, null, null, null)); - buttons.setLayout(new BorderLayout()); + + final WRow row = new WRow(); + buttons.add(row); + + final WColumn left = new WColumn(50); + final WColumn right = new WColumn(50); + right.setAlignment(WColumn.Alignment.RIGHT); + + row.add(left); + row.add(right); + add(buttons); printBtn = new WPrintButton(); - buttons.add(printBtn, BorderLayout.EAST); + right.add(printBtn); submitBtn = new WButton("Submit", 'S'); - buttons.add(submitBtn, BorderLayout.EAST); + right.add(submitBtn); setDefaultSubmitButton(submitBtn); cancelBtn = new WCancelButton(); - buttons.add(cancelBtn, BorderLayout.WEST); + left.add(cancelBtn); // Same as cancel. Just testing a different component. resetBtn = new WConfirmationButton("Reset"); resetBtn.setMessage("Are you sure you want to reset all fields?"); - buttons.add(resetBtn, BorderLayout.WEST); + left.add(resetBtn); } /**