<commit_before>/*******************************************************************************
 * Copyright (c) 2014 Codenvy, S.A.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/

package com.codenvy.plugin.grunt.client.presenter;

import com.codenvy.api.project.gwt.client.ProjectServiceClient;
import com.codenvy.api.runner.dto.RunOptions;
import com.codenvy.ide.api.app.AppContext;
import com.codenvy.ide.api.app.CurrentProject;
import com.codenvy.ide.api.notification.Notification;
import com.codenvy.ide.api.notification.NotificationManager;
import com.codenvy.ide.api.wizard.AbstractWizardPage;
import com.codenvy.ide.api.wizard.Wizard;
import com.codenvy.ide.dto.DtoFactory;
import com.codenvy.ide.extension.runner.client.run.RunController;
import com.codenvy.ide.rest.AsyncRequestCallback;
import com.codenvy.ide.rest.StringUnmarshaller;
import com.codenvy.ide.util.loging.Log;
import com.google.gwt.regexp.shared.MatchResult;
import com.google.gwt.regexp.shared.RegExp;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Inject;
import com.google.inject.Singleton;

import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Presenter for displaying the grunt tasks
 * @author <NAME>
 */
@Singleton
public class SelectGruntTaskPagePresenter extends AbstractWizardPage implements SelectGruntTaskPageView.ActionDelegate {

    private SelectGruntTaskPageView view;
    private RunController           runController;
    private DtoFactory              dtoFactory;
    private String                  taskSelected;
    private ProjectServiceClient    projectServiceClient;
    private AppContext              appContext;
    private NotificationManager     notificationManager;

    /**
     * Create wizard page
     */
    @Inject
    public SelectGruntTaskPagePresenter(SelectGruntTaskPageView view,
                                        RunController runController,
                                        ProjectServiceClient projectServiceClient,
                                        DtoFactory dtoFactory,
                                        NotificationManager notificationManager,
                                        AppContext appContext
                                       ) {
        super("Select Grunt Task", null);
        this.view = view;
        this.runController = runController;
        this.dtoFactory = dtoFactory;
        this.projectServiceClient = projectServiceClient;
        this.appContext = appContext;
        this.notificationManager = notificationManager;
        view.setDelegate(this);
    }

    @Nullable
    @Override
    public String getNotice() {
        return null;
    }

    @Override
    public boolean isCompleted() {
        return true;
    }

    @Override
    public void focusComponent() {

    }

    @Override
    public void removeOptions() {

    }

    @Override
    public void setUpdateDelegate(@NotNull Wizard.UpdateDelegate delegate) {
        super.setUpdateDelegate(delegate);
        requestTasks();
    }

    @Override
    public void go(AcceptsOneWidget container) {
        container.setWidget(view);<commit_msg>fix according new wizard api<commit_after>/*******************************************************************************
 * Copyright (c) 2014 Codenvy, S.A.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/

package com.codenvy.plugin.grunt.client.presenter;

import com.codenvy.api.project.gwt.client.ProjectServiceClient;
import com.codenvy.api.runner.dto.RunOptions;
import com.codenvy.ide.api.app.AppContext;
import com.codenvy.ide.api.app.CurrentProject;
import com.codenvy.ide.api.notification.Notification;
import com.codenvy.ide.api.notification.NotificationManager;
import com.codenvy.ide.api.wizard.AbstractWizardPage;
import com.codenvy.ide.api.wizard.Wizard;
import com.codenvy.ide.dto.DtoFactory;
import com.codenvy.ide.extension.runner.client.run.RunController;
import com.codenvy.ide.rest.AsyncRequestCallback;
import com.codenvy.ide.rest.StringUnmarshaller;
import com.codenvy.ide.util.loging.Log;
import com.google.gwt.regexp.shared.MatchResult;
import com.google.gwt.regexp.shared.RegExp;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Inject;
import com.google.inject.Singleton;

import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Presenter for displaying the grunt tasks
 * @author <NAME>
 */
@Singleton
public class SelectGruntTaskPagePresenter extends AbstractWizardPage implements SelectGruntTaskPageView.ActionDelegate {

    private SelectGruntTaskPageView view;
    private RunController           runController;
    private DtoFactory              dtoFactory;
    private String                  taskSelected;
    private ProjectServiceClient    projectServiceClient;
    private AppContext              appContext;
    private NotificationManager     notificationManager;

    /**
     * Create wizard page
     */
    @Inject
    public SelectGruntTaskPagePresenter(SelectGruntTaskPageView view,
                                        RunController runController,
                                        ProjectServiceClient projectServiceClient,
                                        DtoFactory dtoFactory,
                                        NotificationManager notificationManager,
                                        AppContext appContext
                                       ) {
//        super("Select Grunt Task", null);
        this.view = view;
        this.runController = runController;
        this.dtoFactory = dtoFactory;
        this.projectServiceClient = projectServiceClient;
        this.appContext = appContext;
        this.notificationManager = notificationManager;
        view.setDelegate(this);
    }



    @Override
    public boolean isCompleted() {
        return true;
    }


    @Override
    public void setUpdateDelegate(@NotNull Wizard.UpdateDelegate delegate) {
        super.setUpdateDelegate(delegate);
        requestTasks();
    }

    @Override
    public void go(AcceptsOneWidget container) {
        container.setWidget(view);
{'fraction_non_alphanumeric': 0.12054522220644612, 'fraction_numerical': 0.0022717591935254864, 'mean_word_length': 2.9220489977728286, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7594978', 'n_tokens_mistral': 1828, 'n_tokens_neox': 1773, 'n_words': 386}