@Override
protected NSArray defaultBranchChoices(D2WContext context) {
NSArray result = super.defaultBranchChoices(context);
log.debug("in: " + result);
Bug bug = (Bug)object(context);
// AK: this is just an illustration
if(bug != null) {
result = choiceByRemovingKeys(new NSArray("edit"), result);
if(!bug.state().equals(State.ANALYZE)) {
result = choiceByRemovingKeys(new NSArray("delete"), result);
}
if(!bug.state().equals(State.CLOSED)) {
result = choiceByRemovingKeys(new NSArray(new Object[] {"reopen"}), result);
}
if(bug.state().equals(State.CLOSED)) {
result = choiceByRemovingKeys(new NSArray(new Object[] {"resolve"}), result);
}
if(!bug.state().equals(State.VERIFY)) {
result = choiceByRemovingKeys(new NSArray("reject"), result);
}
log.debug("out: " + result + " -> " + bug.state().textDescription());
} else {
result = choiceByLeavingKeys(new NSArray(new Object[] {"create"}), result);
}
return result;
}