Skip to content
Snippets Groups Projects
Commit 7b5a979f authored by Robert Goldmann's avatar Robert Goldmann
Browse files

added buttons for enabling/disabling all categories in filterGUI

parent b96d88ed
Branches
Tags
1 merge request!75merge v1_1_0 into master
...@@ -26,6 +26,8 @@ public class FilterController ...@@ -26,6 +26,8 @@ public class FilterController
@FXML private Button buttonCancel; @FXML private Button buttonCancel;
@FXML private Button buttonReset; @FXML private Button buttonReset;
@FXML private Button buttonFilter; @FXML private Button buttonFilter;
@FXML private Button buttonCategoryAll;
@FXML private Button buttonCategoryNone;
private Stage stage; private Stage stage;
private Controller controller; private Controller controller;
...@@ -47,7 +49,7 @@ public class FilterController ...@@ -47,7 +49,7 @@ public class FilterController
iconReset.setSize(17); iconReset.setSize(17);
iconReset.setStyle("-fx-text-fill: white"); iconReset.setStyle("-fx-text-fill: white");
buttonReset.setGraphic(iconReset); buttonReset.setGraphic(iconReset);
FontIcon iconSave = new FontIcon(FontIconType.SAVE); FontIcon iconSave = new FontIcon(FontIconType.FILTER);
iconSave.setSize(17); iconSave.setSize(17);
iconSave.setStyle("-fx-text-fill: white"); iconSave.setStyle("-fx-text-fill: white");
buttonFilter.setGraphic(iconSave); buttonFilter.setGraphic(iconSave);
...@@ -55,6 +57,8 @@ public class FilterController ...@@ -55,6 +57,8 @@ public class FilterController
buttonCancel.setStyle("-fx-background-color: #2E79B9; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;"); buttonCancel.setStyle("-fx-background-color: #2E79B9; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;");
buttonReset.setStyle("-fx-background-color: #2E79B9; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;"); buttonReset.setStyle("-fx-background-color: #2E79B9; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;");
buttonFilter.setStyle("-fx-background-color: #2E79B9; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;"); buttonFilter.setStyle("-fx-background-color: #2E79B9; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;");
buttonCategoryAll.setStyle("-fx-background-color: #2E79B9; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 13;");
buttonCategoryNone.setStyle("-fx-background-color: #2E79B9; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 13;");
for(Category currentCategory : controller.getCategoryHandler().getCategories()) for(Category currentCategory : controller.getCategoryHandler().getCategories())
{ {
...@@ -115,7 +119,7 @@ public class FilterController ...@@ -115,7 +119,7 @@ public class FilterController
} }
String name = textFieldSearch.getText(); String name = textFieldSearch.getText();
if(name.equals("")) if(name != null && name.equals(""))
{ {
name = null; name = null;
} }
...@@ -123,13 +127,7 @@ public class FilterController ...@@ -123,13 +127,7 @@ public class FilterController
// get new unfiltered list from server // get new unfiltered list from server
controller.refresh(new FilterSettings()); controller.refresh(new FilterSettings());
FilterSettings newFilterSettings = new FilterSettings(isIncomeAllowed, FilterSettings newFilterSettings = new FilterSettings(isIncomeAllowed, isPaymentAllowed, isNoRepeatingAllowed, isMonthlyRepeatingAllowed, isRepeatingEveryXDaysAllowed, allowedCategoryIDs, name);
isPaymentAllowed,
isNoRepeatingAllowed,
isMonthlyRepeatingAllowed,
isRepeatingEveryXDaysAllowed,
allowedCategoryIDs,
name);
controller.setFilterSettings(newFilterSettings); controller.setFilterSettings(newFilterSettings);
controller.getPaymentHandler().filter(newFilterSettings); controller.getPaymentHandler().filter(newFilterSettings);
...@@ -150,4 +148,20 @@ public class FilterController ...@@ -150,4 +148,20 @@ public class FilterController
{ {
stage.close(); stage.close();
} }
public void enableAllCategories()
{
for(Node node : vboxCategories.getChildren())
{
((CheckBox)node).setSelected(true);
}
}
public void disableAllCategories()
{
for(Node node : vboxCategories.getChildren())
{
((CheckBox)node).setSelected(false);
}
}
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<?import javafx.scene.control.TextField?> <?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
...@@ -55,7 +56,7 @@ ...@@ -55,7 +56,7 @@
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</CheckBox> </CheckBox>
<CheckBox fx:id="checkBoxMonthlyRepeating" mnemonicParsing="false" text="jeden x-ten eines Monats"> <CheckBox fx:id="checkBoxMonthlyRepeating" mnemonicParsing="false" text="monatlich">
<font> <font>
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
...@@ -68,12 +69,27 @@ ...@@ -68,12 +69,27 @@
</children> </children>
</VBox> </VBox>
<VBox prefHeight="150.0" prefWidth="422.0" spacing="10.0"> <VBox prefHeight="150.0" prefWidth="422.0" spacing="10.0">
<children>
<HBox spacing="10.0">
<children> <children>
<Label text="Kategorien"> <Label text="Kategorien">
<font> <font>
<Font name="System Bold" size="16.0" /> <Font name="System Bold" size="16.0" />
</font> </font>
</Label> </Label>
<Region prefWidth="200.0" HBox.hgrow="ALWAYS" />
<Button fx:id="buttonCategoryAll" mnemonicParsing="false" onAction="#enableAllCategories" text="Alle">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Button>
<Button fx:id="buttonCategoryNone" mnemonicParsing="false" onAction="#disableAllCategories" text="Keine">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Button>
</children>
</HBox>
<ScrollPane prefHeight="93.0" prefWidth="422.0" VBox.vgrow="ALWAYS"> <ScrollPane prefHeight="93.0" prefWidth="422.0" VBox.vgrow="ALWAYS">
<content> <content>
<VBox fx:id="vboxCategories" spacing="5.0" /> <VBox fx:id="vboxCategories" spacing="5.0" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment