/** * ValidationBeanInfo constructor. * * <p>Description */ public ValidationBeanInfo() { super(); PropertyEditorManager.registerEditor(URL.class, URLPropertyEditor.class); }
@Override void register() { ClassLoader clsLoader = findClsLoader(); for (Iterator it = lookupResult.allInstances().iterator(); it.hasNext();) { PEClassRegistration clsReg = (PEClassRegistration) it.next(); for (String type : clsReg.targetTypes) { try { Class<?> cls = getClassFromCanonicalName(type); Class<?> editorCls = Class.forName(clsReg.editorClass, true, clsLoader); PropertyEditorManager.registerEditor(cls, editorCls); } catch (ClassNotFoundException ex) { Exceptions.printStackTrace(ex); } } } }
/** * Register an editor class to be used to editor values of a given target class. * * @param type The class of the objetcs to be edited. * @param editorType The class of the editor. */ public static void registerEditor(final Class<?> type, final Class<?> editorType) { PropertyEditorManager.registerEditor(type, editorType); }
/** * Performs the boot. */ protected void performBoot() { // nothing required. Just gather the configuration. PropertyEditorManager.registerEditor( Boolean.class, BooleanPropertyEditor.class ); PropertyEditorManager.registerEditor( Font.class, FontPropertyEditor.class ); PropertyEditorManager.registerEditor( Color.class, ColorPropertyEditor.class ); }
public SbbEntitiesMBeanImpl(SbbEntityFactory sbbEntityFactory) { super(sbbEntityFactory.getSleeContainer()); this.sbbEntityFactory = sbbEntityFactory; PropertyEditorManager.registerEditor(SbbEntityID[].class, SbbEntityIDArrayPropertyEditor.class); PropertyEditorManager.registerEditor(SbbEntityID.class, SbbEntityIDPropertyEditor.class); }
public static PropertyEditor get(final Class<?> type) { final PropertyEditor editor = PropertyEditorManager.findEditor(type); if (editor != null) return editor; final Class<Editors> c = Editors.class; try { final Class<?> editorClass = c.getClassLoader().loadClass(c.getName().replace("Editors", type.getSimpleName() + "Editor")); PropertyEditorManager.registerEditor(type, editorClass); return PropertyEditorManager.findEditor(type); } catch (final ClassNotFoundException e) { return null; } }
protected static void unregisterEditor(String typeName) { Class type = loadClass(typeName); if (type != null) { PropertyEditorManager.registerEditor(type, null); } } public static Class loadClass(String name) {
protected static void unregisterEditor(String typeName) { Class type = loadClass(typeName); if (type != null) { PropertyEditorManager.registerEditor(type, null); } } public static Class loadClass(String name) {
protected static void unregisterEditor(String typeName) { Class type = loadClass(typeName); if (type != null) { PropertyEditorManager.registerEditor(type, null); } } public static Class loadClass(String name) {
@Override protected void triggerLeak() throws Exception { PropertyEditorManager.registerEditor(String[].class, Foo.class); // Before Java 7, this caused a leak }
@Override public Converter register(final Converter converter) { final Converter register = super.register(converter); if (registerWithVM) { PropertyEditorManager.registerEditor(converter.getType(), converter.getClass()); final Class<?> sibling = Primitives.findSibling(converter.getType()); if (sibling != null) { PropertyEditorManager.registerEditor(sibling, converter.getClass()); } } return register; } };
/** * Creates a single stand-alone settings editor panel * * @param settingsToEdit the settings to edit * @return a single settings editor panel for the supplied settings */ public static SingleSettingsEditor createSingleSettingsEditor( Map<Settings.SettingKey, Object> settingsToEdit) { GenericObjectEditor.registerEditors(); PropertyEditorManager.registerEditor(Color.class, ColorEditor.class); return new SingleSettingsEditor(settingsToEdit); }
protected static void registerEditor(String typeName, String editorName) { Class type = loadClass(typeName); Class editor = loadClass(editorName); if (type != null && editor != null) { PropertyEditorManager.registerEditor(type, editor); } }
public CSVReaderGeneric() { // Description du mapping strategy = new HeaderColumnNameTranslateMappingStrategy(); initStrategy(); // Ajout de la conversion pour les dates PropertyEditorManager.registerEditor(Date.class, DatePropertyEditor.class); }
protected static void registerEditor(String typeName, String editorName) { Class type = loadClass(typeName); Class editor = loadClass(editorName); if (type != null && editor != null) { PropertyEditorManager.registerEditor(type, editor); } }
protected static void registerEditor(String typeName, String editorName) { Class type = loadClass(typeName); Class editor = loadClass(editorName); if (type != null && editor != null) { PropertyEditorManager.registerEditor(type, editor); } }
public CSVReaderGeneric() { // Description du mapping strategy = new HeaderColumnNameTranslateMappingStrategy(); initStrategy(); // Ajout de la conversion pour les dates PropertyEditorManager.registerEditor(Date.class, DatePropertyEditor.class); }
protected static void registerEditor(String typeName, String editorName) { Class type = loadClass(typeName); Class editor = loadClass(editorName); if (type != null && editor != null) { PropertyEditorManager.registerEditor(type, editor); } }
public SettingsEditor(Settings settings, GUIApplication ownerApp) { setLayout(new BorderLayout()); m_settings = settings; m_ownerApp = ownerApp; GenericObjectEditor.registerEditors(); PropertyEditorManager.registerEditor(Color.class, ColorEditor.class); if (m_ownerApp.getPerspectiveManager().getLoadedPerspectives().size() > 0) { setupPerspectiveSelector(); } setupPerspectiveSettings(); add(m_settingsTabs, BorderLayout.CENTER); }
public void load() { final AnnotationFinder finder = new AnnotationFinder(new CompositeArchive(thisArchive(), cpArchive())).enableFindSubclasses(); for (final Annotated<Class<?>> clazz : finder.findMetaAnnotatedClasses(Editor.class)) { PropertyEditorManager.registerEditor(clazz.getAnnotation(Editor.class).value(), clazz.get()); } } }