1 19 package org.netbeans.modules.xml.tax; 20 21 import java.beans.*; 22 import java.util.Arrays ; 23 import java.util.List ; 24 import java.util.LinkedList ; 25 26 import org.openide.modules.ModuleInstall; 27 28 33 public class TAXModuleInstall extends ModuleInstall { 34 35 private static final long serialVersionUID = -668302799172493302L; 36 37 private static final String BEANINFO_PATH = "org.netbeans.modules.xml.tax.beans.beaninfo"; private static final String EDITOR_PATH = "org.netbeans.modules.xml.tax.beans.editor"; 39 40 41 43 public void restored () { 44 installBeans(); 45 } 46 47 49 public void uninstalled () { 50 uninstallBeans(); 51 } 52 53 54 58 60 private void installBeans () { 61 List searchPath; 62 63 searchPath = new LinkedList (Arrays.asList (Introspector.getBeanInfoSearchPath())); 64 searchPath.add (BEANINFO_PATH); 65 Introspector.setBeanInfoSearchPath ((String [])searchPath.toArray (new String [0])); 66 67 searchPath = new LinkedList (Arrays.asList (PropertyEditorManager.getEditorSearchPath())); 68 searchPath.add (EDITOR_PATH); 69 PropertyEditorManager.setEditorSearchPath ((String [])searchPath.toArray (new String [0])); 70 } 71 72 74 private void uninstallBeans () { 75 List searchPath; 76 77 searchPath = new LinkedList (Arrays.asList (Introspector.getBeanInfoSearchPath())); 78 searchPath.remove (BEANINFO_PATH); 79 Introspector.setBeanInfoSearchPath ((String [])searchPath.toArray (new String [0])); 80 81 searchPath = new LinkedList (Arrays.asList (PropertyEditorManager.getEditorSearchPath())); 82 searchPath.remove (EDITOR_PATH); 83 PropertyEditorManager.setEditorSearchPath ((String [])searchPath.toArray (new String [0])); 84 } 85 86 } 87 | Popular Tags |