}
EditorFacade.getInstance().modifyDoubleInfo(info, d);
break;
}
case ConstantPoolInfo.FLOAT: {
FloatInfo info = (FloatInfo) cpi;
float f = 0;
try {
f = Float.parseFloat(newValue);
} catch (NumberFormatException nfe) {
throw new BasicInfoEditor.ValidationException(
"Not a valid float. (" + nfe.getMessage() + ")");
}
EditorFacade.getInstance().modifyFloatInfo(info, f);
break;
}
case ConstantPoolInfo.INTEGER: {
IntegerInfo info = (IntegerInfo) cpi;
int i = 0;
try {
i = Integer.parseInt(newValue);
} catch (NumberFormatException nfe) {
throw new BasicInfoEditor.ValidationException(
"Not a valid integer. (" + nfe.getMessage() + ")");
}
EditorFacade.getInstance().modifyIntegerInfo(info, i);
break;
}
case ConstantPoolInfo.LONG: {
LongInfo info = (LongInfo) cpi;
long l = 0;
try {
l = Long.parseLong(newValue);
} catch (NumberFormatException nfe) {
throw new BasicInfoEditor.ValidationException(
"Not a valid long. (" + nfe.getMessage() + ")");
}
EditorFacade.getInstance().modifyLongInfo(info, l);
break;
}
case ConstantPoolInfo.STRING: {
StringInfo info = (StringInfo) cpi;
int answer = JOptionPane.showOptionDialog(this,
"Modify underlying UTF-8 info or create a new one.",
"Modify String Info item",
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE, null, new String[] {
"Modify", "Create new", "Cancel" }, "Modify");
if (answer == JOptionPane.YES_OPTION) {
// Modify UTF-8 Info
UTF8Info ui = info.getUTF8Info();
EditorFacade.getInstance().modifyUTF8Info(ui, newValue);
break;
} else if (answer == JOptionPane.NO_OPTION) {
// Create a new UTF-8 Info