Class EditModeBuilder
java.lang.Object
org.aesh.readline.editing.EditModeBuilder
Builder for creating and configuring EditMode instances with key bindings and variables.
- Author:
- Ståle W. Pedersen
-
Method Summary
Modifier and TypeMethodDescriptionAdds a key binding action to the builder.addVariable(Variable variable, String value) Adds a variable with its value to the builder.static EditModeBuilderbuilder()Creates a new EditModeBuilder instance with default settings.static EditModeBuilderbuilder(EditMode.Mode mode) Creates a new EditModeBuilder instance with the specified editing mode.create()Creates an EditMode instance with all configured actions, variables, and device mappings.Creates a simple EditMode with minimal key bindings (only accept-line).Sets the terminal device for the builder.getVariableValue(Variable variable) Gets the value of a variable.parseInputrc(InputStream inputStream) Parses an inputrc file from the given input stream and applies the settings to this builder.
-
Method Details
-
builder
Creates a new EditModeBuilder instance with default settings.- Returns:
- a new EditModeBuilder instance
-
builder
Creates a new EditModeBuilder instance with the specified editing mode.- Parameters:
mode- the editing mode (EMACS or VI)- Returns:
- a new EditModeBuilder instance configured with the specified mode
-
addAction
Adds a key binding action to the builder.- Parameters:
input- the key input sequenceaction- the action name to bind to the input- Returns:
- this builder instance for method chaining
-
addVariable
Adds a variable with its value to the builder.- Parameters:
variable- the variable to setvalue- the value for the variable- Returns:
- this builder instance for method chaining
-
parseInputrc
Parses an inputrc file from the given input stream and applies the settings to this builder.- Parameters:
inputStream- the input stream containing inputrc configuration- Returns:
- this builder instance for method chaining
-
device
Sets the terminal device for the builder.- Parameters:
device- the terminal device- Returns:
- this builder instance for method chaining
-
getVariableValue
-
createSimple
Creates a simple EditMode with minimal key bindings (only accept-line).- Returns:
- a simple EditMode instance
-
create
Creates an EditMode instance with all configured actions, variables, and device mappings.- Returns:
- a fully configured EditMode instance (either Emacs or Vi based on the editing-mode variable)
-