test latex demo code, make vaadin runnable

This commit is contained in:
me 2021-01-28 00:55:55 +01:00
parent ad0d059f24
commit cfcc2e3bd3
4 changed files with 25 additions and 17 deletions

View File

@ -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 -> {

View File

@ -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<? extends Component> 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

View File

@ -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

View File

@ -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