private void populateLabelAndFieldMaps()
{
HashMap<FieldName, LabelFieldDescriptor> hm =
new HashMap<FieldName, LabelFieldDescriptor>();
hm.put(FieldName.HOST_NAME, new LabelFieldDescriptor(
INFO_HOST_NAME_LABEL.get(),
INFO_HOST_NAME_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.TEXTFIELD,
LabelFieldDescriptor.LabelType.PRIMARY, UIFactory.HOST_FIELD_SIZE));
hm.put(FieldName.SERVER_PORT, new LabelFieldDescriptor(
INFO_SERVER_PORT_LABEL.get(),
INFO_SERVER_PORT_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.TEXTFIELD,
LabelFieldDescriptor.LabelType.PRIMARY, UIFactory.PORT_FIELD_SIZE));
hm.put(FieldName.ADMIN_CONNECTOR_PORT, new LabelFieldDescriptor(
INFO_ADMIN_CONNECTOR_PORT_LABEL.get(),
INFO_ADMIN_CONNECTOR_PORT_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.TEXTFIELD,
LabelFieldDescriptor.LabelType.PRIMARY, UIFactory.PORT_FIELD_SIZE));
hm.put(FieldName.SECURITY_OPTIONS, new LabelFieldDescriptor(
INFO_SERVER_SECURITY_LABEL.get(),
INFO_SERVER_SECURITY_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.READ_ONLY,
LabelFieldDescriptor.LabelType.PRIMARY, 0));
hm.put(FieldName.DIRECTORY_MANAGER_DN, new LabelFieldDescriptor(
INFO_SERVER_DIRECTORY_MANAGER_DN_LABEL.get(),
INFO_SERVER_DIRECTORY_MANAGER_DN_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.TEXTFIELD,
LabelFieldDescriptor.LabelType.PRIMARY, UIFactory.DN_FIELD_SIZE));
hm.put(FieldName.DIRECTORY_MANAGER_PWD, new LabelFieldDescriptor(
INFO_SERVER_DIRECTORY_MANAGER_PWD_LABEL.get(),
INFO_SERVER_DIRECTORY_MANAGER_PWD_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.PASSWORD,
LabelFieldDescriptor.LabelType.PRIMARY, UIFactory.PASSWORD_FIELD_SIZE));
hm.put(FieldName.DIRECTORY_MANAGER_PWD_CONFIRM,
new LabelFieldDescriptor(
INFO_SERVER_DIRECTORY_MANAGER_PWD_CONFIRM_LABEL.get(),
INFO_SERVER_DIRECTORY_MANAGER_PWD_CONFIRM_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.PASSWORD,
LabelFieldDescriptor.LabelType.PRIMARY,
UIFactory.PASSWORD_FIELD_SIZE));
for (FieldName fieldName : hm.keySet())
{
LabelFieldDescriptor desc = hm.get(fieldName);
String defaultValue = getDefaultValue(fieldName);
JLabel label = UIFactory.makeJLabel(desc);
if (fieldName != FieldName.SECURITY_OPTIONS)
{
JTextComponent field = UIFactory.makeJTextComponent(desc, defaultValue);
hmFields.put(fieldName, field);
label.setLabelFor(field);
}
else
{
lSecurity = UIFactory.makeJLabel(UIFactory.IconType.NO_ICON,
Message.raw(defaultValue),
UIFactory.TextStyle.SECONDARY_FIELD_VALID);
}
hmLabels.put(fieldName, label);
}
/* Create the elements for the location */
LabelFieldDescriptor desc =
new LabelFieldDescriptor(INFO_SERVER_LOCATION_LABEL.get(),
INFO_SERVER_LOCATION_PARENT_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.TEXTFIELD,
LabelFieldDescriptor.LabelType.PRIMARY, UIFactory.PATH_FIELD_SIZE);
lServerLocation = UIFactory.makeJLabel(desc);
tfServerLocationParent = UIFactory.makeJTextComponent(desc, "");
lServerLocation.setLabelFor(tfServerLocationParent);
hmLabels.put(FieldName.SERVER_LOCATION, lServerLocation);
desc =
new LabelFieldDescriptor(INFO_SERVER_LOCATION_LABEL.get(),
INFO_SERVER_LOCATION_RELATIVE_TOOLTIP.get(),
LabelFieldDescriptor.FieldType.TEXTFIELD,
LabelFieldDescriptor.LabelType.PRIMARY,
UIFactory.RELATIVE_PATH_FIELD_SIZE);
tfServerLocationRelativePath = UIFactory.makeJTextComponent(desc, "");