Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.drools.workbench.screens.testscenario.client.handler;
 
 import java.util.List;
 
 import  org.drools.workbench.models.testscenarios.shared.Scenario;
import  org.drools.workbench.screens.testscenario.service.ScenarioTestEditorService;
import  org.guvnor.common.services.project.model.Package;
import  org.kie.commons.data.Pair;
import  org.kie.workbench.common.widgets.client.callbacks.HasBusyIndicatorDefaultErrorCallback;
import  org.kie.workbench.common.widgets.client.handlers.DefaultNewResourceHandler;
import  org.kie.workbench.common.widgets.client.handlers.NewResourcePresenter;
import  org.kie.workbench.common.widgets.client.resources.i18n.CommonConstants;
import  org.kie.workbench.common.widgets.client.widget.BusyIndicatorView;
import  org.uberfire.backend.vfs.Path;
        extends DefaultNewResourceHandler {
    @Inject
    private BusyIndicatorView busyIndicatorView;
    @Inject
    private Caller<ScenarioTestEditorService> service;
    @Inject
    @Override
    public String getDescription() {
    }
    @Override
    public IsWidget getIcon() {
    }
    @Override
    public List<Pair<String, ? extends IsWidget>> getExtensions() {
        final Package activePackage = context.getActivePackage();
        this..setPath( ( activePackage == null ? null : activePackage.getPackageTestResourcesPath() ) );
        return this.;
    }
    @Override
    public void createfinal Package pkg,
                        final String baseFileName,
                        final NewResourcePresenter presenter ) {
        .showBusyIndicator( CommonConstants.INSTANCE.Saving() );
        .call(
                getSuccessCallback( presenter ),
                new HasBusyIndicatorDefaultErrorCallback(  ) ).create( pkg.getPackageTestResourcesPath(),
                                                                                        buildFileName,
                                                                                                       baseFileName ),
                                                                                        new Scenario(),
                                                                                        "" );
    }
    @Override
    public void acceptPathfinal Path path,
                            final Callback<BooleanVoidcallback ) {
        if ( path == null ) {
            callback.onSuccessfalse );
        } else {
            projectService.call( new RemoteCallback<Package>() {
                @Override
                public void callbackfinal Package pkg ) {
                    boolean accept = ( pkg == null ? false : pkg.getPackageTestResourcesPath() != null );
                    callback.onSuccessaccept );
                }
            } ).resolvePackage( path );
        }
    }
New to GrepCode? Check out our FAQ X