src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/completer/StringsCompleter.java
equal
deleted
inserted
replaced
2 * Copyright (c) 2002-2016, the original author or authors. |
2 * Copyright (c) 2002-2016, the original author or authors. |
3 * |
3 * |
4 * This software is distributable under the BSD license. See the terms of the |
4 * This software is distributable under the BSD license. See the terms of the |
5 * BSD license in the documentation provided with this software. |
5 * BSD license in the documentation provided with this software. |
6 * |
6 * |
7 * http://www.opensource.org/licenses/bsd-license.php |
7 * https://opensource.org/licenses/BSD-3-Clause |
8 */ |
8 */ |
9 package jdk.internal.org.jline.reader.impl.completer; |
9 package jdk.internal.org.jline.reader.impl.completer; |
10 |
10 |
11 import java.util.ArrayList; |
11 import java.util.ArrayList; |
12 import java.util.Arrays; |
12 import java.util.Arrays; |
41 for (String string : strings) { |
41 for (String string : strings) { |
42 candidates.add(new Candidate(AttributedString.stripAnsi(string), string, null, null, null, null, true)); |
42 candidates.add(new Candidate(AttributedString.stripAnsi(string), string, null, null, null, null, true)); |
43 } |
43 } |
44 } |
44 } |
45 |
45 |
|
46 public StringsCompleter(Candidate ... candidates) { |
|
47 assert candidates != null; |
|
48 this.candidates.addAll(Arrays.asList(candidates)); |
|
49 } |
|
50 |
46 public void complete(LineReader reader, final ParsedLine commandLine, final List<Candidate> candidates) { |
51 public void complete(LineReader reader, final ParsedLine commandLine, final List<Candidate> candidates) { |
47 assert commandLine != null; |
52 assert commandLine != null; |
48 assert candidates != null; |
53 assert candidates != null; |
49 candidates.addAll(this.candidates); |
54 candidates.addAll(this.candidates); |
50 } |
55 } |