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 ForgeRock AS.
016 */
017
018package org.opends.guitools.controlpanel.datamodel;
019
020import org.opends.guitools.controlpanel.ui.StatusGenericPanel;
021import org.forgerock.i18n.LocalizableMessage;
022
023/**
024 * The class that is used by the different action buttons on the left side of
025 * the main ControlPanel dialog.
026 *
027 */
028public class Action
029{
030  private LocalizableMessage name;
031
032  private Class<? extends StatusGenericPanel> associatedPanel;
033
034  /**
035   * Returns the name of the action.
036   * @return the name of the action.
037   */
038  public LocalizableMessage getName()
039  {
040    return name;
041  }
042
043  /**
044   * Sets the name of the action.
045   * @param name the name of the action.
046   */
047  public void setName(LocalizableMessage name)
048  {
049    this.name = name;
050  }
051
052  /**
053   * Returns the class of the panel that is associated with this action
054   * (for instance the NewBaseDNPanel class is associated with the 'New
055   * Base DN' action.
056   * @return the class of the panel that is associated with this action.
057   */
058  public Class<? extends StatusGenericPanel> getAssociatedPanelClass()
059  {
060    return associatedPanel;
061  }
062
063  /**
064   * Sets the class of the panel that is associated with this action.
065   * @param associatedPanel the class of the panel that is associated with this
066   * action.
067   */
068  public void setAssociatedPanel(
069      Class<? extends StatusGenericPanel> associatedPanel)
070  {
071    this.associatedPanel = associatedPanel;
072  }
073}