Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.

1 package org.antlr.works.plugin.container;2 3 importorg.antlr.xjlib.appkit.menu.XJMainMenuBar;4 importorg.antlr.xjlib.appkit.menu.XJMenu;5 importorg.antlr.xjlib.appkit.menu.XJMenuItem;6 importorg.antlr.xjlib.appkit.menu.XJMenuItemDelegate;7 importorg.antlr.works.IDE;8 importorg.antlr.works.editor.EditorMenu;9 /*10 11 [The "BSD licence"]12 Copyright (c) 2005-2006 Jean Bovet13 All rights reserved.14 15 Redistribution and use in source and binary forms, with or without16 modification, are permitted provided that the following conditions17 are met:18 19 1. Redistributions of source code must retain the above copyright20 notice, this list of conditions and the following disclaimer.21 2. Redistributions in binary form must reproduce the above copyright22 notice, this list of conditions and the following disclaimer in the23 documentation and/or other materials provided with the distribution.24 3. The name of the author may not be used to endorse or promote products25 derived from this software without specific prior written permission.26 27 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR28 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES29 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.30 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,31 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT32 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,33 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY34 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF36 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.37 38 */39 40 publicclass PCMenuHelpDelegate implementsXJMenuItemDelegate {41 42 privatePluginContainer container;43 44 public PCMenuHelpDelegate(PluginContainer pluginContainer) {45 this.container = pluginContainer;46 }47 48 publicvoid handleMenuEvent(XJMenu menu, XJMenuItem item) {49 switch(item.getTag()) {50 case XJMainMenuBar.MI_ABOUT:51 PluginContainer.showAbout();52 break;53 case XJMainMenuBar.MI_HELP:54 IDE.showHelp(container.getParent());55 break;56 case EditorMenu.MI_SUBMIT_STATS:57 IDE.submitStats(container.getParent());58 break;59 case EditorMenu.MI_SEND_FEEDBACK:60 IDE.submitFeedback(container.getParent());61 break;62 case EditorMenu.MI_CHECK_UPDATES:63 IDE.checkUpdates(container.getParent());64 break;65 }66 }67 68 }69