mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
pass typeInferer to TypeInferenceView
This commit is contained in:
parent
ba23c64f74
commit
e52c0e1d2f
@ -1,9 +1,9 @@
|
||||
package edu.kit.typicalc.view.content.typeinferencecontent;
|
||||
|
||||
import com.vaadin.flow.component.ComponentUtil;
|
||||
import com.vaadin.flow.component.UI;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.component.orderedlayout.Scroller;
|
||||
import com.vaadin.flow.router.BeforeEvent;
|
||||
import com.vaadin.flow.router.HasUrlParameter;
|
||||
import com.vaadin.flow.router.PageTitle;
|
||||
import com.vaadin.flow.router.Route;
|
||||
import edu.kit.typicalc.model.TypeInfererInterface;
|
||||
@ -14,24 +14,21 @@ import edu.kit.typicalc.view.main.MainViewImpl;
|
||||
@Route(value = "visualize", layout = MainViewImpl.class)
|
||||
@PageTitle("TypeInferenceView")
|
||||
public class TypeInferenceView extends HorizontalLayout
|
||||
implements ControlPanelView, HasUrlParameter<TypeInfererInterface> {
|
||||
implements ControlPanelView {
|
||||
|
||||
private int currentStep;
|
||||
|
||||
private MathjaxUnification unification;
|
||||
private MathjaxProofTree tree;
|
||||
private TypeInfererInterface typeInferer;
|
||||
|
||||
public TypeInferenceView() {
|
||||
setId("type-inference-view");
|
||||
add(new ControlPanel(this));
|
||||
typeInferer = ComponentUtil.getData(UI.getCurrent(), TypeInfererInterface.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParameter(BeforeEvent event, TypeInfererInterface typeInferer) {
|
||||
buildView(typeInferer);
|
||||
}
|
||||
|
||||
private void buildView(TypeInfererInterface typeInferer) {
|
||||
private void buildView() {
|
||||
// todo implement correctly
|
||||
LatexCreator lc = new LatexCreator(typeInferer);
|
||||
unification = new MathjaxUnification(lc.getUnification());
|
||||
|
@ -1,5 +1,7 @@
|
||||
package edu.kit.typicalc.view.main;
|
||||
|
||||
import com.vaadin.flow.component.ComponentUtil;
|
||||
import com.vaadin.flow.component.UI;
|
||||
import com.vaadin.flow.component.applayout.AppLayout;
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.CssImport;
|
||||
@ -11,7 +13,6 @@ import com.vaadin.flow.component.notification.Notification.Position;
|
||||
import com.vaadin.flow.component.notification.NotificationVariant;
|
||||
import com.vaadin.flow.component.orderedlayout.FlexComponent;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
|
||||
import edu.kit.typicalc.model.ModelImpl;
|
||||
import edu.kit.typicalc.model.TypeInfererInterface;
|
||||
import edu.kit.typicalc.model.parser.ParseError;
|
||||
@ -42,7 +43,8 @@ public class MainViewImpl extends AppLayout implements MainView {
|
||||
|
||||
@Override
|
||||
public void setTypeInferenceView(final TypeInfererInterface typeInferer) {
|
||||
this.getUI().ifPresent(ui -> ui.navigate(TypeInferenceView.class, typeInferer));
|
||||
ComponentUtil.setData(UI.getCurrent(), TypeInfererInterface.class, typeInferer);
|
||||
this.getUI().ifPresent(ui -> ui.navigate(TypeInferenceView.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user