Lines 306-318
Link Here
|
306 |
} |
306 |
} |
307 |
|
307 |
|
308 |
/** Lazily loads classes */ // #9951 |
308 |
/** Lazily loads classes */ // #9951 |
309 |
private final Class getKlass(String cls) { |
309 |
private static final Class getKlass(String cls) { |
310 |
try { |
310 |
try { |
311 |
return Class.forName(cls, false, getClass().getClassLoader()); |
311 |
return Class.forName(cls, false, NonGui.class.getClassLoader()); |
312 |
} catch (ClassNotFoundException e) { |
312 |
} catch (ClassNotFoundException e) { |
313 |
throw new NoClassDefFoundError(e.getLocalizedMessage()); |
313 |
throw new NoClassDefFoundError(e.getLocalizedMessage()); |
314 |
} |
314 |
} |
315 |
} |
315 |
} |
|
|
316 |
|
317 |
/** Allow unit tests to call this to perform only property editor |
318 |
* registration */ |
319 |
public static final void registerPropertyEditors() { |
320 |
String[] syspesp = PropertyEditorManager.getEditorSearchPath(); |
321 |
String[] nbpesp = new String[] { |
322 |
"org.netbeans.beaninfo.editors", // NOI18N |
323 |
"org.openide.explorer.propertysheet.editors", // NOI18N |
324 |
}; |
325 |
String[] allpesp = new String[syspesp.length + nbpesp.length]; |
326 |
System.arraycopy(nbpesp, 0, allpesp, 0, nbpesp.length); |
327 |
System.arraycopy(syspesp, 0, allpesp, nbpesp.length, syspesp.length); |
328 |
PropertyEditorManager.setEditorSearchPath(allpesp); |
329 |
PropertyEditorManager.registerEditor (java.lang.Character.TYPE, getKlass("org.netbeans.beaninfo.editors.CharEditor")); |
330 |
PropertyEditorManager.registerEditor(getKlass("[Ljava.lang.String;"), getKlass("org.netbeans.beaninfo.editors.StringArrayEditor")); // NOI18N |
331 |
// bugfix #28676, register editor for a property which type is array of data objects |
332 |
PropertyEditorManager.registerEditor(getKlass("[Lorg.openide.loaders.DataObject;"), getKlass("org.netbeans.beaninfo.editors.DataObjectArrayEditor")); // NOI18N |
333 |
} |
316 |
|
334 |
|
317 |
/** Initialization of the manager. |
335 |
/** Initialization of the manager. |
318 |
*/ |
336 |
*/ |
Lines 333-351
Link Here
|
333 |
System.arraycopy(nbbisp, 0, allbisp, 0, nbbisp.length); |
351 |
System.arraycopy(nbbisp, 0, allbisp, 0, nbbisp.length); |
334 |
System.arraycopy(sysbisp, 0, allbisp, nbbisp.length, sysbisp.length); |
352 |
System.arraycopy(sysbisp, 0, allbisp, nbbisp.length, sysbisp.length); |
335 |
Introspector.setBeanInfoSearchPath(allbisp); |
353 |
Introspector.setBeanInfoSearchPath(allbisp); |
336 |
String[] syspesp = PropertyEditorManager.getEditorSearchPath(); |
354 |
|
337 |
String[] nbpesp = new String[] { |
355 |
registerPropertyEditors(); |
338 |
"org.netbeans.beaninfo.editors", // NOI18N |
356 |
|
339 |
"org.openide.explorer.propertysheet.editors", // NOI18N |
357 |
|
340 |
}; |
|
|
341 |
String[] allpesp = new String[syspesp.length + nbpesp.length]; |
342 |
System.arraycopy(nbpesp, 0, allpesp, 0, nbpesp.length); |
343 |
System.arraycopy(syspesp, 0, allpesp, nbpesp.length, syspesp.length); |
344 |
PropertyEditorManager.setEditorSearchPath(allpesp); |
345 |
PropertyEditorManager.registerEditor (java.lang.Character.TYPE, getKlass("org.netbeans.beaninfo.editors.CharEditor")); |
346 |
PropertyEditorManager.registerEditor(getKlass("[Ljava.lang.String;"), getKlass("org.netbeans.beaninfo.editors.StringArrayEditor")); // NOI18N |
347 |
// bugfix #28676, register editor for a property which type is array of data objects |
348 |
PropertyEditorManager.registerEditor(getKlass("[Lorg.openide.loaders.DataObject;"), getKlass("org.netbeans.beaninfo.editors.DataObjectArrayEditor")); // NOI18N |
349 |
StartLog.logProgress ("PropertyEditors registered"); // NOI18N |
358 |
StartLog.logProgress ("PropertyEditors registered"); // NOI18N |
350 |
|
359 |
|
351 |
// ----------------------------------------------------------------------------------------------------- |
360 |
// ----------------------------------------------------------------------------------------------------- |