1 26 27 package org.objectweb.util.browser.plugin.java; 28 29 import java.util.Collection ; 30 31 import org.objectweb.util.browser.api.MenuItem; 32 import org.objectweb.util.browser.api.MenuItemTreeView; 33 import org.objectweb.util.browser.api.TreeView; 34 35 43 public class CollectionRemoveObjectAction 44 implements MenuItem { 45 46 52 58 64 70 83 public int 84 getStatus(TreeView treeView) { 85 return MenuItem.ENABLED_STATUS; 86 } 87 88 95 public void 96 actionPerformed(MenuItemTreeView treeView) 97 throws Exception { 98 Collection collection = (Collection )treeView.getParentObject(); 99 Object objectToRemove = treeView.getSelectedObject(); 100 collection.remove(objectToRemove); 101 } 102 103 } | Popular Tags |