Kie Workbench - Common - UI 6.0.0.CR4-Pre1

org.kie.workbench.common.widgets.client.handlers
Interface NewResourceHandler

All Known Implementing Classes:
DefaultNewResourceHandler

public interface NewResourceHandler

Definition of Handler to support creation of new resources


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
 void create(org.guvnor.common.services.project.model.Package pkg, String baseFileName, NewResourcePresenter presenter)
          An entry-point for the creation of the new resource
 String getDescription()
          A description of the new resource type
 List<org.kie.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.
 com.google.gwt.user.client.ui.IsWidget getIcon()
          An icon representing the new resource type
 void validate(String fileName, org.kie.workbench.common.services.shared.validation.ValidatorWithReasonCallback callback)
          Provide NewResourceHandlers with the ability to validate additional parameters before the creation of the new resource
 

Method Detail

getDescription

String getDescription()
A description of the new resource type

Returns:

getIcon

com.google.gwt.user.client.ui.IsWidget getIcon()
An icon representing the new resource type

Returns:

create

void create(org.guvnor.common.services.project.model.Package pkg,
            String baseFileName,
            NewResourcePresenter presenter)
An entry-point for the creation of the new resource

Parameters:
pkg - the Package context where new resource should be created
baseFileName - the base name of the new resource
presenter - underlying presenter

getExtensions

List<org.kie.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. The List is of Pairs, where each Pair consists of a String caption and IsWidget editor.

Returns:
null if no extension is provided

validate

void validate(String fileName,
              org.kie.workbench.common.services.shared.validation.ValidatorWithReasonCallback callback)
Provide NewResourceHandlers with the ability to validate additional parameters before the creation of the new resource

Parameters:
fileName - The file name for the new item
callback - Callback depending on validation result

acceptContext

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


Kie Workbench - Common - UI 6.0.0.CR4-Pre1

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