@Override
    void storeProperties() throws IOException {
        super.storeProperties();
        // Store chnages in manifest
        storeManifestChanges();
        // store localized info
        if (bundleInfo != null && bundleInfo.isModified()) {
            bundleInfo.store();
        } // XXX else ignore for now but we could save into some default location
        ProjectXMLManager pxm = getProjectXMLManager();
        // Store project.xml changes
        // store module dependencies
        DependencyListModel dependencyModel = getDependenciesListModel();
        if (dependencyModel.isChanged()) {
            Set<ModuleDependency> depsToSave = new TreeSet<ModuleDependency>(dependencyModel.getDependencies());
            logNetBeansAPIUsage("DEPENDENCIES", dependencyModel.getDependencies()); // NOI18N
            try {
                pxm.replaceDependencies(depsToSave);
            } catch (CyclicDependencyException ex) {
                throw new IOException(ex);
            }
        }
        Set<String> friends = getFriendListModel().getFriends();
        Set<String> publicPkgs = getPublicPackagesModel().getSelectedPackages();
        boolean refreshModuleList = false;
        if (getPublicPackagesModel().isChanged() || getFriendListModel().isChanged()) {
            if (friends.size() > 0) { // store friends packages
                pxm.replaceFriends(friends, publicPkgs);
            } else { // store public packages
                pxm.replacePublicPackages(publicPkgs);
            }
            refreshModuleList = true;
        }
        // store class-path-extensions + its src & javadoc
        if (cps != null && wrappedJarsListModel != null && wrappedJarsChanged) {
            final List<Item> cpExtList = ClassPathUiSupport.getList(wrappedJarsListModel);
            Map<String, String> newCpExt = new HashMap<String, String>();
            for (Item item : cpExtList) {
                String binPath = item.getFilePath();
                if (binPath != null) {
                    FileObject fo = FileUtil.toFileObject(PropertyUtils.resolveFile(getProjectDirectoryFile(), binPath));
                    if(fo != null)
                    {
                        String runtimePath = ApisupportAntUtils.CPEXT_RUNTIME_RELATIVE_PATH + fo.getNameExt();
                        newCpExt.put(runtimePath, binPath);
                    }
                }
            }
            // delete removed JARs, remove any remaining exported packages and src&javadoc refs left
            Iterator<Item> it = getCPExtIterator();
            HashSet<String> jarsSet = new HashSet<String>(newCpExt.values());
            while (it.hasNext()) {
                Item item = it.next();
                if (!jarsSet.contains(item.getFilePath())) {
                    // XXX deleting here doesn't work on Windows: 
//                    File f = PropertyUtils.resolveFile(getProjectDirectoryFile(), item.getFilePath());
//                    FileObject toDel = FileUtil.toFileObject(f);
//                    if (toDel != null) {
//                        toDel.delete();
//                    }
                    assert item.getReference() != null : "getCPExtIterator() initializes references to wrapped JARs";
                    item.removeSourceAndJavadoc(getUpdateHelper());
                    getRefHelper().destroyReference(item.getReference());
                }
            }
            cps.encodeToStrings(cpExtList, CPEXT);
            pxm.replaceClassPathExtensions(newCpExt);
            wrappedJarsChanged = false;
        }
        if (isStandalone()) {
            ModuleProperties.storePlatform(getHelper(), getActivePlatform());
            if (javaPlatformChanged) {
                ModuleProperties.storeJavaPlatform(getHelper(), getEvaluator(), getActiveJavaPlatform(), false);
            }
            if (refreshModuleList) {
                ModuleList.refreshModuleListForRoot(getProjectDirectoryFile());
            }
        } else if (isSuiteComponent() && refreshModuleList) {
            ModuleList.refreshModuleListForRoot(getSuiteDirectory());
        } else if (isNetBeansOrg()) {
            if (javaPlatformChanged) {
                ModuleProperties.storeJavaPlatform(getHelper(), getEvaluator(), getActiveJavaPlatform(), true);
            }
            if (refreshModuleList) {
                ModuleList.refreshModuleListForRoot(ModuleList.findNetBeansOrg(getProjectDirectoryFile()));
            }
        }
    }
