return l < person.getAge() && person.getAge() < u;
}
});
}
});
lower.addKeyboardListener(new KeyboardListenerAdapter(){
public void onKeyUp(final Widget sender, final char keyCode, final int modifiers) {
super.onKeyUp(sender, keyCode, modifiers);
if (KeyboardListener.KEY_ENTER == keyCode) {
filterButton.click();
}
}
});
upper.addKeyboardListener(new KeyboardListenerAdapter(){
public void onKeyUp(final Widget sender, final char keyCode, final int modifiers) {
super.onKeyUp(sender, keyCode, modifiers);
if (KeyboardListener.KEY_ENTER == keyCode) {
filterButton.click();
}
}
});
final HorizontalPanel hp = new HorizontalPanel();
hp.add(new Label("From:"));
hp.add(lower);
hp.add(new Label("to:"));
hp.add(upper);
hp.add(filterButton);
fp.add(hp);
}
if (rel != null) {
final TextBox maxSize = new TextBox();
maxSize.setWidth("3em");
maxSize.setText(Integer.toString(rel.getMaxSize()));
rel.addListEventListener(new ListEventListener() {
public void listChanged(final ListEvent listEvent) {
maxSize.setText(Integer.toString(rel.getMaxSize()));
}
});
maxSize.setTitle("Enter the size of each page");
final Button setMaxSize = new Button("Set maxSize");
setMaxSize.addClickListener(new ClickListener() {
public void onClick(final Widget sender) {
try {
rel.setMaxSize(Integer.parseInt(maxSize.getText()));
} catch (NumberFormatException nfe) {
Window.alert("maxSize must be a integer");
}
}
});
maxSize.addKeyboardListener(new KeyboardListenerAdapter() {
public void onKeyUp(final Widget sender, final char keyCode, final int modifiers) {
super.onKeyUp(sender, keyCode, modifiers);
if (KeyboardListener.KEY_ENTER == keyCode) {
setMaxSize.click();
}
}
});
final TextBox start = new TextBox();
start.setWidth("3em");
start.setText(Integer.toString(rel.getStart()));
rel.addListEventListener(new ListEventListener() {
public void listChanged(final ListEvent listEvent) {
start.setText(Integer.toString(rel.getStart()));
}
});
start.setTitle("Enter the offset for the page.");
final Button setStart = new Button("Set start offset");
setStart.addClickListener(new ClickListener() {
public void onClick(final Widget sender) {
try {
rel.setStart(Integer.parseInt(start.getText()));
} catch (NumberFormatException nfe) {
Window.alert("start offset must be a integer");
}
}
});
start.addKeyboardListener(new KeyboardListenerAdapter() {
public void onKeyUp(final Widget sender, final char keyCode, final int modifiers) {
super.onKeyUp(sender, keyCode, modifiers);
if (KeyboardListener.KEY_ENTER == keyCode) {
setStart.click();
}