public RequestDialog(RequestIndex eventList) {
super(80, 40, false, "Event List");
this.eventList = eventList;
BorderLayoutManager manager = new BorderLayoutManager();
getRootPanel().setLayoutManager(manager);
list = new List(35, false) {
{
setSize(new Rectangle(10, 10));
}
protected boolean handleInput(InputChar inputChar) {
boolean result = super.handleInput(inputChar);
if (Util.wasReturn(inputChar)) {
select(getTrackedItem());
RequestDialog.this.saveAndClose();
}
return result;
}
};
list.setSelectable(false);
loadEvents(false);
manager.addWidget(list, BorderLayoutManager.CENTER, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
Button ok = new Button("Load Fully");
ok.addListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
loadEvents(true);
RequestDialog.this.repaint();
}
});
manager.addWidget(ok, BorderLayoutManager.SOUTH, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
CompletionPanel completionPanel = new CompletionPanel(this.eventList);
manager.addWidget(completionPanel, BorderLayoutManager.EAST, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
}