More java docs

This commit is contained in:
Moritz Dieing 2021-02-10 09:51:47 +01:00
parent 3e153dc0d3
commit 23be70b57c
5 changed files with 22 additions and 7 deletions

View File

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

View File

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

View File

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

View File

@ -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);
}
}

View File

@ -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");