@ SuppressWarnings ( "static-method" ) protected int getIssueAdornment ( XtendMember element ) { final ICompositeNode node = NodeModelUtils . getNode ( element ) ; if ( node == null ) { return 0 ; } // Error markers are more important than warning markers. // Order of checks: // - parser error (from the resource) or semantic error (from Diagnostician) // - parser warning or semantic warning final Resource resource = element . eResource ( ) ; if ( ! resource . getURI ( ) . isArchive ( ) ) { if ( hasParserIssue ( node , resource . getErrors ( ) ) ) { return JavaElementImageDescriptor . ERROR ; } final Diagnostic diagnostic = Diagnostician . INSTANCE . validate ( element ) ; switch ( diagnostic . getSeverity ( ) ) { case Diagnostic . ERROR : return JavaElementImageDescriptor . ERROR ; case Diagnostic . WARNING : return JavaElementImageDescriptor . WARNING ; default : } if ( hasParserIssue ( node , resource . getWarnings ( ) ) ) { return JavaElementImageDescriptor . WARNING ; } } return 0 ; }
Replies the diagnotic adornment for the given element .