final Iterator bindingItr = bindings.iterator();
while (bindingItr.hasNext()) {
final Binding binding = (Binding) bindingItr.next();
final Context context = contextService.getContext(binding
.getContextId());
final ParameterizedCommand parameterizedCommand = binding
.getParameterizedCommand();
final Command command = parameterizedCommand.getCommand();
if ((!context.isDefined()) && (!command.isDefined())) {
continue;
}
final TableItem tableItem = new TableItem(
tableBindingsForTriggerSequence, SWT.NULL);
tableItem.setData(ITEM_DATA_KEY, binding);
/*
* Set the associated image based on the type of binding. Either it
* is a user binding or a system binding.
*
* TODO Identify more image types.
*/
if (binding.getType() == Binding.SYSTEM) {
tableItem.setImage(0, IMAGE_BLANK);
} else {
tableItem.setImage(0, IMAGE_CHANGE);
}
try {
tableItem.setText(1, context.getName());
tableItem.setText(2, parameterizedCommand.getName());
} catch (final NotDefinedException e) {
throw new Error(
"Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$
}
}