public void selectDefinition(List<ProcessDefinitionRef> processDefinitions)
{
this.processDefinitions = processDefinitions;
final LayoutPopupPanel popup = new LayoutPopupPanel(true);
popup.addStyleName("soa-PopupPanel");
final com.google.gwt.user.client.ui.ListBox listBox =
new com.google.gwt.user.client.ui.ListBox();
listBox.addItem("");
for(ProcessDefinitionRef ref : processDefinitions)
{
listBox.addItem(ref.getName());
}
// show dialogue
LayoutPanel p = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
p.add(new HTML("Please select a process:"));
p.add(listBox);
// -----
LayoutPanel p2 = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
p2.add(new Button("Done", new ClickHandler() {
public void onClick(ClickEvent clickEvent)
{
if(listBox.getSelectedIndex()>0)
{
popup.hide();
String procDef = listBox.getItemText(listBox.getSelectedIndex());
update(procDef, getDefinitionId(procDef));
}
}
}));
// -----
HTML html = new HTML("Cancel");
html.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent clickEvent)
{
popup.hide();
}
});
p2.add(html, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
p.add(p2);
// -----
popup.setPopupPosition(menuButton.getAbsoluteLeft()-5, menuButton.getAbsoluteTop()+30);
popup.setWidget(p);
popup.pack();
popup.show();
}