selectField1 = new SelectField(NUMBERS);
testColumn.add(selectField1);
Grid grid = new Grid();
grid.setBorder(new Border(1, Color.BLACK, Border.STYLE_SOLID));
testColumn.add(grid);
selectField2 = new SelectField(NUMBERS);
grid.add(selectField2);
listBox2 = new ListBox(NUMBERS);
grid.add(listBox2);
controlsColumn.add(new Label("Global"));
controlsColumn.addButton("Add ActionListener", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.addActionListener(actionListener);
}
});
}
});
controlsColumn.addButton("Remove ActionListener", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.removeActionListener(actionListener);
}
});
}
});
controlsColumn.addButton("Add ChangeListener", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.getSelectionModel().addChangeListener(changeListener);
}
});
}
});
controlsColumn.addButton("Remove ChangeListener", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.getSelectionModel().removeChangeListener(changeListener);
}
});
}
});
controlsColumn.addButton("Add ListDataListener", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.getModel().addListDataListener(listDataListener);
}
});
}
});
controlsColumn.addButton("Remove ListDataListener", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.getModel().removeListDataListener(listDataListener);
}
});
}
});
controlsColumn.addButton("Toggle Enabled State", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setEnabled(!listComponent.isEnabled());
}
});
}
});
controlsColumn.addButton("Set ListCellRenderer", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setCellRenderer(evenOddListCellRenderer);
}
});
}
});
controlsColumn.addButton("Clear ListCellRenderer", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setCellRenderer(AbstractListComponent.DEFAULT_LIST_CELL_RENDERER);
}
});
}
});
controlsColumn.addButton("Set Border", new ActionListener() {
public void actionPerformed(ActionEvent e) {
final Border border = StyleUtil.randomBorder();
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setBorder(border);
}
});
}
});
controlsColumn.addButton("Clear Border", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setBorder(null);
}
});
}
});
controlsColumn.addButton("Set Foreground", new ActionListener() {
public void actionPerformed(ActionEvent e) {
final Color color = StyleUtil.randomColor();
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setForeground(color);
}
});
}
});
controlsColumn.addButton("Set Background", new ActionListener() {
public void actionPerformed(ActionEvent e) {
final Color color = StyleUtil.randomColor();
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setBackground(color);
}
});
}
});
controlsColumn.addButton("Set Font", new ActionListener() {
public void actionPerformed(ActionEvent e) {
final Font font = StyleUtil.randomFont();
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setFont(font);
}
});
}
});
controlsColumn.addButton("Clear Font", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setFont(null);
}
});
}
});
controlsColumn.addButton("Set Disabled Border", new ActionListener() {
public void actionPerformed(ActionEvent e) {
final Border border = StyleUtil.randomBorder();
apply(new Applicator() {
public void apply(AbstractListComponent listComponent) {
listComponent.setDisabledBorder(border);
}
});