001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008 Sun Microsystems, Inc.
025 *      Portions Copyright 2014 ForgeRock AS
026 */
027
028package org.opends.guitools.controlpanel.datamodel;
029
030import org.opends.guitools.controlpanel.ui.StatusGenericPanel;
031import org.forgerock.i18n.LocalizableMessage;
032
033/**
034 * The class that is used by the different action buttons on the left side of
035 * the main ControlPanel dialog.
036 *
037 */
038public class Action
039{
040  private LocalizableMessage name;
041
042  private Class<? extends StatusGenericPanel> associatedPanel;
043
044  /**
045   * Returns the name of the action.
046   * @return the name of the action.
047   */
048  public LocalizableMessage getName()
049  {
050    return name;
051  }
052
053  /**
054   * Sets the name of the action.
055   * @param name the name of the action.
056   */
057  public void setName(LocalizableMessage name)
058  {
059    this.name = name;
060  }
061
062  /**
063   * Returns the class of the panel that is associated with this action
064   * (for instance the NewBaseDNPanel class is associated with the 'New
065   * Base DN' action.
066   * @return the class of the panel that is associated with this action.
067   */
068  public Class<? extends StatusGenericPanel> getAssociatedPanelClass()
069  {
070    return associatedPanel;
071  }
072
073  /**
074   * Sets the class of the panel that is associated with this action.
075   * @param associatedPanel the class of the panel that is associated with this
076   * action.
077   */
078  public void setAssociatedPanel(
079      Class<? extends StatusGenericPanel> associatedPanel)
080  {
081    this.associatedPanel = associatedPanel;
082  }
083}