1 23 package org.objectweb.clif.scenario.util.isac.gui.action; 24 25 import java.net.URL ; 26 27 import org.apache.log4j.Category; 28 import org.eclipse.jface.action.Action; 29 import org.eclipse.jface.resource.ImageDescriptor; 30 import org.eclipse.jface.window.ApplicationWindow; 31 import org.objectweb.clif.scenario.util.isac.FileName; 32 import org.objectweb.clif.scenario.util.isac.gui.ScenarioGUIEditor; 33 import org.objectweb.clif.scenario.util.isac.gui.tree.ScenarioTreeViewer; 34 import org.objectweb.clif.scenario.util.isac.util.tree.ScenarioNode; 35 import org.objectweb.clif.scenario.util.isac.util.tree.TreeManager; 36 42 public class NodeLowerAction extends Action { 43 46 ScenarioGUIEditor window; 47 ScenarioTreeViewer viewer; 48 static Category cat = Category.getInstance(NodeLowerAction.class.getName()); 49 55 public NodeLowerAction(ApplicationWindow w) { 56 cat.debug("-> constructor"); 57 this.window = (ScenarioGUIEditor) w; 58 this.setText("To down"); 59 this.setToolTipText("Change the place of a child node, to the down"); 60 try { 61 this.setImageDescriptor(ImageDescriptor.createFromURL(new URL ( 62 "file:" + FileName.DOWN_ARROW_ICON))); 63 } catch (Exception e) { 64 cat.warn("Unable to find exit icon file"); 65 } 66 } 67 68 public void run() { 69 cat.debug("-> run"); 70 this.viewer = this.window.getTreeViewer(); 71 ScenarioNode child = this.viewer.getSelectedNode(); 72 if (child == null) 73 return; 74 (TreeManager.getTreeManager(null)).changeChildPlace(child, false); 75 this.viewer.refresh(); 76 } 77 } | Popular Tags |