Java 类org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent 实例源码

项目:workspacemechanic    文件:PreferenceRecorder.java   
public void added(NodeChangeEvent event) {
  synchronized (lock) {
    // It's possible that we've stopped recording, but the listeners have
    // not yet been removed.
    // Ensure that we're still recording before writing new data
    if (currState != State.RECORDING) {
      return;
    }

    IEclipsePreferences childPrefs = (IEclipsePreferences) event.getChild();
    addListener(childPrefs);

    changeLog.add(new NodeChanged(true, new Path(event.getParent().absolutePath()), 
        event.getChild().name()));
  }
}
项目:filesync4eclipse    文件:ProjectProperties.java   
@Override
public void removed(NodeChangeEvent event) {
    try {
        // in case preferences are entirely deleted
        if(event.getParent() == preferences && !preferences.nodeExists("")) {
            // code below throws exception
            // preferences.removeNodeChangeListener(this);
            // preferences.removePreferenceChangeListener(this);
            return;
        }
    } catch (BackingStoreException e) {
        // ignore
        return;
    }
    if (!isIgnorePreferenceListeners()) {
        buildPathMap(preferences);
    } else {
        rebuildPathMap = true;
    }
}
项目:com.onpositive.prefeditor    文件:PlatformPreferenceProvider.java   
@Override
public void removed(NodeChangeEvent event) {
    if (event.getChild() instanceof IEclipsePreferences) { 
        ((IEclipsePreferences) event.getChild()).removePreferenceChangeListener(changeListener);
    }
    if (tracking) {
        preferenceEntries.remove(event.getChild().absolutePath());
        firePreferencesUpdated("");
    }
}
项目:com.onpositive.prefeditor    文件:PlatformPreferenceProvider.java   
@Override
public void added(NodeChangeEvent event) {
    if (tracking && event.getChild() instanceof IEclipsePreferences) {
        ((IEclipsePreferences) event.getChild()).addPreferenceChangeListener(changeListener);
        loadPrefsFromNode(event.getChild());
        firePreferencesUpdated("");
    }
}
项目:workspacemechanic    文件:PreferenceRecorder.java   
public void removed(NodeChangeEvent event) {
  synchronized (lock) {
    if (currState != State.RECORDING) {
      return;
    }

    recordedNodes.remove(event.getChild());
    changeLog.add(new NodeChanged(false, new Path(event.getParent().absolutePath()), 
        event.getChild().name()));
  }
}
项目:bts    文件:FixedScopedPreferenceStore.java   
/**
 * Initialize the node change listener.
 */
private void initializeNodeChangeListener() {
    if (nodeChangeListener == null) {
        nodeChangeListener = new IEclipsePreferences.INodeChangeListener() {
            /*
             * (non-Javadoc)
             * 
             * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener#added(org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent)
             */
            public void added(NodeChangeEvent event) {
                if (nodeQualifier.equals(event.getChild().name())
                        && isListenerAttached()) {
                    getStorePreferences().addPreferenceChangeListener(
                            preferencesListener);
                }
            }

            /*
             * (non-Javadoc)
             * 
             * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener#removed(org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent)
             */
            public void removed(NodeChangeEvent event) {
                // Do nothing as there are no events from removed node
            }
        };
        ((IEclipsePreferences) getStorePreferences().parent())
            .addNodeChangeListener(nodeChangeListener);
    }
}
项目:filesync4eclipse    文件:ProjectProperties.java   
@Override
public void added(NodeChangeEvent event) {
    if (!isIgnorePreferenceListeners()) {
        buildPathMap(preferences);
    } else {
        rebuildPathMap = true;
    }
}