Package org.openquark.cal.services

Examples of org.openquark.cal.services.AutoCompleteHelper


        // OS in existence) We have to get rid of line feeds all together to get rid of parsing errors
        String windowsLineSeparator = "\r\n";
        entireTextField = entireTextField.replaceAll(windowsLineSeparator, "\n");
       
        final String textField = entireTextField;
        final AutoCompleteHelper ach = new AutoCompleteHelper(new AutoCompleteHelper.Document() {
            public char getChar(int offset) {
                return textField.charAt(offset);
            }

            public String get(int startIndex, int length) {
                return textField.substring(startIndex, startIndex + length);
            }                   
        });
       
        // Find the text we are completing (ex: no in "Prelude.no")
        String userInput = ach.getLastIncompleteIdentifier(caretPosition);
        userInputWordLength = userInput.length();       
       
        final Pair<String, List<Integer>> scopingAndOffset = ach.getIdentifierScoping(caretPosition);
        final String moduleNameString = scopingAndOffset.fst();
        final List<Integer> componentPositions = scopingAndOffset.snd();
        final int startOfModuleName = (componentPositions.get(0)).intValue();
        // Now if we are completing a qualification, find the module (ex: Prelude in "Prelude.no")
        final boolean qualification = moduleNameString.length() > 0;
View Full Code Here

TOP

Related Classes of org.openquark.cal.services.AutoCompleteHelper

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.