Kie Workbench - Common - UI 6.2.0.Final

org.kie.workbench.common.widgets.client.handlers
Class DefaultNewResourceHandler

java.lang.Object
  extended by org.kie.workbench.common.widgets.client.handlers.DefaultNewResourceHandler
All Implemented Interfaces:
NewResourceHandler, PackageContextProvider

public abstract class DefaultNewResourceHandler
extends Object
implements NewResourceHandler, PackageContextProvider

Handler for the creation of new Items that require a Name and Path


Field Summary
protected  org.guvnor.common.services.project.context.ProjectContext context
           
protected  List<org.uberfire.commons.data.Pair<String,? extends com.google.gwt.user.client.ui.IsWidget>> extensions
           
protected  PackageListBox packagesListBox
           
protected  org.jboss.errai.common.client.api.Caller<KieProjectService> projectService
           
protected  org.jboss.errai.common.client.api.Caller<ValidationService> validationService
           
 
Constructor Summary
DefaultNewResourceHandler()
           
 
Method Summary
 void acceptContext(org.guvnor.common.services.project.context.ProjectContext context, com.google.gwt.core.client.Callback<Boolean,Void> callback)
          Indicates if the NewResourceHandler can create a resource to this path
protected  String buildFileName(String baseFileName, org.uberfire.workbench.type.ResourceTypeDefinition resourceType)
           
 List<org.uberfire.commons.data.Pair<String,? extends com.google.gwt.user.client.ui.IsWidget>> getExtensions()
          Return a List of Widgets that the NewResourceHandler can use to gather additional parameters for the new resource.
 org.guvnor.common.services.project.model.Package getPackage()
           
protected  org.jboss.errai.common.client.api.RemoteCallback<org.uberfire.backend.vfs.Path> getSuccessCallback(NewResourcePresenter presenter)
           
protected  void notifySuccess()
           
 void validate(String baseFileName, org.uberfire.ext.editor.commons.client.validation.ValidatorWithReasonCallback callback)
          Provide NewResourceHandlers with the ability to validate additional parameters before the creation of the new resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kie.workbench.common.widgets.client.handlers.NewResourceHandler
create, getDescription, getIcon, getResourceType
 

Field Detail

extensions

protected final List<org.uberfire.commons.data.Pair<String,? extends com.google.gwt.user.client.ui.IsWidget>> extensions

packagesListBox

@Inject
protected PackageListBox packagesListBox

context

@Inject
protected org.guvnor.common.services.project.context.ProjectContext context

projectService

@Inject
protected org.jboss.errai.common.client.api.Caller<KieProjectService> projectService

validationService

@Inject
protected org.jboss.errai.common.client.api.Caller<ValidationService> validationService
Constructor Detail

DefaultNewResourceHandler

public DefaultNewResourceHandler()
Method Detail

getExtensions

public List<org.uberfire.commons.data.Pair<String,? extends com.google.gwt.user.client.ui.IsWidget>> getExtensions()
Description copied from interface: NewResourceHandler
Return a List of Widgets that the NewResourceHandler can use to gather additional parameters for the new resource. The List is of Pairs, where each Pair consists of a String caption and IsWidget editor.

Specified by:
getExtensions in interface NewResourceHandler
Returns:
null if no extension is provided

validate

public void validate(String baseFileName,
                     org.uberfire.ext.editor.commons.client.validation.ValidatorWithReasonCallback callback)
Description copied from interface: NewResourceHandler
Provide NewResourceHandlers with the ability to validate additional parameters before the creation of the new resource

Specified by:
validate in interface NewResourceHandler
Parameters:
baseFileName - The base file name for the new item (excluding extension)
callback - Callback depending on validation result

acceptContext

public void acceptContext(org.guvnor.common.services.project.context.ProjectContext context,
                          com.google.gwt.core.client.Callback<Boolean,Void> callback)
Description copied from interface: NewResourceHandler
Indicates if the NewResourceHandler can create a resource to this path

Specified by:
acceptContext in interface NewResourceHandler

getPackage

public org.guvnor.common.services.project.model.Package getPackage()
Specified by:
getPackage in interface PackageContextProvider

buildFileName

protected String buildFileName(String baseFileName,
                               org.uberfire.workbench.type.ResourceTypeDefinition resourceType)

notifySuccess

protected void notifySuccess()

getSuccessCallback

protected org.jboss.errai.common.client.api.RemoteCallback<org.uberfire.backend.vfs.Path> getSuccessCallback(NewResourcePresenter presenter)

Kie Workbench - Common - UI 6.2.0.Final

Copyright © 2001-2015 JBoss by Red Hat. All Rights Reserved.