sidekick

Class SideKickParser

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected java.lang.String name 
      static java.lang.String SERVICE 
    • Constructor Summary

      Constructors 
      Constructor and Description
      SideKickParser(java.lang.String serviceName)
      The parser constructor.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      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.
      SideKickCompletionPopup getCompletionPopup(org.gjt.sp.jedit.View view, int caretPosition, SideKickCompletion complete, boolean active) 
      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

      • name

        protected java.lang.String name
    • Constructor Detail

      • SideKickParser

        public SideKickParser(java.lang.String serviceName)
        The parser constructor.
    • Method Detail

      • getName

        public final java.lang.String getName()
        Returns the parser's name.
      • stop

        public void stop()
        Stops the parse request currently in progress. It is up to the parser to implement this.
        Since:
        SideKick 0.3
      • activate

        public void activate(org.gjt.sp.jedit.View view)
        Deprecated. Use the form taking an EditPane instead.
        This method is called when a buffer using this parser is selected in the specified view.
        Parameters:
        view - The view
        Since:
        SideKick 0.2
      • deactivate

        public void deactivate(org.gjt.sp.jedit.View view)
        Deprecated. Use the form taking an EditPane instead.
        This method is called when a buffer using this parser is no longer selected in the specified view.
        Parameters:
        view - The view
        Since:
        SideKick 0.2
      • activate

        public void activate(org.gjt.sp.jedit.EditPane editPane)
        This method is called when a buffer using this parser is selected in the specified view.
        Parameters:
        editPane - The edit pane
        Since:
        SideKick 0.3.1
      • deactivate

        public 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.
        Parameters:
        editPane - The edit pane
        Since:
        SideKick 0.3.1
      • parse

        public abstract SideKickParsedData parse(org.gjt.sp.jedit.Buffer buffer,
                               errorlist.DefaultErrorSource errorSource)
        Parses the given text and returns a tree model.
        Parameters:
        buffer - The buffer to parse.
        errorSource - An error source to add errors to.
        Returns:
        A new instance of the SideKickParsedData class.
      • supportsCompletion

        public boolean supportsCompletion()
        Returns if the parser supports code completion. Returns false by default.
      • canHandleBackspace

        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.

        Since:
        SideKick 0.3.4
      • canCompleteAnywhere

        public boolean canCompleteAnywhere()
        Returns if completion popups should be shown after any period of inactivity. Otherwise, they are only shown if explicitly requested by the user. Returns true by default.
      • getInstantCompletionTriggers

        public java.lang.String getInstantCompletionTriggers()
        Returns a list of characters which trigger completion immediately. Returns null by default.
      • getParseTriggers

        public java.lang.String getParseTriggers()
        Returns a list of characters which trigger a buffer re-parse. Returns null by default.
        Since:
        SideKick 0.3
      • complete

        public SideKickCompletion complete(org.gjt.sp.jedit.EditPane editPane,
                                  int caret)
        Returns completions suitable for insertion at the specified position. Returns null by default.
        Parameters:
        editPane - The edit pane involved.
        caret - The caret position.
      • getPanel

        public javax.swing.JPanel getPanel()
        Returns a parser-specific panel that will be shown in the SideKick dockable window just below the SideKick toolbar. This panel is meant to be a toolbar, but can be another UI element if needed. Returns null by default.
        Since:
        SideKick 0.7.4