diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2016-01-12 19:55:37 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2016-01-12 19:55:37 +0100 |
| commit | 95dbf97fd8133faf07e465ff6f5bd54c21284470 (patch) | |
| tree | 015f1e915f57da31aece181cc9c7586ae701baa8 /src/de | |
| parent | e3f352ad9b6d566cef25d3a595fe676879fa2562 (diff) | |
| download | Projektthemenvergabe-95dbf97fd8133faf07e465ff6f5bd54c21284470.tar.gz Projektthemenvergabe-95dbf97fd8133faf07e465ff6f5bd54c21284470.zip | |
Disable reset button when its combobox is disabled
Diffstat (limited to 'src/de')
| -rw-r--r-- | src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegen.fxml | 8 | ||||
| -rw-r--r-- | src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegenController.java | 22 |
2 files changed, 26 insertions, 4 deletions
diff --git a/src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegen.fxml b/src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegen.fxml index 1ce4cf7..d7c5fb2 100644 --- a/src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegen.fxml +++ b/src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegen.fxml @@ -95,7 +95,7 @@ </GridPane.margin> <children> <ComboBox fx:id="ansprechpartnerComboBox" prefHeight="25.0" prefWidth="500.0" /> - <Button mnemonicParsing="false" onAction="#handleResetAnsprechpartner" prefWidth="400.0" text="Zurücksetzen" /> + <Button fx:id="ansprechpartnerComboBoxReset" mnemonicParsing="false" onAction="#handleResetAnsprechpartner" prefWidth="400.0" text="Zurücksetzen" /> </children> </HBox> <HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="5"> @@ -104,7 +104,7 @@ </GridPane.margin> <children> <ComboBox fx:id="student1ComboBox" prefHeight="25.0" prefWidth="500.0" /> - <Button mnemonicParsing="false" onAction="#handleResetStudent1" prefWidth="400.0" text="Zurücksetzen" /> + <Button fx:id="student1ComboBoxReset" mnemonicParsing="false" onAction="#handleResetStudent1" prefWidth="400.0" text="Zurücksetzen" /> </children> </HBox> <HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="6"> @@ -113,7 +113,7 @@ </GridPane.margin> <children> <ComboBox fx:id="student2ComboBox" prefHeight="25.0" prefWidth="500.0" /> - <Button mnemonicParsing="false" onAction="#handleResetStudent2" prefWidth="400.0" text="Zurücksetzen" /> + <Button fx:id="student2ComboBoxReset" mnemonicParsing="false" onAction="#handleResetStudent2" prefWidth="400.0" text="Zurücksetzen" /> </children> </HBox> <HBox alignment="CENTER_LEFT" GridPane.columnIndex="1" GridPane.rowIndex="7"> @@ -122,7 +122,7 @@ </GridPane.margin> <children> <ComboBox fx:id="student3ComboBox" minHeight="-Infinity" prefHeight="25.0" prefWidth="500.0" /> - <Button mnemonicParsing="false" onAction="#handleResetStudent3" prefWidth="400.0" text="Zurücksetzen" /> + <Button fx:id="student3ComboBoxReset" mnemonicParsing="false" onAction="#handleResetStudent3" prefWidth="400.0" text="Zurücksetzen" /> </children> </HBox> <TextField fx:id="projektthemaTextField" prefWidth="500.0" GridPane.columnIndex="1"> diff --git a/src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegenController.java b/src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegenController.java index 65fa98c..1ed5f8e 100644 --- a/src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegenController.java +++ b/src/de/fhswf/in/inf/se/projektthemenvergabe/view/ProjektHinzufuegenController.java @@ -38,15 +38,27 @@ public class ProjektHinzufuegenController private ComboBox<Ansprechpartner> ansprechpartnerComboBox; @FXML + private Button ansprechpartnerComboBoxReset; + + @FXML private ComboBox<Student> student1ComboBox; @FXML + private Button student1ComboBoxReset; + + @FXML private ComboBox<Student> student2ComboBox; @FXML + private Button student2ComboBoxReset; + + @FXML private ComboBox<Student> student3ComboBox; @FXML + private Button student3ComboBoxReset; + + @FXML private TextArea dozentenkommentar; @FXML @@ -94,6 +106,16 @@ public class ProjektHinzufuegenController .and(student2ComboBox.valueProperty().isNull().and( student3ComboBox.valueProperty().isNull()))))); + // Bind reset button disabled state to combobox + ansprechpartnerComboBoxReset.disableProperty() + .bind(ansprechpartnerComboBox.disabledProperty()); + student1ComboBoxReset.disableProperty() + .bind(student1ComboBox.disabledProperty()); + student2ComboBoxReset.disableProperty() + .bind(student2ComboBox.disabledProperty()); + student3ComboBoxReset.disableProperty() + .bind(student3ComboBox.disabledProperty()); + if (projekt != null) { if (!projekt.getStatus().equals(Projekt.StatusTypes.IN_BEARBEITUNG) |
