Attachment 'HelloWorldPlugin.java'
Download 1 package helloworld;
2
3 import java.awt.event.ActionEvent;
4 import javax.swing.JOptionPane;
5 import cytoscape.Cytoscape;
6 import cytoscape.plugin.CytoscapePlugin;
7 import cytoscape.util.CytoscapeAction;
8
9 /**
10 * A menu item "Hello World" will appear at Plugins menu. Click on the menu
11 * item, a message dialog will show up.
12 */
13 public class HelloWorldPlugin extends CytoscapePlugin {
14
15 public HelloWorldPlugin() {
16 MyPluginMenuAction menuAction = new MyPluginMenuAction(this);
17 Cytoscape.getDesktop().getCyMenus().addCytoscapeAction((CytoscapeAction) menuAction);
18 }
19
20 public class MyPluginMenuAction extends CytoscapeAction {
21
22 public MyPluginMenuAction(HelloWorldPlugin myPlugin) {
23 super("Hello World");
24 setPreferredMenu("Plugins");
25 }
26
27 public void actionPerformed(ActionEvent e) {
28 JOptionPane.showMessageDialog(Cytoscape.getDesktop(),"Hello World is selected!");
29 }
30 }
31 }
32
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.- [get | view] (2011-10-20 20:44:17, 0.9 KB) [[attachment:HelloWorldPlugin.java]]
- [get | view] (2011-10-20 20:44:17, 1.7 KB) [[attachment:helloworld.jar]]
You are not allowed to attach a file to this page.