/* * ControlChangeAdapter.java * * Copyright (c) 2003-2004 Digi International * This program and the information contained in it is confidential and * proprietary to Digi International and may not be used, copied, or re- * produced without the prior written permission of Digi International. * */ package com.digi.config.ui; import com.digi.config.core.*; import com.digi.config.util.*; import javax.swing.*; import javax.swing.text.*; import java.text.*; import javax.swing.event.*; import javax.swing.tree.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; import java.net.*; /** * This class combines notification of action events and focus event for * listeners who want to use the same handler for both kinds of events. * * The abstract method changePerformed must be implemented by subclasses * to include the event processing activity. */ public abstract class ControlChangeAdapter implements ActionListener, FocusListener { /** * Invoked when an action occurs. */ public void actionPerformed(ActionEvent e) { changePerformed(e.getSource(), e, null); } /** * Invoked when a component gains the keyboard focus. */ public void focusGained(FocusEvent e) { // who cares... } /** * Invoked when a component loses the keyboard focus. */ public void focusLost(FocusEvent e) { changePerformed(e.getSource(), null, e); } /** * Invoked whenever an action occurs or when a component loses the keyboard focus. * This method must be provided by the implementer. */ public abstract void changePerformed(Object source, ActionEvent ae, FocusEvent fe); }