Class ViewerControlAutoCompleteField


  • public class ViewerControlAutoCompleteField
    extends Object
    ViewerControlAutoCompleteField attempts to auto-complete a user's keystrokes by activating a popup that filters a list of proposals according to the content typed by the user.
    • Constructor Detail

      • ViewerControlAutoCompleteField

        public ViewerControlAutoCompleteField​(String[] proposals,
                                              org.eclipse.swt.widgets.Control control,
                                              IViewerControlContentAdapter contentAdapter)
        Construct an AutoComplete field on the specified control, whose completions are characterized by the specified array of Strings.
        Parameters:
        viewer - the control for which auto complete is desired, cannot be null
    • Method Detail

      • setProposalToObjects

        public void setProposalToObjects​(com.google.common.collect.Multimap<String,​Object> proposalToObjects)
        Set multi map of proposals to object, based on target viewer content. Intended to be invoked after viewer input update.
        Parameters:
        proposalToObjects - multi map of content to proposal associations, never null:
        • key - string representation for the target object
        • value - the target object
      • setEnabled

        public void setEnabled​(boolean enabled)
        Set the boolean flag that determines whether the auto completion of this filed is enabled.
        Parameters:
        enabled - true if the auto completion is enabled and responding to user input, false if it is ignoring user input
      • isEnabled

        public boolean isEnabled()
        Returns whether auto completion is enabled.
        Returns:
        true if the adapter is enabled, and false if it is not
      • isProposalPopupOpen

        public boolean isProposalPopupOpen()
        Returns whether the main proposal popup is open.
        Returns:
        whether the main proposal popup is open