Implements proper saving and loading of servers and profiles

This commit is contained in:
2018-02-03 14:39:22 +01:00
parent 27024d7b8f
commit e9e500fb2f
5 changed files with 87 additions and 24 deletions

View File

@ -118,15 +118,6 @@ public class GUI implements ActionListener {
this.profiles.removeItemAt(index);
}
/*public Profile currentProfile() {
Object selected = profiles.getSelectedItem();
if (selected != null) {
return Profile.getProfile(selected.toString());
} else {
return null;
}
}*/
private void initialize() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
@ -511,7 +502,6 @@ public class GUI implements ActionListener {
*/
private void save() {
Profile.getCurrent().save();
//TODO: Save to a text file.
}
/**

View File

@ -25,6 +25,15 @@ public class ServerTab implements ActionListener {
private final JPanel panel;
private final String name;
public void setData(String path, boolean enabled, String typeName, String serverVersion, String maxRam) {
this.directory.setText(path);
this.chckbxEnabled.setSelected(enabled);
this.serverTypes.setSelectedItem(typeName);
this.serverTypes();
this.serverTypes.setSelectedItem(serverVersion);
this.maxRam.setSelectedItem(maxRam);
}
public ServerTab(String name) {
this.name = name;
panel = new JPanel();