All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pekinsoft.api.OptionsPanelProvider Maven / Gradle / Ivy

/*
 * Copyright (C) 2022 PekinSOFT Systems
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 *
 * *****************************************************************************
 *  Project    :   JSR-296.SwingAppApplication
 *  Class      :   OptionsPanelProvider.java
 *  Author     :   Sean Carrick
 *  Created    :   Sep 5, 2022
 *  Modified   :   Sep 5, 2022
 *
 *  Purpose: See class JavaDoc for explanation
 *
 *  Revision History:
 *
 *  WHEN          BY                   REASON
 *  ------------  -------------------  -----------------------------------------
 *  Sep 5, 2022  Sean Carrick         Initial creation.
 * *****************************************************************************
 */
package com.pekinsoft.api;

import com.pekinsoft.framework.Application;
import javax.swing.JPanel;

/**
 * The {@code OptionsPanelProvider} interface provides a method by which each
 * module may provide a panel into the {@code Application}'s options dialog, if
 * one is provided.
 *
 * The module that needs to provide some configurable options is required to
 * provide a {@linkplain javax.swing.JPanel JPanel} that contains the UI for
 * gathering the required information from the user. The implementation also
 * needs to provide a title for the tab that is created for displaying the
 * panel. The category for the options panel must also be provided, so that the
 * {@code Application}'s options dialog will be able to place the provided panel
 * into the appropriate category on the Options dialog.
 *
 * This interface extends the {@link SaveCookie} interface to allow for the 
 * implementing panel to save its data in the way that makes sense for it.
 *
 * @author Sean Carrick <sean at pekinsoft dot com>
 *
 * @version 2.4
 * @since 1.0
 */
public interface OptionsPanelProvider extends SaveCookie {

    /**
     * The title that will be displayed on the generated tab in the Options
     * dialog.
     *
     * @return the tab title
     */
    public String tabTitle();

    /**
     * The category into which the {@code OptionsPanelProvider} would like to be
     * installed. This method returns a string value, which may be parsed into
     * an enumeration constant name by the containing {@link Application}. This
     * allows for the {@code Application} to decide what options categories are
     * available to its plugins, without this interface defining categories that
     * make no sense in a specific context.
     *
     * @return the name of the category into which the panel should be installed
     */
    public String category();

    /**
     * The {@code JPanel} that provides the UI for gathering the settings.
     *
     * @return the UI panel
     */
    public JPanel getPanel();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy