Examples of EditableProperties


Examples of org.netbeans.spi.project.support.ant.EditableProperties

                    public void run() throws IOException {
                        ProjectManager.mutex().writeAccess(new Mutex.Action<Void>() {

                            @Override
                            public Void run() {
                                EditableProperties ep = updateHelper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH);
                                File buildProperties = new File(System.getProperty("netbeans.user"), "build.properties"); // NOI18N
                                ep.setProperty("user.properties.file", buildProperties.getAbsolutePath()); //NOI18N

                                // set jaxws.endorsed.dir property (for endorsed mechanism to be used with wsimport, wsgen)
                                setJaxWsEndorsedDirProperty(ep);

                                // move web-service-clients one level up from in project.xml
                                // WS should be part of auxiliary configuration
                                Element data = helper.getPrimaryConfigurationData(true);
                                NodeList nodes = data.getElementsByTagName(JAX_RPC_CLIENTS);
                                if (nodes.getLength() > 0) {
                                    Element oldJaxRpcClients = (Element) nodes.item(0);
                                    Document doc = createNewDocument();
                                    Element newJaxRpcClients = doc.createElementNS(JAX_RPC_NAMESPACE, JAX_RPC_CLIENTS);
                                    NodeList childNodes = oldJaxRpcClients.getElementsByTagName(JAX_RPC_CLIENT);
                                    for (int i = 0; i < childNodes.getLength(); i++) {
                                        Element oldJaxRpcClient = (Element) childNodes.item(i);
                                        Element newJaxRpcClient = doc.createElementNS(JAX_RPC_NAMESPACE, JAX_RPC_CLIENT);
                                        NodeList nodeProps = oldJaxRpcClient.getChildNodes();
                                        for (int j = 0; j < nodeProps.getLength(); j++) {
                                            Node n = nodeProps.item(j);
                                            if (n instanceof Element) {
                                                Element oldProp = (Element) n;
                                                Element newProp = doc.createElementNS(JAX_RPC_NAMESPACE, oldProp.getLocalName());
                                                String text = oldProp.getTextContent();
                                                newProp.setTextContent(text);
                                                newJaxRpcClient.appendChild(newProp);
                                            }
                                        }
                                        newJaxRpcClients.appendChild(newJaxRpcClient);
                                    }
                                    aux.putConfigurationFragment(newJaxRpcClients, true);
                                    data.removeChild(oldJaxRpcClients);
                                    helper.putPrimaryConfigurationData(data, true);
                                }

                                updateHelper.putProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH, ep);
                                ep = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
                                if (!ep.containsKey(ProjectProperties.INCLUDES)) {
                                    ep.setProperty(ProjectProperties.INCLUDES, "**"); // NOI18N
                                }
                                if (!ep.containsKey(ProjectProperties.EXCLUDES)) {
                                    ep.setProperty(ProjectProperties.EXCLUDES, ""); // NOI18N
                                }
                                helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, ep);
                                try {
                                    ProjectManager.getDefault().saveProject(J2SEProject.this);
                                } catch (IOException e) {
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

        };

        @Override
        public String[] getRecommendedTypes() {

            EditableProperties ep = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
            // if the project has no main class, it's not really an application
            boolean isLibrary = ep.getProperty(J2SEProjectProperties.MAIN_CLASS) == null || "".equals(ep.getProperty(J2SEProjectProperties.MAIN_CLASS)); // NOI18N
            return isLibrary ? LIBRARY_TYPES : APPLICATION_TYPES;
        }
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

            }
        return cachedElement;
    }

    public synchronized EditableProperties getUpdatedProjectProperties () {
        EditableProperties cachedProperties = this.helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
        //The javadoc.additionalparam was not in NB 4.0
        if (cachedProperties.get (J2SEProjectProperties.JAVADOC_ADDITIONALPARAM)==null) {
            cachedProperties.put (J2SEProjectProperties.JAVADOC_ADDITIONALPARAM,"");    //NOI18N
        }
        if (cachedProperties.get ("build.generated.dir")==null) { //NOI18N
            cachedProperties.put ("build.generated.dir","${build.dir}/generated"); //NOI18N
        }
         if (cachedProperties.get ("meta.inf.dir")==null) { //NOI18N
            cachedProperties.put ("meta.inf.dir","${src.dir}/META-INF"); //NOI18N
        }
        return cachedProperties;
    }
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

        ProjectManager.mutex().postWriteRequest(
            new Runnable () {
                public void run () {
                    try {
                        recoverDefaultPlatform ();
                        EditableProperties ep = PropertyUtils.getGlobalProperties();
                        boolean save = updateSourceLevel(ep);
                        save |= updateBuildProperties (ep);
                        if (save) {
                            PropertyUtils.putGlobalProperties (ep);
                        }
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

   
    private void fixPrivateProperties (final J2SEProjectOperations original) {
        if (original != null && (original.appArgs != null || original.workDir != null)) {
            ProjectManager.mutex().writeAccess(new Runnable () {
                public void run () {
                    final EditableProperties ep = project.getUpdateHelper().getProperties (AntProjectHelper.PRIVATE_PROPERTIES_PATH);
                    if (original.appArgs != null) {
                        ep.put(J2SEProjectProperties.APPLICATION_ARGS, original.appArgs);
                    }
                    if (original.workDir != null) {
                        ep.put (J2SEProjectProperties.RUN_WORK_DIR, original.workDir);
                    }
                    project.getUpdateHelper().putProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH, ep);
                }
            });
        }
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

    private void fixDistJarProperty (final String newName) {
        ProjectManager.mutex().writeAccess(new Runnable () {
            public void run () {
                ProjectInformation pi = project.getLookup().lookup(ProjectInformation.class);
                String oldDistJar = pi == null ? null : "${dist.dir}/"+PropertyUtils.getUsablePropertyName(pi.getDisplayName())+".jar"; //NOI18N
                EditableProperties ep = project.getUpdateHelper().getProperties (AntProjectHelper.PROJECT_PROPERTIES_PATH);
                String propValue = ep.getProperty("dist.jar")//NOI18N
                if (oldDistJar != null && oldDistJar.equals (propValue)) {
                    ep.put ("dist.jar","${dist.dir}/"+PropertyUtils.getUsablePropertyName(newName)+".jar"); //NOI18N
                    project.getUpdateHelper().putProperties (AntProjectHelper.PROJECT_PROPERTIES_PATH,ep);
                }
            }
        });
    }
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

                    Project project = getProject(phpModule);
                    AntProjectHelper helper = getAntProjectHelper(project);
                    if (helper == null) {
                        return null;
                    }
                    EditableProperties properties = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
                    List<String> currentIncludePaths = Arrays.asList(getIncludePaths(project));
                    List<String> includePaths = new LinkedList<String>();
                    boolean isAdded = false;
                    for (String path : paths) {
                        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
                        FileObject sourceDirectory = yiiModule.getWebroot();
                        FileObject target = null;
                        if (sourceDirectory != null) {
                            target = sourceDirectory.getFileObject(path);
                        }
                        for (String currentPath : currentIncludePaths) {
                            currentPath = currentPath + ":"; //NOI18N
                            includePaths.add(currentPath);
                        }
                        if (target != null) {
                            File file = FileUtil.toFile(target);
                            String absolutePath = file.getAbsolutePath();
                            if (!currentIncludePaths.contains(absolutePath)) {
                                if (paths.size() > 1) {
                                    absolutePath = absolutePath + ":"; // NOI18N
                                }
                                includePaths.add(absolutePath); //NOI18N
                                isAdded = true;
                            }
                        }
                    }
                    if (isAdded) {
                        properties.setProperty(INCLUDE_PATH, includePaths.toArray(new String[0]));
                        helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, properties);
                    }
                    ProjectManager.getDefault().saveProject(project);
                    return null;
                }
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

     */
    public static String getIncludePath(Project project) {
        String includePath = ""; // NOI18N
        if (project != null) {
            AntProjectHelper helper = getAntProjectHelper(project);
            EditableProperties properties = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
            includePath = properties.getProperty(INCLUDE_PATH);
        }
        return includePath;
    }
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

                    Project project = getProject(phpModule);
                    AntProjectHelper helper = getAntProjectHelper(project);
                    if (helper == null) {
                        return null;
                    }
                    EditableProperties properties = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
                    if (properties != null) {
                        properties.setProperty(TESTING_PROVIDERS, "PhpUnit");
                        helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, properties);
                    }

                    ProjectManager.getDefault().saveProject(project);
                    return null;
View Full Code Here

Examples of org.netbeans.spi.project.support.ant.EditableProperties

                    Project project = getProject(phpModule);
                    AntProjectHelper helper = getAntProjectHelper(project);
                    if (helper == null) {
                        return null;
                    }
                    EditableProperties properties = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
                    if (properties != null) {
                        properties.setProperty(TESTING_PROVIDERS, "PhpUnit"); // NOI18N
                        helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, properties);
                    }

                    ProjectManager.getDefault().saveProject(project);
                    return null;
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.