net.jakubholy.jedit.autocomplete
Class WordTypedListener
java.lang.Object
org.gjt.sp.jedit.buffer.BufferAdapter
net.jakubholy.jedit.autocomplete.WordTypedListener
- All Implemented Interfaces:
- org.gjt.sp.jedit.buffer.BufferListener
public class WordTypedListener
- extends org.gjt.sp.jedit.buffer.BufferAdapter
Listens for word being inserted or removed into/from a buffer to know when a
whole word has been typed & notifies its observers.
What is a word is detemined by the method accept of the call-back object
checkIsWord. Replace it by another one to change what characters are treated
as a part of a word (e.g. accept '_' too as a part of a word). By default,
only letters are considered to belong to a word.
It is observable and fires the events AT_START, INSIDE, AT_END, RESET and
TRUNCATED when a word is inserted/ removed, see
WordTypedEvent
. Notice that it
fires an event not only when a word has been finished but whenever the word
of the buffer changes.
- See Also:
WordTypedEvent
,
BufferAdapter
,
Note: according to the documentation of jEdit it's prefered to use
BufferAdapter since BufferListener might change in the future.
Field Summary |
int |
logLevel
How much logging shall be printed to jEdit's log. |
Methods inherited from class org.gjt.sp.jedit.buffer.BufferAdapter |
bufferLoaded, foldHandlerChanged, foldLevelChanged, preContentInserted, preContentRemoved, transactionComplete |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logLevel
public int logLevel
- How much logging shall be printed to jEdit's log.
WordTypedListener
public WordTypedListener()
contentInserted
public void contentInserted(org.gjt.sp.jedit.buffer.JEditBuffer buffer,
int startLine,
int offset,
int numLines,
int length)
- Specified by:
contentInserted
in interface org.gjt.sp.jedit.buffer.BufferListener
- Overrides:
contentInserted
in class org.gjt.sp.jedit.buffer.BufferAdapter
contentRemoved
public void contentRemoved(org.gjt.sp.jedit.buffer.JEditBuffer buffer,
int startLine,
int offset,
int numLines,
int length)
- Specified by:
contentRemoved
in interface org.gjt.sp.jedit.buffer.BufferListener
- Overrides:
contentRemoved
in class org.gjt.sp.jedit.buffer.BufferAdapter
addObserver
public void addObserver(java.util.Observer o)
deleteObserver
public void deleteObserver(java.util.Observer o)
getCheckIsWord
public WordTypedListener.Filter getCheckIsWord()
- Returns:
- Returns the checkIsWord Filter
setCheckIsWord
public void setCheckIsWord(WordTypedListener.Filter checkIsWord)
- Parameters:
checkIsWord
- The checkIsWord Filer to set.- See Also:
WordTypedListener.Filter