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;
}
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;
}
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;
}
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;
}
Aggregations