public View create(final Element element) { if (echoCharIsSet() || !getI18nProperty()) { return new PasswordView(element); } else { return (View)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { Class cls = Class.forName(FIELD_VIEW_I18N_CLASS); Constructor constructor = cls.getConstructor(new Class[] {Element.class}); constructor.setAccessible(true); return constructor.newInstance(new Object[] {element}); } catch (Exception e) { return null; } } }); } }
public View create(Element elem) { return new PasswordView(elem); }
public void testCreateElement() { Element element = new PlainDocument().getDefaultRootElement(); assertTrue(ui.create(element) instanceof PasswordView); }
/** * Creates a view (PasswordView) for an element. * * @param elem the element * * @return the view */ public View create(Element elem) { return new PasswordView(elem); }