Class FunctionCompletion

    • Field Detail

      • returnValDesc

        private java.lang.String returnValDesc
        A description of the return value of this function.
      • compareString

        private java.lang.String compareString
        Used to improve performance of sorting FunctionCompletions.
    • Constructor Detail

      • FunctionCompletion

        public FunctionCompletion​(CompletionProvider provider,
                                  java.lang.String name,
                                  java.lang.String returnType)
        Constructor.
        Parameters:
        provider - The parent provider.
        name - The name of this function.
        returnType - The return type of this function.
    • Method Detail

      • addParameters

        protected void addParameters​(java.lang.StringBuilder sb)
        Adds HTML describing the parameters to this function to a buffer.
        Parameters:
        sb - The buffer to append to.
      • compareTo

        public int compareTo​(Completion c2)
        Overridden to compare methods by their comparison strings.
        Specified by:
        compareTo in interface java.lang.Comparable<Completion>
        Specified by:
        compareTo in interface Completion
        Overrides:
        compareTo in class AbstractCompletion
        Parameters:
        c2 - A Completion to compare to.
        Returns:
        The sort order.
      • equals

        public boolean equals​(java.lang.Object other)
        Overridden to match the behavior of compareTo(Completion).
        Overrides:
        equals in class java.lang.Object
        Parameters:
        other - Another object.
        Returns:
        Whether these two objects are equal.
      • getCompareString

        private java.lang.String getCompareString()
        Returns a string used to compare this method completion to another.
        Returns:
        The comparison string.
      • getInsertionInfo

        public ParameterizedCompletionInsertionInfo getInsertionInfo​(javax.swing.text.JTextComponent tc,
                                                                     boolean replaceTabsWithSpaces)
        Description copied from interface: ParameterizedCompletion
        Returns completion information for this parameterized completion, given the specified text component.
        Specified by:
        getInsertionInfo in interface ParameterizedCompletion
        Parameters:
        tc - The text component.
        replaceTabsWithSpaces - Whether to replace tabs with spaces.
        Returns:
        The completion info.
      • getShowParameterToolTip

        public boolean getShowParameterToolTip()
        Description copied from interface: ParameterizedCompletion
        Returns whether a tool tip displaying assistance for each parameter while it is being edited is appropriate for this completion.
        Specified by:
        getShowParameterToolTip in interface ParameterizedCompletion
        Returns:
        Whether the tool tip is appropriate to display.
      • getParamText

        private java.lang.String getParamText​(ParameterizedCompletion.Parameter param)
        Returns the text to insert for a parameter.
        Parameters:
        param - The parameter.
        Returns:
        The text.
      • getReturnValueDescription

        public java.lang.String getReturnValueDescription()
        Returns the description of the return value of this function.
        Returns:
        The description, or null if there is none.
        See Also:
        setReturnValueDescription(String)
      • getSummary

        public java.lang.String getSummary()
        Description copied from interface: Completion
        Returns the description of this auto-complete choice. This can be used in a popup "description window."
        Specified by:
        getSummary in interface Completion
        Overrides:
        getSummary in class VariableCompletion
        Returns:
        This item's description. This should be HTML. It may be null if there is no description for this completion.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • setReturnValueDescription

        public void setReturnValueDescription​(java.lang.String desc)
        Sets the description of the return value of this function.
        Parameters:
        desc - The description.
        See Also:
        getReturnValueDescription()