public boolean eventPosted(EventObject event) {
if(event instanceof ProjectSelectedEvent) {
return true;
}
AntBuildEvent buildEvent = (AntBuildEvent) event;
Style style = null;
String text = null;
switch(buildEvent.getType().getValue()) {
case BuildEventType.BUILD_STARTED_VAL:
case BuildEventType.BUILD_FINISHED_VAL:
text = buildEvent.getType().toString() +
" (" + new Date().toString() + ")";
style = _styles.getHeadingStyle();
break;
case BuildEventType.TARGET_STARTED_VAL:
text = buildEvent.getEvent().getTarget().getName() + ":";
style = _styles.getSubheadingStyle();
break;
case BuildEventType.TARGET_FINISHED_VAL:
case BuildEventType.TASK_STARTED_VAL:
case BuildEventType.TASK_FINISHED_VAL:
break;
case BuildEventType.MESSAGE_LOGGED_VAL:
// Filter out events that are below our
// selected filterint level.
LogLevelEnum level =
(LogLevelEnum) _logLevel.getSelectedItem();
int priority = buildEvent.getEvent().getPriority();
if(priority <= level.getValue()) {
text = buildEvent.toString();
style = _styles.getStyle(LogLevelEnum.fromInt(priority));
}
break;
}