class ServerTemplatePresenter {

    public void copyTemplate() {
        copyPresenter.copy( new ParameterizedCommand<String>() {
            @Override
            public void execute( final String value ) {
                specManagementService.call( new RemoteCallback<Void>() {
                    @Override
                    public void callback( final Void aVoid ) {
                        copyPresenter.hide();
                        serverTemplateListRefreshEvent.fire( new ServerTemplateListRefresh( value ) );
                    }
                }, new ErrorCallback<Object>() {
                    @Override
                    public boolean error( final Object o,
                                          final Throwable throwable ) {
                        copyPresenter.errorDuringProcessing( view.getCopyTemplateErrorMessage() );
                        return false;
                    }
                } ).copyServerTemplate( serverTemplate.getId(), value, value );
            }
        } );
    }

    @Inject public  ServerTemplatePresenter( final Logger logger,
                                    final View view,
                                    final CopyPopupPresenter copyPresenter,
                                    final Caller<SpecManagementService> specManagementService,
                                    final Event<NotificationEvent> notification,
                                    final Event<AddNewContainer> addNewContainerEvent,
                                    final Event<ContainerSpecSelected> containerSpecSelectedEvent,
                                    final Event<ServerInstanceSelected> serverInstanceSelectedEvent,
                                    final Event<ServerTemplateListRefresh> serverTemplateListRefreshEvent );

}