}
public Iterable<Control> getControls() {
java.util.List<Control> l = new ArrayList<Control>();
HFlexBox row = null;
row = new HFlexBox();
row.add(new Label("font size"));
final PopupMenuButton<String> fontbutton = new PopupMenuButton<String>();
fontbutton.setModel(ListView.createModel(new String[]{"mini","small","regular","large","gigante"}));
fontbutton.setSelectedIndex(2);
EventBus.getSystem().addListener(fontbutton, SelectionEvent.Changed, new Callback<SelectionEvent>() {
public void call(SelectionEvent event) {
u.p("font size set to :" + fontbutton.getSelectedItem());
fontsize = fontbutton.getSelectedItem();
}
});
if("mini".equals(fontsize)) fontbutton.setSelectedIndex(0);
if("small".equals(fontsize)) fontbutton.setSelectedIndex(1);
if("regular".equals(fontsize)) fontbutton.setSelectedIndex(2);
if("large".equals(fontsize)) fontbutton.setSelectedIndex(3);
if("gigante".equals(fontsize)) fontbutton.setSelectedIndex(4);
row.add(fontbutton);
l.add(row);
row = new HFlexBox();
final Togglebutton left = new Togglebutton("<");
left.setSelected(leftAnchored);
left.onClicked(new Callback<ActionEvent>() {
public void call(ActionEvent event) throws Exception {
leftAnchored = left.isSelected();
}
});
row.add(left);
final Togglebutton right = new Togglebutton(">");
right.setSelected(rightAnchored);
right.onClicked(new Callback<ActionEvent>() {
public void call(ActionEvent event) throws Exception {
rightAnchored = right.isSelected();
}
});
row.add(right);
final Togglebutton top = new Togglebutton("^");
top.setSelected(topAnchored);
top.onClicked(new Callback<ActionEvent>() {
public void call(ActionEvent event) throws Exception {
topAnchored = top.isSelected();
}
});
row.add(top);
final Togglebutton bottom = new Togglebutton("v");
bottom.setSelected(bottomAnchored);
bottom.onClicked(new Callback<ActionEvent>() {
public void call(ActionEvent event) throws Exception {
bottomAnchored = bottom.isSelected();
}
});
row.add(bottom);
l.add(row);