Package qupath.lib.scripting.languages
Class AutoCompletions
java.lang.Object
qupath.lib.scripting.languages.AutoCompletions
Class to deal with script auto-completions.
- Since:
- v0.4.0
- Author:
- Pete Bankhead
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A single completion.static interface
Functional interface to extract a token from a string needed to determine a completion. -
Field Summary
Modifier and TypeFieldDescriptionstatic final AutoCompletions.CompletionTokenizer
A completion tokenizer that extracts a token used to determine Java completions.static final AutoCompletions.CompletionTokenizer
A completion tokenizer that simply takes the first part of the text up to the caret position. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AutoCompletions.Completion
createJavaCompletion
(Class<?> cls) Create a new completion for a class.static AutoCompletions.Completion
createJavaCompletion
(Class<?> declaringClass, Field field) Create a new completion for a field.static AutoCompletions.Completion
createJavaCompletion
(Class<?> declaringClass, Method method) Create a new completion for a method.static AutoCompletions.Completion
createJavaCompletion
(Class<?> declaringClass, String displayText, String completionText) Create a new completion with fixed display and completion text.static Comparator
<AutoCompletions.Completion> Get a comparator to order completions.
-
Field Details
-
SUBSTRING_TOKENIZER
A completion tokenizer that simply takes the first part of the text up to the caret position. -
JAVA_TOKENIZER
A completion tokenizer that extracts a token used to determine Java completions.
-
-
Constructor Details
-
AutoCompletions
public AutoCompletions()
-
-
Method Details
-
getComparator
Get a comparator to order completions.- Returns:
-
createJavaCompletion
public static AutoCompletions.Completion createJavaCompletion(Class<?> declaringClass, String displayText, String completionText) Create a new completion with fixed display and completion text.- Parameters:
declaringClass
- the declaring class; choose null for static importsdisplayText
- the text to displaycompletionText
- the text to use in the completion- Returns:
-
createJavaCompletion
Create a new completion for a class.- Parameters:
cls
- the class to complete- Returns:
-
createJavaCompletion
Create a new completion for a field.- Parameters:
declaringClass
- the parent class; choose null for static importsfield
- the field- Returns:
-
createJavaCompletion
public static AutoCompletions.Completion createJavaCompletion(Class<?> declaringClass, Method method) Create a new completion for a method.- Parameters:
declaringClass
- the parent class; choose null for static importsmethod
- the method- Returns:
-