diff --git a/src/main/java/edu/kit/typicalc/view/main/HelpContentField.java b/src/main/java/edu/kit/typicalc/view/main/HelpContentField.java index d66a93e..8a843b2 100644 --- a/src/main/java/edu/kit/typicalc/view/main/HelpContentField.java +++ b/src/main/java/edu/kit/typicalc/view/main/HelpContentField.java @@ -1,5 +1,6 @@ package edu.kit.typicalc.view.main; +import com.vaadin.flow.component.Component; import com.vaadin.flow.component.accordion.AccordionPanel; import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.details.DetailsVariant; @@ -57,6 +58,11 @@ public class HelpContentField extends AccordionPanel implements LocaleChangeObse setContent(content); } + protected HelpContentField(String summaryKey, Component contentComponent) { + this(summaryKey, ""); + setContent(contentComponent); + } + @Override public void localeChange(LocaleChangeEvent event) { summaryText.setText(getTranslation(summaryKey)); diff --git a/src/main/java/edu/kit/typicalc/view/main/HelpDialog.java b/src/main/java/edu/kit/typicalc/view/main/HelpDialog.java index 7839d12..b7508e4 100644 --- a/src/main/java/edu/kit/typicalc/view/main/HelpDialog.java +++ b/src/main/java/edu/kit/typicalc/view/main/HelpDialog.java @@ -1,5 +1,6 @@ package edu.kit.typicalc.view.main; +import com.vaadin.flow.component.Component; import com.vaadin.flow.component.ItemLabelGenerator; import com.vaadin.flow.component.UI; import com.vaadin.flow.component.accordion.Accordion; @@ -7,6 +8,7 @@ import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.dependency.CssImport; import com.vaadin.flow.component.dialog.Dialog; import com.vaadin.flow.component.html.H3; +import com.vaadin.flow.component.html.Paragraph; import com.vaadin.flow.component.icon.Icon; import com.vaadin.flow.component.icon.VaadinIcon; import com.vaadin.flow.component.orderedlayout.HorizontalLayout; @@ -72,6 +74,7 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver { acc.add(new HelpContentField("root.typeInferButton", "root.helpTypeInferButton")); acc.add(new HelpContentField("root.inputField", "root.helpInputField")); acc.add(new HelpContentField("root.typeAssumptions", "root.helpTypeAssumptions")); + acc.add(new HelpContentField("root.shortcuts", createShortcutComponent())); acc.add(new HelpContentField("root.drawer", new Button(new Icon(VaadinIcon.MENU)), "root.helpDrawer")); acc.add(new HelpContentField("root.example", @@ -89,6 +92,13 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver { return acc; } + private Component createShortcutComponent() { + VerticalLayout layout = new VerticalLayout(); + layout.add(new Paragraph("CTRL + Left = First Step")); + layout.add(new Paragraph("Left = Previous Step")); // todo + return layout; + } + @Override public void localeChange(LocaleChangeEvent event) { heading.setText(getTranslation("root.operatingHelp")); diff --git a/src/main/resources/language/translation_de.properties b/src/main/resources/language/translation_de.properties index 5f45830..8f1bae2 100644 --- a/src/main/resources/language/translation_de.properties +++ b/src/main/resources/language/translation_de.properties @@ -26,6 +26,7 @@ root.title404=404 - Seite nicht gefunden root.message404=Versuche /infer/ oder gebe deinen Lieblingsterm in das Eingabefeld ein root.drawer=Drawer (Ableitungsregeln) root.example=Beispiele +root.shortcuts=Shortcuts root.inputField=Eingabefeld root.typeInferButton=Typisieren-Knopf root.firstStepButton=Erster-Schritt-Knopf diff --git a/src/main/resources/language/translation_en.properties b/src/main/resources/language/translation_en.properties index 63542ce..faf8a66 100644 --- a/src/main/resources/language/translation_en.properties +++ b/src/main/resources/language/translation_en.properties @@ -26,6 +26,7 @@ root.title404=404 - Not Found root.message404=Try /infer/ or type your favourite term into the input field root.drawer=Drawer (type inference rules) root.example=Examples +root.shortcuts=Shortcuts root.inputField=Input Field root.typeInferButton=Type Button root.firstStepButton=First-Step Button