public CommandsCompleter() { this(CommandSessionHolder.getSession()); }
public CommandNamesCompleter() { this(CommandSessionHolder.getSession()); }
public int complete(String buffer, int cursor, List<String> candidates) { if (session == null) { session = CommandSessionHolder.getSession(); } checkData(); int res = new StringsCompleter(commands).complete(buffer, cursor, candidates); Collections.sort(candidates); return res; }
@SuppressWarnings("rawtypes") public int complete(final String buffer, final int cursor, final List candidates) { CommandSession session = CommandSessionHolder.getSession(); if (session != null) { String pid = getPid(session); Set<String> propertyNames = getPropertyNames(pid); delegate.getStrings().clear(); if (propertyNames != null && !propertyNames.isEmpty()) { delegate.getStrings().addAll(propertyNames); } } return delegate.complete(buffer,cursor,candidates); }
@Override public int complete(String buffer, int cursor, List<String> candidates) { CommandSession commandSession = CommandSessionHolder.getSession(); ArgumentCompleter.ArgumentList list = (ArgumentCompleter.ArgumentList) commandSession.get(ArgumentCompleter.ARGUMENTS_LIST); delegate.getStrings().clear(); if (list != null) { String contextName = extractContextName(list.getArguments()); String providerOrApi = extractProviderOrApiFromArguments(list.getArguments()); Collection<String> values; if (contextName != null && cache.containsKey(contextName)) { values = cache.get(contextName); } else if (providerOrApi != null && cache.containsKey(providerOrApi)) { values = cache.get(providerOrApi); } else { values = cache.values(); } for (String item : values) { if (buffer == null || item.startsWith(buffer)) { delegate.getStrings().add(item); } } } return delegate.complete(buffer, cursor, candidates); }
public int complete(String buffer, int cursor, List<String> candidates) { if (session == null) { session = CommandSessionHolder.getSession();
CommandSession commandSession = CommandSessionHolder.getSession(); if(commandSession != null) { commandSession.put(ARGUMENTS_LIST,list);
CommandSession commandSession = CommandSessionHolder.getSession(); if(commandSession != null) { commandSession.put(ARGUMENTS_LIST,list);
CommandSession commandSession = CommandSessionHolder.getSession(); if(commandSession != null) { commandSession.put(ARGUMENTS_LIST,list);
CommandSession commandSession = CommandSessionHolder.getSession(); if(commandSession != null) { commandSession.put(ARGUMENTS_LIST,list);