< prev index next >

src/java.desktop/share/classes/java/beans/PropertyEditorManager.java

Print this page




  91     public static PropertyEditor findEditor(Class<?> targetType) {
  92         return ThreadGroupContext.getContext().getPropertyEditorFinder().find(targetType);
  93     }
  94 
  95     /**
  96      * Gets the package names that will be searched for property editors.
  97      *
  98      * @return  The array of package names that will be searched in
  99      *          order to find property editors.
 100      * <p>     The default value for this array is implementation-dependent,
 101      *         e.g. Sun implementation initially sets to  {"sun.beans.editors"}.
 102      */
 103     public static String[] getEditorSearchPath() {
 104         return ThreadGroupContext.getContext().getPropertyEditorFinder().getPackages();
 105     }
 106 
 107     /**
 108      * Change the list of package names that will be used for
 109      *          finding property editors.
 110      *
 111      * <p>First, if there is a security manager, its <code>checkPropertiesAccess</code>
 112      * method is called. This could result in a SecurityException.
 113      *
 114      * @param path  Array of package names.
 115      * @exception  SecurityException  if a security manager exists and its
 116      *             <code>checkPropertiesAccess</code> method doesn't allow setting
 117      *              of system properties.
 118      * @see SecurityManager#checkPropertiesAccess
 119      */
 120     public static void setEditorSearchPath(String[] path) {
 121         SecurityManager sm = System.getSecurityManager();
 122         if (sm != null) {
 123             sm.checkPropertiesAccess();
 124         }
 125         ThreadGroupContext.getContext().getPropertyEditorFinder().setPackages(path);
 126     }
 127 }


  91     public static PropertyEditor findEditor(Class<?> targetType) {
  92         return ThreadGroupContext.getContext().getPropertyEditorFinder().find(targetType);
  93     }
  94 
  95     /**
  96      * Gets the package names that will be searched for property editors.
  97      *
  98      * @return  The array of package names that will be searched in
  99      *          order to find property editors.
 100      * <p>     The default value for this array is implementation-dependent,
 101      *         e.g. Sun implementation initially sets to  {"sun.beans.editors"}.
 102      */
 103     public static String[] getEditorSearchPath() {
 104         return ThreadGroupContext.getContext().getPropertyEditorFinder().getPackages();
 105     }
 106 
 107     /**
 108      * Change the list of package names that will be used for
 109      *          finding property editors.
 110      *
 111      * <p>First, if there is a security manager, its {@code checkPropertiesAccess}
 112      * method is called. This could result in a SecurityException.
 113      *
 114      * @param path  Array of package names.
 115      * @exception  SecurityException  if a security manager exists and its
 116      *             {@code checkPropertiesAccess} method doesn't allow setting
 117      *              of system properties.
 118      * @see SecurityManager#checkPropertiesAccess
 119      */
 120     public static void setEditorSearchPath(String[] path) {
 121         SecurityManager sm = System.getSecurityManager();
 122         if (sm != null) {
 123             sm.checkPropertiesAccess();
 124         }
 125         ThreadGroupContext.getContext().getPropertyEditorFinder().setPackages(path);
 126     }
 127 }
< prev index next >