Examples of Sources


Examples of org.netbeans.api.project.Sources

        Set retVal = new HashSet();
        final FileObject documentBase = wm.getDocumentBase();
        Project project = FileOwnerQuery.getOwner(documentBase);

        Library sipLibrary = LibraryManager.getDefault().getLibrary(libname);
        Sources s = project.getLookup().lookup(Sources.class);
        SourceGroup[] sources = null;
        if (null != s) {
            sources = s.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
        }
        if (sipLibrary != null) {
            Library[] sipLibs = new Library[1];
            sipLibs[0] = sipLibrary;
            boolean extended = false;
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[] sourceGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
        if (panels == null) {
            embedded = new SipListenerWizardPanel1();
            panels = new WizardDescriptor.Panel[]{
                JavaTemplates.createPackageChooser(project,sourceGroups,embedded)
            };
View Full Code Here

Examples of org.netbeans.api.project.Sources

     */
    private WizardDescriptor.Panel[] getPanels() {
        if (panels == null) {
       
            Project project = Templates.getProject(wizard);
            Sources s = ProjectUtils.getSources(project);
            SourceGroup[] groups = s.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
            WizardDescriptor.Panel targetChooser =
                    0 == groups.length ?
                    Templates.createSimpleTargetChooser(
                        project,
                        groups,
View Full Code Here

Examples of org.netbeans.api.project.Sources

//            "cs:utf-8,en:utf-8"
            return sb.toString();
        }
       
        private FileObject getProjectJavaSourcesRoot(Project project) {
            Sources srcs = ProjectUtils.getSources(project);
            SourceGroup[] javaSrcs =
                    srcs.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
            if(javaSrcs.length > 0){
                return javaSrcs[0].getRootFolder();
            }else {
                throw new RuntimeException("No java sources in given project.");
            }
View Full Code Here

Examples of org.netbeans.api.project.Sources

                throw new RuntimeException("No java sources in given project.");
            }
        }

        private FileObject getProjectResourcesRoot(Project project) {
            Sources srcs = ProjectUtils.getSources(project);
            SourceGroup[] resources =
                    srcs.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_RESOURCES);
            if(resources.length > 0){
                return resources[0].getRootFolder();
            }else {
                // no resources in given project => place together with java sources
                return getProjectJavaSourcesRoot(project);
View Full Code Here

Examples of org.netbeans.api.project.Sources

     * various properties for them influencing wizard appearance.
     */
    private WizardDescriptor.Panel[] getPanels() {
        if (panels == null) {
            Project p = Templates.getProject(wizard);
            Sources s = ProjectUtils.getSources(p);
            SourceGroup[] groups = s.getSourceGroups(Sources.TYPE_GENERIC);
            WizardDescriptor.Panel customizedTargetChooser =
                    Templates.createSimpleTargetChooser(p, groups,
                        new LayoutDefinitionWizardPanel(wizard));

            panels = new WizardDescriptor.Panel[]{
View Full Code Here

Examples of org.netbeans.api.project.Sources

     */
    public static SourceGroup[] getSourceGroups(Project project, String sourceType) {
   
        SourceGroup[] sg = new SourceGroup[] {};
        if(null != project){
            Sources sources = ProjectUtils.getSources(project);
            sg = sources.getSourceGroups(sourceType);
        }
       
        return sg;
    }
View Full Code Here

Examples of org.netbeans.api.project.Sources

   
    static boolean isValidRoot (File file, File[] relatedRoots, File projectFolder) {
        Project p;
        if ((p = FileOwnerQuery.getOwner(file.toURI()))!=null
            && !file.getAbsolutePath().startsWith(projectFolder.getAbsolutePath()+File.separatorChar)) {
            final Sources sources = (Sources) p.getLookup().lookup(Sources.class);
            if (sources == null) {
                return false;
            }
            final SourceGroup[] sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC);
            final SourceGroup[] javaGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
            final SourceGroup[] groups = new SourceGroup [sourceGroups.length + javaGroups.length];
            System.arraycopy(sourceGroups,0,groups,0,sourceGroups.length);
            System.arraycopy(javaGroups,0,groups,sourceGroups.length,javaGroups.length);
            final FileObject projectDirectory = p.getProjectDirectory();
            final FileObject fileObject = FileUtil.toFileObject(file);
View Full Code Here

Examples of org.netbeans.api.project.Sources

            }
        }
    }

    private Iterable<? extends FileObject> getRoots() {
        Sources _src = null;
        synchronized (this) {
            if (this.roots != null) {
                return this.roots;
            }
            if (this.src == null) {
                this.src = this.project.getLookup().lookup(Sources.class);
                this.src.addChangeListener(sourcesChangeListener);
            }
            _src = this.src;
        }
        assert _src != null;
        final SourceGroup[] sgs = _src.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
        final List<FileObject> _roots = new ArrayList<FileObject>(sgs.length);
        for (SourceGroup sg : sgs) {
            final FileObject root = sg.getRootFolder();
            if (UnitTestForSourceQuery.findSources(root).length == 0) {
                _roots.add(root);
View Full Code Here

Examples of org.netbeans.api.project.Sources

     * {@link J2SESources#fireChange} method.
     */
    public SourceGroup[] getSourceGroups(final String type) {
        return ProjectManager.mutex().readAccess(new Mutex.Action<SourceGroup[]>() {
            public SourceGroup[] run() {
                Sources _delegate;
                synchronized (J2SESources.this) {
                    if (delegate == null) {                   
                        delegate = initSources();
                        delegate.addChangeListener(J2SESources.this);
                    }
                    _delegate = delegate;
                }
                SourceGroup[] groups = _delegate.getSourceGroups(type);
                if (type.equals(Sources.TYPE_GENERIC)) {
                    FileObject libLoc = getSharedLibraryFolderLocation();
                    if (libLoc != null) {
                        SourceGroup[] grps = new SourceGroup[groups.length + 1];
                        System.arraycopy(groups, 0, grps, 0, groups.length);
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.