Package org.openide.util

Examples of org.openide.util.ChangeSupport


    public JavadocForBinaryQuery.Result findJavadoc(final URL b) {
        class R implements JavadocForBinaryQuery.Result, PropertyChangeListener {

            private Library lib;
            private final ChangeSupport cs = new ChangeSupport(this);
            private URL[] cachedRoots;
           

            public R (Library lib) {
                this.lib = lib;
                this.lib.addPropertyChangeListener (WeakListeners.propertyChange(this,this.lib));
            }

            public synchronized URL[] getRoots() {
                if (this.cachedRoots == null) {
                    List<URL> result = new ArrayList<URL>();
                    for (URL u : lib.getContent(J2SELibraryTypeProvider.VOLUME_TYPE_JAVADOC)) {
                        result.add (getIndexFolder(u));
                    }
                    this.cachedRoots = result.toArray(new URL[result.size()]);
                }
                return this.cachedRoots;
            }
           
            public synchronized void addChangeListener(ChangeListener l) {
                assert l != null : "Listener can not be null";
                cs.addChangeListener(l);
            }
           
            public synchronized void removeChangeListener(ChangeListener l) {
                assert l != null : "Listener can not be null";
                cs.removeChangeListener(l);
            }
           
            public void propertyChange (PropertyChangeEvent event) {
                if (Library.PROP_CONTENT.equals(event.getPropertyName())) {
                    synchronized (this) {
                        this.cachedRoots = null;
                    }
                    cs.fireChange();
                }
            }
           
        }
View Full Code Here


   
    public JavadocForBinaryQuery.Result findJavadoc(final URL b) {
        class R implements JavadocForBinaryQuery.Result, PropertyChangeListener {

            private ScalaPlatform platform;
            private final ChangeSupport cs = new ChangeSupport(this);
            private URL[] cachedRoots;

            public R (ScalaPlatform plat) {
                this.platform = plat;
                this.platform.addPropertyChangeListener (WeakListeners.propertyChange(this,this.platform));
            }

            public synchronized URL[] getRoots() {
                if (this.cachedRoots == null) {
                    List<URL> l = new ArrayList<URL>();
                    for (URL u : platform.getJavadocFolders()) {
                        l.add(getIndexFolder(u));
                    }
                    this.cachedRoots = l.toArray(new URL[l.size()]);
                }
                return this.cachedRoots;
            }

            public synchronized void addChangeListener(ChangeListener l) {
                assert l != null : "Listener can not be null";      //NOI18N
                cs.addChangeListener(l);
            }
            public synchronized void removeChangeListener(ChangeListener l) {
                assert l != null : "Listener can not be null"//NOI18N
                cs.removeChangeListener(l);
            }
           
            public void propertyChange (PropertyChangeEvent event) {
                if (ScalaPlatform.PROP_JAVADOC_FOLDER.equals(event.getPropertyName())) {
                    synchronized (this) {
                        this.cachedRoots = null;
                    }
                    cs.fireChange();
                }
            }
           
        }
        ScalaPlatformManager jpm = ScalaPlatformManager.getDefault();
View Full Code Here

            ExceptionHelper.checkNotNullArgument(converter, "converter");

            this.settingsName = settingsName;
            this.converter = converter;
            this.changesLock = new ReentrantLock();
            this.changes = new ChangeSupport(this);
            this.changeForwarder = new PreferenceChangeListener() {
                @Override
                public void preferenceChange(PreferenceChangeEvent evt) {
                    if (GlobalProperty.this.settingsName.equals(evt.getKey())) {
                        changes.fireChange();
View Full Code Here

        private final ChangeSupport changes;
        private final PropertyChangeListener changeForwarder;

        public JavaPlatformSource() {
            this.changesLock = new ReentrantLock();
            this.changes = new ChangeSupport(this);
            this.changeForwarder = new PropertyChangeListener() {
                @Override
                public void propertyChange(PropertyChangeEvent evt) {
                    if (JavaPlatformManager.PROP_INSTALLED_PLATFORMS.equals(evt.getPropertyName())) {
                        changes.fireChange();
View Full Code Here

        ExceptionHelper.checkNotNullArgument(initialValue, "initialValue");

        this.allowNulls = allowNulls;
        this.valueSource = initialValue;
        this.changesLock = new ReentrantLock();
        this.changes = new ChangeSupport(this);
        this.changeForwarder = new ChangeListener() {
            private ValueType prevValue = initialValue.getValue();

            @Override
            public void stateChanged(ChangeEvent e) {
View Full Code Here

    public ProjectPropertiesProxy(NbGradleProject project) {
        ExceptionHelper.checkNotNullArgument(project, "project");

        this.project = project;
        this.propertiesRef = new AtomicReference<>(null);
        this.changes = new ChangeSupport(this);
        this.loadedSignal = new WaitableSignal();

        this.auxProperties = new ConcurrentHashMap<>();
        this.auxConfigListener = new MutablePropertyProxy<>(new ProjectMutablePropertyRef<Void>(this) {
            @Override
View Full Code Here

    private ListenerRef subListenerRef;
    private final AtomicReference<GradleProjectPlatformQuery> queryRef;

    public AbstractProjectPlatformSource() {
        this.changesLock = new ReentrantLock();
        this.changes = new ChangeSupport(this);
        this.subListenerRef = null;
        this.queryRef = new AtomicReference<>(null);
    }
View Full Code Here

    public GradleProjectLogicalViewProvider(NbGradleProject project) {
        ExceptionHelper.checkNotNullArgument(project, "project");
        this.project = project;
        this.childRefreshListeners = new CopyOnTriggerListenerManager<>();
        this.listenersToFinalize = new AtomicReference<>(null);
        this.refreshRequestListeners = new ChangeSupport(this);
    }
View Full Code Here

        this.extensionLookupRef = new AtomicReference<>(null);
        this.combinedLookupRef = new AtomicReference<>(null);
        this.hasEverBeenLoaded = false;
        this.sourceDirsHandlerRef = new AtomicReference<>(null);
        this.dependencyResolutionFailureRef = getProjectInfoManager(project).createInfoRef();
        this.modelChanges = new ChangeSupport(this);
    }
View Full Code Here

        this.projectInfoManager = new ProjectInfoManager();
        this.combinedExtensionLookup = new DynamicLookup();

        this.hasModelBeenLoaded = new AtomicBoolean(false);
        this.loadErrorRef = new AtomicReference<>(null);
        this.modelChanges = new ChangeSupport(this);
        this.currentModelRef = new AtomicReference<>(
                GradleModelLoader.createEmptyModel(projectDirAsFile));

        this.loadedAtLeastOnceSignal = new WaitableSignal();
        this.name = projectDir.getNameExt();
View Full Code Here

TOP

Related Classes of org.openide.util.ChangeSupport

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.