mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
New example button in help dialog
This commit is contained in:
parent
1dab9a3996
commit
6b84aa5402
@ -36,6 +36,9 @@ public class TypicalcI18NProvider implements I18NProvider {
|
||||
|
||||
@Override
|
||||
public String getTranslation(String key, Locale locale, Object... params) {
|
||||
if (key.equals("")) {
|
||||
return "";
|
||||
}
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(LANGUAGE_BUNDLE_PREFIX, locale);
|
||||
|
||||
String result;
|
||||
|
@ -82,8 +82,8 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver {
|
||||
acc.add(new HelpContentField("root.inferenceViewFeatures", "root.helpInferenceViewFeatures"));
|
||||
acc.add(new HelpContentField("root.shortcuts", "root.helpShortcuts"));
|
||||
acc.add(new HelpContentField("root.drawer", "root.helpDrawer"));
|
||||
acc.add(new HelpContentField("root.example",
|
||||
new Button(new Icon(VaadinIcon.PAPERCLIP)), "root.helpExample"));
|
||||
acc.add(new HelpContentField("",
|
||||
InputBar.createExampleButton(), "root.helpExample"));
|
||||
acc.add(new HelpContentField("root.firstStepButton",
|
||||
new Button(new Icon(VaadinIcon.ANGLE_DOUBLE_LEFT)), "root.helpFirstStepButton"));
|
||||
acc.add(new HelpContentField("root.previousStepButton",
|
||||
|
@ -77,8 +77,8 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver {
|
||||
typeAssumptions = new Button("", event -> onTypeAssumptionsButton());
|
||||
typeAssumptions.setId(ASS_BUTTON_ID);
|
||||
typeAssumptionsArea = new TypeAssumptionsArea();
|
||||
exampleButton = new Button(getTranslation("root.exampleButton"), event -> onExampleButtonClick());
|
||||
exampleButton.setId(EXAMPLE_BUTTON_ID);
|
||||
exampleButton = createExampleButton();
|
||||
exampleButton.addClickListener(event -> onExampleButtonClick());
|
||||
inferTypeButton = new Button("", event -> onTypeInferButtonClick());
|
||||
inferTypeButton.addClickShortcut(Key.ENTER).listenOn(this);
|
||||
inferTypeButton.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
|
||||
@ -87,6 +87,12 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver {
|
||||
add(infoIcon, typeAssumptions, lambdaButton, inputField, exampleButton, inferTypeButton);
|
||||
}
|
||||
|
||||
public static Button createExampleButton() {
|
||||
Button button = new Button(UI.getCurrent().getTranslation("root.exampleButton"));
|
||||
button.setId(EXAMPLE_BUTTON_ID);
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the provided string as the value of the inputField.
|
||||
*
|
||||
|
@ -27,7 +27,6 @@ root.type=Typ
|
||||
root.title404=404 - Seite nicht gefunden
|
||||
root.message404=Versuche /infer/<term> oder gib deinen Lieblingsterm in das Eingabefeld ein.
|
||||
root.drawer=Ableitungsregeln-Knopf
|
||||
root.example=Beispiele
|
||||
root.shortcuts=Tastaturbefehle
|
||||
root.inputField=Eingabefeld
|
||||
root.typeInferButton=Typisieren-Knopf
|
||||
|
@ -27,7 +27,6 @@ root.type=Type
|
||||
root.title404=404 - Not Found
|
||||
root.message404=Try /infer/<term> or type your favourite term into the input field.
|
||||
root.drawer=Type Inference Rules Button
|
||||
root.example=Examples
|
||||
root.shortcuts=Shortcuts
|
||||
root.inputField=Input Field
|
||||
root.typeInferButton=Type Button
|
||||
|
Loading…
Reference in New Issue
Block a user