Back to index

wims  3.65+svn20090927
MenuItemAction.java
Go to the documentation of this file.
00001 package rene.gui;
00002 
00003 import java.awt.event.ActionEvent;
00004 import java.awt.event.ActionListener;
00005 
00012 class MenuItemActionTranslator implements ActionListener
00013 {      String S;
00014        DoActionListener C;
00015        public MenuItemActionTranslator (DoActionListener c, String s)
00016        {      S=s; C=c;
00017        }
00018        public void actionPerformed (ActionEvent e)
00019        {      C.doAction(S);
00020        }
00021 }
00022 
00023 public class MenuItemAction extends MyMenuItem
00024 {   MenuItemActionTranslator MIT;
00025        public MenuItemAction (DoActionListener c, String s, String st)
00026     {   super(s);
00027         addActionListener(MIT=new MenuItemActionTranslator(c,st));
00028     }
00029        public MenuItemAction (DoActionListener c, String s)
00030        {      this(c,s,s);
00031        }
00032        public void setString (String s)
00033        {      MIT.S=s;
00034        }
00035 }