1 19 20 package org.netbeans.modules.xml.text.syntax; 21 22 import java.util.*; 23 import org.netbeans.modules.xml.core.actions.CollectSystemAction; 24 import org.openide.actions.OpenAction; 25 import org.openide.actions.ViewAction; 26 import org.openide.modules.*; 27 import org.openide.util.*; 28 import org.openide.util.actions.SystemAction; 29 30 36 final class XMLViewActions extends CollectSystemAction { 37 38 39 private static final long serialVersionUID = 8223872687291078210L; 40 41 43 protected final Class getActionLookClass () { 44 return null; 46 } 47 48 protected Collection getPossibleActions () { 49 Collection actions = new Vector(2); 50 51 boolean visualEditorInstalled = false; 53 Lookup lookup = Lookup.getDefault(); 54 Lookup.Template t = new Lookup.Template(ModuleInfo.class); 55 Iterator it = lookup.lookup(t).allInstances().iterator(); 56 while (it.hasNext()) { 57 ModuleInfo next = (ModuleInfo) it.next(); 58 if (next.getCodeNameBase().equals("org.netbeans.modules.xml.tree") && next.isEnabled()) { visualEditorInstalled = true; 60 break; 61 } 62 } 63 if (visualEditorInstalled) { 64 actions.add (SystemAction.get (OpenAction.class)); 65 } 66 actions.add (SystemAction.get (ViewAction.class)); 67 return actions; 68 } 69 70 71 75 public void actionPerformed (java.awt.event.ActionEvent e) { 76 } 77 78 79 81 public String getName () { 82 return Util.THIS.getString ("NAME_WeakXMLActions"); 83 } 84 85 87 public HelpCtx getHelpCtx () { 88 return new HelpCtx (XMLViewActions.class); 89 } 90 91 } 92 | Popular Tags |