Package org.eclipse.jface.text.contentassist

Examples of org.eclipse.jface.text.contentassist.ICompletionProposal


  /**
   * @deprecated XML proposal is added via xml declaration template instead
   */
  protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
    String proposedText = "<?xml version=\"1.0\" encoding=\"" + ContentTypeEncodingPreferences.getUserPreferredCharsetName(ContentTypeIdForXML.ContentTypeID_XML) + "\"?>"; //$NON-NLS-2$//$NON-NLS-1$
    ICompletionProposal proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_PROCESSINGINSTRUCTION), proposedText, null, null, XMLRelevanceConstants.R_XML_DECLARATION);
    // TODO add special XML proposal info
    contentAssistRequest.addProposal(proposal);
  }
View Full Code Here


   * @param imagePath
   *            content assist image relative path
   * @return ICompletionProposal
   */
  public static ICompletionProposal computeJSPEndTagProposal(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, String parentTagName, String imagePath) {
    ICompletionProposal p = null;

    // check if tag is closed
    boolean hasEndTag = true;
    boolean isJSPTag = false;
    IDOMNode xnode = null;
View Full Code Here

   * @param imagePath
   *            content assist relative image path
   * @return ICompletionProposal
   */
  public static ICompletionProposal computeXMLEndTagProposal(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, String parentTagName, String imagePath) {
    ICompletionProposal p = null;

    // check if tag is closed
    boolean hasEndTag = true;
    IDOMNode xnode = null;
    String tagName = ""; //$NON-NLS-1$
View Full Code Here

        List<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>();
        for ( int k = 0; k < possibleAttributeTypes.length; k++ )
        {
            if ( possibleAttributeTypes[k].toUpperCase().startsWith( attribute.toUpperCase() ) )
            {
                ICompletionProposal proposal = new CompletionProposal( possibleAttributeTypes[k] + ", ", start,
                    documentOffset - start, possibleAttributeTypes[k].length() + 2, null, possibleAttributeTypes[k],
                    null, null );
                proposalList.add( proposal );
            }
        }
View Full Code Here

        ICompletionProposal[] oldProposals = computeCompletionProposals( position );
        IContentProposal[] proposals = new IContentProposal[oldProposals.length];
        for ( int i = 0; i < oldProposals.length; i++ )
        {
            final ICompletionProposal oldProposal = oldProposals[i];
            final Document document = new Document( contents );
            oldProposal.apply( document );

            proposals[i] = new IContentProposal()
            {
                public String getContent()
                {
                    return document.get();
                }


                public int getCursorPosition()
                {
                    return oldProposal.getSelection( document ).x;
                }


                public String getDescription()
                {
                    return oldProposal.getAdditionalProposalInfo();
                }


                public String getLabel()
                {
                    return oldProposal.getDisplayString();
                }


                public String toString()
                {
View Full Code Here

                    else
                    {
                        displayString += " (" + description.getNumericOID() + ")";
                    }

                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, attributeType
                        .length(), replacementString.length(), getAttributeTypeImage(), displayString, null, schema
                        .getAttributeTypeDescription( possibleAttributeType ).getLine().getUnfoldedValue() );
                    proposalList.add( proposal );
                }
            }
View Full Code Here

            for ( String possibleFilterType : copy.keySet() )
            {
                String replacementString = possibleFilterType;
                String displayString = copy.get( possibleFilterType );

                ICompletionProposal proposal = new CompletionProposal( replacementString, offset, filterType.length(),
                    possibleFilterType.length(), getFilterTypeImage(), displayString, null, null );
                proposalList.add( proposal );
            }
        }
    }
View Full Code Here

                    else
                    {
                        displayString += " (" + description.getNumericOID() + ")";
                    }

                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, objectClass
                        .length(), replacementString.length(), getObjectClassImage(), displayString, null, schema
                        .getObjectClassDescription( possibleObjectClass ).getLine().getUnfoldedValue() );
                    proposalList.add( proposal );
                }
            }
View Full Code Here

                    else
                    {
                        displayString += " (" + description.getNumericOID() + ")";
                    }

                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, matchingRule
                        .length(), replacementString.length(), getMatchingRuleImage(), displayString, null, schema
                        .getMatchingRuleDescription( possibleMatchingRule ).getLine().getUnfoldedValue() );
                    proposalList.add( proposal );
                }
            }
View Full Code Here

    {
        if ( "dn".toUpperCase().startsWith( dnAttr.toUpperCase() ) )
        {
            String replacementString = "dn:";
            String displayString = "dn: ()";
            ICompletionProposal proposal = new CompletionProposal( replacementString, offset, dnAttr.length(),
                replacementString.length(), null, displayString, null, null );
            proposalList.add( proposal );
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.contentassist.ICompletionProposal

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.