Class BasicDatePickerUI.Handler

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.LayoutManager, java.beans.PropertyChangeListener, java.util.EventListener, DateSelectionListener
    Enclosing class:
    BasicDatePickerUI

    private class BasicDatePickerUI.Handler
    extends java.lang.Object
    implements java.awt.LayoutManager, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.PropertyChangeListener, DateSelectionListener, java.awt.event.ActionListener, java.awt.event.FocusListener
    PENDING: JW - I really hate the one-in-all. Wont touch it for now, maybe later. As long as we have it, the new listeners (dateSelection) are here too, for consistency. Adding the Layout here as well is ... , IMO.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Handler()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)  
      void addLayoutComponent​(java.lang.String name, java.awt.Component comp)  
      private void buttonPropertyChange​(java.beans.PropertyChangeEvent e)
      Handles propertyChanges from the picker's popupButton.
      private void datePickerPropertyChange​(java.beans.PropertyChangeEvent e)
      Handles property changes from DatePicker.
      private void editorActionPerformed​(java.awt.event.ActionEvent e)
      Listening to actionEvents fired by the picker's editor.
      private void editorPropertyChange​(java.beans.PropertyChangeEvent evt)
      Handles property changes from datepicker's editor.
      void focusGained​(java.awt.event.FocusEvent e)
      Issue #573-swingx - F2 in table doesn't focus the editor.
      void focusLost​(java.awt.event.FocusEvent e)
      #565-swingx: popup not hidden if clicked into combo.
      void layoutContainer​(java.awt.Container parent)  
      java.awt.Dimension minimumLayoutSize​(java.awt.Container parent)  
      private void monthViewActionPerformed​(java.awt.event.ActionEvent e)
      Listening to actionEvents fired by the picker's monthView.
      private void monthViewPropertyChange​(java.beans.PropertyChangeEvent e)
      Handles propertyChanges from the picker's monthView.
      void mouseClicked​(java.awt.event.MouseEvent ev)  
      void mouseDragged​(java.awt.event.MouseEvent ev)  
      void mouseEntered​(java.awt.event.MouseEvent ev)  
      void mouseExited​(java.awt.event.MouseEvent ev)  
      void mouseMoved​(java.awt.event.MouseEvent ev)  
      void mousePressed​(java.awt.event.MouseEvent ev)  
      void mouseReleased​(java.awt.event.MouseEvent ev)  
      java.awt.Dimension preferredLayoutSize​(java.awt.Container parent)  
      void propertyChange​(java.beans.PropertyChangeEvent e)
      void removeLayoutComponent​(java.awt.Component comp)  
      void valueChanged​(DateSelectionEvent ev)  
      • Methods inherited from class java.lang.Object

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

      • _forwardReleaseEvent

        private boolean _forwardReleaseEvent
    • Constructor Detail

      • Handler

        private Handler()
    • Method Detail

      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent ev)
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent ev)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent ev)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent ev)
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent ev)
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent ev)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent ev)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent e)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
      • editorPropertyChange

        private void editorPropertyChange​(java.beans.PropertyChangeEvent evt)
        Handles property changes from datepicker's editor.
        Parameters:
        e - the PropertyChangeEvent object describing the event source and the property that has changed
      • datePickerPropertyChange

        private void datePickerPropertyChange​(java.beans.PropertyChangeEvent e)
        Handles property changes from DatePicker.
        Parameters:
        e - the PropertyChangeEvent object describing the event source and the property that has changed
      • monthViewPropertyChange

        private void monthViewPropertyChange​(java.beans.PropertyChangeEvent e)
        Handles propertyChanges from the picker's monthView.
        Parameters:
        e - the PropertyChangeEvent object describing the event source and the property that has changed
      • buttonPropertyChange

        private void buttonPropertyChange​(java.beans.PropertyChangeEvent e)
        Handles propertyChanges from the picker's popupButton. PENDING: does nothing, kept while refactoring .. which properties from the button do we want to handle?
        Parameters:
        e - the PropertyChangeEvent object describing the event source and the property that has changed.
      • addLayoutComponent

        public void addLayoutComponent​(java.lang.String name,
                                       java.awt.Component comp)
        Specified by:
        addLayoutComponent in interface java.awt.LayoutManager
      • removeLayoutComponent

        public void removeLayoutComponent​(java.awt.Component comp)
        Specified by:
        removeLayoutComponent in interface java.awt.LayoutManager
      • preferredLayoutSize

        public java.awt.Dimension preferredLayoutSize​(java.awt.Container parent)
        Specified by:
        preferredLayoutSize in interface java.awt.LayoutManager
      • minimumLayoutSize

        public java.awt.Dimension minimumLayoutSize​(java.awt.Container parent)
        Specified by:
        minimumLayoutSize in interface java.awt.LayoutManager
      • layoutContainer

        public void layoutContainer​(java.awt.Container parent)
        Specified by:
        layoutContainer in interface java.awt.LayoutManager
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • editorActionPerformed

        private void editorActionPerformed​(java.awt.event.ActionEvent e)
        Listening to actionEvents fired by the picker's editor.
        Parameters:
        e -
      • monthViewActionPerformed

        private void monthViewActionPerformed​(java.awt.event.ActionEvent e)
        Listening to actionEvents fired by the picker's monthView.
        Parameters:
        e -
      • focusGained

        public void focusGained​(java.awt.event.FocusEvent e)
        Issue #573-swingx - F2 in table doesn't focus the editor. Do the same as combo: manually pass-on the focus to the editor.
        Specified by:
        focusGained in interface java.awt.event.FocusListener
      • focusLost

        public void focusLost​(java.awt.event.FocusEvent e)
        #565-swingx: popup not hidden if clicked into combo. The problem is that the combo uses the same trick as this datepicker to prevent auto-closing of the popup if focus is transfered back to the picker's editor. The idea is to hide the popup manually when the permanentFocusOwner changes to somewhere else. JW: doesn't work - we only get the temporary lost, but no permanent loss if the focus is transfered from the focusOwner to a new permanentFocusOwner. OOOkaay ... looks like exclusively related to a combo: we do get the expected focusLost if the focus is transferred permanently from the temporary focusowner to a new "normal" permanentFocusOwner (like a textfield), we don't get it if transfered to a tricksing owner (like a combo or picker). So can't do anything here. listen to keyboardFocusManager?
        Specified by:
        focusLost in interface java.awt.event.FocusListener