if (selectionIndex != -1)
{
final CompositeData selectedLogger = (CompositeData)_table.getItem(
selectionIndex).getData();
String user = selectedLogger.get(USERNAME).toString();
InputDialog id = new InputDialog(setPasswordButton.getShell(),"Set Password",
"Please enter the new password for '" + user + "':",null,null){
@Override
protected Control createDialogArea(Composite parent)
{
Control control = super.createDialogArea(parent);
//set the Text field echo char to '*' to mask the password
getText().setEchoChar('*');
//return the normal result
return control;
}
};
int returnValue;
while((returnValue = id.open()) == InputDialog.OK)
{
if (id.getValue() == null || id.getValue().toString().length() == 0)
{
ViewUtility.popupErrorMessage("Set Password", "Please enter a valid password");
}
else
{
break;
}
}
if (returnValue == InputDialog.OK)
{
char[] password = id.getValue().toCharArray();
// Qpid JMX API 1.1 and below expects the password to be sent as a hashed value.
if (_ApiVersion.lessThanOrEqualTo(1,1))
{
try
{
password = ViewUtility.getHash(id.getValue());
}
catch (Exception hashException)
{
ViewUtility.popupErrorMessage("Set Password",
"Unable to calculate hash for Password:"