Skip to content

AutoCompleteSuggestion ​

com.jsmacrosce.jsmacros.client.gui.editor.highlighting.AutoCompleteSuggestion

Describes an editor autocomplete replacement and its dropdown label.

js
const Suggestion = Java.type("com.jsmacrosce.jsmacros.client.gui.editor.highlighting.AutoCompleteSuggestion");  
const item = new Suggestion(0, "Chat.log");

Constructors ​

new AutoCompleteSuggestion ​

new AutoCompleteSuggestion(int startIndex, String suggestion)#
Creates a suggestion whose label is styled from its replacement text.

Parameters:

  • startIndex: zero-based UTF-16 index where replacement begins
  • suggestion: replacement string
new AutoCompleteSuggestion(int startIndex, String suggestion, Component displayText)#
Uses the supplied component as the dropdown label, separately from the replacement string.

Parameters:

  • startIndex: zero-based UTF-16 index where replacement begins
  • suggestion: replacement string
  • displayText: component shown in the dropdown

Fields ​

displayText ​

displayText: Componentread-only#
Component shown as the dropdown label; it need not match suggestion.

startIndex ​

startIndex: intread-only#
Zero-based UTF-16 index where replacement begins; acceptance replaces through the cursor index.

suggestion ​

suggestion: Stringread-only#
String inserted in place of the text from startIndex to the cursor.