Package org.netbeans.api.project

Examples of org.netbeans.api.project.Project


        return getUnloadedProject(dirs[0]);
    }

    public NbGradleProject loadSingleProject() throws IOException {
        Project project = getSingleUnloadedProject();
        return toLoadedProject(project);
    }
View Full Code Here


        Project project = getSingleUnloadedProject();
        return toLoadedProject(project);
    }

    public NbGradleProject loadProject(String... projectPath) throws IOException {
        Project project = getUnloadedProject(projectPath);
        return toLoadedProject(project);
    }
View Full Code Here

    public void tearDown() throws Exception {
    }

    @Test
    public void testProjectServiceProvider() throws Exception {
        Project project = rootProject;

        MyCustomLookupEntry entry = project.getLookup().lookup(MyCustomLookupEntry.class);
        assertNotNull("Lookup must contain entry: MyCustomLookupEntry", entry);
        assertEquals("Must be registered with the currect project.",
                project.getProjectDirectory(),
                entry.getProject().getProjectDirectory());
    }
View Full Code Here

        return isOwnerProject(fileObj);
    }

    public boolean isOwnerProject(FileObject file) {
        Project owner = FileOwnerQuery.getOwner(file);
        if (owner == null) {
            return false;
        }

        return project.getProjectDirectory().equals(owner.getProjectDirectory());
    }
View Full Code Here

        ExceptionHelper.checkNotNullArgument(plainProjectDir, "plainProjectDir");

        Closeable safeToOpen = null;
        try {
            safeToOpen = NbGradleProjectFactory.safeToOpen(plainProjectDir);
            Project project = ProjectManager.getDefault().findProject(projectDir);
            if (project != null) {
                return project.getLookup().lookup(NbGradleProject.class);
            }
        } catch (IOException | IllegalArgumentException ex) {
            LOGGER.log(Level.INFO, "Failed to load project: " + projectDir, ex);
        } finally {
            try {
View Full Code Here

        public ProjectDependencyFactory(JavaProjectDependency projectDep) {
            this.projectDep = projectDep;
        }

        private DataObject getProjectDirObj() {
            Project project = projectDep.getProjectReference().tryGetProject();
            if (project == null) {
                return null;
            }
            try {
                return DataObject.find(project.getProjectDirectory());
            } catch (DataObjectNotFoundException ex) {
                LOGGER.log(Level.INFO, "Failed to find node for project directory: " + project.getProjectDirectory(), ex);
                return null;
            }
        }
View Full Code Here

                // does not have build.gradle, NetBeans might have
                // already determined that the directory does not
                // contain a project.
                projectManager.clearNonProjectCache();

                Project subProject = projectManager.findProject(projectDirObj);
                if (subProject == null) {
                    LOGGER.log(Level.WARNING,
                            "Project cannot be found: {0}",
                            projectDir);
                    return;
View Full Code Here

    public File getProjectDir() {
        return projectDir;
    }

    public Project tryGetProject() {
        Project result = projectRef.get();
        if (result == null) {
            FileObject projectDirObj = FileUtil.toFileObject(projectDir);
            try {
                try (Closeable safeToOpen = NbGradleProjectFactory.safeToOpen(projectDir)) {
                    assert safeToOpen != null; // Avoid warning
View Full Code Here

    }

    public JavaExtension tryGetJavaExtension() {
        JavaExtension result = javaExtensionRef.get();
        if (result == null) {
            Project project = tryGetProject();
            if (project != null) {
                result = project.getLookup().lookup(JavaExtension.class);
                if (result != null) {
                    javaExtensionRef.set(result);
                }
            }
View Full Code Here

            super(NbStrings.getTestClassAgain());
        }

        @Override
        public void actionPerformed(ActionEvent e) {
            Project project = javaExt.getProject();
            Lookup context = Lookups.fixed(testTaskName, new SpecificTestClass(suiteName));

            GradleActionProvider.invokeAction(project, ActionProvider.COMMAND_TEST_SINGLE, context);
        }
View Full Code Here

TOP

Related Classes of org.netbeans.api.project.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.