components.add(field);
continue;
}
if (item instanceof CredentialItem.Password) {
components.add(new JLabel(item.getPromptText()));
JTextField field = new JPasswordField();
field.putClientProperty(CRED_ITEM, item);
components.add(field);
continue;
}
if (item instanceof CredentialItem.StringType) {
components.add(new JLabel(item.getPromptText()));
JTextField field;
if (item.isValueSecure()) {
field = new JPasswordField();
} else {
field = new JTextField();
}
field.putClientProperty(CRED_ITEM, item);
components.add(field);
continue;
}
if (item instanceof CredentialItem.InformationalMessage) {
components.add(new JLabel(item.getPromptText()));
continue;
}
if (item instanceof CredentialItem.YesNoType) {
JCheckBox field = new JCheckBox(item.getPromptText(), ((CredentialItem.YesNoType) item).getValue());
field.putClientProperty(CRED_ITEM, item);
components.add(field);
continue;
}
}
return components.toArray(new JComponent[components.size()]);