final FormStylePopup form = new FormStylePopup( images.ruleAsset(),
constants.CopyThisItem() );
final TextBox newName = new TextBox();
form.addAttribute( constants.NewName(),
newName );
final RulePackageSelector sel = new RulePackageSelector();
form.addAttribute( constants.NewPackage(),
sel );
Button ok = new Button( constants.CreateCopy() );
ok.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent arg0) {
if ( newName.getText() == null || newName.getText().equals( "" ) ) {
Window.alert( constants.AssetNameMustNotBeEmpty() );
return;
}
String name = newName.getText().trim();
if ( !NewAssetWizard.validatePathPerJSR170( name ) ) {
return;
}
RepositoryServiceFactory.getService().copyAsset( asset.uuid,
sel.getSelectedPackage(),
name,
new GenericCallback<String>() {
public void onSuccess(String data) {
completedCopying( newName.getText(),
sel.getSelectedPackage(),
data );
form.hide();
}
@Override