1 19 20 package org.netbeans.modules.languages.features; 21 22 import java.awt.event.ActionEvent ; 23 import java.util.ArrayList ; 24 import java.util.List ; 25 import javax.swing.text.JTextComponent ; 26 import org.netbeans.api.editor.fold.FoldHierarchy; 27 import org.netbeans.api.editor.fold.FoldHierarchy; 28 import org.netbeans.api.editor.fold.FoldType; 29 import org.netbeans.api.editor.fold.FoldUtilities; 30 import org.netbeans.editor.BaseAction; 31 32 33 37 public class CollapseFoldTypeAction extends BaseAction { 38 39 public CollapseFoldTypeAction (String name){ 40 super (name); 41 } 44 45 public void actionPerformed (ActionEvent evt, JTextComponent target) { 46 FoldHierarchy hierarchy = FoldHierarchy.get (target); 47 List <FoldType> types = new ArrayList <FoldType> (); 49 types.add (Folds.getFoldType ((String ) getValue (NAME))); 50 FoldUtilities.collapse (hierarchy, types); 51 } 52 } 53 54 | Popular Tags |