public class SettingsImpl extends Object implements Settings
Modifier | Constructor and Description |
---|---|
protected |
SettingsImpl() |
protected |
SettingsImpl(Settings baseSettings) |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
doExportUsesSystemEnvironment()
Is load environment system?
|
boolean |
doPersistAlias()
Is alias persisted
|
boolean |
doPersistExport()
Is aesh persisting variables at shutdown
|
boolean |
doReadInputrc()
Should we read config from inputrc
Set to true by default
|
void |
enableOperatorParser(boolean enable) |
AeshContext |
getAeshContext()
Get aesh context
|
File |
getAliasFile()
Location of alias file
|
String |
getBellStyle()
By default, bell style is noisy
NOTE: Not implemented yet
|
EditMode |
getEditMode()
Get EditMode based on os and mode
|
String |
getExecuteAtStart() |
Resource |
getExecuteFileAtStart() |
File |
getExportFile()
Get the export file
Defaults to ~/.aesh_export
|
File |
getHistoryFile()
If not set the history file will be:
$HOME/.aesh_history
|
FileAccessPermission |
getHistoryFilePermission()
Get history file access permission, this is used when write to history file.
|
int |
getHistorySize()
By default history size is 500
If its set to -1 the size is unlimited (Integer.MAX_VALUE)
|
File |
getInputrc()
Get the inputrc file, if not set it defaults to:
System.getProperty("user.home")+Config.getPathSeparator()+".inputrc"
|
InputStream |
getInputStream()
If not set, System.in will be used
|
InterruptHook |
getInterruptHook()
Get interrupt hook
|
String |
getLogFile()
Get log file
|
Mode |
getMode()
Either Emacs or Vi mode.
|
String |
getName()
Get the name of the cli
|
KeyOperationManager |
getOperationManager()
Get KeyOperationManager
|
QuitHandler |
getQuitHandler()
Get quit handler
|
Resource |
getResource() |
PrintStream |
getStdErr()
If not set System.out is used
|
PrintStream |
getStdOut()
If not set System.out is used
|
Terminal |
getTerminal()
Use the specified terminal implementation
If not set, aesh will try to use the best suited one
|
boolean |
hasInterruptHook()
Is an interrupt hook defined
|
boolean |
isAliasEnabled()
Is alias enabled
|
boolean |
isAnsiConsole()
If the current console is an ANSI console
|
boolean |
isCompletionDisabled()
Is completion disabled?
Set to false by default
|
boolean |
isExportEnabled()
Are export enabled?
|
boolean |
isHistoryDisabled()
Is history disabled
Set to true to disable history
|
boolean |
isHistoryPersistent()
Is the history list persisted to file.
|
boolean |
isLogging()
Are we logging?
|
boolean |
isManEnabled()
Is the man command enabled (currently only for AeshConsole)
|
boolean |
isOperatorParserEnabled()
Is operator parser enabled
|
void |
resetEditMode()
Reset edit mode
|
void |
resetToDefaults() |
void |
setAeshContext(AeshContext aeshContext) |
void |
setAliasEnabled(boolean enabled) |
void |
setAliasFile(File file) |
void |
setAnsiConsole(boolean ansiConsole)
Possible to override the type of console
|
void |
setBellStyle(String bellStyle) |
void |
setDisableCompletion(boolean disableCompletion)
Set to true do disable completion
Set to false by default
|
void |
setExecuteAtStart(String execute) |
void |
setExecuteFileAtStart(Resource executeFileAtStart) |
void |
setExportEnabled(boolean exportEnabled) |
void |
setExportFile(File exportFile) |
void |
setExportUsesSystemEnvironment(boolean isLoad)
Aesh load environment system.
|
void |
setHistoryDisabled(boolean historyDisabled)
Is history disabled
Set to true to disable history
|
void |
setHistoryFile(File historyFile) |
void |
setHistoryFilePermission(FileAccessPermission historyFilePermission) |
void |
setHistoryPersistent(boolean historyPersistent)
Is the history list persisted to file.
|
void |
setHistorySize(int historySize)
By default history size is 500
If its set to -1 the size is unlimited (Integer.MAX_VALUE)
|
void |
setInputrc(File inputrc) |
void |
setInputStream(InputStream inputStream)
Set where input is coming from
|
void |
setInterruptHook(InterruptHook hook) |
void |
setLogFile(String logFile)
Specify a log file
|
void |
setLogging(boolean logging)
Set logging, by default set to true
|
void |
setManEnabled(boolean enabled) |
void |
setMode(Mode editMode) |
void |
setName(String name)
Set the name of the cli
|
void |
setPersistAlias(boolean persist) |
void |
setPersistExport(boolean persistExport)
Should aesh persist export variables at shutdown
|
void |
setQuitHandler(QuitHandler qh) |
void |
setReadInputrc(boolean readInputrc)
Specify if we should read config from inputrc
Set to true by default
|
void |
setResource(Resource resource)
Specify
|
void |
setStdErr(PrintStream stdErr)
Set where output should go to
|
void |
setStdOut(PrintStream stdOut)
Set where output should go to
|
void |
setTerminal(Terminal terminal)
Specify which terminal impl to use
|
void |
switchMode()
Switch from Emacs to Vi mode (or back)
|
protected SettingsImpl()
protected SettingsImpl(Settings baseSettings)
public void resetToDefaults()
public void setName(String name)
name
- namepublic String getName()
public Mode getMode()
public void setMode(Mode editMode)
public EditMode getEditMode()
getEditMode
in interface Settings
public void resetEditMode()
Settings
resetEditMode
in interface Settings
public KeyOperationManager getOperationManager()
Settings
getOperationManager
in interface Settings
public FileAccessPermission getHistoryFilePermission()
Settings
null
means default file permission revealed by system.getHistoryFilePermission
in interface Settings
public void setHistoryFilePermission(FileAccessPermission historyFilePermission)
historyFilePermission
- the historyFilePermission to setpublic File getHistoryFile()
getHistoryFile
in interface Settings
public void setHistoryFile(File historyFile)
public int getHistorySize()
getHistorySize
in interface Settings
public void setHistorySize(int historySize)
historySize
- sizepublic String getBellStyle()
getBellStyle
in interface Settings
public void setBellStyle(String bellStyle)
public boolean isAnsiConsole()
Settings
isAnsiConsole
in interface Settings
public void setAnsiConsole(boolean ansiConsole)
ansiConsole
- is it an ansi compatible console?public InputStream getInputStream()
getInputStream
in interface Settings
public void setInputStream(InputStream inputStream)
inputStream
- inputpublic PrintStream getStdOut()
public void setStdOut(PrintStream stdOut)
stdOut
- outputpublic PrintStream getStdErr()
public void setStdErr(PrintStream stdErr)
stdErr
- outputpublic Terminal getTerminal()
getTerminal
in interface Settings
public void setTerminal(Terminal terminal)
terminal
- termpublic File getInputrc()
getInputrc
in interface Settings
public void setInputrc(File inputrc)
public boolean isLogging()
public void setLogging(boolean logging)
logging
- do logpublic boolean isCompletionDisabled()
isCompletionDisabled
in interface Settings
public void setDisableCompletion(boolean disableCompletion)
disableCompletion
- dispublic String getLogFile()
getLogFile
in interface Settings
public void setLogFile(String logFile)
logFile
- filepublic boolean doReadInputrc()
doReadInputrc
in interface Settings
public void setReadInputrc(boolean readInputrc)
readInputrc
- specifypublic boolean isHistoryDisabled()
isHistoryDisabled
in interface Settings
public void setHistoryDisabled(boolean historyDisabled)
historyDisabled
- historypublic boolean isHistoryPersistent()
isHistoryPersistent
in interface Settings
public void setHistoryPersistent(boolean historyPersistent)
historyPersistent
- historypublic void setAliasFile(File file)
public File getAliasFile()
Settings
getAliasFile
in interface Settings
public boolean isAliasEnabled()
Settings
isAliasEnabled
in interface Settings
public void setAliasEnabled(boolean enabled)
public void setPersistAlias(boolean persist)
public boolean doPersistAlias()
Settings
doPersistAlias
in interface Settings
public void setQuitHandler(QuitHandler qh)
public QuitHandler getQuitHandler()
Settings
getQuitHandler
in interface Settings
public void setInterruptHook(InterruptHook hook)
public boolean hasInterruptHook()
Settings
hasInterruptHook
in interface Settings
public InterruptHook getInterruptHook()
Settings
getInterruptHook
in interface Settings
public void enableOperatorParser(boolean enable)
public boolean isOperatorParserEnabled()
Settings
isOperatorParserEnabled
in interface Settings
public void switchMode()
Settings
switchMode
in interface Settings
public boolean isManEnabled()
Settings
isManEnabled
in interface Settings
public void setManEnabled(boolean enabled)
public AeshContext getAeshContext()
Settings
getAeshContext
in interface Settings
public void setAeshContext(AeshContext aeshContext)
public File getExportFile()
Settings
getExportFile
in interface Settings
public void setExportFile(File exportFile)
public boolean isExportEnabled()
Settings
isExportEnabled
in interface Settings
public void setExportEnabled(boolean exportEnabled)
public void setPersistExport(boolean persistExport)
Settings
setPersistExport
in interface Settings
public boolean doPersistExport()
Settings
doPersistExport
in interface Settings
public void setExportUsesSystemEnvironment(boolean isLoad)
Settings
setExportUsesSystemEnvironment
in interface Settings
public boolean doExportUsesSystemEnvironment()
Settings
doExportUsesSystemEnvironment
in interface Settings
public void setResource(Resource resource)
Settings
setResource
in interface Settings
public void setExecuteAtStart(String execute)
setExecuteAtStart
in interface Settings
execute
- specify a string that will be pushed to the input stream at startpublic String getExecuteAtStart()
getExecuteAtStart
in interface Settings
public void setExecuteFileAtStart(Resource executeFileAtStart)
setExecuteFileAtStart
in interface Settings
executeFileAtStart
- file that will be read, parsed and executed at startpublic Resource getExecuteFileAtStart()
getExecuteFileAtStart
in interface Settings
public Resource getResource()
getResource
in interface Settings
Copyright © 2021 JBoss by Red Hat. All rights reserved.