ch.claudio.pen.data
Class MenuItem

java.lang.Object
  extended by ch.claudio.pen.data.MenuItem

public class MenuItem
extends java.lang.Object

A simple data structure for a menu item. The text is displayed to the user for selection. The action is executed if the user selects the menu item.

Version:
$Id: MenuItem.java 25 2006-07-10 23:44:44Z $
Author:
Claudio Nieder

Copyright (C) 2006 Claudio Nieder <private@claudio.ch>, CH-8610 Uster

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


Constructor Summary
MenuItem(java.lang.String textArg, java.lang.Runnable actionArg)
          Create a new item supplying both the idetifing text and the action.
 
Method Summary
 java.lang.Runnable getAction()
           
 java.lang.String getText()
           
static void main(java.lang.String[] args)
          Print license.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuItem

public MenuItem(java.lang.String textArg,
                java.lang.Runnable actionArg)
Create a new item supplying both the idetifing text and the action.

Parameters:
textArg - string to be displayed
actionArg - runnable who's run method is executed.
Method Detail

getAction

public java.lang.Runnable getAction()
Returns:
the action

getText

public java.lang.String getText()
Returns:
the text

main

public static void main(java.lang.String[] args)
Print license.

Parameters:
args - ignored