Search in sources :

Example 1 with AutocompleteRegistry

use of com.twosigma.beakerx.autocomplete.AutocompleteRegistry in project beakerx by twosigma.

the class AutocompleteRegistryFactory method createRegistry.

public static AutocompleteRegistry createRegistry(ClasspathScanner cps) {
    AutocompleteRegistry registry = AutocompleteRegistryFactory.create(JavaCompletionTypes.NUM_TYPES);
    for (String pkg : cps.getPackages()) {
        String[] pkgv = pkg.split("\\.");
        AutocompleteCandidate c = new AutocompleteCandidate(JavaCompletionTypes.PACKAGE_NAME, pkgv);
        registry.addCandidate(c);
        List<String> cls = cps.getClasses(pkg);
        if (cls != null && !cls.isEmpty()) {
            c = new AutocompleteCandidate(JavaCompletionTypes.FQ_TYPE, pkgv);
            AutocompleteCandidate l = c;
            while (l.hasChildren()) {
                l = l.getChildrens().get(0);
            }
            for (String cl : cls) {
                l.addChildren(new AutocompleteCandidate(JavaCompletionTypes.FQ_TYPE, cl));
            }
            registry.addCandidate(c);
        }
    }
    return registry;
}
Also used : AutocompleteCandidate(com.twosigma.beakerx.autocomplete.AutocompleteCandidate) AutocompleteRegistry(com.twosigma.beakerx.autocomplete.AutocompleteRegistry)

Example 2 with AutocompleteRegistry

use of com.twosigma.beakerx.autocomplete.AutocompleteRegistry in project beakerx by twosigma.

the class AutocompleteRegistryFactory method create.

private static AutocompleteRegistry create(int num) {
    AutocompleteRegistry registry = new AutocompleteRegistry(num);
    setup(registry);
    return registry;
}
Also used : AutocompleteRegistry(com.twosigma.beakerx.autocomplete.AutocompleteRegistry)

Example 3 with AutocompleteRegistry

use of com.twosigma.beakerx.autocomplete.AutocompleteRegistry in project beakerx by twosigma.

the class AutocompleteRegistryFactory method createRegistry.

public static AutocompleteRegistry createRegistry(GroovyClasspathScanner cps) {
    AutocompleteRegistry registry = AutocompleteRegistryFactory.create(GroovyCompletionTypes.NUM_TYPES);
    for (String pkg : cps.getPackages()) {
        String[] pkgv = pkg.split("\\.");
        AutocompleteCandidate c = new AutocompleteCandidate(GroovyCompletionTypes.PACKAGE_NAME, pkgv);
        registry.addCandidate(c);
        List<String> cls = cps.getClasses(pkg);
        if (cls != null && !cls.isEmpty()) {
            c = new AutocompleteCandidate(GroovyCompletionTypes.FQ_TYPE, pkgv);
            AutocompleteCandidate l = c;
            while (l.hasChildren()) {
                l = l.getChildrens().get(0);
            }
            for (String cl : cls) {
                l.addChildren(new AutocompleteCandidate(GroovyCompletionTypes.FQ_TYPE, cl));
            }
            registry.addCandidate(c);
        }
    }
    return registry;
}
Also used : AutocompleteCandidate(com.twosigma.beakerx.autocomplete.AutocompleteCandidate) AutocompleteRegistry(com.twosigma.beakerx.autocomplete.AutocompleteRegistry)

Example 4 with AutocompleteRegistry

use of com.twosigma.beakerx.autocomplete.AutocompleteRegistry in project beakerx by twosigma.

the class AutocompleteRegistryFactory method create.

private static AutocompleteRegistry create(int num) {
    AutocompleteRegistry registry = new AutocompleteRegistry(num);
    setup(registry);
    return registry;
}
Also used : AutocompleteRegistry(com.twosigma.beakerx.autocomplete.AutocompleteRegistry)

Aggregations

AutocompleteRegistry (com.twosigma.beakerx.autocomplete.AutocompleteRegistry)4 AutocompleteCandidate (com.twosigma.beakerx.autocomplete.AutocompleteCandidate)2