Package org.eclipse.jface.text.contentassist

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


            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.getOid() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
                    }

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

                    else
                    {
                        displayString += " (" + description.getOid() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
                    }
                    String info = SchemaUtils.getLdifLine( description );
                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, matchingRule
                        .length(), replacementString.length(), getMatchingRuleImage(), displayString, null, info );
                    proposalList.add( proposal );
                }
            }
        }
View Full Code Here

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

        String input = contentAssistSubjectControl.getDocument().get();
        ICompletionProposal[] proposals = createProposals(documentOffset, input);
        Arrays.sort(proposals, new Comparator() {
       
            public int compare(Object o1, Object o2) {
                ICompletionProposal cp1 = (ICompletionProposal) o1;
                ICompletionProposal cp2 = (ICompletionProposal) o2;
                return cp1.getDisplayString().compareTo(cp2.getDisplayString());
            }
       
        });
        return proposals;
    }
View Full Code Here

    }

    public static void addAllNewProposals(final Collection proposals,
                                          final Collection newProposals) {
        for ( Iterator iter = newProposals.iterator(); iter.hasNext(); ) {
            ICompletionProposal newProp = (ICompletionProposal) iter.next();
            String displayString = newProp.getDisplayString();

            //JBRULES-1134 do not add completions if they already exist
            if ( !containsProposal( proposals,
                                    displayString ) ) {
                proposals.add( newProp );
View Full Code Here

     * The match is based on the first token based on a space split
     */
    public static boolean containsProposal(final Collection proposals,
                                           String newProposal) {
        for ( Iterator iter = proposals.iterator(); iter.hasNext(); ) {
            ICompletionProposal prop = (ICompletionProposal) iter.next();
            String displayString = prop.getDisplayString();
            String[] existings = displayString.split( " " );
            if ( existings.length == 0 ) {
                continue;
            }

View Full Code Here

    protected static void filterProposalsOnPrefix(String prefix, List props) {
        if ( prefix != null && prefix.trim().length() > 0 ) {
            Iterator iterator = props.iterator();
            String prefixLc = prefix.toLowerCase();
            while ( iterator.hasNext() ) {
                ICompletionProposal item = (ICompletionProposal) iterator.next();
                String content = item.getDisplayString().toLowerCase();
                if ( !content.toLowerCase().startsWith( prefixLc ) ) {
                    iterator.remove();
                }
            }
        }
View Full Code Here

                      value.append(name);
                    if (c == LexicalConstants.LEFT_ANGLE_BRACKET)
                      value.append(LexicalConstants.RIGHT_ANGLE_BRACKET);
                    else
                      value.append(LexicalConstants.RIGHT_SQUARE_BRACKET);
                    ICompletionProposal completionProposal = new CompletionProposal(
                        value.toString(), offset, 0,
                        offset
                            + value.toString()
                                .length());
                    return new ICompletionProposal[] { completionProposal };
View Full Code Here

    final IModelElement element = editor.getInputModelElement();
    final IScriptProject scriptProject = element.getScriptProject();
    List proposals = null;
    for (int i = 0; i < annotations.length; i++) {
      final Annotation annotation = annotations[i];
      ICompletionProposal proposal = null;
      if (annotation instanceof MarkerAnnotation) {
        MarkerAnnotation mAnnot = (MarkerAnnotation) annotation;
        IMarker marker = mAnnot.getMarker();
        if (isFixable(marker)) {
          final String pkgName = CorrectionEngine.getProblemArguments(marker)[0];
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.