mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-21 17:29:55 +00:00
Improve file/volume name editing in create wizard.
This commit is contained in:
parent
e0b0cb5d8b
commit
f378b7f586
@ -92,7 +92,7 @@ public class DiskImageNamePane extends WizardPane {
|
||||
public void handleEvent(Event e) {
|
||||
String s = edit(fileName.getText(), e);
|
||||
wizard.setFileName(s);
|
||||
setButtonStatus();
|
||||
setButtonStatus();
|
||||
}
|
||||
});
|
||||
if (wizard.isFormatProdos() || wizard.isFormatPascal()) {
|
||||
@ -113,7 +113,7 @@ public class DiskImageNamePane extends WizardPane {
|
||||
e.text = e.text.toUpperCase();
|
||||
String s = edit(volumeName.getText(), e);
|
||||
wizard.setVolumeName(s);
|
||||
setButtonStatus();
|
||||
setButtonStatus();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -125,8 +125,13 @@ public class DiskImageNamePane extends WizardPane {
|
||||
* @return the modified name
|
||||
*/
|
||||
private String edit(String name, Event e) {
|
||||
if (e.character != '\b') return name + e.text;
|
||||
else return name.substring(0, name.length() - 1);
|
||||
if (e.character == '\b') {
|
||||
return name.substring(0, e.start)
|
||||
+ name.substring(e.end);
|
||||
} else {
|
||||
return name.substring(0, e.start)
|
||||
+ e.text + name.substring(e.end);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Enable the Next button when data has been entered into all fields.
|
||||
|
Loading…
Reference in New Issue
Block a user