public void complete(final Completer completer, final String buffer, final int cursor) { assert completer != null; this.cursor = completer.complete(buffer, cursor, candidates); } }
protected boolean verifyCompleter(Completer completer, String argument) { List<String> candidates = new ArrayList<>(); return completer.complete(argument, argument.length(), candidates) != -1 && !candidates.isEmpty(); }
protected boolean verifyCompleter(Completer completer, String argument) { List<String> candidates = new ArrayList<>(); return completer.complete(argument, argument.length(), candidates) != -1 && !candidates.isEmpty(); }
protected boolean verifyCompleter(Completer completer, String argument) { List<String> candidates = new ArrayList<>(); return completer.complete(argument, argument.length(), candidates) != -1 && !candidates.isEmpty(); }
protected boolean verifyCompleter(Completer completer, String argument) { List<String> candidates = new ArrayList<>(); return completer.complete(argument, argument.length(), candidates) != -1 && !candidates.isEmpty(); }
@Override public int complete(String buffer, int cursor, List<String> candidates) { ServiceReference<? extends Completer> ref = context.getServiceReference(clazz); if (ref != null) { Completer completer = context.getService(ref); if (completer != null) { try { return completer.complete(buffer, cursor, candidates); } finally { context.ungetService(ref); } } } return -1; } }
@Override public int complete(String buffer, int cursor, List<String> candidates) { ServiceReference<? extends Completer> ref = context.getServiceReference(clazz); if (ref != null) { Completer completer = context.getService(ref); if (completer != null) { try { return completer.complete(buffer, cursor, candidates); } finally { context.ungetService(ref); } } } return -1; } }
@Override public int complete(String buffer, int cursor, List<String> candidates) { if (buffer == null || !buffer.contains(delimeter)) { return delegate.complete(buffer, cursor, candidates); } else { int pivot = buffer.lastIndexOf(",") + 1; int result = delegate.complete(buffer.substring(pivot), cursor, candidates); List<String> updatedCandidates = new LinkedList<String>(); for (String candidate:candidates) { candidate = buffer.substring(0, pivot) + candidate; updatedCandidates.add(candidate); } candidates.clear(); for (String candidate:updatedCandidates) { candidates.add(candidate); } return result; } }
@Override public int complete(String buffer, int cursor, List<String> candidates) { if (buffer == null || !buffer.contains(delimeter)) { return delegate.complete(buffer, cursor, candidates); } else { int pivot = buffer.lastIndexOf(",") + 1; int result = delegate.complete(buffer.substring(pivot), cursor, candidates); List<String> updatedCandidates = new LinkedList<String>(); for (String candidate:candidates) { candidate = buffer.substring(0, pivot) + candidate; updatedCandidates.add(candidate); } candidates.clear(); for (String candidate:updatedCandidates) { candidates.add(candidate); } return result; } }
int ret = comp.complete(list.getCursorArgument(), argpos, candidates);
int ret = comp.complete(list.getCursorArgument(), argpos, candidates);
int ret = comp.complete(list.getCursorArgument(), argpos, candidates);
int ret = comp.complete(list.getCursorArgument(), argpos, candidates);