/*
 * FormattedComboBoxEditor.java  $Revision: 1.2 $  $Date: 2007/10/03 04:39:40 $
 *
 * Copyright (C) 2007 Meldcraft Corporation
 *
 * This file is part of Scaffold.
 * 
 * Scaffold is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Scaffold is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with Scaffold.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.meldcraft.gui.swing;

import java.awt.Component;
import java.awt.event.ActionListener;

import javax.swing.ComboBoxEditor;
import javax.swing.JFormattedTextField;

/**
 * @version $Revision: 1.2 $ $Date: 2007/10/03 04:39:40 $
 * @author Rob Richards
 */
public class FormattedComboBoxEditor implements ComboBoxEditor
{
// Static variables
// Member variables
    private JFormattedTextField     mEditor;

// Constructors and initialization
    public FormattedComboBoxEditor(JFormattedTextField editor)
    {
        mEditor = editor;
    }

// Interface implemenations
    // ComboBoxEditor interface
    public void setItem(Object obj)
    {
        mEditor.setValue(obj);
    }

    public Object getItem()
    {
        return mEditor.getValue();
    }

    public void addActionListener(ActionListener l)
    {
        mEditor.addActionListener(l);
    }

    public void removeActionListener(ActionListener l)
    {
        mEditor.removeActionListener(l);
    }

    public void selectAll()
    {
        mEditor.selectAll();
        mEditor.requestFocus();
    }

// Public methods
    public Component getEditorComponent()
    {
        return mEditor;
    }

// Protected methods
// Private methods
// Inner classes
}
