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 39 public class CollapseCurrentTreeAction extends Action { 40 43 ScenarioGUIEditor window; 44 static Category cat = Category.getInstance(CollapseCurrentTreeAction.class.getName()); 45 46 50 public CollapseCurrentTreeAction(ApplicationWindow w) { 51 cat.debug("-> constructor") ; 52 this.window = (ScenarioGUIEditor)w; 53 this.setText("Collapse current tree@Ctrl+Alt+C"); 54 this.setToolTipText("Collapse the current tree, The tree containing by the treeViewer which has the focus"); 55 try { 56 this.setImageDescriptor(ImageDescriptor.createFromURL( 57 new URL ("file:" + FileName.COLLAPSE_ICON))); 58 } catch (Exception e) { 59 cat.warn("Unable to find collapse icon file"); 60 } 61 62 } 63 64 public void run() { 65 cat.debug("-> run") ; 66 this.window.getTreeViewer().collapseAll() ; 67 } 68 } 69 | Popular Tags |