mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
More java docs
This commit is contained in:
parent
3e153dc0d3
commit
23be70b57c
@ -26,11 +26,6 @@ public class Presenter implements MainViewListener {
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the user input to the model and provide the result to the main view.
|
||||
* @param lambdaTerm the lambda term to type-infer
|
||||
* @param typeAssumptions type assumptions to use during the calculation
|
||||
*/
|
||||
@Override
|
||||
public void typeInferLambdaString(String lambdaTerm, Map<String, String> typeAssumptions) {
|
||||
Result<TypeInfererInterface, ParseError> result = model.getTypeInferer(lambdaTerm, typeAssumptions);
|
||||
|
@ -7,12 +7,20 @@ import com.vaadin.flow.component.notification.NotificationVariant;
|
||||
import com.vaadin.flow.component.orderedlayout.FlexComponent;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
|
||||
/**
|
||||
* The notification being displayed on invalid input.
|
||||
*/
|
||||
public class ErrorNotification extends Notification {
|
||||
|
||||
private static final long serialVersionUID = 239587L;
|
||||
|
||||
private static final String NOTIFICATION_ID = "errorNotification";
|
||||
|
||||
/**
|
||||
* Creates a new ErrorNotification with a specific error message.
|
||||
*
|
||||
* @param errorMessage the error message
|
||||
*/
|
||||
protected ErrorNotification(String errorMessage) {
|
||||
VerticalLayout container = new VerticalLayout();
|
||||
Span errorSpan = new Span(errorMessage);
|
||||
|
@ -56,6 +56,4 @@ public class InfoDialog extends Dialog {
|
||||
assSyntax.setId(GRAMMAR_ID);
|
||||
return new VerticalLayout(termExplanation, termSyntax, assExplanation, assSyntax);
|
||||
}
|
||||
|
||||
// local change observer is not needed, the dialog is created when it is opened
|
||||
}
|
||||
|
@ -25,7 +25,17 @@ public interface MainView {
|
||||
*/
|
||||
void displayError(ParseError error);
|
||||
|
||||
/**
|
||||
* Provides an interface for the view to interact with the model.
|
||||
*/
|
||||
interface MainViewListener {
|
||||
|
||||
/**
|
||||
* Provides the user input to the model and provide the result to the main view.
|
||||
*
|
||||
* @param lambdaTerm the lambda term to type-infer
|
||||
* @param typeAssumptions type assumptions to use during the calculation
|
||||
*/
|
||||
void typeInferLambdaString(String lambdaTerm, Map<String, String> typeAssumptions);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,10 @@ import com.vaadin.flow.router.ParentLayout;
|
||||
*/
|
||||
@ParentLayout(MainViewImpl.class)
|
||||
public class NotFoundView extends VerticalLayout {
|
||||
|
||||
/**
|
||||
* Creates a new NotFoundView.
|
||||
*/
|
||||
public NotFoundView() {
|
||||
H1 error404 = new H1("404 - Not found");
|
||||
H2 suggestion = new H2("Try \"/infer/<term>\" or type your favourite term into the input field");
|
||||
|
Loading…
Reference in New Issue
Block a user