@Override
    void storeProperties() throws IOException {
        super.storeProperties();
       
        storeManifestChanges();
       
        if (bundleInfo != null && bundleInfo.isModified()) {
            bundleInfo.store();
        }
        ProjectXMLManager pxm = getProjectXMLManager();
       
       
        DependencyListModel dependencyModel = getDependenciesListModel();
        if (dependencyModel.isChanged()) {
            Set<ModuleDependency> depsToSave = new TreeSet<ModuleDependency>(dependencyModel.getDependencies());
            logNetBeansAPIUsage("DEPENDENCIES", dependencyModel.getDependencies());
            try {
                pxm.replaceDependencies(depsToSave);
            } catch (CyclicDependencyException ex) {
                throw new IOException(ex);
            }
        }
        Set<String> friends = getFriendListModel().getFriends();
        Set<String> publicPkgs = getPublicPackagesModel().getSelectedPackages();
        boolean refreshModuleList = false;
        if (getPublicPackagesModel().isChanged() || getFriendListModel().isChanged()) {
            if (friends.size() > 0) {
                pxm.replaceFriends(friends, publicPkgs);
            } else {
                pxm.replacePublicPackages(publicPkgs);
            }
            refreshModuleList = true;
        }
       
        if (cps != null && wrappedJarsListModel != null && wrappedJarsChanged) {
            final List<Item> cpExtList = ClassPathUiSupport.getList(wrappedJarsListModel);
            Map<String, String> newCpExt = new HashMap<String, String>();
            for (Item item : cpExtList) {
                String binPath = item.getFilePath();
                if (binPath != null) {
                    FileObject fo = FileUtil.toFileObject(PropertyUtils.resolveFile(getProjectDirectoryFile(), binPath));
                    if(fo != null)
                    {
                        String runtimePath = ApisupportAntUtils.CPEXT_RUNTIME_RELATIVE_PATH + fo.getNameExt();
                        newCpExt.put(runtimePath, binPath);
                    }
                }
            }
           
            Iterator<Item> it = getCPExtIterator();
            HashSet<String> jarsSet = new HashSet<String>(newCpExt.values());
            while (it.hasNext()) {
                Item item = it.next();
                if (!jarsSet.contains(item.getFilePath())) {
                   
                    assert item.getReference() != null : "getCPExtIterator() initializes references to wrapped JARs";
                    item.removeSourceAndJavadoc(getUpdateHelper());
                    getRefHelper().destroyReference(item.getReference());
                }
            }
            cps.encodeToStrings(cpExtList, CPEXT);
            pxm.replaceClassPathExtensions(newCpExt);
            wrappedJarsChanged = false;
        }
        if (isStandalone()) {
            ModuleProperties.storePlatform(getHelper(), getActivePlatform());
            if (javaPlatformChanged) {
                ModuleProperties.storeJavaPlatform(getHelper(), getEvaluator(), getActiveJavaPlatform(), false);
            }
            if (refreshModuleList) {
                ModuleList.refreshModuleListForRoot(getProjectDirectoryFile());
            }
        } else if (isSuiteComponent() && refreshModuleList) {
            ModuleList.refreshModuleListForRoot(getSuiteDirectory());
        } else if (isNetBeansOrg()) {
            if (javaPlatformChanged) {
                ModuleProperties.storeJavaPlatform(getHelper(), getEvaluator(), getActiveJavaPlatform(), true);
            }
            if (refreshModuleList) {
                ModuleList.refreshModuleListForRoot(ModuleList.findNetBeansOrg(getProjectDirectoryFile()));
            }
        }
    }
@override void storeproperties() throws ioexception { super.storeproperties(); storemanifestchanges(); if (bundleinfo != null && bundleinfo.ismodified()) { bundleinfo.store(); } projectxmlmanager pxm = getprojectxmlmanager(); dependencylistmodel dependencymodel = getdependencieslistmodel(); if (dependencymodel.ischanged()) { set<moduledependency> depstosave = new treeset<moduledependency>(dependencymodel.getdependencies()); lognetbeansapiusage("dependencies", dependencymodel.getdependencies()); try { pxm.replacedependencies(depstosave); } catch (cyclicdependencyexception ex) { throw new ioexception(ex); } } set<string> friends = getfriendlistmodel().getfriends(); set<string> publicpkgs = getpublicpackagesmodel().getselectedpackages(); boolean refreshmodulelist = false; if (getpublicpackagesmodel().ischanged() || getfriendlistmodel().ischanged()) { if (friends.size() > 0) { pxm.replacefriends(friends, publicpkgs); } else { pxm.replacepublicpackages(publicpkgs); } refreshmodulelist = true; } if (cps != null && wrappedjarslistmodel != null && wrappedjarschanged) { final list<item> cpextlist = classpathuisupport.getlist(wrappedjarslistmodel); map<string, string> newcpext = new hashmap<string, string>(); for (item item : cpextlist) { string binpath = item.getfilepath(); if (binpath != null) { fileobject fo = fileutil.tofileobject(propertyutils.resolvefile(getprojectdirectoryfile(), binpath)); if(fo != null) { string runtimepath = apisupportantutils.cpext_runtime_relative_path + fo.getnameext(); newcpext.put(runtimepath, binpath); } } } iterator<item> it = getcpextiterator(); hashset<string> jarsset = new hashset<string>(newcpext.values()); while (it.hasnext()) { item item = it.next(); if (!jarsset.contains(item.getfilepath())) { assert item.getreference() != null : "getcpextiterator() initializes references to wrapped jars"; item.removesourceandjavadoc(getupdatehelper()); getrefhelper().destroyreference(item.getreference()); } } cps.encodetostrings(cpextlist, cpext); pxm.replaceclasspathextensions(newcpext); wrappedjarschanged = false; } if (isstandalone()) { moduleproperties.storeplatform(gethelper(), getactiveplatform()); if (javaplatformchanged) { moduleproperties.storejavaplatform(gethelper(), getevaluator(), getactivejavaplatform(), false); } if (refreshmodulelist) { modulelist.refreshmodulelistforroot(getprojectdirectoryfile()); } } else if (issuitecomponent() && refreshmodulelist) { modulelist.refreshmodulelistforroot(getsuitedirectory()); } else if (isnetbeansorg()) { if (javaplatformchanged) { moduleproperties.storejavaplatform(gethelper(), getevaluator(), getactivejavaplatform(), true); } if (refreshmodulelist) { modulelist.refreshmodulelistforroot(modulelist.findnetbeansorg(getprojectdirectoryfile())); } } }