Class BaseFocusControlListener

  • All Implemented Interfaces:
    java.util.EventListener, org.eclipse.swt.events.ControlListener, org.eclipse.swt.events.FocusListener, org.eclipse.swt.internal.SWTEventListener
    Direct Known Subclasses:
    CComboFocusControlListener, ComboFocusControlListener, StyledTextFocusControlListener, TextFocusControlListener

    abstract class BaseFocusControlListener
    extends java.lang.Object
    implements org.eclipse.swt.events.FocusListener, org.eclipse.swt.events.ControlListener
    Abstract class that contains code for the FocusLost, FocusGained and ControlResized events
    • Field Detail

      • control

        protected org.eclipse.swt.widgets.Control control
      • firstDraw

        private boolean firstDraw
      • initialFont

        private org.eclipse.swt.graphics.Font initialFont
      • initialBackgroundColor

        private org.eclipse.swt.graphics.Color initialBackgroundColor
      • initialForegroundColor

        private org.eclipse.swt.graphics.Color initialForegroundColor
    • Constructor Detail

      • BaseFocusControlListener

        BaseFocusControlListener​(org.eclipse.swt.widgets.Control control)
        Constructor
        Parameters:
        control - control on which this listener will be attached
    • Method Detail

      • focusGained

        public void focusGained​(org.eclipse.swt.events.FocusEvent e)
        Specified by:
        focusGained in interface org.eclipse.swt.events.FocusListener
        See Also:
        FocusListener.focusGained(org.eclipse.swt.events.FocusEvent)
      • applyInitialLook

        private void applyInitialLook()
        Apply the initial look of the widget
      • hidePrompt

        protected abstract void hidePrompt()
        Code when the focus behiaviour is "Hide"
      • highLightPrompt

        protected abstract void highLightPrompt()
        Code when the focus behiaviour is "Highlight"
      • focusLost

        public void focusLost​(org.eclipse.swt.events.FocusEvent e)
        Specified by:
        focusLost in interface org.eclipse.swt.events.FocusListener
        See Also:
        FocusListener.focusLost(org.eclipse.swt.events.FocusEvent)
      • isFilled

        protected abstract boolean isFilled()
        Returns:
        true if the widget is filled, false otherwise
      • applyForegroundColor

        private void applyForegroundColor()
        Apply the foreground color for the prompt
      • applyBackgroundColor

        private void applyBackgroundColor()
        Apply the background color for the prompt
      • applyFontStyle

        private void applyFontStyle()
        Apply the font style to the prompt
      • fillPromptText

        protected abstract void fillPromptText()
        Fill the prompt text
      • controlMoved

        public void controlMoved​(org.eclipse.swt.events.ControlEvent e)
        Specified by:
        controlMoved in interface org.eclipse.swt.events.ControlListener
        See Also:
        ControlListener.controlMoved(org.eclipse.swt.events.ControlEvent)
      • controlResized

        public void controlResized​(org.eclipse.swt.events.ControlEvent e)
        Specified by:
        controlResized in interface org.eclipse.swt.events.ControlListener
        See Also:
        ControlListener.controlResized(org.eclipse.swt.events.ControlEvent)
      • storeInitialLook

        private void storeInitialLook()
        Store the initial look of the widget