1 28 29 package org.objectweb.util.browser.plugins.fractal.menu; 30 31 import org.objectweb.fractal.api.NoSuchInterfaceException; 32 import org.objectweb.fractal.api.control.LifeCycleController; 33 import org.objectweb.util.browser.api.DropAction; 34 import org.objectweb.util.browser.api.DropTreeView; 35 import org.objectweb.util.browser.plugins.fractal.FcBrowser; 36 import org.objectweb.util.browser.plugins.fractal.api.FractalDropAction; 37 38 43 public abstract class DefaultFractalDropAction 44 implements DropAction, 45 FractalDropAction 46 { 47 53 59 65 71 74 public void execute(DropTreeView dropTreeView) throws Exception { 75 LifeCycleController lcc = null ; 76 try{ 77 lcc = FcBrowser.getLifeCycleController(FcBrowser.getComponent(dropTreeView.getSelectedObject())); 78 } catch (NoSuchInterfaceException e) { 79 try{ 80 executeStarted(dropTreeView); 81 } catch (Exception e1) { 82 executeStopped(dropTreeView); 83 } 84 } 85 if(lcc.getFcState().equals(LifeCycleController.STARTED)) 86 executeStarted(dropTreeView); 87 else 88 executeStopped(dropTreeView); 89 } 90 91 97 101 public abstract void executeStarted(DropTreeView dropTreeView) throws Exception ; 102 103 107 public void executeStopped(DropTreeView dropTreeView) throws Exception {} 108 109 110 } 111 | Popular Tags |