001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 * Portions Copyright 2014-2016 ForgeRock AS.
016 */
017
018package org.opends.guitools.controlpanel.ui.components;
019
020import java.awt.event.KeyEvent;
021
022import javax.swing.JButton;
023import javax.swing.KeyStroke;
024
025import org.forgerock.i18n.LocalizableMessage;
026
027/**
028 * This is a simple extension of the JButton class used to be able to invoke
029 * the method processKeyBinding.
030 */
031public class CellEditorButton extends JButton
032{
033  private static final long serialVersionUID = -1491628553090264453L;
034
035  /**
036   * The constructor of the cell editor button.
037   * @param label the label of the button.
038   */
039  public CellEditorButton(LocalizableMessage label)
040  {
041    super(label.toString());
042  }
043
044  @Override
045  public boolean processKeyBinding(KeyStroke ks, KeyEvent e,
046      int condition, boolean pressed)
047  {
048    return super.processKeyBinding(ks, e, condition, pressed);
049  }
050}