public static boolean isMainClass (final String className, ClassPath bootPath, ClassPath compilePath, ClassPath sourcePath) { ClasspathInfo cpInfo = ClasspathInfo.create(bootPath, compilePath, sourcePath); /** @Todo */ return true; //return SourceUtils.isMainClass(className, cpInfo); }
private ModelUnit(ClassPath bootPath, ClassPath compilePath, ClassPath sourcePath) { this.bootPath = bootPath; this.compilePath = compilePath; this.sourcePath = sourcePath; this.classPathInfo = ClasspathInfo.create(bootPath, compilePath, sourcePath); }
private ModelUnit( ClassPath bootPath, ClassPath compilePath, ClassPath sourcePath, Project project) { myBootPath= bootPath; myCompilePath = compilePath; mySourcePath = sourcePath; myProject = project; myClassPathInfo = ClasspathInfo.create(bootPath, compilePath, sourcePath); }
protected final ClasspathInfo getClasspathInfoFromRequest(final CompletionContext request) { FileObject fileObject = request.getSourceFile(); if (fileObject != null) { return ClasspathInfo.create(fileObject); } return null; }
public static boolean isMainClass (final String className, ClassPath bootPath, ClassPath compilePath, ClassPath sourcePath) { ClasspathInfo cpInfo = ClasspathInfo.create(bootPath, compilePath, sourcePath); return SourceUtils.isMainClass(className, cpInfo); }
public static Object execute(Write task, List<FileObject> fObjs) { JavaSource js = JavaSource.create(ClasspathInfo.create(fObjs.get(0)), fObjs); return execute(task, js); }
/** Creates new interface to the compiler * @param fo for which the CompilerInterface should be created */ @NonNull public static ClasspathInfo create(@NonNull final FileObject fo) { return create (fo, null, false, false, false, true); }
private ClasspathInfo getClasspathInfo(Project project) { if (project == null) { return null; } SourceGroup group = getSourceGroup(project); if (group == null) { return null; } FileObject fileObject = group.getRootFolder(); return ClasspathInfo.create(fileObject); }
private ClasspathInfo getClasspathInfo(Project project) { if (project == null) { return null; } SourceGroup group = getSourceGroup(project); return group != null ? ClasspathInfo.create(group.getRootFolder()) : null; }
public static ClasspathInfo getClasspathInfo(Project project) { SourceGroup group = getSourceGroup(project); if (group == null) return null; FileObject fileObject = group.getRootFolder(); return ClasspathInfo.create(fileObject); }
private static void runUserActionTask(JTextComponent target, Task<CompilationController> aTask) { FileObject fobj = getFileObject(target); if (fobj == null) { return; } try { JavaSource src = JavaSource.create(ClasspathInfo.create(fobj)); if (src != null) src.runUserActionTask(aTask, false); } catch (IOException e) { Exceptions.printStackTrace(e); } }
private void jButtonClassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClassActionPerformed ClasspathInfo cpInfo = ClasspathInfo.create(config.getPrimaryFile()); final ElementHandle<TypeElement> handle = TypeElementFinder.find(cpInfo, new TypeElementFinder.Customizer() { public Set<ElementHandle<TypeElement>> query(ClasspathInfo classpathInfo, String textForQuery, NameKind nameKind, Set<SearchScope> searchScopes) { return classpathInfo.getClassIndex().getDeclaredTypes(textForQuery, nameKind, searchScopes); } public boolean accept(ElementHandle<TypeElement> typeHandle) { return true; } }); if (handle != null) { jTextFieldClass.setText(handle.getQualifiedName()); } }//GEN-LAST:event_jButtonClassActionPerformed
static ClasspathInfo createClasspathInfo(FileObject fileObject) { return ClasspathInfo.create( ClassPath.getClassPath(fileObject, ClassPath.BOOT), ClassPath.getClassPath(fileObject, ClassPath.COMPILE), ClassPath.getClassPath(fileObject, ClassPath.SOURCE) ); }
private JavaSource createJavaSource() { FileObject fileObject = info.getSnapshot().getSource().getFileObject(); if (fileObject == null) { return null; } // get the JavaSource for our file. JavaSource javaSource = JavaSource.create(ClasspathInfo.create(fileObject)); if (javaSource == null) { LOG.log(Level.FINEST, "Problem retrieving JavaSource from ClassPathInfo, exiting."); return null; } return javaSource; }
public RestApplicationMetadataModelImpl(MetadataUnit metadataUnit, Project project) { ClasspathInfo cpi = ClasspathInfo.create(metadataUnit.getBootPath(), metadataUnit.getCompilePath(), metadataUnit.getSourcePath()); helper = AnnotationModelHelper.create(cpi); metadata = RestApplicationsImpl.create(helper, project); //metadata = new RestServicesMetadataImpl(root); }
private EjbReference(String ejbClass, String ejbRefType, String local, String localHome, String remote, String remoteHome, EjbJar ejbModule) { this.ejbClass = ejbClass; this.ejbRefType = ejbRefType; this.local = local; this.localHome = localHome; this.remote = remote; this.remoteHome = remoteHome; this.ejbModule = ejbModule; FileObject[] javaSources = getEjbModule().getJavaSources(); cpInfo = javaSources.length > 0 ? ClasspathInfo.create( ClassPath.getClassPath(javaSources[0], ClassPath.BOOT), ClassPath.getClassPath(javaSources[0], ClassPath.COMPILE), ClassPath.getClassPath(javaSources[0], ClassPath.SOURCE) ) : null; }
private JsfModelImplementation ( ModelUnit unit ){ ClasspathInfo classpathInfo = ClasspathInfo.create(unit.getBootPath(), unit.getCompilePath(), unit.getSourcePath()); myHelper = AnnotationModelHelper.create(classpathInfo); myModel = new JsfModelImpl( unit , getHelper() ); }
public RestServicesMetadataModelImpl(MetadataUnit metadataUnit, Project project) { ClasspathInfo cpi = ClasspathInfo.create(metadataUnit.getBootPath(), metadataUnit.getCompilePath(), metadataUnit.getSourcePath()); helper = AnnotationModelHelper.create(cpi); root = RestServicesImpl.create(helper, project); metadata = new RestServicesMetadataImpl(root); }
public static JavaSource createJavaSource(WebModule webModule) { Project project = FileOwnerQuery.getOwner(webModule.getDocumentBase()); ClassPathProvider cpp = project.getLookup().lookup(ClassPathProvider.class); ClassPath bootCP = cpp.findClassPath(webModule.getDocumentBase(), ClassPath.BOOT); ClassPath compileCP = cpp.findClassPath(webModule.getDocumentBase(), ClassPath.COMPILE); ClassPath sourceCP = cpp.findClassPath(webModule.getDocumentBase(), ClassPath.SOURCE); return JavaSource.create(ClasspathInfo.create(bootCP, compileCP, sourceCP), Collections.EMPTY_LIST); }
@NbBundle.Messages("title.go.to.class.action=Searching Managed Bean") private void findJavaClass(final String fqn, javax.swing.text.Document doc) { FileObject fo = NbEditorUtilities.getFileObject(doc); if (fo != null) { WebModule wm = WebModule.getWebModule(fo); if (wm != null) { ClasspathInfo cpi = ClasspathInfo.create(wm.getDocumentBase()); ClassSeekerTask classSeekerTask = new ClassSeekerTask(cpi, fqn); runClassSeekerUserTask(classSeekerTask); if (!classSeekerTask.wasElementFound() && SourceUtils.isScanInProgress()) { ScanDialog.runWhenScanFinished(classSeekerTask, Bundle.title_go_to_class_action()); } } } }