KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > CalculateChange1


1 package test;
2
3 /** To use the ExtendedActionListener interface */
4 import org.objectweb.util.browser.api.MenuItem;
5 import org.objectweb.util.browser.api.MenuItemTreeView;
6 import org.objectweb.util.browser.api.TreeView;
7
8
9 public class CalculateChange1
10     implements MenuItem
11 {
12     
13     public void actionPerformed(MenuItemTreeView treeView){
14         Calculate cc = (Calculate)treeView.getSelectedObject();
15         cc.changeValue();
16     }
17  
18     /**
19      * @see org.objectweb.util.browser.api.MenuItem#isActive(java.lang.Object)
20      */

21     public int getStatus(TreeView treeView) {
22         Calculate cc = (Calculate)treeView.getSelectedObject();
23         if(cc.getValue()){
24             return MenuItem.ENABLED_STATUS;
25         }else{
26             return MenuItem.DISABLED_STATUS;
27         }
28     }
29     
30 }
Popular Tags