Class AbstractLanguageSupport

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int autoActivationDelay
      The delay for auto-activation, in milliseconds.
      private boolean autoActivationEnabled
      Whether auto-activation for completion choices is enabled for this language.
      private boolean autoCompleteEnabled
      Whether auto-completion is enabled for this language.
      private boolean parameterAssistanceEnabled
      Whether parameter assistance should be enabled for this language.
      private javax.swing.ListCellRenderer<java.lang.Object> renderer
      The default renderer for the completion list.
      private boolean showDescWindow
      Whether the description window is displayed when the completion list window is displayed.
      private java.util.Map<org.fife.ui.rsyntaxtextarea.RSyntaxTextArea,​org.fife.ui.autocomplete.AutoCompletion> textAreaToAutoCompletion
      Map of all text areas using this language support to their installed AutoCompletion instances.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.fife.ui.autocomplete.AutoCompletion createAutoCompletion​(org.fife.ui.autocomplete.CompletionProvider p)
      Creates an auto-completion instance pre-configured and usable by most LanguageSupports.
      protected javax.swing.ListCellRenderer<java.lang.Object> createDefaultCompletionCellRenderer()
      Creates the default cell renderer to use when none is specified.
      private void delegateToSubstanceRenderer​(org.fife.ui.autocomplete.CompletionCellRenderer ccr)
      Attempts to delegate rendering to a Substance cell renderer.
      int getAutoActivationDelay()
      Returns the delay between when the user types a character and when the code completion popup should automatically appear (if applicable).
      protected org.fife.ui.autocomplete.AutoCompletion getAutoCompletionFor​(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
      Returns the auto-completion instance used by a text area.
      javax.swing.ListCellRenderer<java.lang.Object> getDefaultCompletionCellRenderer()
      Returns the default list cell renderer to install for all text areas with this language support installed.
      boolean getShowDescWindow()
      REturns whether the description window is also shown when the completion list is displayed, for editors of this language.
      protected java.util.Set<org.fife.ui.rsyntaxtextarea.RSyntaxTextArea> getTextAreas()
      Returns the text areas with this language support currently installed.
      protected void installImpl​(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea, org.fife.ui.autocomplete.AutoCompletion ac)
      Registers an auto-completion instance.
      boolean isAutoActivationEnabled()
      Returns whether auto-activation is enabled (that is, whether the completion popup will automatically appear after a delay when the user types an appropriate character).
      boolean isAutoCompleteEnabled()
      Returns whether auto-completion is enabled for this language.
      boolean isParameterAssistanceEnabled()
      Returns whether parameter assistance is enabled for editors of this language.
      void setAutoActivationDelay​(int ms)
      Sets the delay between when the user types a character and when the code completion popup should automatically appear (if applicable).
      void setAutoActivationEnabled​(boolean enabled)
      Toggles whether auto-activation is enabled.
      void setAutoCompleteEnabled​(boolean enabled)
      Toggles whether auto-completion is enabled for this language.
      void setDefaultCompletionCellRenderer​(javax.swing.ListCellRenderer<java.lang.Object> r)
      Sets the default list cell renderer to install for all text areas with this language support installed.
      void setParameterAssistanceEnabled​(boolean enabled)
      Toggles whether parameter assistance is enabled for editors of this language.
      void setShowDescWindow​(boolean show)
      Toggles whether the description window should also be shown when the completion list is displayed, for editors of this language.
      protected void uninstallImpl​(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
      Unregisters an textArea.
      • Methods inherited from class java.lang.Object

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

      • autoCompleteEnabled

        private boolean autoCompleteEnabled
        Whether auto-completion is enabled for this language.
      • autoActivationEnabled

        private boolean autoActivationEnabled
        Whether auto-activation for completion choices is enabled for this language. Note that this parameter only matters if autoCompleteEnabled is true.
      • parameterAssistanceEnabled

        private boolean parameterAssistanceEnabled
        Whether parameter assistance should be enabled for this language.
      • showDescWindow

        private boolean showDescWindow
        Whether the description window is displayed when the completion list window is displayed.
      • renderer

        private javax.swing.ListCellRenderer<java.lang.Object> renderer
        The default renderer for the completion list.
    • Constructor Detail

      • AbstractLanguageSupport

        protected AbstractLanguageSupport()
        Constructor.
    • Method Detail

      • createAutoCompletion

        protected org.fife.ui.autocomplete.AutoCompletion createAutoCompletion​(org.fife.ui.autocomplete.CompletionProvider p)
        Creates an auto-completion instance pre-configured and usable by most LanguageSupports.
        Parameters:
        p - The completion provider.
        Returns:
        The auto-completion instance.
      • createDefaultCompletionCellRenderer

        protected javax.swing.ListCellRenderer<java.lang.Object> createDefaultCompletionCellRenderer()
        Creates the default cell renderer to use when none is specified. Subclasses can override this method if there is a "better" default renderer for a specific language.
        Returns:
        The default renderer for the completion list.
      • delegateToSubstanceRenderer

        private void delegateToSubstanceRenderer​(org.fife.ui.autocomplete.CompletionCellRenderer ccr)
        Attempts to delegate rendering to a Substance cell renderer.
        Parameters:
        ccr - The cell renderer to modify.
      • getAutoCompletionFor

        protected org.fife.ui.autocomplete.AutoCompletion getAutoCompletionFor​(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
        Returns the auto-completion instance used by a text area.
        Parameters:
        textArea - The text area.
        Returns:
        The auto-completion instance, or null if none is installed on the text area.
      • getTextAreas

        protected java.util.Set<org.fife.ui.rsyntaxtextarea.RSyntaxTextArea> getTextAreas()
        Returns the text areas with this language support currently installed.
        Returns:
        The text areas.
      • installImpl

        protected void installImpl​(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea,
                                   org.fife.ui.autocomplete.AutoCompletion ac)
        Registers an auto-completion instance. This should be called by subclasses in their LanguageSupport.install(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea) methods so that this language support can update all of them at once.
        Parameters:
        textArea - The text area that just installed the auto-completion.
        ac - The auto-completion instance.
        See Also:
        uninstallImpl(RSyntaxTextArea)
      • setShowDescWindow

        public void setShowDescWindow​(boolean show)
        Description copied from interface: LanguageSupport
        Toggles whether the description window should also be shown when the completion list is displayed, for editors of this language.
        Specified by:
        setShowDescWindow in interface LanguageSupport
        Parameters:
        show - Whether to show the description window.
        See Also:
        LanguageSupport.getShowDescWindow()