Package org.netbeans.api.project

Examples of org.netbeans.api.project.Sources


                FileObject file = FileUtil.toFileObject(clazzfile);
                String newclazz = clazz;
                if (file != null) {
                    Project prj = FileOwnerQuery.getOwner(file);
                    if (prj != null) {
                        Sources srcs = ProjectUtils.getSources(prj);
                        if (srcs != null) {
                            for (SourceGroup grp : srcs.getSourceGroups(ScalaSourcesImpl.TYPE_SCALA)) {
                                if (FileUtil.isParentOf(grp.getRootFolder(), file)) {
                                    newclazz = FileUtil.getRelativePath(grp.getRootFolder(), file);
                                    if (newclazz.endsWith(".scala")) { //NOI18N
                                        newclazz = newclazz.substring(0, newclazz.length() -".scala".length()); //NOI18N
                                    }
View Full Code Here


    }

    public static String getSourceDirectory(Project project) {
        String path = "";
       
        Sources sources = (Sources) project.getLookup().lookup(Sources.class);
        SourceGroup[] groups = sources.getSourceGroups(Sources.TYPE_GENERIC);
        for (int i=0; i<groups.length; i++){
            if (groups[i].getName().equals("${src.dir}")){
                path = groups[i].getRootFolder().getPath();
            }
        }
View Full Code Here

    static final String CLOJURE_EXT = "clj";

    public static List<FileObject> getClojureSources(Project project) {
        List<FileObject> result = new ArrayList<FileObject>();
        Sources sources = ProjectUtils.getSources(project);
        SourceGroup[] groups = sources.getSourceGroups(Sources.TYPE_GENERIC);

        for (SourceGroup group : groups) {
            FileObject root = group.getRootFolder();
            Enumeration<? extends FileObject> files = root.getData(true);
View Full Code Here

     * Initialize panels representing individual wizard's steps and sets
     * various properties for them influencing wizard appearance.
     */
    private WizardDescriptor.Panel[] getPanels() {
        Project project = Templates.getProject(wizard);
        Sources sources = ProjectUtils.getSources(project);
        SourceGroup[] groups = sources.getSourceGroups(Sources.TYPE_GENERIC);

        if (panels == null) {
            panels = new WizardDescriptor.Panel[]{
                        Templates.buildSimpleTargetChooser(project, groups).bottomPanel(new ParentPresenterWizardPanel()).create(),
                        new ActionRenderWizardPanel(),
View Full Code Here

                }
            };
        }

        private static Sources getTestSources() {
            return new Sources() {
                @Override
                public SourceGroup[] getSourceGroups(String type) {
                    if (JavaProjectConstants.SOURCES_TYPE_JAVA.equals(type)) {
                        return new SourceGroup[]{getTestSourceGroup()};
                    }
View Full Code Here

    }

    @Test
    public void testSourcesMerger() {
        Lookup lookup = rootProject.getLookup();
        Sources sources = lookup.lookup(Sources.class);
        assertNotNull("sources", sources);

        SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
        SourceGroup foundGroup = findGroupByName(CustomSourcesMergerExtDef.TEST_SRC_GROUP_NAME, groups);
        assertNotNull("Must have the source groups merged.", foundGroup);
    }
View Full Code Here

        if (project == null) {
            return null;
        }
        Set<File> set = new HashSet<File>();

        Sources sources = ProjectUtils.getSources(project);
        SourceGroup[] sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC);
        for (int j = 0; j < sourceGroups.length; j++) {
            SourceGroup sourceGroup = sourceGroups[j];
            FileObject srcRootFo = sourceGroup.getRootFolder();
            File rootFile = FileUtil.toFile(srcRootFo);
            set.add(rootFile);
View Full Code Here

                  }
                 
//                    projectRoot = selectedProject.getProjectDirectory().getPath() + "/";
                    logger.info("[OFF] fetching files from project " + projectRoot);

                    Sources s = ProjectUtils.getSources(selectedProject);
//                    s.addChangeListener(this);
                    SourceGroup[] groups = s.getSourceGroups(Sources.TYPE_GENERIC);

                    for (SourceGroup group : groups) {
                        FileObject folder = group.getRootFolder();
                        logger.info("[OFF] found source group: " + group.getName() + " (" + folder.getPath() + ")");
                        collectFiles(group, folder);
View Full Code Here

TOP

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

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.