in client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java [275:442]
private void showHide() {
int typeOrdinal = -1;
try {
typeOrdinal = Integer.parseInt(type.getField().getValue());
} catch (NumberFormatException e) {
LOG.error("Invalid value found: {}", type.getField().getValue(), e);
}
if (AttrSchemaType.Long.ordinal() == typeOrdinal
|| AttrSchemaType.Double.ordinal() == typeOrdinal
|| AttrSchemaType.Date.ordinal() == typeOrdinal) {
conversionParams.setVisible(true);
enumParams.setVisible(false);
enumValues.setModelObject(new HashMap<>());
dropdownParams.setVisible(false);
dropdownValueProvider.setModelObject(null);
if (dropdownValueProvider.isRequired()) {
dropdownValueProvider.removeRequiredLabel();
}
encryptedParams.setVisible(false);
if (secretKey.isRequired()) {
secretKey.removeRequiredLabel();
}
secretKey.setModelObject(null);
if (cipherAlgorithm.isRequired()) {
cipherAlgorithm.removeRequiredLabel();
}
cipherAlgorithm.setModelObject(null);
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
} else if (AttrSchemaType.Enum.ordinal() == typeOrdinal) {
conversionParams.setVisible(false);
conversionPattern.setModelObject(null);
enumParams.setVisible(true);
enumValues.setModelObject(schemaTO.getEnumValues());
dropdownParams.setVisible(false);
dropdownValueProvider.setModelObject(null);
if (dropdownValueProvider.isRequired()) {
dropdownValueProvider.removeRequiredLabel();
}
encryptedParams.setVisible(false);
if (secretKey.isRequired()) {
secretKey.removeRequiredLabel();
}
secretKey.setModelObject(null);
if (cipherAlgorithm.isRequired()) {
cipherAlgorithm.removeRequiredLabel();
}
cipherAlgorithm.setModelObject(null);
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
} else if (AttrSchemaType.Dropdown.ordinal() == typeOrdinal) {
conversionParams.setVisible(false);
conversionPattern.setModelObject(null);
enumParams.setVisible(false);
enumValues.setModelObject(schemaTO.getEnumValues());
dropdownParams.setVisible(true);
if (!dropdownValueProvider.isRequired()) {
dropdownValueProvider.addRequiredLabel();
}
encryptedParams.setVisible(false);
if (secretKey.isRequired()) {
secretKey.removeRequiredLabel();
}
secretKey.setModelObject(null);
if (cipherAlgorithm.isRequired()) {
cipherAlgorithm.removeRequiredLabel();
}
cipherAlgorithm.setModelObject(null);
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
} else if (AttrSchemaType.Encrypted.ordinal() == typeOrdinal) {
conversionParams.setVisible(false);
enumParams.setVisible(false);
enumValues.setModelObject(new HashMap<>());
dropdownParams.setVisible(false);
dropdownValueProvider.setModelObject(null);
if (dropdownValueProvider.isRequired()) {
dropdownValueProvider.removeRequiredLabel();
}
encryptedParams.setVisible(true);
if (!secretKey.isRequired()) {
secretKey.addRequiredLabel();
}
if (cipherAlgorithm.isRequired()) {
cipherAlgorithm.addRequiredLabel();
}
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
} else if (AttrSchemaType.Binary.ordinal() == typeOrdinal) {
conversionParams.setVisible(false);
conversionPattern.setModelObject(null);
enumParams.setVisible(false);
enumValues.setModelObject(new HashMap<>());
dropdownParams.setVisible(false);
dropdownValueProvider.setModelObject(null);
if (dropdownValueProvider.isRequired()) {
dropdownValueProvider.removeRequiredLabel();
}
encryptedParams.setVisible(false);
if (secretKey.isRequired()) {
secretKey.removeRequiredLabel();
}
secretKey.setModelObject(null);
if (cipherAlgorithm.isRequired()) {
cipherAlgorithm.removeRequiredLabel();
}
cipherAlgorithm.setModelObject(null);
binaryParams.setVisible(true);
mimeType.setChoices(mimeTypesLoader.getMimeTypes());
schemaTO.setValidator("BinaryValidator");
} else {
conversionParams.setVisible(false);
conversionPattern.setModelObject(null);
enumParams.setVisible(false);
enumValues.setModelObject(new HashMap<>());
dropdownParams.setVisible(false);
dropdownValueProvider.setModelObject(null);
if (dropdownValueProvider.isRequired()) {
dropdownValueProvider.removeRequiredLabel();
}
encryptedParams.setVisible(false);
if (secretKey.isRequired()) {
secretKey.removeRequiredLabel();
}
secretKey.setModelObject(null);
if (cipherAlgorithm.isRequired()) {
cipherAlgorithm.removeRequiredLabel();
}
cipherAlgorithm.setModelObject(null);
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
}
if (type.isEnabled() && AttrSchemaType.Binary.ordinal() != typeOrdinal) {
schemaTO.setValidator(null);
}
}