void (final String tempPath, final PathsList sources, final Module module, final VirtualFile formFile, @Nullable final Locale stringDescriptorLocale) { // 3. Now we are ready to launch Java process final JavaParameters parameters = new JavaParameters(); parameters.getClassPath().add(tempPath); parameters.getClassPath().add(PathManager.getJarPathForClass(CellConstraints.class)); final List<String> paths = sources.getPathList(); for (final String path : paths) { parameters.getClassPath().add(path); } try { parameters.configureByModule(module, JavaParameters.JDK_AND_CLASSES); } catch (CantRunException e) { Messages.showErrorDialog( module.getProject(), UIDesignerBundle.message("error.cannot.preview.form", formFile.getPath().replace('/', File.separatorChar), e.getMessage()), CommonBundle.getErrorTitle() ); return; } parameters.setMainClass(CLASS_TO_BIND_NAME); parameters.setWorkingDirectory(tempPath); if (stringDescriptorLocale != null && stringDescriptorLocale.getDisplayName().length() > 0) { parameters.getVMParametersList().add("-Duser.language=" + stringDescriptorLocale.getLanguage()); } try { RunProfile profile = new MyRunProfile(module, parameters, tempPath, UIDesignerBundle.message("progress.preview.started", formFile.getPresentableUrl())); ExecutionEnvironmentBuilder.create(module.getProject(), DefaultRunExecutor.getRunExecutorInstance(), profile).buildAndExecute(); } catch (ExecutionException e) { Messages.showErrorDialog( module.getProject(), UIDesignerBundle.message("error.cannot.preview.form", formFile.getPath().replace('/', File.separatorChar), e.getMessage()), CommonBundle.getErrorTitle() ); } }