TreeViewerColumn actionColumn = createColumn(headings[2], 90);
actionColumn.setLabelProvider(new HighlightingColumnLabelProvider() {
@Override
public Image getImage(Object element) {
ElementAction a = getAction(element);
if (a != null) {
switch (a) {
case EDIT:
return UIIcons.getImage(resources, UIIcons.EDITCONFIG);
case FIXUP:
if (RebaseInteractivePreferences.isOrderReversed())
return UIIcons.getImage(resources,
UIIcons.FIXUP_DOWN);
else
return UIIcons.getImage(resources,
UIIcons.FIXUP_UP);
case PICK:
return UIIcons.getImage(resources, UIIcons.CHERRY_PICK);
case REWORD:
return UIIcons.getImage(resources, UIIcons.REWORD);
case SKIP:
return UIIcons.getImage(resources, UIIcons.REBASE_SKIP);
case SQUASH:
if (RebaseInteractivePreferences.isOrderReversed())
return UIIcons.getImage(resources,
UIIcons.SQUASH_DOWN);
else
return UIIcons.getImage(resources,
UIIcons.SQUASH_UP);
default:
// fall through
}
}
return super.getImage(element);
}
@Override
public String getText(Object element) {
ElementAction a = getAction(element);
return (a != null) ? a.name() : super.getText(element);
}
private ElementAction getAction(Object element) {
if (element instanceof PlanElement) {
PlanElement planLine = (PlanElement) element;