KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > browser > plugin > java > RemoveFromContextAction


1 package org.objectweb.util.browser.plugin.java;
2
3 /** The console's imports */
4 import org.objectweb.util.browser.api.Entry;
5 import org.objectweb.util.browser.api.MenuItem;
6 import org.objectweb.util.browser.api.MenuItemTreeView;
7 import org.objectweb.util.browser.api.TreeView;
8 import org.objectweb.util.browser.core.api.ContextContainer;
9
10 public class RemoveFromContextAction
11     implements MenuItem {
12
13     public void actionPerformed(MenuItemTreeView treeView) {
14         if (treeView != null) {
15             Entry entry = treeView.getSelectedEntry();
16             String JavaDoc value = entry.getName().toString();
17             ContextContainer context = (ContextContainer) treeView.getParentObject();
18             context.removeEntry(value);
19         }
20     }
21     
22     /**
23      * @see org.objectweb.util.browser.api.MenuItem#getStatus(org.objectweb.util.browser.api.TreeView)
24      */

25     public int getStatus(TreeView treeView) {
26         return MenuItem.ENABLED_STATUS;
27     }
28     
29 }
30
Popular Tags