Added NewProjectDialog, fixed some error handling and general stability fixes
This commit is contained in:
parent
34cf5865fe
commit
223fe1f136
13 changed files with 336 additions and 54 deletions
|
|
@ -16,6 +16,7 @@ import javafx.collections.ObservableList;
|
|||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.ListCell;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.input.KeyCode;
|
||||
|
|
@ -36,6 +37,7 @@ public class SelectProjectDialog extends GuiWindow {
|
|||
@FXML private Button newProjectButton;
|
||||
@FXML private Button cancelButton;
|
||||
@FXML private Button openButton;
|
||||
@FXML private Label errorLabel;
|
||||
|
||||
private String projectName = null;
|
||||
|
||||
|
|
@ -54,10 +56,12 @@ public class SelectProjectDialog extends GuiWindow {
|
|||
openButton.fire();
|
||||
}
|
||||
openButton.setDisable(true);
|
||||
projectListView.requestFocus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
|
||||
errorLabel.setText("");
|
||||
projectList = FXCollections.observableArrayList();
|
||||
projectListView.setItems(projectList);
|
||||
projectListView.setCellFactory(new Callback<ListView<ProjectListItem>, ListCell<ProjectListItem>>(){
|
||||
|
|
@ -164,5 +168,10 @@ public class SelectProjectDialog extends GuiWindow {
|
|||
public void setProject(String project) {
|
||||
this.projectName = project;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setErrorMessage(String errorMsg){
|
||||
this.errorLabel.setText(errorMsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue