some more buttons in the GUI and fixed the project list logic when the list was cleared.
This commit is contained in:
parent
eb35156313
commit
120dded24f
9 changed files with 63 additions and 17 deletions
|
|
@ -1,19 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
|
||||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="217.0" prefWidth="396.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<AnchorPane xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<ScrollPane fitToHeight="true" fitToWidth="true" hbarPolicy="NEVER">
|
||||
<ScrollPane fitToHeight="true" fitToWidth="true" hbarPolicy="NEVER" prefHeight="164.0" prefWidth="396.0" AnchorPane.bottomAnchor="50.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<content>
|
||||
<ListView fx:id="projectListView" prefHeight="200.0" prefWidth="200.0" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
<GridPane prefHeight="77.0" prefWidth="396.0">
|
||||
<GridPane maxHeight="-Infinity" minHeight="-Infinity" prefHeight="50.0" prefWidth="396.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
|
|
@ -43,9 +44,14 @@
|
|||
<Insets left="10.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button mnemonicParsing="false" onAction="#refresh" text="Refresh">
|
||||
<HBox.margin>
|
||||
<Insets left="10.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
</VBox>
|
||||
</AnchorPane>
|
||||
|
|
|
|||
|
|
@ -51,10 +51,16 @@ public class SelectProjectDialog extends GuiWindow {
|
|||
projectListView.setCellFactory(new Callback<ListView<ProjectListItem>, ListCell<ProjectListItem>>(){
|
||||
@Override
|
||||
public ListCell<ProjectListItem> call(ListView<ProjectListItem> arg0) {
|
||||
System.out.println("cell factory");
|
||||
ListCell<ProjectListItem> cell = new ListCell<ProjectListItem>(){
|
||||
@Override
|
||||
protected void updateItem(ProjectListItem item, boolean empty){
|
||||
System.out.println("update item: " + item);
|
||||
super.updateItem(item, empty);
|
||||
if(empty){
|
||||
setText("");
|
||||
setGraphic(null);
|
||||
}
|
||||
if(item != null){
|
||||
setText(item.toString());
|
||||
//setGraphic(null);
|
||||
|
|
@ -124,5 +130,10 @@ public class SelectProjectDialog extends GuiWindow {
|
|||
ProjectListItem item = new ProjectListItem(projectName, projectData.type, projectData.description);
|
||||
this.projectList.add(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTitle() {
|
||||
return "Select Project";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue