Class PhpCompletionProvider

  • All Implemented Interfaces:
    org.fife.ui.autocomplete.CompletionProvider

    public class PhpCompletionProvider
    extends HtmlCompletionProvider
    Completion provider for PHP.
    Version:
    1.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.fife.ui.autocomplete.AbstractCompletionProvider

        org.fife.ui.autocomplete.AbstractCompletionProvider.CaseInsensitiveComparator
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int EVERYTHING_HERE_AND_BELOW_IS_PHP  
      private boolean phpCompletion
      Whether getAlreadyEnteredText(JTextComponent) determined the caret to be in a location where PHP completions were required (as opposed to HTML completions).
      private java.util.List<org.fife.ui.autocomplete.Completion> phpCompletions
      PHP function completions.
      • Fields inherited from class org.fife.ui.autocomplete.DefaultCompletionProvider

        seg
      • Fields inherited from class org.fife.ui.autocomplete.AbstractCompletionProvider

        comparator, completions
      • Fields inherited from class org.fife.ui.autocomplete.CompletionProviderBase

        EMPTY_STRING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAlreadyEnteredText​(javax.swing.text.JTextComponent comp)
      protected java.util.List<org.fife.ui.autocomplete.Completion> getCompletionsImpl​(javax.swing.text.JTextComponent comp)
      private boolean inPhpBlock​(javax.swing.text.JTextComponent comp)
      Returns whether the caret is inside a PHP block in this text component.
      boolean isAutoActivateOkay​(javax.swing.text.JTextComponent tc)
      Overridden to properly handle both HTML markup and PHP code.
      void loadPhpCompletionsFromXML​(java.io.InputStream in)
      Loads completions from an XML input stream.
      • Methods inherited from class org.fife.ui.autocomplete.DefaultCompletionProvider

        getCompletionsAt, getParameterizedCompletions, init, isValidChar, loadFromXML, loadFromXML, loadFromXML, loadFromXML
      • Methods inherited from class org.fife.ui.autocomplete.AbstractCompletionProvider

        addCompletion, addCompletions, addWordCompletions, checkProviderAndAdd, clear, getCompletionByInputText, removeCompletion
      • Methods inherited from class org.fife.ui.autocomplete.CompletionProviderBase

        clearParameterizedCompletionParams, getCompletions, getListCellRenderer, getParameterChoicesProvider, getParameterListEnd, getParameterListSeparator, getParameterListStart, getParent, setAutoActivationRules, setListCellRenderer, setParameterChoicesProvider, setParameterizedCompletionParams, setParent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • phpCompletion

        private boolean phpCompletion
        Whether getAlreadyEnteredText(JTextComponent) determined the caret to be in a location where PHP completions were required (as opposed to HTML completions).
      • phpCompletions

        private java.util.List<org.fife.ui.autocomplete.Completion> phpCompletions
        PHP function completions.
      • EVERYTHING_HERE_AND_BELOW_IS_PHP

        private static final int EVERYTHING_HERE_AND_BELOW_IS_PHP
        See Also:
        Constant Field Values
    • Constructor Detail

      • PhpCompletionProvider

        public PhpCompletionProvider()
    • Method Detail

      • loadPhpCompletionsFromXML

        public void loadPhpCompletionsFromXML​(java.io.InputStream in)
                                       throws java.io.IOException
        Loads completions from an XML input stream. The XML should validate against the completion DTD found in the AutoComplete library.
        Parameters:
        in - The input stream to read from.
        Throws:
        java.io.IOException - If an IO error occurs.
      • getAlreadyEnteredText

        public java.lang.String getAlreadyEnteredText​(javax.swing.text.JTextComponent comp)
        Specified by:
        getAlreadyEnteredText in interface org.fife.ui.autocomplete.CompletionProvider
        Overrides:
        getAlreadyEnteredText in class HtmlCompletionProvider
      • getCompletionsImpl

        protected java.util.List<org.fife.ui.autocomplete.Completion> getCompletionsImpl​(javax.swing.text.JTextComponent comp)
        Overrides:
        getCompletionsImpl in class HtmlCompletionProvider
      • inPhpBlock

        private boolean inPhpBlock​(javax.swing.text.JTextComponent comp)
        Returns whether the caret is inside a PHP block in this text component.
        Parameters:
        comp - The RSyntaxTextAera.
        Returns:
        Whether the caret is inside a PHP block.