Class JXFindBar

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

    public class JXFindBar
    extends JXFindPanel
    A simple low-intrusion default widget for incremental search. Actions registered (in addition to super):
    • JXDialog.CLOSE_ACTION_COMMAND - an action bound to this component's cancel method. The method itself is an empty implementation: Subclassing clients can override the method, all clients can register a custom action.
    Key bindings: This implementation uses textfield coloring as not-found visualization.

    PENDING: the coloring needs to be read from the UIManager instead of hardcoding.

    PENDING: the state transition of found/non-found coloring needs clean-up - there are spurious problems when re-using the same instance (as SearchFactory does).

    Author:
    Jeanette Winzenburg
    See Also:
    Serialized Form
    • Field Detail

      • previousBackgroundColor

        protected Color previousBackgroundColor
      • previousForegroundColor

        protected Color previousForegroundColor
      • notFoundBackgroundColor

        protected Color notFoundBackgroundColor
      • notFoundForegroundColor

        protected Color notFoundForegroundColor
      • findNext

        protected JButton findNext
      • findPrevious

        protected JButton findPrevious
    • Constructor Detail

      • JXFindBar

        public JXFindBar()
      • JXFindBar

        public JXFindBar​(Searchable searchable)
    • Method Detail

      • setSearchable

        public void setSearchable​(Searchable searchable)
        Description copied from class: JXFindPanel
        Sets the Searchable targeted of this find widget. Triggers a search with null pattern to release the old searchable, if any.
        Overrides:
        setSearchable in class JXFindPanel
        Parameters:
        searchable - Component where search widget will try to locate and select information using methods of the Searchable interface.
      • showNotFoundMessage

        protected void showNotFoundMessage()
        here: set textfield colors to not-found colors.
        Overrides:
        showNotFoundMessage in class JXFindPanel
      • showFoundMessage

        protected void showFoundMessage()
        here: set textfield colors to normal.
        Overrides:
        showFoundMessage in class JXFindPanel
      • addNotify

        public void addNotify()
        Description copied from class: JXFindPanel
        Notifies this component that it now has a parent component. When this method is invoked, the chain of parent components is set up with KeyboardAction event listeners.
        Overrides:
        addNotify in class JXFindPanel
      • cancel

        public void cancel()
        Action callback method for bound action JXDialog.CLOSE_ACTION_COMMAND. Here: does nothing. Subclasses can override to define custom "closing" behaviour. Alternatively, any client can register a custom action with the actionMap.
      • initExecutables

        protected void initExecutables()
        Description copied from class: JXFindPanel
        creates and registers all "executable" actions. Meaning: the actions bound to a callback method on this.
        Overrides:
        initExecutables in class JXFindPanel
      • bind

        protected void bind()
        Description copied from class: JXFindPanel
        Configure and bind components to/from PatternModel.
        Overrides:
        bind in class JXFindPanel
      • build

        protected void build()
        Description copied from class: JXFindPanel
        Compose and layout all the subcomponents.
        Overrides:
        build in class JXFindPanel