|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jakubholy.jedit.autocomplete.PreferencesManager
public class PreferencesManager
Makes user settings available for other classes so that they don't need to deal with properties directly, calling PreferencesManager's methods instead.
An instance of this class keeps values of the various settings and makes them
availabe through getter methods. The settings are also stored as jEdit
properties (see jEdit.setProperty(java.lang.String, java.lang.String)
). To change a setting, modify the
appropriate jEdit property and call aPreferencesManager.optionsChanged()
.
Most settings can be changed via the menu Plugins > Plugins Options... >
TextAutocomplete. See TextAutocompletePane
.
Field Summary | |
---|---|
protected WordTypedListener.Filter |
isWordFilter
Used to check whether an insertion appended to a word is still a word. |
Method Summary | |
---|---|
java.net.URL |
getDefaultWordListForBuffer(java.lang.String bufferName,
boolean onlyIfExists)
Return a list of default words for a newly opened buffer of the given name if there is any. |
java.lang.String |
getFilenameFilter()
Returns the filename filter registered for inclusion or exclusion from auto completion. |
java.util.regex.Pattern |
getFilenameFilterPattern()
Returns the filename filter pattern. |
WordTypedListener.Filter |
getIsWordFilter()
Checker that determines what is a word separator and what is not. |
int |
getLogLevel()
True if the autocompletion should be started automatically for new buffers. |
int |
getMaxCountOfWords()
The maximal number of words that we do remeber for a given buffer. |
java.lang.String |
getNoWordSeparators()
Characters that do not end word such as '@' or '_' in PHP. |
static PreferencesManager |
getPreferencesManager()
Create a new Pref.Manager or return the existing one if exists. |
int |
getSelectionByNumberModifier()
Returns the mask for the special key that must be pressed together with a number N to select the Nth completion in the popup. |
boolean |
isAcceptKey(java.awt.event.KeyEvent evt)
Return true for keys used to accept a selected completition. |
boolean |
isDisposeKey(java.awt.event.KeyEvent evt)
Return true for keys used to dispose (hide) the popup window. |
boolean |
isExclusionFilter()
Returns whether filenames matching the filename filter should be excluded. |
boolean |
isInclusionFilter()
Returns whether filenames matching the filename filter should be included. |
boolean |
isLoadMainModeOnly()
When loading keywords associated with the buffer's edit mode, shall we load only those from the default mode? E.g. |
boolean |
isLoadModeKeywords()
True if keywords from the buffer's edit mode shall be loaded upon start. |
boolean |
isSelectionByNumberEnabled()
Do we allow to select an entry in the completion popup by typing its number? |
boolean |
isSelectionDownKey(java.awt.event.KeyEvent evt)
Return true for keys used to move down in the popup list of completitions. |
boolean |
isSelectionUpKey(java.awt.event.KeyEvent evt)
Return true for keys used to move up in the popup list of completitions. |
boolean |
isStartForBuffers()
True if the autocompletion should be started automatically for new buffers. |
boolean |
isWordToRemember(java.lang.String word)
Return true if the word shall be rememberd i.e. |
int |
minPrefixLength()
Return the minimal length the word being typed must have for the list of completions to be displayed. |
void |
optionsChanged()
Called to notify the PreferencesManager that preferences have changed. |
static java.lang.String |
sanitizeCode(java.lang.String code)
Make sure that the code ends with ';' i.e. |
void |
setBooleanProperty(java.lang.String name,
boolean value)
Set the boolean jEdit property named TextAutocompletePlugin.PROPS_PREFIX + 'name'
to the value 'value'. |
void |
setIntegerProperty(java.lang.String name,
int value)
Set the int jEdit property named TextAutocompletePlugin.PROPS_PREFIX + 'name'
to the value 'value'. |
void |
setNoWordSeparators(java.lang.String noWordSeparators)
Characters that do not end word such as '@' or '_' in PHP. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Set the String jEdit property named TextAutocompletePlugin.PROPS_PREFIX + 'name'
to the value 'value'. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final WordTypedListener.Filter isWordFilter
Method Detail |
---|
public static PreferencesManager getPreferencesManager()
public void optionsChanged()
public WordTypedListener.Filter getIsWordFilter()
public int minPrefixLength()
public boolean isAcceptKey(java.awt.event.KeyEvent evt)
public boolean isDisposeKey(java.awt.event.KeyEvent evt)
public boolean isSelectionUpKey(java.awt.event.KeyEvent evt)
public boolean isSelectionDownKey(java.awt.event.KeyEvent evt)
public boolean isWordToRemember(java.lang.String word)
public int getMaxCountOfWords()
public boolean isStartForBuffers()
public boolean isLoadMainModeOnly()
isLoadModeKeywords()
public boolean isLoadModeKeywords()
public java.util.regex.Pattern getFilenameFilterPattern()
public java.lang.String getFilenameFilter()
public boolean isInclusionFilter()
public boolean isExclusionFilter()
public int getLogLevel()
public boolean isSelectionByNumberEnabled()
Returnes true by default. The corrseponding property is
TextAutocompletePlugin.PROPS_PREFIX
+ "isSelectionByNumberEnabled".
public int getSelectionByNumberModifier()
The corresponding property is TextAutocompletePlugin.PROPS_PREFIX
+ 'selectionByNumberModifierMask'.
Valid values: InputEvent.CTRL_MASK, InputEvent.ALT_MASK, InputEvent.ALT_GRAPH_MASK.
InputEvent
such as
InputEvent.CTRL_DOWN_MASK
.public void setProperty(java.lang.String name, java.lang.String value)
TextAutocompletePlugin.PROPS_PREFIX
+ 'name'
to the value 'value'.
public void setBooleanProperty(java.lang.String name, boolean value)
TextAutocompletePlugin.PROPS_PREFIX
+ 'name'
to the value 'value'.
public void setIntegerProperty(java.lang.String name, int value)
TextAutocompletePlugin.PROPS_PREFIX
+ 'name'
to the value 'value'.
public static java.lang.String sanitizeCode(java.lang.String code)
public java.net.URL getDefaultWordListForBuffer(java.lang.String bufferName, boolean onlyIfExists)
AutoComplete.importWordList()
.
This method shall be called when AutoCompletion is started for a new buffer and perhaps also when the buffer name changes (e.g. after the change from 'Untitled-1' to 'SourceCode.java' we will want to load default words for Java files).
bufferName
- (required) a name of the buffer that AutoComplete has
just been started for; examples: 'SourceCode.java', 'Untitled-1'.
It's used to find a suitable word list, usually based on the file
name extension. To get the default, not buffer-specific word list you can pass
an empty string ("") as the buffer name.onlyIfExists
- (required) If false then the word list file path is
returned even if the file doesn't currently exist othewrise null is
returned if the file doesn't exist
AutoComplete.importWordList()
or null if there're no defaults.
Beware that the URL may point to a non-existing file.public java.lang.String getNoWordSeparators()
public void setNoWordSeparators(java.lang.String noWordSeparators)
noWordSeparators
- (required) ex.: "_@-"
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |