diff --git a/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java b/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java index 140ba17..9d8f24b 100644 --- a/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java +++ b/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java @@ -4,6 +4,7 @@ import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.dependency.CssImport; import com.vaadin.flow.component.notification.Notification; import com.vaadin.flow.component.orderedlayout.VerticalLayout; +import com.vaadin.flow.component.textfield.TextArea; import com.vaadin.flow.component.textfield.TextField; import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.router.Route; @@ -12,16 +13,17 @@ import edu.kit.typicalc.view.main.MainViewImpl; @Route(value = "home", layout = MainViewImpl.class) @PageTitle("Typicalc") -@CssImport("./styles/views/typeinferenceview/type-inference-view-view.css") @RouteAlias(value = "", layout = MainViewImpl.class) public class StartPageView extends VerticalLayout { - private TextField name; + private TextArea name; private Button sayHello; public StartPageView() { setId("start-page"); - name = new TextField("Your name"); + name = new TextArea("translation test"); + name.setValue(getTranslation("abs-rule")); + name.setWidthFull(); sayHello = new Button("Say hello"); add(name, sayHello); sayHello.addClickListener(e -> { diff --git a/src/main/java/edu/kit/typicalc/view/main/MainViewImpl.java b/src/main/java/edu/kit/typicalc/view/main/MainViewImpl.java index 1ebea7e..4c54945 100644 --- a/src/main/java/edu/kit/typicalc/view/main/MainViewImpl.java +++ b/src/main/java/edu/kit/typicalc/view/main/MainViewImpl.java @@ -34,7 +34,7 @@ import java.util.Optional; /** * The main view is a top-level placeholder for other views. */ -@CssImport("./styles/views/main/main-view.css") +@CssImport("./styles/view/main/main-view.css") @JsModule("./styles/shared-styles.js") public class MainViewImpl extends AppLayout implements MainView { @@ -83,13 +83,9 @@ public class MainViewImpl extends AppLayout implements MainView { tabs.setOrientation(Tabs.Orientation.VERTICAL); tabs.addThemeVariants(TabsVariant.LUMO_MINIMAL); tabs.setId("tabs"); - tabs.add(createMenuItems()); return tabs; } - private Component[] createMenuItems() { - return new Tab[]{createTab("TypeInferenceView", TypeInferenceView.class)}; - } private static Tab createTab(String text, Class navigationTarget) { final Tab tab = new Tab(); @@ -116,7 +112,7 @@ public class MainViewImpl extends AppLayout implements MainView { @Override public void setTypeInferenceView(final TypeInfererInterface typeInferer) { - this.getUI().get().navigate(TypeInferenceView.class, typeInferer); + this.getUI().ifPresent(ui -> ui.navigate(TypeInferenceView.class, typeInferer)); } @Override @@ -124,7 +120,7 @@ public class MainViewImpl extends AppLayout implements MainView { final Span errorText = new Span(getTranslation("root." + error.toString())); final Notification errorNotification = new Notification(); final Button closeButton = new Button(getTranslation("root.close"), event -> errorNotification.close()); - + errorNotification.addThemeVariants(NotificationVariant.LUMO_ERROR); errorNotification.add(errorText, closeButton); errorNotification.setPosition(Position.MIDDLE); diff --git a/src/main/resources/language/translation_de.properties b/src/main/resources/language/translation_de.properties index 639db37..a61023e 100644 --- a/src/main/resources/language/translation_de.properties +++ b/src/main/resources/language/translation_de.properties @@ -1,10 +1,10 @@ -abs-rule=\\begin{prooftree}\ -\\AxiomC{$\\Gamma=\\vdash t_1 : \\tau_1 \\rightarrow \\tau_2$}\ -\ -\\AxiomC{$\\Gamma \\vdash t_2 : \\tau_1$}\ -\ -\\LeftLabel{APP}\ -\\BinaryInfC{$\\Gamma \\vdash t_1 \\ t_2 : \\tau_2$}\ +abs-rule=\ +\\begin{prooftree}\n\ +\\AxiomC{$\\Gamma=\\vdash t_1 : \\tau_1 \\rightarrow \\tau_2$}\n\ +\\AxiomC{$\\Gamma \\vdash t_2 : \\tau_1$}\n\ +\n\ +\\LeftLabel{APP}\n\ +\\BinaryInfC{$\\Gamma \\vdash t_1 \\ t_2 : \\tau_2$}\n\ \\end{prooftree} test=hello world \ No newline at end of file diff --git a/src/main/resources/language/translation_en.properties b/src/main/resources/language/translation_en.properties index e69de29..a61023e 100644 --- a/src/main/resources/language/translation_en.properties +++ b/src/main/resources/language/translation_en.properties @@ -0,0 +1,10 @@ +abs-rule=\ +\\begin{prooftree}\n\ +\\AxiomC{$\\Gamma=\\vdash t_1 : \\tau_1 \\rightarrow \\tau_2$}\n\ +\\AxiomC{$\\Gamma \\vdash t_2 : \\tau_1$}\n\ +\n\ +\\LeftLabel{APP}\n\ +\\BinaryInfC{$\\Gamma \\vdash t_1 \\ t_2 : \\tau_2$}\n\ +\\end{prooftree} + +test=hello world \ No newline at end of file