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

com.pekinsoft.spi.MenuBarProvider Maven / Gradle / Ivy

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();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy