Example usage for javax.swing JMenuBar JMenuBar

List of usage examples for javax.swing JMenuBar JMenuBar

Introduction

In this page you can find the example usage for javax.swing JMenuBar JMenuBar.

Prototype

public JMenuBar() 

Source Link

Document

Creates a new menu bar.

Usage

From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmSwing.CFCrmSwingTldListJPanel.java

public JMenuBar getPanelMenuBar() {
    if (panelMenuBar == null) {
        JMenuItem menuItem;/* www  . j  a va  2 s .c  om*/
        ICFLibAnyObj container = getSwingContainer();
        panelMenuBar = new JMenuBar();
        menuAdd = new JMenu("Add");
        actionAddTld = new ActionAddTld();
        if (container instanceof ICFCrmTenantObj) {
            menuItem = new JMenuItem(actionAddTld);
            menuAdd.add(menuItem);
        }
        if (getSwingContainer() != null) {
            panelMenuBar.add(menuAdd);
        }
        menuSelected = new JMenu("Selected");
        menuSelected.setEnabled(false);
        actionViewSelected = new ViewSelectedActionTld();
        menuItem = new JMenuItem(actionViewSelected);
        menuSelected.add(menuItem);
        actionEditSelected = new EditSelectedActionTld();
        menuItem = new JMenuItem(actionEditSelected);
        menuSelected.add(menuItem);
        actionDeleteSelected = new DeleteSelectedActionTld();
        menuItem = new JMenuItem(actionDeleteSelected);
        menuSelected.add(menuItem);
        panelMenuBar.add(menuSelected);
    }
    return (panelMenuBar);
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingTldListJPanel.java

public JMenuBar getPanelMenuBar() {
    if (panelMenuBar == null) {
        JMenuItem menuItem;//from ww  w  .  ja va 2s  .c  om
        ICFLibAnyObj2 container = getSwingContainer();
        panelMenuBar = new JMenuBar();
        menuAdd = new JMenu("Add");
        actionAddTld = new ActionAddTld();
        if (container instanceof ICFInternetTenantObj) {
            menuItem = new JMenuItem(actionAddTld);
            menuAdd.add(menuItem);
        }
        if (getSwingContainer() != null) {
            panelMenuBar.add(menuAdd);
        }
        menuSelected = new JMenu("Selected");
        menuSelected.setEnabled(false);
        actionViewSelected = new ViewSelectedActionTld();
        menuItem = new JMenuItem(actionViewSelected);
        menuSelected.add(menuItem);
        actionEditSelected = new EditSelectedActionTld();
        menuItem = new JMenuItem(actionEditSelected);
        menuSelected.add(menuItem);
        actionDeleteSelected = new DeleteSelectedActionTld();
        menuItem = new JMenuItem(actionDeleteSelected);
        menuSelected.add(menuItem);
        panelMenuBar.add(menuSelected);
    }
    return (panelMenuBar);
}

From source file:gui.DownloadManagerGUI.java

private JMenuBar initMenuBar() {
    JMenuBar menuBar = new JMenuBar();

    /////////////////////////////////////////////////////////////////////////
    JMenu fileMenu = new JMenu(messagesBundle.getString("downloadManagerGUI.fileMenu.name"));
    exportDataItem = new JMenuItem("Export Data...");
    importDataItem = new JMenuItem("Import Data...");
    exitItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.exitItem.name"));
    exitItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.exitItem.iconPath")))); // NOI18N

    exportDataItem.setEnabled(false);//www  .java 2 s. com
    importDataItem.setEnabled(false);

    //     fileMenu.add(exportDataItem);
    //     fileMenu.add(importDataItem);
    fileMenu.addSeparator();
    fileMenu.add(exitItem);

    /////////////////////////////////////////////////////////////////////////
    JMenu windowMenu = new JMenu(messagesBundle.getString("downloadManagerGUI.windowMenu.name"));
    JMenu showMenu = new JMenu(messagesBundle.getString("downloadManagerGUI.showMenu.name"));
    prefsItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.prefsItem.name"));
    prefsItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.prefsItem.iconPath"))));

    JCheckBoxMenuItem showFormItem = new JCheckBoxMenuItem(
            messagesBundle.getString("downloadManagerGUI.showFormItem.name"));
    showFormItem.setSelected(true);

    showMenu.add(showFormItem);
    windowMenu.add(showMenu);
    windowMenu.add(prefsItem);

    exportDataItem.addActionListener(this);
    importDataItem.addActionListener(this);
    exitItem.addActionListener(this);
    prefsItem.addActionListener(this);

    /////////////////////////////////////////////////////////////////////////
    JMenu downloadsMenu = new JMenu(messagesBundle.getString("downloadManagerGUI.downloadsMenu.name"));
    newDownloadItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.newDownloadItem.name"));
    newDownloadItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.newDownloadItem.iconPath"))));
    openItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.openItem.name"));
    openFolderItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.openFolderItem.name"));
    resumeItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.resumeItem.name"));
    resumeItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.resumeItem.iconPath"))));
    pauseItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.pauseItem.name"));
    pauseItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.pauseItem.iconPath"))));
    pauseAllItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.pauseAllItem.name"));
    pauseAllItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.pauseAllItem.iconPath"))));
    clearItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.clearItem.name"));
    clearItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.clearItem.iconPath"))));
    clearAllCompletedItem = new JMenuItem(
            messagesBundle.getString("downloadManagerGUI.clearAllCompletedItem.name"));
    clearAllCompletedItem.setIcon(new javax.swing.ImageIcon(getClass()
            .getResource(messagesBundle.getString("downloadManagerGUI.clearAllCompletedItem.iconPath"))));
    reJoinItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.reJoinItem.name"));
    reJoinItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.reJoinItem.iconPath"))));
    reDownloadItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.reDownloadItem.name"));
    reDownloadItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.reDownloadItem.iconPath"))));

    moveToQueueItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.moveToQueueItem.name"));

    removeFromQueueItem = new JMenuItem(
            messagesBundle.getString("downloadManagerGUI.removeFromQueueItem.name"));
    propertiesItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.propertiesItem.name"));
    propertiesItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.propertiesItem.iconPath"))));

    downloadsMenu.add(newDownloadItem);
    downloadsMenu.add(new JSeparator());
    downloadsMenu.add(openItem);
    downloadsMenu.add(openFolderItem);
    downloadsMenu.add(new JSeparator());
    downloadsMenu.add(resumeItem);
    downloadsMenu.add(pauseItem);
    downloadsMenu.add(pauseAllItem);
    downloadsMenu.add(new JSeparator());
    downloadsMenu.add(clearItem);
    downloadsMenu.add(clearAllCompletedItem);
    downloadsMenu.add(new JSeparator());
    downloadsMenu.add(reJoinItem);
    downloadsMenu.add(reDownloadItem);
    downloadsMenu.add(new JSeparator());
    downloadsMenu.add(moveToQueueItem);
    downloadsMenu.add(removeFromQueueItem);
    downloadsMenu.add(new JSeparator());
    downloadsMenu.add(propertiesItem);

    newDownloadItem.addActionListener(this);
    openItem.addActionListener(this);
    openFolderItem.addActionListener(this);
    resumeItem.addActionListener(this);
    pauseItem.addActionListener(this);
    pauseAllItem.addActionListener(this);
    clearItem.addActionListener(this);
    clearAllCompletedItem.addActionListener(this);
    reDownloadItem.addActionListener(this);
    moveToQueueItem.addActionListener(this);
    removeFromQueueItem.addActionListener(this);
    propertiesItem.addActionListener(this);

    setStateOfMenuItems();

    /////////////////////////////////////////////////////////////////////////
    JMenu helpMenu = new JMenu(messagesBundle.getString("downloadManagerGUI.helpMenu.name"));
    aboutItem = new JMenuItem(messagesBundle.getString("downloadManagerGUI.aboutItem.name"));
    aboutItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource(messagesBundle.getString("downloadManagerGUI.aboutItem.iconPath"))));

    helpMenu.add(aboutItem);

    aboutItem.addActionListener(this);

    menuBar.add(fileMenu);
    menuBar.add(windowMenu);
    menuBar.add(downloadsMenu);
    menuBar.add(helpMenu);

    showFormItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ev) {
            JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) ev.getSource();

            if (menuItem.isSelected()) {
                mainSplitPane.setDividerLocation((int) categoryPanel.getMinimumSize().getWidth());
            }

            categoryPanel.setVisible(menuItem.isSelected());
        }
    });

    fileMenu.setMnemonic(KeyEvent.VK_F);
    exitItem.setMnemonic(KeyEvent.VK_X);

    prefsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK));

    exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));

    importDataItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.CTRL_MASK));

    return menuBar;
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingTldListJPanel.java

public JMenuBar getPanelMenuBar() {
    if (panelMenuBar == null) {
        JMenuItem menuItem;//  w  w  w.  ja va  2  s  .c  om
        ICFLibAnyObj container = getSwingContainer();
        panelMenuBar = new JMenuBar();
        menuAdd = new JMenu("Add");
        actionAddTld = new ActionAddTld();
        if (container instanceof ICFSecurityTenantObj) {
            menuItem = new JMenuItem(actionAddTld);
            menuAdd.add(menuItem);
        }
        if (getSwingContainer() != null) {
            panelMenuBar.add(menuAdd);
        }
        menuSelected = new JMenu("Selected");
        menuSelected.setEnabled(false);
        actionViewSelected = new ViewSelectedActionTld();
        menuItem = new JMenuItem(actionViewSelected);
        menuSelected.add(menuItem);
        actionEditSelected = new EditSelectedActionTld();
        menuItem = new JMenuItem(actionEditSelected);
        menuSelected.add(menuItem);
        actionDeleteSelected = new DeleteSelectedActionTld();
        menuItem = new JMenuItem(actionDeleteSelected);
        menuSelected.add(menuItem);
        panelMenuBar.add(menuSelected);
    }
    return (panelMenuBar);
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingTenantListJPanel.java

public JMenuBar getPanelMenuBar() {
    if (panelMenuBar == null) {
        JMenuItem menuItem;//www  . j  a  v  a2 s.  c o  m
        ICFLibAnyObj2 container = getSwingContainer();
        panelMenuBar = new JMenuBar();
        menuAdd = new JMenu("Add");
        actionAddTenant = new ActionAddTenant();
        if (container instanceof ICFInternetClusterObj) {
            menuItem = new JMenuItem(actionAddTenant);
            menuAdd.add(menuItem);
        }
        if (getSwingContainer() != null) {
            panelMenuBar.add(menuAdd);
        }
        menuSelected = new JMenu("Selected");
        menuSelected.setEnabled(false);
        actionViewSelected = new ViewSelectedActionTenant();
        menuItem = new JMenuItem(actionViewSelected);
        menuSelected.add(menuItem);
        actionEditSelected = new EditSelectedActionTenant();
        menuItem = new JMenuItem(actionEditSelected);
        menuSelected.add(menuItem);
        actionDeleteSelected = new DeleteSelectedActionTenant();
        menuItem = new JMenuItem(actionDeleteSelected);
        menuSelected.add(menuItem);
        panelMenuBar.add(menuSelected);
    }
    return (panelMenuBar);
}

From source file:org.jets3t.apps.cockpit.Cockpit.java

/**
 * Initialise the application's menu bar.
 *///from  ww w  .j a  va  2  s. c  om
private void initMenus() {
    JMenuBar appMenuBar = new JMenuBar();
    if (this.isStandAloneApplication && OS_NAME_MAC.equals(System.getProperty("os.name"))) {
        /*
         * We need to check we're running on a Mac before adding the menu to the
         * owner frame, otherwise the menus will be displayed *behind* the main
         * GUI panel on Windows Vista and later [sigh]
         */
        ownerFrame.setJMenuBar(appMenuBar);
    } else {
        this.setJMenuBar(appMenuBar);
    }

    // Service menu
    JMenu serviceMenu = new JMenu("Service");

    loginMenuItem = new JMenuItem("Log in...");
    loginMenuItem.setActionCommand("LoginEvent");
    loginMenuItem.addActionListener(this);
    guiUtils.applyIcon(loginMenuItem, "/images/nuvola/16x16/actions/connect_creating.png");
    serviceMenu.add(loginMenuItem);

    logoutMenuItem = new JMenuItem("Log out");
    logoutMenuItem.setActionCommand("LogoutEvent");
    logoutMenuItem.addActionListener(this);
    guiUtils.applyIcon(logoutMenuItem, "/images/nuvola/16x16/actions/connect_no.png");
    serviceMenu.add(logoutMenuItem);

    loginSwitchMenu = new JMenu("Switch login");
    loginSwitchMenu.addActionListener(this);
    serviceMenu.add(new JSeparator());
    guiUtils.applyIcon(loginSwitchMenu, "/images/nuvola/16x16/actions/connect_established.png");
    serviceMenu.add(loginSwitchMenu);
    loginSwitchMenu.setEnabled(false);

    if (isStandAloneApplication) {
        serviceMenu.add(new JSeparator());

        JMenuItem quitMenuItem = new JMenuItem("Quit");
        quitMenuItem.setActionCommand("QuitEvent");
        quitMenuItem.addActionListener(this);
        guiUtils.applyIcon(quitMenuItem, "/images/nuvola/16x16/actions/exit.png");
        serviceMenu.add(quitMenuItem);
    }

    logoutMenuItem.setEnabled(false);

    // Bucket action menu.
    bucketActionMenu = new JPopupMenu();

    refreshBucketMenuItem = new JMenuItem("Refresh bucket listing");
    refreshBucketMenuItem.setActionCommand("RefreshBuckets");
    refreshBucketMenuItem.addActionListener(this);
    guiUtils.applyIcon(refreshBucketMenuItem, "/images/nuvola/16x16/actions/reload.png");
    bucketActionMenu.add(refreshBucketMenuItem);

    viewBucketPropertiesMenuItem = new JMenuItem("View bucket properties...");
    viewBucketPropertiesMenuItem.setActionCommand("ViewBucketProperties");
    viewBucketPropertiesMenuItem.addActionListener(this);
    guiUtils.applyIcon(viewBucketPropertiesMenuItem, "/images/nuvola/16x16/actions/viewmag.png");
    bucketActionMenu.add(viewBucketPropertiesMenuItem);

    updateBucketACLMenuItem = new JMenuItem("Update bucket's Access Control List...");
    updateBucketACLMenuItem.setActionCommand("UpdateBucketACL");
    updateBucketACLMenuItem.addActionListener(this);
    guiUtils.applyIcon(updateBucketACLMenuItem, "/images/nuvola/16x16/actions/encrypted.png");
    bucketActionMenu.add(updateBucketACLMenuItem);

    updateBucketRequesterPaysStatusMenuItem = new JMenuItem("Update bucket's Requester Pays status...");
    updateBucketRequesterPaysStatusMenuItem.setActionCommand("UpdateBucketRequesterPaysStatus");
    updateBucketRequesterPaysStatusMenuItem.addActionListener(this);
    guiUtils.applyIcon(updateBucketRequesterPaysStatusMenuItem, "/images/nuvola/16x16/actions/identity.png");
    bucketActionMenu.add(updateBucketRequesterPaysStatusMenuItem);

    bucketActionMenu.add(new JSeparator());

    createBucketMenuItem = new JMenuItem("Create new bucket...");
    createBucketMenuItem.setActionCommand("CreateBucket");
    createBucketMenuItem.addActionListener(this);
    guiUtils.applyIcon(createBucketMenuItem, "/images/nuvola/16x16/actions/viewmag+.png");
    bucketActionMenu.add(createBucketMenuItem);

    JMenuItem thirdPartyBucketMenuItem = new JMenuItem("Add third-party bucket...");
    thirdPartyBucketMenuItem.setActionCommand("AddThirdPartyBucket");
    thirdPartyBucketMenuItem.addActionListener(this);
    guiUtils.applyIcon(thirdPartyBucketMenuItem, "/images/nuvola/16x16/actions/viewmagfit.png");
    bucketActionMenu.add(thirdPartyBucketMenuItem);

    bucketActionMenu.add(new JSeparator());

    deleteBucketMenuItem = new JMenuItem("Delete bucket...");
    deleteBucketMenuItem.setActionCommand("DeleteBucket");
    deleteBucketMenuItem.addActionListener(this);
    guiUtils.applyIcon(deleteBucketMenuItem, "/images/nuvola/16x16/actions/cancel.png");
    bucketActionMenu.add(deleteBucketMenuItem);

    viewBucketPropertiesMenuItem.setEnabled(false);
    refreshBucketMenuItem.setEnabled(false);
    createBucketMenuItem.setEnabled(false);
    updateBucketACLMenuItem.setEnabled(false);
    updateBucketRequesterPaysStatusMenuItem.setEnabled(false);
    deleteBucketMenuItem.setEnabled(false);

    // Object action menu.
    objectActionMenu = new JPopupMenu();

    refreshObjectMenuItem = new JMenuItem("Refresh object listing");
    refreshObjectMenuItem.setActionCommand("RefreshObjects");
    refreshObjectMenuItem.addActionListener(this);
    guiUtils.applyIcon(refreshObjectMenuItem, "/images/nuvola/16x16/actions/reload.png");
    objectActionMenu.add(refreshObjectMenuItem);

    viewOrModifyObjectAttributesMenuItem = new JMenuItem("View or Modify object attributes...");
    viewOrModifyObjectAttributesMenuItem.setActionCommand("ViewOrModifyObjectAttributes");
    viewOrModifyObjectAttributesMenuItem.addActionListener(this);
    guiUtils.applyIcon(viewOrModifyObjectAttributesMenuItem, "/images/nuvola/16x16/actions/viewmag.png");
    objectActionMenu.add(viewOrModifyObjectAttributesMenuItem);

    copyObjectsMenuItem = new JMenuItem("Copy or Move objects...");
    copyObjectsMenuItem.setActionCommand("CopyObjects");
    copyObjectsMenuItem.addActionListener(this);
    guiUtils.applyIcon(copyObjectsMenuItem, "/images/nuvola/16x16/actions/filenew.png");
    objectActionMenu.add(copyObjectsMenuItem);

    updateObjectACLMenuItem = new JMenuItem("View or Modify Access Control Lists...");
    updateObjectACLMenuItem.setActionCommand("UpdateObjectACL");
    updateObjectACLMenuItem.addActionListener(this);
    guiUtils.applyIcon(updateObjectACLMenuItem, "/images/nuvola/16x16/actions/encrypted.png");
    objectActionMenu.add(updateObjectACLMenuItem);

    downloadObjectMenuItem = new JMenuItem("Download objects...");
    downloadObjectMenuItem.setActionCommand("DownloadObjects");
    downloadObjectMenuItem.addActionListener(this);
    guiUtils.applyIcon(downloadObjectMenuItem, "/images/nuvola/16x16/actions/1downarrow.png");
    objectActionMenu.add(downloadObjectMenuItem);

    uploadFilesMenuItem = new JMenuItem("Upload files...");
    uploadFilesMenuItem.setActionCommand("UploadFiles");
    uploadFilesMenuItem.addActionListener(this);
    guiUtils.applyIcon(uploadFilesMenuItem, "/images/nuvola/16x16/actions/1uparrow.png");
    objectActionMenu.add(uploadFilesMenuItem);

    objectActionMenu.add(new JSeparator());

    generatePublicGetUrls = new JMenuItem("Generate Public GET URLs...");
    generatePublicGetUrls.setActionCommand("GeneratePublicGetURLs");
    generatePublicGetUrls.addActionListener(this);
    guiUtils.applyIcon(generatePublicGetUrls, "/images/nuvola/16x16/actions/wizard.png");
    objectActionMenu.add(generatePublicGetUrls);

    generateTorrentUrl = new JMenuItem("Generate Torrent URL...");
    generateTorrentUrl.setActionCommand("GenerateTorrentURL");
    generateTorrentUrl.addActionListener(this);
    guiUtils.applyIcon(generateTorrentUrl, "/images/nuvola/16x16/actions/wizard.png");
    objectActionMenu.add(generateTorrentUrl);

    objectActionMenu.add(new JSeparator());

    deleteObjectMenuItem = new JMenuItem("Delete objects...");
    deleteObjectMenuItem.setActionCommand("DeleteObjects");
    deleteObjectMenuItem.addActionListener(this);
    guiUtils.applyIcon(deleteObjectMenuItem, "/images/nuvola/16x16/actions/cancel.png");
    objectActionMenu.add(deleteObjectMenuItem);

    viewOrModifyObjectAttributesMenuItem.setEnabled(false);
    copyObjectsMenuItem.setEnabled(false);
    refreshObjectMenuItem.setEnabled(false);
    updateObjectACLMenuItem.setEnabled(false);
    downloadObjectMenuItem.setEnabled(false);
    uploadFilesMenuItem.setEnabled(false);
    generatePublicGetUrls.setEnabled(false);
    generateTorrentUrl.setEnabled(false);
    deleteObjectMenuItem.setEnabled(false);

    // Tools menu.
    JMenu toolsMenu = new JMenu("Tools");

    bucketLoggingMenuItem = new JMenuItem("Configure Bucket logging...");
    bucketLoggingMenuItem.setActionCommand("BucketLogging");
    bucketLoggingMenuItem.addActionListener(this);
    bucketLoggingMenuItem.setEnabled(false);
    guiUtils.applyIcon(bucketLoggingMenuItem, "/images/nuvola/16x16/actions/toggle_log.png");
    toolsMenu.add(bucketLoggingMenuItem);

    manageDistributionsMenuItem = new JMenuItem("CloudFront Distributions...");
    manageDistributionsMenuItem.setActionCommand("ManageDistributions");
    manageDistributionsMenuItem.addActionListener(this);
    guiUtils.applyIcon(manageDistributionsMenuItem, "/images/nuvola/16x16/actions/irkick.png");
    manageDistributionsMenuItem.setEnabled(false);
    toolsMenu.add(manageDistributionsMenuItem);

    toolsMenu.add(new JSeparator());

    preferencesDialogMenuItem = new JMenuItem("Preferences...");
    preferencesDialogMenuItem.setActionCommand("PreferencesDialog");
    preferencesDialogMenuItem.addActionListener(this);
    guiUtils.applyIcon(preferencesDialogMenuItem, "/images/nuvola/16x16/actions/configure.png");
    toolsMenu.add(preferencesDialogMenuItem);

    // Help menu.
    JMenu helpMenu = new JMenu("Help");
    cockpitHelpMenuItem = new JMenuItem("Cockpit Guide");
    guiUtils.applyIcon(cockpitHelpMenuItem, "/images/nuvola/16x16/actions/help.png");
    cockpitHelpMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            try {
                followHyperlink(new URL(JETS3T_COCKPIT_HELP_PAGE), "_blank");
            } catch (MalformedURLException ex) {
                throw new IllegalStateException("Invalid URL embedded in program: " + JETS3T_COCKPIT_HELP_PAGE);
            }
        }
    });
    helpMenu.add(cockpitHelpMenuItem);
    amazonS3HelpMenuItem = new JMenuItem("Amazon S3");
    guiUtils.applyIcon(amazonS3HelpMenuItem, "/images/nuvola/16x16/actions/gohome.png");
    amazonS3HelpMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            try {
                followHyperlink(new URL(AMAZON_S3_PAGE), "_blank");
            } catch (MalformedURLException ex) {
                throw new IllegalStateException("Invalid URL embedded in program: " + AMAZON_S3_PAGE);
            }
        }
    });
    helpMenu.add(amazonS3HelpMenuItem);

    // Build application menu bar.
    appMenuBar.add(serviceMenu);
    appMenuBar.add(toolsMenu);
    appMenuBar.add(helpMenu);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingISOCountryCurrencyListJPanel.java

public JMenuBar getPanelMenuBar() {
    if (panelMenuBar == null) {
        JMenuItem menuItem;//from  ww w  . j  a  v  a  2 s .c  o m
        ICFLibAnyObj container = getSwingContainer();
        panelMenuBar = new JMenuBar();
        menuAdd = new JMenu("Add");
        actionAddISOCountryCurrency = new ActionAddISOCountryCurrency();
        if (container instanceof ICFSecurityISOCountryObj) {
            menuItem = new JMenuItem(actionAddISOCountryCurrency);
            menuAdd.add(menuItem);
        }
        if (getSwingContainer() != null) {
            panelMenuBar.add(menuAdd);
        }
        menuSelected = new JMenu("Selected");
        menuSelected.setEnabled(false);
        actionViewSelected = new ViewSelectedActionISOCountryCurrency();
        menuItem = new JMenuItem(actionViewSelected);
        menuSelected.add(menuItem);
        actionEditSelected = new EditSelectedActionISOCountryCurrency();
        menuItem = new JMenuItem(actionEditSelected);
        menuSelected.add(menuItem);
        actionDeleteSelected = new DeleteSelectedActionISOCountryCurrency();
        menuItem = new JMenuItem(actionDeleteSelected);
        menuSelected.add(menuItem);
        panelMenuBar.add(menuSelected);
    }
    return (panelMenuBar);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingISOCountryLanguageListJPanel.java

public JMenuBar getPanelMenuBar() {
    if (panelMenuBar == null) {
        JMenuItem menuItem;/*from  w ww .j a  v  a2s . c  o m*/
        ICFLibAnyObj container = getSwingContainer();
        panelMenuBar = new JMenuBar();
        menuAdd = new JMenu("Add");
        actionAddISOCountryLanguage = new ActionAddISOCountryLanguage();
        if (container instanceof ICFSecurityISOCountryObj) {
            menuItem = new JMenuItem(actionAddISOCountryLanguage);
            menuAdd.add(menuItem);
        }
        if (getSwingContainer() != null) {
            panelMenuBar.add(menuAdd);
        }
        menuSelected = new JMenu("Selected");
        menuSelected.setEnabled(false);
        actionViewSelected = new ViewSelectedActionISOCountryLanguage();
        menuItem = new JMenuItem(actionViewSelected);
        menuSelected.add(menuItem);
        actionEditSelected = new EditSelectedActionISOCountryLanguage();
        menuItem = new JMenuItem(actionEditSelected);
        menuSelected.add(menuItem);
        actionDeleteSelected = new DeleteSelectedActionISOCountryLanguage();
        menuItem = new JMenuItem(actionDeleteSelected);
        menuSelected.add(menuItem);
        panelMenuBar.add(menuSelected);
    }
    return (panelMenuBar);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingTenantListJPanel.java

public JMenuBar getPanelMenuBar() {
    if (panelMenuBar == null) {
        JMenuItem menuItem;/*w  w w  .  j  av a2 s.  co m*/
        ICFLibAnyObj container = getSwingContainer();
        panelMenuBar = new JMenuBar();
        menuAdd = new JMenu("Add");
        actionAddTenant = new ActionAddTenant();
        if (container instanceof ICFSecurityClusterObj) {
            menuItem = new JMenuItem(actionAddTenant);
            menuAdd.add(menuItem);
        }
        if (getSwingContainer() != null) {
            panelMenuBar.add(menuAdd);
        }
        menuSelected = new JMenu("Selected");
        menuSelected.setEnabled(false);
        actionViewSelected = new ViewSelectedActionTenant();
        menuItem = new JMenuItem(actionViewSelected);
        menuSelected.add(menuItem);
        actionEditSelected = new EditSelectedActionTenant();
        menuItem = new JMenuItem(actionEditSelected);
        menuSelected.add(menuItem);
        actionDeleteSelected = new DeleteSelectedActionTenant();
        menuItem = new JMenuItem(actionDeleteSelected);
        menuSelected.add(menuItem);
        panelMenuBar.add(menuSelected);
    }
    return (panelMenuBar);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingSecAppListJPanel.java

public JMenuBar getPanelMenuBar() {
    if (panelMenuBar == null) {
        JMenuItem menuItem;/* w  w w  .  j a v a 2  s  . c o  m*/
        ICFLibAnyObj container = getSwingContainer();
        panelMenuBar = new JMenuBar();
        menuAdd = new JMenu("Add");
        actionAddSecApp = new ActionAddSecApp();
        if (container instanceof ICFSecurityClusterObj) {
            menuItem = new JMenuItem(actionAddSecApp);
            menuAdd.add(menuItem);
        }
        if (getSwingContainer() != null) {
            panelMenuBar.add(menuAdd);
        }
        menuSelected = new JMenu("Selected");
        menuSelected.setEnabled(false);
        actionViewSelected = new ViewSelectedActionSecApp();
        menuItem = new JMenuItem(actionViewSelected);
        menuSelected.add(menuItem);
        actionEditSelected = new EditSelectedActionSecApp();
        menuItem = new JMenuItem(actionEditSelected);
        menuSelected.add(menuItem);
        actionDeleteSelected = new DeleteSelectedActionSecApp();
        menuItem = new JMenuItem(actionDeleteSelected);
        menuSelected.add(menuItem);
        panelMenuBar.add(menuSelected);
    }
    return (panelMenuBar);
}