Package org.eclipse.jdt.internal.ui.text.java

Examples of org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal


                                      classNameStart.length(),
                                      collector );
            IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
            for ( int i = 0; i < proposals.length; i++ ) {
                if ( proposals[i] instanceof AbstractJavaCompletionProposal ) {
                    AbstractJavaCompletionProposal javaProposal = (AbstractJavaCompletionProposal) proposals[i];
                    int replacementOffset = documentOffset - (classNameStart.length() - javaProposal.getReplacementOffset());
                    javaProposal.setReplacementOffset( replacementOffset );
                    if ( javaProposal instanceof LazyJavaTypeCompletionProposal ) {
                        String completionPrefix = classNameStart.substring( classNameStart.length() - javaProposal.getReplacementLength() );
                        int dotIndex = completionPrefix.lastIndexOf( '.' );
                        // match up to the last dot in order to make higher level matching still work (camel case...)
                        if ( dotIndex != -1 ) {
                            javaProposal.setReplacementString( ((LazyJavaTypeCompletionProposal) javaProposal).getQualifiedTypeName() );
                        }
                    }
                    result.add( proposals[i] );
                }
            }
View Full Code Here


            return false;
        }
        for ( Iterator iter = completions.iterator(); iter.hasNext(); ) {
            Object o = iter.next();
            if ( o instanceof AbstractJavaCompletionProposal ) {
                AbstractJavaCompletionProposal prop = (AbstractJavaCompletionProposal) o;
                String content = prop.getReplacementString();
                if ( completion.equals( content ) ) {
                    IJavaElement javaElement = prop.getJavaElement();
                    if ( javaElement instanceof ILocalVariable || javaElement instanceof IField ) {
                        return false;
                    }
                }
            }
View Full Code Here

                                      fixedText.length(),
                                      collector );
            IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
            for ( int i = 0; i < proposals.length; i++ ) {
                if ( proposals[i] instanceof AbstractJavaCompletionProposal ) {
                    AbstractJavaCompletionProposal javaProposal = (AbstractJavaCompletionProposal) proposals[i];
                    int replacementOffset = documentOffset - (fixedText.length() - javaProposal.getReplacementOffset());
                    javaProposal.setReplacementOffset( replacementOffset );
                    if ( javaProposal instanceof LazyJavaTypeCompletionProposal ) {
                        String completionPrefix = javaText.substring( javaText.length() - javaProposal.getReplacementLength() );
                        int dotIndex = completionPrefix.lastIndexOf( '.' );
                        // match up to the last dot in order to make higher level matching still work (camel case...)
                        if ( dotIndex != -1 ) {
                            javaProposal.setReplacementString( ((LazyJavaTypeCompletionProposal) javaProposal).getQualifiedTypeName() );
                        }
                    }
                    if ( !filterObjectMethods || !(proposals[i] instanceof JavaMethodCompletionProposal) ) {
                        results.add( proposals[i] );
                    }
View Full Code Here

                                      classNameStart.length(),
                                      collector );
            IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
            for ( int i = 0; i < proposals.length; i++ ) {
                if ( proposals[i] instanceof AbstractJavaCompletionProposal ) {
                    AbstractJavaCompletionProposal javaProposal = (AbstractJavaCompletionProposal) proposals[i];
                    int replacementOffset = documentOffset - (classNameStart.length() - javaProposal.getReplacementOffset());
                    javaProposal.setReplacementOffset( replacementOffset );
                    if ( javaProposal instanceof LazyJavaTypeCompletionProposal ) {
                        String completionPrefix = classNameStart.substring( classNameStart.length() - javaProposal.getReplacementLength() );
                        int dotIndex = completionPrefix.lastIndexOf( '.' );
                        // match up to the last dot in order to make higher level matching still work (camel case...)
                        if ( dotIndex != -1 ) {
                            javaProposal.setReplacementString( ((LazyJavaTypeCompletionProposal) javaProposal).getQualifiedTypeName() );
                        }
                    }
                    result.add( proposals[i] );
                }
            }
View Full Code Here

            return false;
        }
        for ( Iterator<ICompletionProposal> iter = completions.iterator(); iter.hasNext(); ) {
            Object o = iter.next();
            if ( o instanceof AbstractJavaCompletionProposal ) {
                AbstractJavaCompletionProposal prop = (AbstractJavaCompletionProposal) o;
                String content = prop.getReplacementString();
                if ( completion.equals( content ) ) {
                    IJavaElement javaElement = prop.getJavaElement();
                    if ( javaElement instanceof ILocalVariable || javaElement instanceof IField ) {
                        return false;
                    }
                }
            }
View Full Code Here

                                      fixedText.length(),
                                      collector );
            IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
            for ( int i = 0; i < proposals.length; i++ ) {
                if ( proposals[i] instanceof AbstractJavaCompletionProposal ) {
                    AbstractJavaCompletionProposal javaProposal = (AbstractJavaCompletionProposal) proposals[i];
                    int replacementOffset = documentOffset - (fixedText.length() - javaProposal.getReplacementOffset());
                    javaProposal.setReplacementOffset( replacementOffset );
                    if ( javaProposal instanceof LazyJavaTypeCompletionProposal ) {
                        String completionPrefix = javaText.substring( javaText.length() - javaProposal.getReplacementLength() );
                        int dotIndex = completionPrefix.lastIndexOf( '.' );
                        // match up to the last dot in order to make higher level matching still work (camel case...)
                        if ( dotIndex != -1 ) {
                            javaProposal.setReplacementString( ((LazyJavaTypeCompletionProposal) javaProposal).getQualifiedTypeName() );
                        }
                    }
                    if ( !filterObjectMethods || !(proposals[i] instanceof JavaMethodCompletionProposal) ) {
                        results.add( proposals[i] );
                    }
View Full Code Here

                                      classNameStart.length(),
                                      collector );
            IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
            for ( int i = 0; i < proposals.length; i++ ) {
                if ( proposals[i] instanceof AbstractJavaCompletionProposal ) {
                    AbstractJavaCompletionProposal javaProposal = (AbstractJavaCompletionProposal) proposals[i];
                    int replacementOffset = documentOffset - (classNameStart.length() - javaProposal.getReplacementOffset());
                    javaProposal.setReplacementOffset( replacementOffset );
                    if ( javaProposal instanceof LazyJavaTypeCompletionProposal ) {
                        String completionPrefix = classNameStart.substring( classNameStart.length() - javaProposal.getReplacementLength() );
                        int dotIndex = completionPrefix.lastIndexOf( '.' );
                        // match up to the last dot in order to make higher level matching still work (camel case...)
                        if ( dotIndex != -1 ) {
                            javaProposal.setReplacementString( ((LazyJavaTypeCompletionProposal) javaProposal).getQualifiedTypeName() );
                        }
                    }
                    result.add( proposals[i] );
                }
            }
View Full Code Here

            return false;
        }
        for ( Iterator iter = completions.iterator(); iter.hasNext(); ) {
            Object o = iter.next();
            if ( o instanceof AbstractJavaCompletionProposal ) {
                AbstractJavaCompletionProposal prop = (AbstractJavaCompletionProposal) o;
                String content = prop.getReplacementString();
                if ( completion.equals( content ) ) {
                    IJavaElement javaElement = prop.getJavaElement();
                    if ( javaElement instanceof ILocalVariable || javaElement instanceof IField ) {
                        return false;
                    }
                }
            }
View Full Code Here

                                      fixedText.length(),
                                      collector );
            IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
            for ( int i = 0; i < proposals.length; i++ ) {
                if ( proposals[i] instanceof AbstractJavaCompletionProposal ) {
                    AbstractJavaCompletionProposal javaProposal = (AbstractJavaCompletionProposal) proposals[i];
                    int replacementOffset = documentOffset - (fixedText.length() - javaProposal.getReplacementOffset());
                    javaProposal.setReplacementOffset( replacementOffset );
                    if ( javaProposal instanceof LazyJavaTypeCompletionProposal ) {
                        String completionPrefix = javaText.substring( javaText.length() - javaProposal.getReplacementLength() );
                        int dotIndex = completionPrefix.lastIndexOf( '.' );
                        // match up to the last dot in order to make higher level matching still work (camel case...)
                        if ( dotIndex != -1 ) {
                            javaProposal.setReplacementString( ((LazyJavaTypeCompletionProposal) javaProposal).getQualifiedTypeName() );
                        }
                    }
                    if ( !filterObjectMethods || !(proposals[i] instanceof JavaMethodCompletionProposal) ) {
                        results.add( proposals[i] );
                    }
View Full Code Here

        unit.codeComplete(value.length(), collector, DefaultWorkingCopyOwner.PRIMARY);
        IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
        List<ICompletionProposal> result = new ArrayList<ICompletionProposal>();
        for(int i=0;i<proposals.length;i++){
          if(proposals[i] instanceof AbstractJavaCompletionProposal){
            AbstractJavaCompletionProposal proposal = (AbstractJavaCompletionProposal)proposals[i];
            proposal.setReplacementOffset(offset - matchString.trim().length());
            proposal.setReplacementLength(matchString.length());
            proposal.setReplacementString(proposal.getReplacementString().replaceFirst(";$", ""));
            proposal.setCursorPosition(proposal.getReplacementString().length());
            result.add(proposal);
          }
        }
        return result.toArray(new ICompletionProposal[result.size()]);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal

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.