Class JavaLanguageSupportBridge

java.lang.Object
org.fife.rsta.ac.AbstractLanguageSupport
org.fife.rsta.ac.java.JavaLanguageSupport
net.mcreator.ui.ide.autocomplete.JavaLanguageSupportBridge
All Implemented Interfaces:
org.fife.rsta.ac.LanguageSupport

public class JavaLanguageSupportBridge extends org.fife.rsta.ac.java.JavaLanguageSupport
MCreator installs a separate JavaLanguageSupport per code editor so each editor can use the jar manager of its own workspace. Some library internals (e.g. SourceParamChoicesProvider invoked by parameter assistance when a method completion is inserted) instead look the Java language support up through the global LanguageSupportFactory, whose instance was never installed on the editor, which made such lookups fail with a NullPointerException. This class is registered as the factory's Java language support and routes those lookups to the per-editor support stored as a client property on the text area.
  • Field Summary

    Fields inherited from interface org.fife.rsta.ac.LanguageSupport

    PROPERTY_LANGUAGE_PARSER
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    bridge(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea, org.fife.rsta.ac.java.JavaLanguageSupport support)
    Registers this bridge as the factory's Java language support and links the given text area to the language support instance actually installed on it.
    org.fife.rsta.ac.java.JavaCompletionProvider
    getCompletionProvider(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
     

    Methods inherited from class org.fife.rsta.ac.java.JavaLanguageSupport

    getJarManager, getParser, install, uninstall

    Methods inherited from class org.fife.rsta.ac.AbstractLanguageSupport

    createAutoCompletion, createDefaultCompletionCellRenderer, getAutoActivationDelay, getAutoCompletionFor, getDefaultCompletionCellRenderer, getShowDescWindow, getTextAreas, installImpl, isAutoActivationEnabled, isAutoCompleteEnabled, isParameterAssistanceEnabled, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setDefaultCompletionCellRenderer, setParameterAssistanceEnabled, setShowDescWindow, uninstallImpl

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JavaLanguageSupportBridge

      public JavaLanguageSupportBridge()
  • Method Details

    • bridge

      public static void bridge(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea, org.fife.rsta.ac.java.JavaLanguageSupport support)
      Registers this bridge as the factory's Java language support and links the given text area to the language support instance actually installed on it. Must be called before any factory lookup for Java language support happens, so the factory instantiates the bridge and not the default support.
      Parameters:
      textArea - The text area the given language support was installed on.
      support - The language support installed on the given text area.
    • getCompletionProvider

      public org.fife.rsta.ac.java.JavaCompletionProvider getCompletionProvider(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
      Overrides:
      getCompletionProvider in class org.fife.rsta.ac.java.JavaLanguageSupport