1 2 import java.lang.Runnable ; 3 import org.objectweb.util.browser.api.MenuItem; 4 import org.objectweb.util.browser.api.MenuItemTreeView; 5 import org.objectweb.util.browser.api.TreeView; 6 7 14 public class InvokeAction 15 implements MenuItem 16 { 17 18 public void actionPerformed(MenuItemTreeView e) { 19 Runnable r = (Runnable )e.getSelectedObject(); 20 InvokeThread t = new InvokeThread(r); 21 t.start(); 22 } 23 24 27 public int getStatus(TreeView treeView) { 28 return MenuItem.ENABLED_STATUS; 29 } 30 31 public class InvokeThread extends Thread { 32 33 protected Runnable r_ = null; 34 35 public InvokeThread(Runnable r) { 36 r_ = r; 37 } 38 39 public void run() { 40 r_.run(); 41 } 42 } 43 44 } | Popular Tags |