}
private IDetailItemModificator createStartDeadlineMarker(Order order) {
final DateTime projectStart = new DateTime(order.getInitDate());
final DateTime deadline = new DateTime(order.getDeadline());
IDetailItemModificator detailItemModificator;
if (order.getInitDate() != null) {
if (order.getDeadline() != null) {
// Both project Start and deadline markers
detailItemModificator = new IDetailItemModificator() {
@Override
public DetailItem applyModificationsTo(DetailItem item,
ZoomLevel z) {
item.markDeadlineDay(deadline);
item.markProjectStart(projectStart);
return item;
}
};
} else {
// Project Start without deadline
detailItemModificator = new IDetailItemModificator() {
@Override
public DetailItem applyModificationsTo(DetailItem item,
ZoomLevel z) {
item.markProjectStart(projectStart);
return item;
}
};
}
} else {
// Only project deadline marker
detailItemModificator = new IDetailItemModificator() {
@Override
public DetailItem applyModificationsTo(DetailItem item,
ZoomLevel z) {
item.markDeadlineDay(deadline);
return item;