@Override protected final void createCompilationUnit(final IFileStore store, final String name, final String content, final IProgressMonitor pm) throws CoreException { fFragment.createCompilationUnit(name, content, true, pm); }
@Override protected final void createCompilationUnit(final IFileStore store, final String name, final String content, final IProgressMonitor pm) throws CoreException { fFragment.createCompilationUnit(name, content, true, pm); }
@Override protected final void createCompilationUnit(final IFileStore store, final String name, final String content, final IProgressMonitor pm) throws CoreException { fFragment.createCompilationUnit(name, content, true, pm); }
@Override protected final void createCompilationUnit(final IFileStore store, final String name, final String content, final IProgressMonitor pm) throws CoreException { fFragment.createCompilationUnit(name, content, true, pm); }
protected final void createCompilationUnit(final IFileStore store, final String name, final String content, final IProgressMonitor pm) throws CoreException { fFragment.createCompilationUnit(name, content, true, pm); }
protected final void createCompilationUnit(final IFileStore store, final String name, final String content, final IProgressMonitor pm) throws CoreException { fFragment.createCompilationUnit(name, content, true, pm); }
IPackageFragment pack = sourceFolder.createPackageFragment(packageName, false, null); StringBuffer buf = new StringBuffer(); buf.append("package " + pack.getElementName() + ";\n"); buf.append("\n"); buf.append(source); ICompilationUnit cu = pack.createCompilationUnit(cuName, buf.toString(), false, null);
private void generateSourceFile(String className, String fileName, String source) throws JavaModelException { try { this.packageFragment.createCompilationUnit(fileName, source, false, new SubProgressMonitor(this.monitor, 10)); } catch (JavaModelException ex) { if (ex.getJavaModelStatus().getCode() == IJavaModelStatusConstants.NAME_COLLISION) { if (this.overwriteConfirmer.overwrite(className)) { this.packageFragment.createCompilationUnit(fileName, source, true, new SubProgressMonitor(this.monitor, 0)); } } else { throw ex; } } }
/** * Create the sample process junit test file. */ private void createProcessSampleJUnit(IJavaProject project, String exampleType, IProgressMonitor monitor) throws JavaModelException, IOException { String s = "org/jbpm/eclipse/wizard/project/ProcessJUnit-" + exampleType + ".java"; IRuntime runtime = startPage.getRuntime(); if (runtime.getVersion().getMajor()==5) { s += ".v5.template"; } else { s += ".template"; } IFolder folder = project.getProject().getFolder("src/main/java"); IPackageFragmentRoot packageFragmentRoot = project .getPackageFragmentRoot(folder); IPackageFragment packageFragment = packageFragmentRoot .createPackageFragment("com.sample", true, monitor); InputStream inputstream = getClass().getClassLoader() .getResourceAsStream(s); packageFragment.createCompilationUnit("ProcessTest.java", new String( FileUtils.readStream(inputstream)), true, monitor); }
pack.createCompilationUnit(fileName, content, true, null); byte[] contentBytes = content.getBytes(); IPath packageFullPath = new Path(packageName.replace('.', IPath.SEPARATOR));
content.append(";"); //$NON-NLS-1$ ICompilationUnit compilationUnit= fCreatedPackageFragment.createCompilationUnit(PACKAGE_INFO_JAVA_FILENAME, content.toString(), true, monitor);
private ICompilationUnit createCompilationUnit(ICompilationUnit unit) { try { unit.getResource().refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor()); if (unit.getResource().exists()) { IJavaElement parent = unit.getParent(); if (parent instanceof IPackageFragment) { IPackageFragment pkg = (IPackageFragment) parent; unit = pkg.createCompilationUnit(unit.getElementName(), unit.getSource(), true, new NullProgressMonitor()); } } } catch (CoreException e) { JavaLanguageServerPlugin.logException(e.getMessage(), e); } return unit; }
ICompilationUnit compilationUnit= pack.createCompilationUnit(fileName, content.toString(), true, monitor);
IPackageFragment packageFragment = packageFragmentRoot.createPackageFragment("com.sample", true, monitor); inputstream = getClass().getClassLoader().getResourceAsStream(fileName); packageFragment.createCompilationUnit("ProcessMain.java", new String(FileUtils.readStream(inputstream)), true, monitor);
destinationPack.createCompilationUnit(cuName, parsedText, true, new SubProgressMonitor(pm, 1));
destinationPack.createCompilationUnit(cuName, parsedText, true, new SubProgressMonitor(pm, 1));
if (parent instanceof IPackageFragment) { IPackageFragment pkg = (IPackageFragment) parent; unit = pkg.createCompilationUnit(unit.getElementName(), unit.getSource(), true, new NullProgressMonitor());
destinationPack.createCompilationUnit(cu.getElementName(), document.get(), false, null); editorPart[0]= openCu(cu); EditorUtility.revealInEditor(editorPart[0], textPosition.getStartPosition() + textPosition.getLength(), 0);
destinationPack.createCompilationUnit(cu.getElementName(), document.get(), false, null); editorPart[0]= openCu(cu); EditorUtility.revealInEditor(editorPart[0], textPosition.getStartPosition() + textPosition.getLength(), 0);
m_createdCompilationUnit = pck.createCompilationUnit(getFileName(), newSource, true, progress.newChild(0)); progress.worked(1);