AbstractNode node = (AbstractNode) bo;
ValidationResult res = ValidationFactory.getInstance().validate(node);
if (res.getInformationCount() > 0) {
for (String message : res.getInformations()) {
IDecorator imageRenderingDecorator = new ImageDecorator(IPlatformImageConstants.IMG_ECLIPSE_INFORMATION_TSK);
imageRenderingDecorator.setMessage(message);
decorators.add(imageRenderingDecorator);
}
}
if (res.getWarningCount() > 0) {
for (String message : res.getWarnings()) {
IDecorator imageRenderingDecorator = new ImageDecorator(IPlatformImageConstants.IMG_ECLIPSE_WARNING_TSK);
imageRenderingDecorator.setMessage(message);
decorators.add(imageRenderingDecorator);
}
}
if (res.getErrorCount() > 0) {
for (String message : res.getErrors()) {
IDecorator imageRenderingDecorator = new ImageDecorator(IPlatformImageConstants.IMG_ECLIPSE_ERROR_TSK);
imageRenderingDecorator.setMessage(message);
decorators.add(imageRenderingDecorator);
}
}
// decorate breakpoints on endpoints
if (getDiagramTypeProvider().getDiagramBehavior().getDiagramContainer() != null && getDiagramTypeProvider().getDiagramBehavior().getDiagramContainer() instanceof RiderDesignEditor) {
RiderDesignEditor editor = (RiderDesignEditor)getDiagramTypeProvider().getDiagramBehavior().getDiagramContainer();
IFile activeFile = editor.getCamelContextFile();
String projectName = activeFile.getProject().getName();
IBreakpoint bp = CamelDebugUtils.getBreakpointForSelection(node.getId(), activeFile.getName(), projectName);
if (bp != null && bp instanceof CamelEndpointBreakpoint) {
CamelEndpointBreakpoint cep = (CamelEndpointBreakpoint)bp;
// we only want to decorate breakpoints which belong to this project
if (cep.getProjectName().equals(activeFile.getProject().getName())) {
try {
if (cep.isEnabled() && bp instanceof CamelConditionalBreakpoint) {
// show enabled breakpoint decorator
IDecorator imageRenderingDecorator = new ImageDecorator(ImageProvider.IMG_YELLOWDOT);
imageRenderingDecorator.setMessage("");
decorators.add(imageRenderingDecorator);
} else if (cep.isEnabled() && bp instanceof CamelEndpointBreakpoint) {
// show enabled breakpoint decorator
IDecorator imageRenderingDecorator = new ImageDecorator(ImageProvider.IMG_REDDOT);
imageRenderingDecorator.setMessage("");
decorators.add(imageRenderingDecorator);
} else {
// show disabled breakpoint decorator
IDecorator imageRenderingDecorator = new ImageDecorator(ImageProvider.IMG_GRAYDOT);
imageRenderingDecorator.setMessage("");
decorators.add(imageRenderingDecorator);
}
} catch (CoreException e) {
Activator.getLogger().error(e);
}