/* Author: Jeff Dalton * Updated: Fri Nov 30 23:35:33 2001 by Jeff Dalton * Copyright: (c) 2001, AIAI, University of Edinburgh */ package ix.ileed; import javax.swing.JMenu; import java.awt.event.*; import ix.ideel.IssueViewingTable; import ix.icore.IXAgent; import ix.util.*; public class IleedIssueViewingTable extends IssueViewingTable { public IleedIssueViewingTable(IXAgent agent) { super(agent); } public void addTestMenuItems(JMenu testMenu) { TestActionListener listener = new IleedTestActionListener(); testMenu.add(listener.makeMenuItem ("Add issue \"Separate Gao and Agadez forces\"")); testMenu.add(listener.makeMenuItem ("Add issue \"Consider elephants laki_safari_park\"")); } protected class IleedTestActionListener extends IssueViewingTable.TestActionListener { public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); Debug.noteln("Issue viewer action:", command); if (command.equals ("Add issue \"Separate Gao and Agadez forces\"")) { addIssue("separate gao and agadez forces"); } else if (command.equals ("Add issue \"Consider elephants laki_safari_park\"")) { addIssue("consider elephants laki_safari_park"); } else Debug.noteln("Nothing to do for", command); } } } // Issues: // * This is probably not the right way to change the test-menu items. // * For some reason, makeMenuItem(String) has to be public in // ix.ideel.IssueViewingTable.TestActionListener before we can // have a call to the inherited makeMenuItem(String) method in // our subclass. (Of course, the whole thing can be avoided // by replacing the makeMenuItem trick by something that gives // the action listener as a parameter.)