Class DefaultEditorPrompt

java.lang.Object
org.jline.prompt.impl.DefaultPrompt
org.jline.prompt.impl.DefaultEditorPrompt
All Implemented Interfaces:
EditorPrompt, Prompt

public class DefaultEditorPrompt extends DefaultPrompt implements EditorPrompt
Default implementation of EditorPrompt interface.
  • Constructor Details

    • DefaultEditorPrompt

      public DefaultEditorPrompt(String name, String message)
    • DefaultEditorPrompt

      public DefaultEditorPrompt(String name, String message, String initialText)
    • DefaultEditorPrompt

      public DefaultEditorPrompt(String name, String message, String initialText, String fileExtension, String title, boolean showLineNumbers, boolean enableWrapping)
  • Method Details

    • getInitialText

      public String getInitialText()
      Description copied from interface: EditorPrompt
      Get the initial text to populate the editor with.
      Specified by:
      getInitialText in interface EditorPrompt
      Returns:
      the initial text, or null for empty
    • getFileExtension

      public String getFileExtension()
      Description copied from interface: EditorPrompt
      Get the file extension to use for the temporary file. This can affect syntax highlighting in the editor.
      Specified by:
      getFileExtension in interface EditorPrompt
      Returns:
      the file extension (without dot), or null for .txt
    • getTitle

      public String getTitle()
      Description copied from interface: EditorPrompt
      Get the title to display in the editor.
      Specified by:
      getTitle in interface EditorPrompt
      Returns:
      the editor title, or null for default
    • showLineNumbers

      public boolean showLineNumbers()
      Description copied from interface: EditorPrompt
      Whether to show line numbers in the editor.
      Specified by:
      showLineNumbers in interface EditorPrompt
      Returns:
      true to show line numbers, false to hide
    • enableWrapping

      public boolean enableWrapping()
      Description copied from interface: EditorPrompt
      Whether to enable text wrapping in the editor.
      Specified by:
      enableWrapping in interface EditorPrompt
      Returns:
      true to enable wrapping, false to disable