| | |
| | | import java.awt.event.ActionEvent; |
| | | import java.awt.event.ActionListener; |
| | | import java.io.IOException; |
| | | import java.io.StringReader; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | hmEditors.put(attrName.toLowerCase(), components); |
| | | |
| | | final Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | boolean isBinary = isBinary(attrName); |
| | | for (ByteString v : values) |
| | | { |
| | | gbc.fill = GridBagConstraints.HORIZONTAL; |
| | |
| | | components.add(new EditorComponent(ocCellPanel)); |
| | | break; |
| | | } |
| | | else if (isPassword(attrName) || isConfirmPassword(attrName)) |
| | | else if (isConfirmPassword(attrName) || isPassword(attrName)) |
| | | { |
| | | JPasswordField pf = Utilities.createPasswordField(); |
| | | if (!"".equals(v)) |
| | | { |
| | | pf.setText(getPasswordStringValue(attrName, v)); |
| | | pf.setText(getPasswordStringValue(getAttributeForConfirmPasswordKey(attrName), v)); |
| | | } |
| | | panel.add(pf, gbc); |
| | | components.add(new EditorComponent(pf)); |
| | | } |
| | | else if (!isBinary) |
| | | else if (!isBinary(attrName)) |
| | | { |
| | | if (isSingleValue(attrName)) |
| | | { |
| | |
| | | } |
| | | |
| | | final String ldif = getLDIF(); |
| | | try (LDIFEntryReader reader = new LDIFEntryReader(ldif) |
| | | try (LDIFEntryReader reader = new LDIFEntryReader(new StringReader(ldif)) |
| | | .setSchemaValidationPolicy(checkSchema() ? defaultPolicy():ignoreAll())) |
| | | { |
| | | final Entry entry = reader.readEntry(); |
| | |
| | | return key.startsWith(CONFIRM_PASSWORD); |
| | | } |
| | | |
| | | private String getAttributeForConfirmPasswordKey(String key) |
| | | { |
| | | return key.startsWith(CONFIRM_PASSWORD) ? key.substring(CONFIRM_PASSWORD.length()) : key; |
| | | } |
| | | |
| | | /** |
| | | * Returns the LDIF representation of the displayed entry. |
| | | * @return the LDIF representation of the displayed entry. |