Example usage for java.awt.event FocusEvent getID

List of usage examples for java.awt.event FocusEvent getID

Introduction

In this page you can find the example usage for java.awt.event FocusEvent getID.

Prototype

public int getID() 

Source Link

Document

Returns the event type.

Usage

From source file:org.xulux.swing.listeners.PrePostFieldListener.java

/**
 * now call pre../*from   w  w w  .  j  ava 2s  .  com*/
 * @see java.awt.event.FocusListener#focusGained(FocusEvent)
 */
public void focusGained(FocusEvent e) {
    if (isProcessing()) {
        return;
    }
    if (e.getID() != FocusEvent.FOCUS_GAINED || e.isTemporary()) {
        return;
    }
    NyxEventQueue q = NyxEventQueue.getInstance();
    q.holdEvents(false);
    started();
}

From source file:org.xulux.swing.listeners.PrePostFieldListener.java

/**
 * now call post../*w  w  w.j av a  2s.c o  m*/
 * @see java.awt.event.FocusListener#focusLost(FocusEvent)
 */
public void focusLost(FocusEvent e) {
    if (isProcessing()) {
        return;
    }
    if (e.getID() != FocusEvent.FOCUS_LOST || e.isTemporary()) {
        return;
    }
    NyxEventQueue q = NyxEventQueue.getInstance();
    // @todo make test..
    // A checkbox would consume an event, so it wouldn't process 
    // any further.. Need to make a test of this!
    if (!(e.getComponent() instanceof JCheckBox)) {
        q.holdEvents(true);
        q.holdAccepted(this);
    }
}