public void provideWidget(ProvisioningCallback callback)
{
panel = new LayoutPanel();
CaptionLayoutPanel wrapper = new CaptionLayoutPanel("BPAF Data Keys");
wrapper.setLayout(new ColumnLayout());
LayoutPanel leftPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
wrapper.getHeader().add(new Button("Reload",
new ClickHandler()
{
public void onClick(ClickEvent clickEvent)
{
loadDefinitions();
}
})
);
processDefinitions = new ListBox<String>(new String[] {"processDefinitionID"});
processDefinitions.setMinimumColumnWidth(0, 190);
processDefinitions.setCellRenderer(
new ListBox.CellRenderer<String>()
{
public void renderCell(ListBox<String> stringListBox, int row, int column, String item)
{
switch (column)
{
case 0:
processDefinitions.setText(row, column, item);
break;
default:
throw new IllegalArgumentException("unknown column");
}
}
}
);
processDefinitions.addRowSelectionHandler(
new RowSelectionHandler()
{
public void onRowSelection(RowSelectionEvent rowSelectionEvent)
{
loadInstances();
}
}
);
leftPanel.add(processDefinitions, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
// -----
LayoutPanel rightPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
processInstances = new ListBox<String>(new String[] {"processInstanceID"});
processInstances.setMinimumColumnWidth(0, 190);
processInstances.setCellRenderer(
new ListBox.CellRenderer<String>()
{
public void renderCell(ListBox<String> stringListBox, int row, int column, String item)
{
switch (column)
{
case 0:
processInstances.setText(row, column, item);
break;
default:
throw new IllegalArgumentException("unknown column");
}
}
}
);
processInstances.addRowSelectionHandler(
new RowSelectionHandler()
{
public void onRowSelection(RowSelectionEvent rowSelectionEvent)
{
loadActivities();
}
}
);
activities = new ListBox<String>(new String[] {"activityDefinitionID"});
activities.setMinimumColumnWidth(0, 190);
activities.setCellRenderer(
new ListBox.CellRenderer<String>()
{
public void renderCell(ListBox<String> stringListBox, int row, int column, String item)
{
switch (column)
{
case 0:
activities.setText(row, column, item);
break;
default:
throw new IllegalArgumentException("unknown column");
}
}
}
);
rightPanel.add(processInstances, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
rightPanel.add(activities, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
// -----
wrapper.add(leftPanel);
wrapper.add(rightPanel);
panel.add(wrapper);
callback.onSuccess(panel);
}