MainView erstellen

This commit is contained in:
Moritz Dieing 2021-01-27 19:39:18 +01:00
parent 75d686d8af
commit 1cef080606
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,26 @@
package edu.kit.typicalc.view.main;
import edu.kit.typicalc.model.TypeInfererInterface;
import edu.kit.typicalc.model.parser.ParseError;
/**
* Provides an interface for the presenter to interact with the view. The interaction consists of
* either passing a TypeInfererInterface or a ParseError to the view.
*/
public interface MainView {
/**
* Starts the creation of the visual representation of the provided typeInferer.
* After the process is finished, the first step of the type inference tree is displayed.
*
* @param typeInferer the result of the computation of the type inference algorithm
*/
void setTypeInferenceView(TypeInfererInterface typeInferer);
/**
* Displays the provided error indicating syntactically invalid input.
*
* @param error the error which is displayed to indicate invalid input
*/
void displayError(ParseError error);
}

View File

@ -17,6 +17,8 @@ import com.vaadin.flow.component.tabs.Tabs;
import com.vaadin.flow.component.tabs.TabsVariant;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.RouterLink;
import edu.kit.typicalc.model.TypeInfererInterface;
import edu.kit.typicalc.model.parser.ParseError;
import edu.kit.typicalc.view.content.typeinferencecontent.TypeInferenceView;
import java.util.Optional;
@ -26,7 +28,7 @@ import java.util.Optional;
*/
@CssImport("./styles/views/main/main-view.css")
@JsModule("./styles/shared-styles.js")
public class MainViewImpl extends AppLayout {
public class MainViewImpl extends AppLayout implements MainView {
private final Tabs menu;
private H1 viewTitle;
@ -103,4 +105,14 @@ public class MainViewImpl extends AppLayout {
private String getCurrentPageTitle() {
return getContent().getClass().getAnnotation(PageTitle.class).value();
}
@Override
public void setTypeInferenceView(TypeInfererInterface typeInferer) {
// TODO Auto-generated method stub
}
@Override
public void displayError(ParseError error) {
// TODO Auto-generated method stub
}
}