mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
MainView erstellen
This commit is contained in:
parent
75d686d8af
commit
1cef080606
26
src/main/java/edu/kit/typicalc/view/main/MainView.java
Normal file
26
src/main/java/edu/kit/typicalc/view/main/MainView.java
Normal 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);
|
||||||
|
}
|
@ -17,6 +17,8 @@ import com.vaadin.flow.component.tabs.Tabs;
|
|||||||
import com.vaadin.flow.component.tabs.TabsVariant;
|
import com.vaadin.flow.component.tabs.TabsVariant;
|
||||||
import com.vaadin.flow.router.PageTitle;
|
import com.vaadin.flow.router.PageTitle;
|
||||||
import com.vaadin.flow.router.RouterLink;
|
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 edu.kit.typicalc.view.content.typeinferencecontent.TypeInferenceView;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@ -26,7 +28,7 @@ import java.util.Optional;
|
|||||||
*/
|
*/
|
||||||
@CssImport("./styles/views/main/main-view.css")
|
@CssImport("./styles/views/main/main-view.css")
|
||||||
@JsModule("./styles/shared-styles.js")
|
@JsModule("./styles/shared-styles.js")
|
||||||
public class MainViewImpl extends AppLayout {
|
public class MainViewImpl extends AppLayout implements MainView {
|
||||||
|
|
||||||
private final Tabs menu;
|
private final Tabs menu;
|
||||||
private H1 viewTitle;
|
private H1 viewTitle;
|
||||||
@ -103,4 +105,14 @@ public class MainViewImpl extends AppLayout {
|
|||||||
private String getCurrentPageTitle() {
|
private String getCurrentPageTitle() {
|
||||||
return getContent().getClass().getAnnotation(PageTitle.class).value();
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user