Moving state variables from CoderClient to each GUI window.

This commit is contained in:
dcollin 2015-10-27 12:18:22 +01:00
parent 6db9f94014
commit eb71b4da59
6 changed files with 107 additions and 112 deletions

View file

@ -51,6 +51,7 @@ public class LoginDialog extends GuiWindow {
passwordPasswordField.requestFocus();
}else{
usernameTextField.requestFocus();
passwordPasswordField.setText("");
}
}
}

View file

@ -32,6 +32,7 @@ public class NewProjectDialog extends GuiWindow {
for(NewProjectDialogListener listener : this.listeners){
listener.willShow();
}
//TODO: if(errorMessage == null || errorMessage.isEmpty()){project = ""; type = "";} //keep field data if there is an error
}
@Override

View file

@ -51,7 +51,7 @@ public class SelectProjectDialog extends GuiWindow {
for(SelectProjectDialogListener listener : this.listeners){
listener.willShow();
}
if(this.projectName != null){
if(this.projectName != null && !this.projectName.isEmpty()){
openButton.setDisable(false);
openButton.fire();
}
@ -134,7 +134,7 @@ public class SelectProjectDialog extends GuiWindow {
@FXML
protected void open(ActionEvent event){
if(this.projectName == null){
if(this.projectName == null || this.projectName.isEmpty()){
ProjectListItem selectedItem = projectListView.getSelectionModel().getSelectedItem();
projectName = selectedItem.getName();
}
@ -173,5 +173,13 @@ public class SelectProjectDialog extends GuiWindow {
public void setErrorMessage(String errorMsg){
this.errorLabel.setText(errorMsg);
}
public boolean isProjectSelected() {
return this.projectName != null && !this.projectName.isEmpty();
}
public String getSelectedProject() {
return this.projectName;
}
}