private void handleButtonPressed(Button button) {
if (button.equals(browseThenButton)) {
ElementListSelectionDialog dialog = new ElementListSelectionDialog(
getShell(), new DecoratingLabelProvider(
new WebflowModelLabelProvider(),
new WebflowModelLabelDecorator()));
dialog.setBlockOnOpen(true);
dialog.setElements(WebflowModelXmlUtils.getStates(parent, false)
.toArray());
dialog.setEmptySelectionMessage("Enter a valid state id");
dialog.setTitle("State reference");
dialog.setMessage("Please select a state reference");
dialog.setMultipleSelection(false);
if (Dialog.OK == dialog.open()) {
this.thenText.setText(((IState) dialog.getFirstResult())
.getId());
}
}
else {
ElementListSelectionDialog dialog = new ElementListSelectionDialog(
getShell(), new DecoratingLabelProvider(
new WebflowModelLabelProvider(),
new WebflowModelLabelDecorator()));
dialog.setBlockOnOpen(true);
dialog.setElements(WebflowModelXmlUtils.getStates(parent, false)
.toArray());
dialog.setEmptySelectionMessage("Enter a valid state id");