com.pekinsoft.spi.MenuBarProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ServiceProviders Show documentation
Show all versions of ServiceProviders Show documentation
An API that allows for dynamic application features and loose coupling.
The newest version!
/*
* 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 : Application
* Class : MenuBarProvider.java
* Author : Sean Carrick
* Created : Dec 12, 2022
* Modified : Dec 12, 2022
*
* Purpose: See class JavaDoc for explanation
*
* Revision History:
*
* WHEN BY REASON
* ------------ ------------------- -----------------------------------------
* Dec 12, 2022 Sean Carrick Initial creation.
* *****************************************************************************
*/
package com.pekinsoft.spi;
import javax.swing.JMenuBar;
/**
* The {@code MenuBarProvider} interface allows for an {@code Application} developer to provide a
* complete {@link javax.swing.JMenuBar menu bar} for their application.
*
* How this works is that the {@code org.jdesktop.application.Application Application}
* instance uses {@link org.openide.util.Lookup Lookup} to find the first
* implementation of this interface. If the {@code Lookup} returns null, then no
* {@code MenuBarProvider} was found, so no menu bar is added to the application.
*
* In that instance, the {@code Application} will seek out {@link
* com.pekinsoft.spi.MenuProvider MenuProvider} implementations and build a
* menu bar using those.
*
* One {@code MenuBarProvider} or the other {@code MenuProvider}s must be used
* to have a menu bar within the application. If neither is used, then the
* application's main window will have no menu bar.
*
* @author Sean Carrick <sean at pekinsoft dot com>
*
* @version 1.3
* @since 1.0
*/
public interface MenuBarProvider {
/**
* Retrieves the {@link javax.swing.JMenuBar JMenuBar} being provided by the
* implementing class. Typically, the returned menu bar will be fully setup
* and configured, including all of its menus.
*
* @return the menu bar to use for the application's main window
*/
public JMenuBar getMenuBar();
}