Changed encoding to utf-8
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
package customUI;
|
||||
|
||||
public class Button extends javafx.scene.control.Button {
|
||||
|
||||
public void setTextValue(String text){
|
||||
super.setText(Converter.convertString(text));
|
||||
}
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
package customUI;
|
||||
|
||||
public class Converter {
|
||||
/*
|
||||
Ä, ä \u00c4, \u00e4
|
||||
Ö, ö \u00d6, \u00f6
|
||||
Ü, ü \u00dc, \u00fc
|
||||
ß \u00df
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public static String convertString(String str){
|
||||
return str
|
||||
.replace("ä", "\u00e4")
|
||||
.replace("Ä", "\u00c4")
|
||||
.replace("ö", "\u00f6")
|
||||
.replace("Ö", "\u00d6")
|
||||
.replace("ü", "\u00fc")
|
||||
.replace("Ü", "\u00dc")
|
||||
.replace("ß", "\u00df");
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
package customUI;
|
||||
|
||||
public class Label extends javafx.scene.control.Label {
|
||||
public Label(String content){
|
||||
super(Converter.convertString(content));
|
||||
}
|
||||
|
||||
public Label(){
|
||||
super();
|
||||
}
|
||||
|
||||
public void setTextValue(String text){
|
||||
super.setText(Converter.convertString(text));
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
package customUI;
|
||||
|
||||
public class Tooltip extends javafx.scene.control.Tooltip {
|
||||
|
||||
public Tooltip(String tollTipText){
|
||||
super(Converter.convertString(tollTipText));
|
||||
}
|
||||
|
||||
}
|
@@ -2,9 +2,7 @@ package helper;
|
||||
|
||||
import javafx.geometry.Bounds;
|
||||
import javafx.scene.Group;
|
||||
import customUI.Button;
|
||||
import javafx.scene.control.ContentDisplay;
|
||||
import customUI.Tooltip;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.shape.SVGPath;
|
||||
|
||||
public class SvgBtnCreator {
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package main;
|
||||
|
||||
import customUI.Converter;
|
||||
import helper.HttpRequestException;
|
||||
import res.DataController;
|
||||
import res.Event;
|
||||
@@ -16,7 +15,7 @@ public class EditEventController extends CreateEventController{
|
||||
public void setCurrentEvent(Event currentEvent) {
|
||||
this.currentEvent = currentEvent;
|
||||
|
||||
textName.setText(Converter.convertString(currentEvent.getName()));
|
||||
textName.setText(currentEvent.getName());
|
||||
datePickerDate.setValue(currentEvent.getDate().toLocalDate());
|
||||
ComboBoxPriotity.getSelectionModel().select(currentEvent.getPriority());
|
||||
|
||||
|
@@ -2,8 +2,6 @@ package main;
|
||||
|
||||
import config.Config;
|
||||
import config.ConfigLoader;
|
||||
import customUI.Button;
|
||||
import customUI.Label;
|
||||
import helper.SvgBtnCreator;
|
||||
import helper.HttpRequestException;
|
||||
import javafx.fxml.FXML;
|
||||
@@ -12,7 +10,7 @@ import javafx.geometry.Pos;
|
||||
import javafx.scene.Group;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.ScrollPane;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.VBox;
|
||||
@@ -154,7 +152,7 @@ public class MainController {
|
||||
private void createWeek() {
|
||||
for (int i = 0; i < 7; i++) {
|
||||
Label label = new Label();
|
||||
label.setTextValue(dayNames[i]);
|
||||
label.setText(dayNames[i]);
|
||||
label.setMaxHeight(Double.MAX_VALUE);
|
||||
label.setMaxWidth(Double.MAX_VALUE);
|
||||
label.getStyleClass().add("labelDays");
|
||||
@@ -248,7 +246,7 @@ public class MainController {
|
||||
Label typeLabel = new Label("Wer: " + event.getOwnerName());
|
||||
vBox.getChildren().add(typeLabel);
|
||||
|
||||
Label prioLabel = new Label("Priorit\u00e4t: " + event.getPriority());
|
||||
Label prioLabel = new Label("Priorität: " + event.getPriority());
|
||||
vBox.getChildren().add(prioLabel);
|
||||
|
||||
if (event.isFullDay()) {
|
||||
@@ -286,7 +284,7 @@ public class MainController {
|
||||
weekStartDateTime = now.plusDays(weekOffset * 7L - dayOfWeek + 1);
|
||||
|
||||
for (int i = 0; i < 7; i++) {
|
||||
dayLabel[i].setTextValue(dayFormatter.format(weekStartDateTime.plusDays(i)));
|
||||
dayLabel[i].setText(dayFormatter.format(weekStartDateTime.plusDays(i)));
|
||||
}
|
||||
|
||||
LabelMonth.setText(dateFormatter.format(weekStartDateTime));
|
||||
|
@@ -9,6 +9,8 @@ import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.ButtonType;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.stage.Modality;
|
||||
@@ -20,6 +22,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class OptionController {
|
||||
|
||||
@@ -36,10 +39,13 @@ public class OptionController {
|
||||
@FXML
|
||||
public GridPane mainGrid;
|
||||
|
||||
private JFXComboBox<String> comboBox;
|
||||
private DataController dataController;
|
||||
private List<User> users;
|
||||
|
||||
@FXML
|
||||
public void initialize(){
|
||||
DataController dataController = new DataController();
|
||||
List<User> users;
|
||||
dataController = new DataController();
|
||||
try{
|
||||
users = dataController.getAllUser();
|
||||
} catch (HttpRequestException e){
|
||||
@@ -50,7 +56,7 @@ public class OptionController {
|
||||
for (User user: users) {
|
||||
observableUserList.add(user.getLogin());
|
||||
}
|
||||
JFXComboBox<String> comboBox = new JFXComboBox<>(observableUserList);
|
||||
comboBox = new JFXComboBox<>(observableUserList);
|
||||
comboBox.getStyleClass().add("comboBox");
|
||||
mainGrid.add(comboBox, 2,2);
|
||||
|
||||
@@ -62,14 +68,36 @@ public class OptionController {
|
||||
}
|
||||
|
||||
public void onCreateBtnClick(ActionEvent actionEvent) {
|
||||
try{
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(
|
||||
MainApplication.class.getResource("../users/create-user.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load(), 800, 650);
|
||||
loadUserScene(actionEvent, "User erstellen", "../users/create-user.fxml");
|
||||
}
|
||||
|
||||
public void onUpdateBtnClick(ActionEvent actionEvent) {
|
||||
loadUserScene(actionEvent, "User bearbeiten", "../users/edit-user.fxml");
|
||||
}
|
||||
|
||||
public void onDeleteBtnClick(ActionEvent actionEvent) {
|
||||
Alert alert = new Alert(Alert.AlertType.CONFIRMATION, "Wirklich löschen?");
|
||||
Optional<ButtonType> result = alert.showAndWait();
|
||||
if(result.isPresent() && result.get() == ButtonType.OK){
|
||||
try {
|
||||
dataController.deleteUser(users.get(comboBox.getSelectionModel().getSelectedIndex()));
|
||||
} catch (HttpRequestException e) {
|
||||
Alert alert1 = new Alert(Alert.AlertType.ERROR, e.getMessage());
|
||||
alert1.showAndWait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Scene loadUserScene(ActionEvent actionEvent, String title, String fxml) {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(
|
||||
MainApplication.class.getResource(fxml));
|
||||
Scene scene = null;
|
||||
try {
|
||||
scene = new Scene(fxmlLoader.load(), 800, 650);
|
||||
scene.getStylesheets().add(Objects.requireNonNull(
|
||||
MainApplication.class.getResource("../users/create-user.css")).toExternalForm());
|
||||
Stage stage = new Stage();
|
||||
stage.setTitle("User erstellen");
|
||||
stage.setTitle(title);
|
||||
stage.setScene(scene);
|
||||
stage.initModality(Modality.APPLICATION_MODAL);
|
||||
stage.setResizable(false);
|
||||
@@ -79,11 +107,6 @@ public class OptionController {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void onUpdateBtnClick(ActionEvent actionEvent) {
|
||||
}
|
||||
|
||||
public void onDeleteBtnClick(ActionEvent actionEvent) {
|
||||
return scene;
|
||||
}
|
||||
}
|
||||
|
19
client/app/src/main/java/users/EditUserController.java
Normal file
19
client/app/src/main/java/users/EditUserController.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package users;
|
||||
|
||||
import res.User;
|
||||
|
||||
public class EditUserController extends CreateUserController{
|
||||
private User currentUser;
|
||||
|
||||
public User getCurrentUser() {
|
||||
return currentUser;
|
||||
}
|
||||
|
||||
public void setCurrentUser(User currentUser) {
|
||||
this.currentUser = currentUser;
|
||||
|
||||
textForename.setText(currentUser.getForename());
|
||||
textName.setText(currentUser.getName());
|
||||
textLogin.setText(currentUser.getLogin());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user