if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.TOP);
c.setLayout(layout);
c.add(new Button(button1Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
HBoxLayoutData flex = new HBoxLayoutData(new Margins(0, 5, 0, 0));
flex.setFlex(1);
c.add(new Text(), flex);
c.add(new Button(button2Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button3Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button4Text), new HBoxLayoutData(new Margins(0)));
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Multi-Spaced", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.TOP);
c.setLayout(layout);
c.add(new Button(button1Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
HBoxLayoutData flex = new HBoxLayoutData(new Margins(0, 5, 0, 0));
flex.setFlex(1);
c.add(new Text(), flex);
c.add(new Button(button2Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Text(), flex);
c.add(new Button(button3Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Text(), flex);
c.add(new Button(button4Text), new HBoxLayoutData(new Margins(0)));
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Align: top", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.TOP);
c.setLayout(layout);
c.add(new Button(button1Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button2Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button3Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button4Text), new HBoxLayoutData(new Margins(0)));
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Align: middle", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
c.setLayout(layout);
c.add(new Button(button1Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button2Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button3Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button4Text), new HBoxLayoutData(new Margins(0)));
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Align: bottom", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.BOTTOM);
c.setLayout(layout);
c.add(new Button(button1Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button2Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button3Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button4Text), new HBoxLayoutData(new Margins(0)));
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Align: stretch", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.STRETCH);
c.setLayout(layout);
c.add(new Button(button1Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button2Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button3Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button4Text), new HBoxLayoutData(new Margins(0)));
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Align: stretchmax", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.STRETCHMAX);
c.setLayout(layout);
c.add(new Button(button1Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button2Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button3Text), new HBoxLayoutData(new Margins(0, 5, 0, 0)));
c.add(new Button(button4Text), new HBoxLayoutData(new Margins(0)));
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Flex: All even", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
c.setLayout(layout);
HBoxLayoutData flex = new HBoxLayoutData(new Margins(0, 5, 0, 0));
flex.setFlex(1);
c.add(new Button(button1Text), flex);
c.add(new Button(button2Text), flex);
c.add(new Button(button3Text), flex);
HBoxLayoutData flex2 = new HBoxLayoutData(new Margins(0));
flex2.setFlex(1);
c.add(new Button(button4Text), flex2);
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Flex: ratio", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
c.setLayout(layout);
HBoxLayoutData flex = new HBoxLayoutData(new Margins(0, 5, 0, 0));
flex.setFlex(1);
c.add(new Button(button1Text), flex);
c.add(new Button(button2Text), flex);
c.add(new Button(button3Text), flex);
HBoxLayoutData flex2 = new HBoxLayoutData(new Margins(0));
flex2.setFlex(3);
c.add(new Button(button4Text), flex2);
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Flex + Stretch", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.STRETCH);
c.setLayout(layout);
HBoxLayoutData flex = new HBoxLayoutData(new Margins(0, 5, 0, 0));
flex.setFlex(1);
c.add(new Button(button1Text), flex);
c.add(new Button(button2Text), flex);
c.add(new Button(button3Text), flex);
HBoxLayoutData flex2 = new HBoxLayoutData(new Margins(0));
flex2.setFlex(3);
c.add(new Button(button4Text), flex2);
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Pack: start", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
layout.setPack(BoxLayoutPack.START);
c.setLayout(layout);
HBoxLayoutData layoutData = new HBoxLayoutData(new Margins(0, 5, 0, 0));
c.add(new Button(button1Text), layoutData);
c.add(new Button(button2Text), layoutData);
c.add(new Button(button3Text), layoutData);
HBoxLayoutData layoutData2 = new HBoxLayoutData(new Margins(0));
c.add(new Button(button4Text), layoutData2);
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Pack: center", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
layout.setPack(BoxLayoutPack.CENTER);
c.setLayout(layout);
HBoxLayoutData layoutData = new HBoxLayoutData(new Margins(0, 5, 0, 0));
c.add(new Button(button1Text), layoutData);
c.add(new Button(button2Text), layoutData);
c.add(new Button(button3Text), layoutData);
HBoxLayoutData layoutData2 = new HBoxLayoutData(new Margins(0));
c.add(new Button(button4Text), layoutData2);
addToCenter(c);
}
}), vBoxData);
lcwest.add(createToggleButton("Pack: end", new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent ce) {
if (!ce.<ToggleButton> getComponent().isPressed()) {
return;
}
LayoutContainer c = new LayoutContainer();
HBoxLayout layout = new HBoxLayout();
layout.setPadding(new Padding(5));
layout.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
layout.setPack(BoxLayoutPack.END);
c.setLayout(layout);
HBoxLayoutData layoutData = new HBoxLayoutData(new Margins(0, 5, 0, 0));
c.add(new Button(button1Text), layoutData);
c.add(new Button(button2Text), layoutData);