home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import com.sun.java.swing.Timer;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Window;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.WindowEvent;
- import java.awt.event.WindowListener;
- import java.io.Serializable;
-
- class BasicComboBoxUI$FocusRequestHelper implements WindowListener, ActionListener, Serializable {
- Window window = null;
- Component component;
- Timer timer;
-
- BasicComboBoxUI$FocusRequestHelper(Component var1) {
- this.component = var1;
-
- for(Container var2 = var1.getParent(); var2 != null; var2 = ((Component)var2).getParent()) {
- if (var2 instanceof Window) {
- this.window = (Window)var2;
- break;
- }
- }
-
- if (this.window != null) {
- this.window.addWindowListener(this);
- }
- }
-
- public void windowOpened(WindowEvent var1) {
- }
-
- public void windowClosing(WindowEvent var1) {
- }
-
- public void windowClosed(WindowEvent var1) {
- this.window.removeWindowListener(this);
- }
-
- public void windowIconified(WindowEvent var1) {
- }
-
- public void windowDeiconified(WindowEvent var1) {
- }
-
- public void windowActivated(WindowEvent var1) {
- this.window.removeWindowListener(this);
- this.startTimer();
- }
-
- public void windowDeactivated(WindowEvent var1) {
- }
-
- void startTimer() {
- this.timer = new Timer(20, this);
- this.timer.start();
- }
-
- public void actionPerformed(ActionEvent var1) {
- if (this.timer != null) {
- this.timer.stop();
- }
-
- if (this.component != null) {
- this.component.requestFocus();
- }
-
- this.component = null;
- this.timer = null;
- this.window = null;
- }
- }
-