|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsidekick.SideKickParser
public abstract class SideKickParser
An abstract base class for plugin-provided parser implementations.
Plugins can provide SideKick parsers by defining entries in their
services.xml
files like so:
<SERVICE CLASS="sidekick.SideKickParser" NAME="name"> new MyParser(); </SERVICE>See
org.gjt.sp.jedit.ServiceManager
for details.
Note that each SideKickParser
subclass has a name which is
used to key a property sidekick.parser.name.label
.
To associate a parser with some edit modes, define properties like this:
mode.scheme.sidekick.parser=lisp mode.lisp.sidekick.parser=lisp
Field Summary | |
---|---|
protected java.lang.String |
name
|
static java.lang.String |
SERVICE
|
Constructor Summary | |
---|---|
SideKickParser(java.lang.String serviceName)
The parser constructor. |
Method Summary | |
---|---|
void |
activate(org.gjt.sp.jedit.EditPane editPane)
This method is called when a buffer using this parser is selected in the specified view. |
void |
activate(org.gjt.sp.jedit.View view)
Deprecated. Use the form taking an EditPane instead. |
boolean |
canCompleteAnywhere()
Returns if completion popups should be shown after any period of inactivity. |
boolean |
canHandleBackspace()
Returns true if the parser can handle the backspace key being typed when the completion popup is open, else false if not. |
SideKickCompletion |
complete(org.gjt.sp.jedit.EditPane editPane,
int caret)
Returns completions suitable for insertion at the specified position. |
void |
deactivate(org.gjt.sp.jedit.EditPane editPane)
This method is called when a buffer using this parser is no longer selected in the specified view. |
void |
deactivate(org.gjt.sp.jedit.View view)
Deprecated. Use the form taking an EditPane instead. |
java.lang.String |
getInstantCompletionTriggers()
Returns a list of characters which trigger completion immediately. |
java.lang.String |
getName()
Returns the parser's name. |
javax.swing.JPanel |
getPanel()
Returns a parser-specific panel that will be shown in the SideKick dockable window just below the SideKick toolbar. |
java.lang.String |
getParseTriggers()
Returns a list of characters which trigger a buffer re-parse. |
abstract SideKickParsedData |
parse(org.gjt.sp.jedit.Buffer buffer,
errorlist.DefaultErrorSource errorSource)
Parses the given text and returns a tree model. |
void |
stop()
Stops the parse request currently in progress. |
boolean |
supportsCompletion()
Returns if the parser supports code completion. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SERVICE
protected java.lang.String name
Constructor Detail |
---|
public SideKickParser(java.lang.String serviceName)
Method Detail |
---|
public final java.lang.String getName()
public void stop()
public void activate(org.gjt.sp.jedit.View view)
EditPane
instead.
view
- The viewpublic void deactivate(org.gjt.sp.jedit.View view)
EditPane
instead.
view
- The viewpublic void activate(org.gjt.sp.jedit.EditPane editPane)
editPane
- The edit panepublic void deactivate(org.gjt.sp.jedit.EditPane editPane)
editPane
- The edit panepublic abstract SideKickParsedData parse(org.gjt.sp.jedit.Buffer buffer, errorlist.DefaultErrorSource errorSource)
buffer
- The buffer to parse.errorSource
- An error source to add errors to.
SideKickParsedData
class.public boolean supportsCompletion()
public boolean canHandleBackspace()
Returns true if the parser can handle the backspace key being typed when the completion popup is open, else false if not.
If false, the completion popup is closed when backspace is typed.
If true, the
SideKickCompletion.handleKeystroke(int, char)
method must be overidden to handle receiving
the backspace character, '\b', as a value
for the keyChar parameter.
Returns false by default.
public boolean canCompleteAnywhere()
public java.lang.String getInstantCompletionTriggers()
public java.lang.String getParseTriggers()
public SideKickCompletion complete(org.gjt.sp.jedit.EditPane editPane, int caret)
editPane
- The edit pane involved.caret
- The caret position.public javax.swing.JPanel getPanel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |