Examples of Sources


Examples of org.netbeans.api.project.Sources

       
        public List<SourceGroupKey> keys() {
            if (this.project.getProjectDirectory() == null || !this.project.getProjectDirectory().isValid()) {
                return Collections.EMPTY_LIST;
            }
            Sources sources = getSources();
            SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
           
            List result =  new ArrayList(groups.length);
            for( int i = 0; i < groups.length; i++ ) {
                result.add(new SourceGroupKey(groups[i]));
            }
View Full Code Here

Examples of org.netbeans.api.project.Sources

            for (SourceGroup sg : javasg) {
                javaroots.add(sg.getRootFolder());
            }

            List<SourceGroup> list = new ArrayList<SourceGroup>();
            Sources srcs = ProjectUtils.getSources(project);
            SourceGroup[] groovygroup = srcs.getSourceGroups(ScalaSourcesImpl.TYPE_SCALA);
            for (int i = 0; i < groovygroup.length; i++) {
                if (!javaroots.contains(groovygroup[i].getRootFolder())) {
                    list.add(groovygroup[i]);
                }
            }
View Full Code Here

Examples of org.netbeans.api.project.Sources

            return PackageView.createPackageView(group);
        }
       
        @Override
        public void addNotify() {
            Sources srcs = ProjectUtils.getSources(project);
            srcs.addChangeListener(this);
        }
View Full Code Here

Examples of org.netbeans.api.project.Sources

            srcs.addChangeListener(this);
        }
       
        @Override
        public void removeNotify() {
            Sources srcs = ProjectUtils.getSources(project);
            srcs.removeChangeListener(this);
        }
View Full Code Here

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

Examples of org.netbeans.api.project.Sources

    }

    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

Examples of org.netbeans.api.project.Sources

    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

Examples of org.netbeans.api.project.Sources

     * 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

Examples of org.netbeans.api.project.Sources

                }
            };
        }

        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

Examples of org.netbeans.api.project.Sources

    }

    @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
TOP
Copyright © 2018 www.massapi.com. 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.