<commit_before>package de.oio.ui.views;

import com.google.common.eventbus.EventBus;
import com.vaadin.event.ShortcutAction;
import com.vaadin.icons.VaadinIcons;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.spring.annotation.SpringView;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.PasswordField;
import com.vaadin.ui.TextField;
import de.oio.ui.MainUI;
import de.oio.spring.security.UserAuthenticationService;
import de.oio.ui.components.GoToMainViewLink;
import de.oio.ui.events.NavigationEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;

@SpringView(name = LoginView.NAME)
public class LoginView extends AbstractView implements Button.ClickListener {

    public final static String NAME = "login";

    @Autowired
    private UserAuthenticationService userAuthenticationService;

    private String forwardTo;
    private TextField nameTF;
    private PasswordField passwordTF;

    public LoginView() {
        addComponent(new Label(
                "Please enter your credentials:"));
        nameTF = new TextField();
        nameTF.setRequiredIndicatorVisible(true);
        nameTF.focus();

        passwordTF = new PasswordField();
        passwordTF.setRequiredIndicatorVisible(true);

        addComponent(nameTF);
        addComponent(passwordTF);

        Button loginButton = new Button("Login");
        loginButton.setClickShortcut(ShortcutAction.KeyCode.ENTER);
        loginButton.addClickListener(this);
        loginButton.setIcon(VaadinIcons.SIGN_IN);
        addComponent(loginButton);

        addComponent(new GoToMainViewLink());
    }

    @Override
    public void enter(ViewChangeEvent event) {
        forwardTo = event.getParameters();<commit_msg>Show which users are available in the demo app<commit_after>package de.oio.ui.views;

import com.google.common.eventbus.EventBus;
import com.vaadin.event.ShortcutAction;
import com.vaadin.icons.VaadinIcons;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.spring.annotation.SpringView;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.PasswordField;
import com.vaadin.ui.TextField;
import de.oio.ui.MainUI;
import de.oio.spring.security.UserAuthenticationService;
import de.oio.ui.components.GoToMainViewLink;
import de.oio.ui.events.NavigationEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;

@SpringView(name = LoginView.NAME)
public class LoginView extends AbstractView implements Button.ClickListener {

    public final static String NAME = "login";

    @Autowired
    private UserAuthenticationService userAuthenticationService;

    private String forwardTo;
    private TextField nameTF;
    private PasswordField passwordTF;

    public LoginView() {
        addComponent(new Label(
                "Please enter your credentials (use admin:admin or user:user):"));
        nameTF = new TextField();
        nameTF.setRequiredIndicatorVisible(true);
        nameTF.focus();

        passwordTF = new PasswordField();
        passwordTF.setRequiredIndicatorVisible(true);

        addComponent(nameTF);
        addComponent(passwordTF);

        Button loginButton = new Button("Login");
        loginButton.setClickShortcut(ShortcutAction.KeyCode.ENTER);
        loginButton.addClickListener(this);
        loginButton.setIcon(VaadinIcons.SIGN_IN);
        addComponent(loginButton);

        addComponent(new GoToMainViewLink());
    }

    @Override
    public void enter(ViewChangeEvent event) {
        forwardTo = event.getParameters();
{'fraction_non_alphanumeric': 0.09099901088031652, 'fraction_numerical': 0.0, 'mean_word_length': 4.260078023407022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4047866', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1093, 'n_words': 215}