Projektin moduulirakenteen formatointi
Signed-off-by: laurimaaninka <lauri.maaninka@gmail.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package fi.lpam.ruokamanageri.gui.virheDialogit;
|
||||
|
||||
public class SiirtoVirhe extends TietokantaVirhe{
|
||||
public SiirtoVirhe(Exception e){
|
||||
this.setHeaderText("Virhe datan siirrossa");
|
||||
this.setContentText(e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package fi.lpam.ruokamanageri.gui.virheDialogit;
|
||||
|
||||
import fi.lpam.ruokamanageri.Main;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
abstract class TietokantaVirhe extends Alert {
|
||||
public TietokantaVirhe() {
|
||||
super(AlertType.ERROR);
|
||||
this.setTitle("Tietokanta");
|
||||
ImageView sql = new ImageView(new Image(Objects.requireNonNull(Main.class.getClassLoader().getResourceAsStream("tietokanta.png"))));
|
||||
sql.setPreserveRatio(true);
|
||||
sql.setFitHeight(100);
|
||||
this.setGraphic(sql);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package fi.lpam.ruokamanageri.gui.virheDialogit;
|
||||
|
||||
public class YhteysVirhe extends TietokantaVirhe{
|
||||
public YhteysVirhe(Exception error){
|
||||
this.setHeaderText("Virhe yhdistäessä tietokantaan");
|
||||
this.setContentText(error.getMessage());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user