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,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;
}
}