Class SourceParamChoicesProvider

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

    class SourceParamChoicesProvider
    extends java.lang.Object
    implements org.fife.ui.autocomplete.ParameterChoicesProvider
    A parameter choices provider for Java methods.

    NOTE: This class is not thread-safe, but it's assumed that it is only ever called on the EDT, so it should be a non-issue.

    Version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.fife.ui.autocomplete.CompletionProvider provider
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addPublicAndProtectedFieldsAndGetters​(Type type, JarManager jm, Package pkg, java.util.List<org.fife.ui.autocomplete.Completion> list)
      Adds all accessible fields and getters of a specific type, from an extended class or implemented interface.
      java.util.List<org.fife.ui.autocomplete.Completion> getLocalVarsFieldsAndGetters​(NormalClassDeclaration ncd, java.lang.String type, int offs)
      Gets all local variables, fields, and simple getters defined in a class, that are of a specific type, and are accessible from a given offset.
      java.util.List<org.fife.ui.autocomplete.Completion> getParameterChoices​(javax.swing.text.JTextComponent tc, org.fife.ui.autocomplete.ParameterizedCompletion.Parameter param)  
      private boolean isPrimitiveNumericType​(Type type)  
      private boolean isSimpleGetter​(Method method)
      Returns whether a method is a no-argument getter method.
      private boolean isTypeCompatible​(Type type, java.lang.String typeName)
      Returns whether a Type and a type name are type compatible.
      • Methods inherited from class java.lang.Object

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

    • Constructor Detail

      • SourceParamChoicesProvider

        SourceParamChoicesProvider()
    • Method Detail

      • addPublicAndProtectedFieldsAndGetters

        private void addPublicAndProtectedFieldsAndGetters​(Type type,
                                                           JarManager jm,
                                                           Package pkg,
                                                           java.util.List<org.fife.ui.autocomplete.Completion> list)
        Adds all accessible fields and getters of a specific type, from an extended class or implemented interface.
        Parameters:
        type - The type being examined.
        jm - The jar manager.
        pkg - The parent package.
        list - The list of completions to add to.
      • getLocalVarsFieldsAndGetters

        public java.util.List<org.fife.ui.autocomplete.Completion> getLocalVarsFieldsAndGetters​(NormalClassDeclaration ncd,
                                                                                                java.lang.String type,
                                                                                                int offs)
        Gets all local variables, fields, and simple getters defined in a class, that are of a specific type, and are accessible from a given offset.
        Parameters:
        ncd - The class.
        type - The type that the variables, fields, and (return value of) getters must be.
        offs - The offset of the caret.
        Returns:
        The list of stuff, or an empty list if none are found.
      • getParameterChoices

        public java.util.List<org.fife.ui.autocomplete.Completion> getParameterChoices​(javax.swing.text.JTextComponent tc,
                                                                                       org.fife.ui.autocomplete.ParameterizedCompletion.Parameter param)
        Specified by:
        getParameterChoices in interface org.fife.ui.autocomplete.ParameterChoicesProvider
      • isPrimitiveNumericType

        private boolean isPrimitiveNumericType​(Type type)
      • isSimpleGetter

        private boolean isSimpleGetter​(Method method)
        Returns whether a method is a no-argument getter method.
        Parameters:
        method - The method.
        Returns:
        Whether it is a no-argument getter.
      • isTypeCompatible

        private boolean isTypeCompatible​(Type type,
                                         java.lang.String typeName)
        Returns whether a Type and a type name are type compatible. This method currently is a sham!
        Parameters:
        type - The type to check.
        typeName - The name of a type to check.
        Returns:
        Whether the two are compatible.