Class CodeCompletion

java.lang.Object
com.codename1.ui.CodeCompletion

public class CodeCompletion extends Object
A single code completion proposal returned by a CodeCompletionProvider and shown in the CodeEditor completion popup.
  • Constructor Details

    • CodeCompletion

      public CodeCompletion(String text)

      Creates a completion whose displayed and inserted text are identical.

      Parameters
      • text: the text shown in the popup and inserted when chosen
    • CodeCompletion

      public CodeCompletion(String displayText, String insertText)

      Creates a completion with distinct display and insertion text.

      Parameters
      • displayText: the text shown in the completion popup

      • insertText: the text inserted into the editor when this completion is chosen

  • Method Details

    • getDisplayText

      public String getDisplayText()
      The text shown to the user in the completion popup.
    • getInsertText

      public String getInsertText()
      The text inserted into the editor when this completion is accepted.
    • getType

      public String getType()
      An optional category used to badge / icon the entry, e.g. "method", "keyword", "variable", "class", "snippet".
    • setType

      public CodeCompletion setType(String type)

      Sets the completion category. Returns this for chaining.

      Parameters
      • type: the completion category
    • getDetail

      public String getDetail()
      Optional secondary detail (e.g. a method signature or return type) shown alongside the entry.
    • setDetail

      public CodeCompletion setDetail(String detail)

      Sets the optional secondary detail. Returns this for chaining.

      Parameters
      • detail: the detail string