Package org.netbeans.gradle.project.properties

Examples of org.netbeans.gradle.project.properties.PropertiesSnapshot


        checkCallingThread();

        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                final PropertiesSnapshot snapshot = new PropertiesSnapshot(properties);
                NbGradleProject.PROJECT_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
                    @Override
                    public void execute(CancellationToken cancelToken) {
                        XmlPropertyFormat.saveToXml(project, propertiesFile, snapshot);
                    }
View Full Code Here


                : RecursiveExecutor.INSTANCE;

        NbGradleProject.PROJECT_PROCESSOR.execute(Cancellation.UNCANCELABLE_TOKEN, new CancelableTask() {
            @Override
            public void execute(CancellationToken cancelToken) {
                final PropertiesSnapshot snapshot = XmlPropertyFormat.readFromXml(propertiesFile);

                setterExecutor.execute(new Runnable() {
                    @Override
                    public void run() {
                        for (PropertySetter<?> setter: setters) {
                            setter.set(snapshot);
                        }

                        // TODO: This might overwrite concurrently set
                        //  properties which is unexpected by the user. This
                        //  is unlikely to happen but should be fixed anyway.

                        Set<Map.Entry<String, PropertySource<PredefinedTask>>> builtInTasks
                                = snapshot.getBuiltInTasks().entrySet();
                        for (Map.Entry<String, PropertySource<PredefinedTask>> taskEntry: builtInTasks) {
                            MutableProperty<PredefinedTask> property
                                    = properties.tryGetBuiltInTask(taskEntry.getKey());
                            if (property == null) {
                                LOGGER.log(Level.SEVERE, "Cannot set property for built-in task: {0}", taskEntry.getKey());
                            }
                            else {
                                property.setValueFromSource(taskEntry.getValue());
                            }
                        }

                        List<AuxConfig> newAuxConfigs = new LinkedList<>();
                        for (AuxConfigSource config: snapshot.getAuxProperties()) {
                            newAuxConfigs.add(new AuxConfig(config.getKey(), config.getSource().getValue()));
                        }
                        properties.setAllAuxConfigs(newAuxConfigs);

                        if (onDone != null) {
View Full Code Here

TOP

Related Classes of org.netbeans.gradle.project.properties.PropertiesSnapshot

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.