<commit_before>package com.github.appreciated.quickstart.material.components;

import com.github.appreciated.quickstart.base.components.Helper;
import com.github.appreciated.quickstart.base.navigation.theme.ProgressStepperView;
import com.github.appreciated.quickstart.base.pages.Finishable;
import com.github.appreciated.quickstart.base.pages.ProgressStepper;
import com.github.appreciated.quickstart.base.pages.Subpage;
import com.github.appreciated.quickstart.base.pages.actions.Action;
import com.github.appreciated.quickstart.base.pages.actions.CustomAction;
import com.github.appreciated.quickstart.base.ui.QuickStartUI;
import com.github.appreciated.quickstart.material.component.MaterialProgressStepView;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.vaadin.ui.VerticalLayout;

import java.util.Arrays;
import java.util.List;

/**
 * Created by appreciated on 09.03.2017.
 */
public class MaterialProgressStepperView extends VerticalLayout implements ProgressStepperView {

    private final MaterialProgressStepView progressStepView;
    private ProgressStepper finishableSubpages;
    private final List<Finishable> pages;
    private final List<Action> actions;

    public MaterialProgressStepperView(ProgressStepper progressStepper) {
        progressStepView = new MaterialProgressStepView(progressStepper, isNavigatable());
        this.finishableSubpages = progressStepper;
        progressStepView.setNavigationListener(this);
        this.pages = progressStepper.getPagingElements();
        setMargin(false);
        actions = Arrays.asList(new CustomAction(progressStepView) {
            @Override
            public boolean isMobileCompliant() {
                return false;
            }
        }.withAlignment(Alignment.MIDDLE_CENTER));
    }

    @Override
    public void attach() {
        super.attach();
        progressStepView.setNavigationListener(this);
        setNewContent(progressStepView.getCurrent());
    }

    @Override
    public void onNavigate(Subpage next) {
        setNewContent((Finishable) next);
    }

    @Override
    public void onDone() {
        finishableSubpages.onDone();
    }

    @Override
    public boolean showTitle() {
        return false;
    }

    @Override
    public List<Action> getContextActions() {
        return actions;
    }

    public boolean isNavigatable() {
        return false;
    }

    public void setNewContent(Finishable content) {
        Component component = QuickStartUI.getProvider().getComponent(content);
        Helper.prepareContainerForComponent(this,component);
        this.removeAllComponents();
        this.addComponent(component);
    }

    public void next() {
        progressStepView.next();
    }

    public void previous() {
        progressStepView.previous();
    }

    @Override
    public void onSubpageFinish() {
        progressStepView.next();
    }

}
<commit_msg>- fix for incorrect refactoring<commit_after>package com.github.appreciated.quickstart.material.components;

import com.github.appreciated.quickstart.base.components.Helper;
import com.github.appreciated.quickstart.base.navigation.theme.ProgressStepperView;
import com.github.appreciated.quickstart.base.pages.Finishable;
import com.github.appreciated.quickstart.base.pages.ProgressStepper;
import com.github.appreciated.quickstart.base.pages.Subpage;
import com.github.appreciated.quickstart.base.pages.actions.Action;
import com.github.appreciated.quickstart.base.pages.actions.CustomAction;
import com.github.appreciated.quickstart.base.ui.QuickStartUI;
import com.github.appreciated.quickstart.material.component.MaterialProgressStepView;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.vaadin.ui.VerticalLayout;

import java.util.Arrays;
import java.util.List;

/**
 * Created by appreciated on 09.03.2017.
 */
public class MaterialProgressStepperView extends VerticalLayout implements ProgressStepperView {

    private final MaterialProgressStepView progressStepView;
    private ProgressStepper finishableSubpages;
    private final List<Finishable> pages;
    private final List<Action> actions;

    public MaterialProgressStepperView(ProgressStepper progressStepper) {
        progressStepView = new MaterialProgressStepView(progressStepper, isNavigatable());
        this.finishableSubpages = progressStepper;
        progressStepView.setNavigationListener(this);
        this.pages = progressStepper.getPagingElements();
        setMargin(false);
        actions = Arrays.asList(new CustomAction(progressStepView) {
            @Override
            public boolean isMobileCompliant() {
                return false;
            }
        }.withAlignment(Alignment.MIDDLE_CENTER));
    }

    @Override
    public void attach() {
        super.attach();
        progressStepView.setNavigationListener(this);
        setNewContent(progressStepView.getCurrent());
    }

    @Override
    public void onNavigate(Subpage next) {
        setNewContent((Finishable) next);
    }

    @Override
    public void onDone() {
        finishableSubpages.onDone();
    }

    @Override
    public boolean showTitle() {
        return false;
    }

    @Override
    public List<Action> getContextActions() {
        return actions;
    }

    public boolean isNavigatable() {
        return false;
    }

    public void setNewContent(Finishable content) {
        Component component = QuickStartUI.getProvider().getComponent(content);
        Helper.prepareContainerForComponent(this,component);
        this.removeAllComponents();
        this.addComponent(component);
    }

    public void next() {
        progressStepView.next();
    }

    public void previous() {
        progressStepView.previous();
    }

    @Override
    public void onFinish() {
        progressStepView.next();
    }

}

{'fraction_non_alphanumeric': 0.09078474952983416, 'fraction_numerical': 0.002735510343648487, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4159601', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1567, 'n_words': 282}