class DesktopGeneratorController implements GeneratorController {

    private final LongTaskExecutor executor;

    public DesktopGeneratorController() {
        executor = new LongTaskExecutor(true, "Generator");
    }

    @Override
    public Generator[] getGenerators() {
        return Lookup.getDefault().lookupAll(Generator.class).toArray(new Generator[0]);
    }

    @Override
    public void generate(final Generator generator) {<FILL_FUNCTION_BODY>}

    private void finishGenerate(Container container) {
        container.closeLoader();

        DefaultProcessor defaultProcessor = new DefaultProcessor();
        defaultProcessor.setContainers(new ContainerUnloader[] {container.getUnloader()});
        defaultProcessor.process();
    }
}


        String title = generator.getName();
        GeneratorUI ui = generator.getUI();
        if (ui != null) {
            ui.setup(generator);
            JPanel panel = ui.getPanel();
            final DialogDescriptor dd = DialogDescriptorWithValidation.dialog(panel, title);
            Object result = DialogDisplayer.getDefault().notify(dd);
            if (result != NotifyDescriptor.OK_OPTION) {
                return;
            }
            ui.unsetup();
        }

        final Container container = Lookup.getDefault().lookup(Container.Factory.class).newContainer();
        container.setSource(generator.getName());
        container.setReport(new Report());
        String taskname = NbBundle
            .getMessage(DesktopGeneratorController.class, "DesktopGeneratorController.taskname", generator.getName());

        //Error handler
        LongTaskErrorHandler errorHandler = new LongTaskErrorHandler() {

            @Override
            public void fatalError(Throwable t) {
                Exceptions.printStackTrace(t);
            }
        };

        //Execute
        executor.execute(generator, new Runnable() {

            @Override
            public void run() {
                generator.generate(container.getLoader());
                finishGenerate(container);
            }
        }, taskname, errorHandler);
    
<no_super_class>