Object[] args = invocation.getArguments();
Context context = (Context) args[CONTEXT];
ICommand command = (ICommand) args[COMMAND];
String[] curArgs = (String[]) args[CUR_ARGS];
if (context instanceof HighlightHandler) {
HighlightHandler handler = (HighlightHandler) context;
handler.unhighlight();
if (handler.isHighlight()) {
int i = 0;
String[] locators = command.convertLocators(curArgs);
for (String locator : locators)
handler.highlight(locator, HighlightStyle.ELEMENT_STYLES[i++]);
}
}
return invocation.proceed();
}