Package org.eclipse.jface.fieldassist

Examples of org.eclipse.jface.fieldassist.FieldDecoration


    if (installDecoration) {
      // Note top left is used for compatibility with 3.2, although
      // this may change to center alignment in the future.
      decoration = new ControlDecoration(control, SWT.TOP | SWT.LEFT);
      decoration.setShowOnlyOnFocus(true);
      FieldDecoration dec = getContentAssistFieldDecoration();
      decoration.setImage(dec.getImage());
      decoration.setDescriptionText(dec.getDescription());
    }

  }
View Full Code Here


   */
  private FieldDecoration getContentAssistFieldDecoration() {
    FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
    // Look for a decoration installed for this particular command id.
    String decId = CONTENT_ASSIST_DECORATION_ID + getCommandId();
    FieldDecoration dec = registry.getFieldDecoration(decId);

    // If there is not one, base ours on the standard JFace one.
    if (dec == null) {
      FieldDecoration originalDec = registry
          .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);

      registry.registerFieldDecoration(decId, null, originalDec
          .getImage());
      dec = registry.getFieldDecoration(decId);
    }
    // Always update the decoration text since the key binding may
    // have changed since it was last retrieved.
View Full Code Here

        info = new Text(composite, SWT.SINGLE | SWT.BORDER);
        info.setLayoutData(String.format(WIDTH_LAYOUT_FORMAT, CONTROL_WIDTH));
        info.addModifyListener(new ValidatingModifyListener());
       
        infoDecoration = new ControlDecoration(info, SWT.TOP | SWT.LEFT);
        final FieldDecoration errorFieldIndicator = FieldDecorationRegistry.getDefault()
                .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
        infoDecoration.setImage(errorFieldIndicator.getImage());
        infoDecoration.hide();
       
    }
View Full Code Here

        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

            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()) {
            control.setToolTipText(warning);
View Full Code Here

               
                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();
            if (control != null && !control.isDisposed()) {
View Full Code Here

        if( input != null && input.getFeedback() != null ){
            ControlDecoration feedback = input.getFeedback();
           
            feedback.setDescriptionText(error);
            FieldDecorationRegistry decorations = FieldDecorationRegistry.getDefault();
            FieldDecoration warningDecoration = decorations.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING);
            feedback.setImage(warningDecoration.getImage());
            feedback.show();
        }
        Control control = getControl();
        if (control != null && !control.isDisposed()) {
            control.setToolTipText(error+":"+exception);
View Full Code Here

  private void addDecorationMargin(Control control) {
    Object layoutData= control.getLayoutData();
    if (!(layoutData instanceof GridData))
      return;
    GridData gd= (GridData)layoutData;
    FieldDecoration dec= FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
    gd.horizontalIndent= dec.getImage().getBounds().width;
  }
View Full Code Here

            // combo widget
            Collection<String> names = SchemaUtils.getNames( schema.getAttributeTypeDescriptions() );
            String[] allAtNames = names.toArray( new String[names.size()] );
            Arrays.sort( allAtNames );

            final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
                FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
            attributeTypeComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
            {
                public Control createControl( Composite parent, int style )
                {
View Full Code Here

        // combo widget
        Collection<String> names = SchemaUtils.getNames( schema.getAttributeTypeDescriptions() );
        String[] allAtNames = names.toArray( new String[names.size()] );
        Arrays.sort( allAtNames );

        final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
            FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
        attributeTypeComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
        {
            public Control createControl( Composite parent, int style )
            {
View Full Code Here

TOP

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

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.