Fix disabled move and indent buttons for the WBS tree manipulation

These icons are disabled when the WBS is showed filtered, as the manipulation
operations could be ambiguous or problematic, but it was treating wrongly
empty predicates.

FEA: ItEr77S15FilteringEnhancements
This commit is contained in:
Lorenzo Tilve Álvaro 2013-03-11 10:36:27 +01:00
parent 3ad35624a2
commit cabf12ad8f
2 changed files with 7 additions and 1 deletions

View file

@ -67,6 +67,11 @@ public class OrderElementPredicate implements IPredicate {
return accepts(orderElement) || accepts(orderElement.getAllChildren());
}
public boolean isEmpty() {
return (filters.isEmpty() && startDate == null && finishDate == null && name
.isEmpty());
}
private boolean accepts(OrderElement orderElement) {
if (orderElement == null) {
return false;

View file

@ -602,7 +602,8 @@ public class OrderElementTreeController extends TreeController<OrderElement> {
@Override
protected boolean isPredicateApplied() {
return predicate != null;
return (predicate != null)
&& !((OrderElementPredicate) predicate).isEmpty();
}
/**