Class ContentProposal

    • Constructor Detail

      • ContentProposal

        public ContentProposal​(String content)
        Create a content proposal whose label and content are the specified String. The cursor position will be located at the end of the content.
        Parameters:
        content - the String representing the content. Should not be null.
      • ContentProposal

        public ContentProposal​(String content,
                               String description)
        Create a content proposal whose content and description are as specified in the parameters. The cursor position will be located at the end of the content.
        Parameters:
        content - the String representing the content. Should not be null. This string will also be used as the label.
        description - the String representing the description, or null if there should be no description.
      • ContentProposal

        public ContentProposal​(String content,
                               String label,
                               String description)
        Create a content proposal whose content, label, and description are as specified in the parameters. The cursor position will be located at the end of the content.
        Parameters:
        content - the String representing the content. Should not be null.
        label - the String representing the label. Should not be null.
        description - the String representing the description, or null if there should be no description.
      • ContentProposal

        public ContentProposal​(String content,
                               String label,
                               String description,
                               int cursorPosition)
        Create a content proposal whose content, label, description, and cursor position are as specified in the parameters.
        Parameters:
        content - the String representing the content. Should not be null.
        label - the String representing the label. Should not be null.
        description - the String representing the description, or null if there should be no description.
        cursorPosition - the zero-based index position within the contents where the cursor should be placed after the proposal is accepted. The range of the cursor position is from 0..N where N is the number of characters in the content.
        Throws:
        IllegalArgumentException - if the index is not between 0 and the number of characters in the content.
    • Method Detail

      • getContent

        public String getContent()
        Description copied from interface: IContentProposal
        Return the content represented by this proposal.
        Specified by:
        getContent in interface IContentProposal
        Returns:
        the String content represented by this proposal.
      • getCursorPosition

        public int getCursorPosition()
        Description copied from interface: IContentProposal
        Return the integer position within the contents that the cursor should be placed after the proposal is accepted.
        Specified by:
        getCursorPosition in interface IContentProposal
        Returns:
        the zero-based index position within the contents where the cursor should be placed after the proposal is accepted. The range of the cursor position is from 0..N where N is the number of characters in the contents.
      • getDescription

        public String getDescription()
        Description copied from interface: IContentProposal
        Return a description that describes this proposal.
        Specified by:
        getDescription in interface IContentProposal
        Returns:
        the String label used to further the proposal. If null, then no description will be displayed.
      • getLabel

        public String getLabel()
        Description copied from interface: IContentProposal
        Return the label used to describe this proposal.
        Specified by:
        getLabel in interface IContentProposal
        Returns:
        the String label used to display the proposal. If null, then the content will be displayed as the label.