Package org.eclipse.jface.fieldassist

Examples of org.eclipse.jface.fieldassist.FieldDecorationRegistry


    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();
        }
View Full Code Here


        if( input != null && input.getFeedback() != null ){
            ControlDecoration feedback = input.getFeedback();
           
            feedback.setDescriptionText(warning);
           
            FieldDecorationRegistry decorations = FieldDecorationRegistry.getDefault();
            FieldDecoration errorDecoration = decorations.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING);
            feedback.setImage(errorDecoration.getImage());
            feedback.show();
        }
        Control control = getControl();
        if (control != null && !control.isDisposed()) {
View Full Code Here

            if( input != null && input.getFeedback() != null ){
                ControlDecoration feedback = input.getFeedback();
               
                feedback.setDescriptionText(warning);
               
                FieldDecorationRegistry decorations = FieldDecorationRegistry.getDefault();
                if( isRequired ){
                    FieldDecoration requiredDecoration = decorations.getFieldDecoration(FieldDecorationRegistry.DEC_REQUIRED);
                    feedback.setImage(requiredDecoration.getImage());
                } else {
                    FieldDecoration warningDecoration = decorations.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING );
                    feedback.setImage(warningDecoration.getImage());
                }
                feedback.show();
            }
            Control control = getControl();
View Full Code Here

    }

    protected void updateDecoration(ControlDecoration decoration, IStatus status) {
        if (status != null) {
            Image newImage = null;
            FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
            switch (status.getSeverity()) {
                case IStatus.INFO:
                    newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_REQUIRED).getImage();
                    break;
                case IStatus.WARNING:
                    newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
                    break;
                case IStatus.ERROR:
                    newImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
            }
            decoration.setDescriptionText(status.getMessage());
            decoration.setImage(newImage);
            decoration.show();
        } else {
View Full Code Here

   *
   * @param image
   *            desired image to be shown in the ImageAndMessageArea
   */
  public void setImage(Image image) {
    FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
    registry.registerFieldDecoration("messageImage", null, image); //$NON-NLS-1$
    messageField.addFieldDecoration(registry
        .getFieldDecoration("messageImage"), //$NON-NLS-1$
        SWT.LEFT | SWT.TOP, false);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.fieldassist.FieldDecorationRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.