Package java.util.prefs

Examples of java.util.prefs.Preferences.addPreferenceChangeListener()


        }
    }

    private void installPreferenceListener() {
        Preferences preferences = Preferences.userNodeForPackage(RSTAEditor.class);
        preferences.addPreferenceChangeListener(this);
    }

    private void setupGutterListener(Gutter gutter) {
        Component[] components = gutter.getComponents();
        for (Component component : components) {
View Full Code Here


        try {
            p.removeNode();
        } catch (BackingStoreException e2) {
        }
        p.addNodeChangeListener(null);
        p.addPreferenceChangeListener(null);
        p.removeNodeChangeListener(null);
        p.removePreferenceChangeListener(null);
        try {
            p.sync();
        } catch (BackingStoreException e3) {
View Full Code Here

  @Test
  public void testAddPreferenceChangeListenerPreferenceChangeListener() {
    final SynchronousQueue<Boolean> done = new SynchronousQueue<Boolean>();
    final String key = "testAddPreferenceChangeListenerPreferenceChangeListener";
    Preferences prefs = getCPRoot().node("testAddPreferenceChangeListener");
    prefs.addPreferenceChangeListener(new PreferenceChangeListener() {

      public void preferenceChange(PreferenceChangeEvent evt) {
        assertEquals(key, evt.getKey());
        assertEquals("Bar", evt.getNewValue());
        try {
View Full Code Here

        } catch (InterruptedException e) {
          e.printStackTrace();
          fail();
        }
      }};
    prefs.addPreferenceChangeListener(pcl);
    prefs.put(key, "Bar");
    try {
      assertTrue(done.poll(1, TimeUnit.SECONDS));
    } catch (InterruptedException e) {
      e.printStackTrace();
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.