Moving state variables from CoderClient to each GUI window.
This commit is contained in:
parent
6db9f94014
commit
eb71b4da59
6 changed files with 107 additions and 112 deletions
|
|
@ -51,6 +51,7 @@ public class LoginDialog extends GuiWindow {
|
|||
passwordPasswordField.requestFocus();
|
||||
}else{
|
||||
usernameTextField.requestFocus();
|
||||
passwordPasswordField.setText("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue