Skip to content

Removed usage of BorderLayout from the examples #1788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: georgie
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -13,7 +12,6 @@
* This example demonstrates all of the standard layouts.
*
* @see GridLayout
* @see BorderLayout
* @see FlowLayout
* @see ColumnLayout
*
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand All @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
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;
import com.github.bordertech.wcomponents.WFieldSet;
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;
Expand Down Expand Up @@ -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);
Expand All @@ -148,7 +158,7 @@ public void execute(final ActionEvent event) {
mainLayout.reset();
}
});
buttonPanel.add(cancelButton, BorderLayout.EAST);
right.add(cancelButton);

add(mainLayout);
add(buttonPanel);
Expand Down
Loading