private void showFeedback( String message, Throwable t ) {
feedbackDecorator.hide();
feedbackDecorator.hideHover();
if( t == null && message != null){
// warning feedback!
FieldDecorationRegistry decorations = FieldDecorationRegistry.getDefault();
FieldDecoration errorDecoration = decorations.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING);
feedbackDecorator.setImage(errorDecoration.getImage());
feedbackDecorator.setDescriptionText( message );
feedbackDecorator.showHoverText( message );
feedbackDecorator.show();
}
else if( t != null ){
// if(! (t instanceof ReshapeException) ){
// CatalogUIPlugin.log("error with reshape", t); //$NON-NLS-1$
// }
String errormessage = t.getLocalizedMessage();
if( errormessage == null ){
errormessage = Messages.ReshapeOperation_2;
}
else {
// fix up really long CQL messages
errormessage = errormessage.replaceAll("\\n\\s+", " ");
}
if( message == null ){
message = MessageFormat.format(Messages.ReshapeOperation_3,errormessage);
}
FieldDecorationRegistry decorations = FieldDecorationRegistry.getDefault();
FieldDecoration errorDecoration = decorations.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING);
feedbackDecorator.setImage(errorDecoration.getImage());
feedbackDecorator.setDescriptionText( message );
feedbackDecorator.showHoverText( message );
feedbackDecorator.show();
}