Package org.eclipse.jface.fieldassist

Examples of org.eclipse.jface.fieldassist.ControlDecoration


                    });
                }

                String description = propertyElement.getAttribute("description");
                if (description != null) {
                    ControlDecoration decoration = new ControlDecoration(label, SWT.RIGHT | SWT.CENTER);
                    decoration.setShowHover(true);
                    decoration.setDescriptionText(description);
                    decoration.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());
                }

                String deprecation = propertyElement.getAttribute("deprecated");
                if (deprecation != null) {
                    ControlDecoration decoration = new ControlDecoration(label, SWT.LEFT | SWT.CENTER);
                    decoration.setShowHover(true);
                    decoration.setDescriptionText("Property deprecated: " + deprecation);
                    decoration.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage());
                }
            }
            Label summaryLabel = new Label(fieldContainer, SWT.NONE);
            summaryLabel.setText(summaryMessage);
            summaryLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
View Full Code Here


        activatorProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
        activatorProposalAdapter.setLabelProvider(new JavaContentProposalLabelProvider());
        activatorProposalAdapter.setAutoActivationDelay(1000);

        // Decorator for the Activator field
        ControlDecoration decorActivator = new ControlDecoration(txtActivator, SWT.LEFT | SWT.CENTER, composite);
        decorActivator.setImage(contentAssistDecoration.getImage());
        decorActivator.setMarginWidth(3);
        if (assistKeyStroke == null) {
            decorActivator.setDescriptionText("Content Assist is available. Start typing to activate");
        } else {
            decorActivator.setDescriptionText(MessageFormat.format("Content Assist is available. Press {0} or start typing to activate", assistKeyStroke.format()));
        }
        decorActivator.setShowOnlyOnFocus(true);
        decorActivator.setShowHover(true);

        // Decorator for the Components combo
        ControlDecoration decorComponents = new ControlDecoration(cmbComponents, SWT.LEFT | SWT.CENTER, composite);
        decorComponents.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());
        decorComponents.setMarginWidth(3);
        decorComponents.setDescriptionText("Use Java annotations to detect Declarative Service Components.");
        decorComponents.setShowOnlyOnFocus(false);
        decorComponents.setShowHover(true);

        // Listeners
        txtVersion.addModifyListener(new ModifyListener() {
            @Override
            public void modifyText(ModifyEvent e) {
View Full Code Here

    private Control createHelpLabel(Composite container, String text) {
        Label label = new Label(container, SWT.WRAP);
        label.setText(text);

        ControlDecoration decoration = new ControlDecoration(label, SWT.LEFT, container);
        Image imgInfo = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage();
        decoration.setImage(imgInfo);

        GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
        gd.horizontalIndent = imgInfo.getBounds().width;
        gd.widthHint = 100;
        label.setLayoutData(gd);
View Full Code Here

        sectProcessingErrors.setText("Processing Errors:");

        processingErrorsText = toolkit.createText(sectProcessingErrors, "", SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
        sectProcessingErrors.setClient(processingErrorsText);

        ControlDecoration controlDecoration = new ControlDecoration(processingErrorsText, SWT.RIGHT | SWT.TOP);
        controlDecoration.setMarginWidth(2);
        controlDecoration.setDescriptionText("Double-click to view details");
        controlDecoration.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL).getImage());

        gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        gd.widthHint = 600;
        gd.heightHint = 300;
        sectProcessingErrors.setLayoutData(gd);
View Full Code Here

    private void decorateComponents()
    {
        FieldDecoration infoDecor = FieldDecorationRegistry.getDefault().getFieldDecoration(
            FieldDecorationRegistry.DEC_INFORMATION);

        ControlDecoration txtBSNDecor = new ControlDecoration(txtBSN, SWT.LEFT
            | SWT.CENTER);
        txtBSNDecor.setImage(infoDecor.getImage());
        txtBSNDecor.setDescriptionText("The unique name of this bundle - should follow reverse domain name pattern");
       
        ControlDecoration txtVersionDecor = new ControlDecoration(txtVersion, SWT.LEFT
            | SWT.CENTER);
        txtVersionDecor.setImage(infoDecor.getImage());
        txtVersionDecor.setDescriptionText("The version of this bundle");
       
        ControlDecoration txtNameDecor = new ControlDecoration(txtName, SWT.LEFT
            | SWT.CENTER);
        txtNameDecor.setImage(infoDecor.getImage());
        txtNameDecor.setDescriptionText("Defines a human-readable name for the bundle");

        ControlDecoration txtDescDecor = new ControlDecoration(txtDescription, SWT.LEFT
            | SWT.CENTER);
        txtDescDecor.setImage(infoDecor.getImage());
        txtDescDecor.setDescriptionText("Defines a short human-readable description for the bundle");

        ControlDecoration txtVendorDecor = new ControlDecoration(txtVendor, SWT.LEFT
            | SWT.CENTER);
        txtVendorDecor.setImage(infoDecor.getImage());
        txtVendorDecor.setDescriptionText("The name of the company, organisation or individual providing the bundle");
    }
View Full Code Here

            }
        }
        else
        {
            txtSelection = new Text(composite, SWT.BORDER);
            ControlDecoration selectionDecor = new ControlDecoration(txtSelection,
                SWT.LEFT | SWT.TOP);
            FieldDecoration proposalDecor = FieldDecorationRegistry.getDefault().getFieldDecoration(
                FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
            selectionDecor.setImage(proposalDecor.getImage());
            selectionDecor.setDescriptionText(proposalDecor.getDescription());

            ExclusionContentProposalProvider<E> proposalProvider = new ExclusionContentProposalProvider<E>(
                elements, filter, descriptor);

            proposalAdapter = new ContentProposalAdapter(txtSelection,
View Full Code Here

            }
        }
        else
        {
            txtSelection = new Text(composite, SWT.BORDER);
            ControlDecoration selectionDecor = new ControlDecoration(txtSelection,
                SWT.LEFT | SWT.TOP);
            FieldDecoration proposalDecor = FieldDecorationRegistry.getDefault().getFieldDecoration(
                FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
            selectionDecor.setImage(proposalDecor.getImage());
            selectionDecor.setDescriptionText(proposalDecor.getDescription());
   
            ExclusionContentProposalProvider<E> proposalProvider = new ExclusionContentProposalProvider<E>(
                elements, filter, descriptor);
   
            proposalAdapter = new ContentProposalAdapter(txtSelection,
View Full Code Here

     * This method will make use of an associated ControlDecoration if available.
     * </p>
     */
    protected void feedback(String warning){
        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()) {
            control.setToolTipText(warning);
        }
View Full Code Here

     * </p>
     */
    protected void feedback(String warning, boolean isRequired){
        if( isRequired ){
            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();
            if (control != null && !control.isDisposed()) {
                control.setToolTipText(warning);
            }
View Full Code Here

     * This method will make use of an associated ControlDecoration if available.
     * </p>
     */
    protected void feedback(String error, Throwable exception){
        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

TOP

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

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.