當前位置: 首頁>>代碼示例>>Java>>正文


Java PreferenceChangeEvent類代碼示例

本文整理匯總了Java中java.util.prefs.PreferenceChangeEvent的典型用法代碼示例。如果您正苦於以下問題:Java PreferenceChangeEvent類的具體用法?Java PreferenceChangeEvent怎麽用?Java PreferenceChangeEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PreferenceChangeEvent類屬於java.util.prefs包,在下文中一共展示了PreferenceChangeEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: M2RepositoryBrowser

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
private M2RepositoryBrowser() {
    super(Children.create(new RootNodes(), true));
    setName(NAME);
    setDisplayName(CTL_M2RepositoryBrowserTopComponent2(RepositoryPreferences.isIndexRepositories() ? "" : CTL_M2RepositoriesDisabled()));
    setShortDescription(HINT_M2RepositoryBrowserTopComponent());
    setIconBaseWithExtension(ICON_PATH);
    NbPreferences.root().node("org/netbeans/modules/maven/nexus/indexing").addPreferenceChangeListener(new PreferenceChangeListener() {

        @Override
        public void preferenceChange(PreferenceChangeEvent evt) {
            if (RepositoryPreferences.PROP_INDEX.equals(evt.getKey())) {
                setDisplayName(CTL_M2RepositoryBrowserTopComponent2(RepositoryPreferences.isIndexRepositories() ? "" : CTL_M2RepositoriesDisabled()));
            }
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:M2RepositoryBrowser.java

示例2: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
    String k = evt.getKey();
    if (FoldUtilitiesImpl.PREF_CONTENT_PREVIEW.equals(k) ||
        FoldUtilitiesImpl.PREF_CONTENT_SUMMARY.equals(k)) {
        initViewFlags();
        final Document d = document();
        if (d != null) {
            d.render(new Runnable() {
                @Override
                public void run() {
                    int end = d.getLength();
                    fireEvent(EditorViewFactoryChange.createList(0, end, EditorViewFactoryChange.Type.CHARACTER_CHANGE));
                }
            });
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:FoldViewFactory.java

示例3: updateCheckers

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
private String updateCheckers(PreferenceChangeEvent evt) {
    String pk = evt.getKey();
    if (pk != null) {
        if (pk.equals(SimpleValueNames.CODE_FOLDING_ENABLE)) {
            updateEnabledState();
            return pk;
        }
        if (pk.equals(PREF_OVERRIDE_DEFAULTS)) {
            updateOverrideChanged();
        } else if (!pk.startsWith(COLLAPSE_PREFIX)) {
            return pk;
        }
    } else {
        updateEnabledState();
    }
    String c = pk == null ? null : pk.substring(COLLAPSE_PREFIX.length());
    for (JCheckBox cb : controls) {
        FoldType ft = (FoldType)cb.getClientProperty("type"); // NOI18N
        FoldType ftp = ft.parent();
        if (c == null || ft.code().equals(c) || (ftp != null && ftp.code().equals(c))) {
            updateChecker(pk, cb, ft);
            return pk;
        }
    }
    return pk;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:DefaultFoldingOptions.java

示例4: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
public @Override void preferenceChange(PreferenceChangeEvent evt) {
    EditorUI eui = editorUI;
    JTextComponent c = eui == null ? null : eui.getComponent();
    Rectangle rect = c == null ? null : c.getVisibleRect();
    if (rect != null && rect.width == 0) {
        if (SwingUtilities.isEventDispatchThread()) {
            resize();
        } else {
            SwingUtilities.invokeLater(
                new Runnable() {
                    public @Override void run() {
                        resize();
                    }
                }
            );
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:GlyphGutter.java

示例5: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent event) {
	Preferences prefs = event.getNode();
	String prop = event.getKey();
	String name = getIdentifier();
	if (prop.equals(name)) {
		String oldValue = value;
		String newValue = prefs.get(name, dflt);
		if (!isSame(oldValue, newValue)) {
			String[] o = opts;
			String chosen = null;
			for (int i = 0; i < o.length; i++) {
				if (isSame(o[i], newValue)) {
					chosen = o[i];
					break;
				}
			}
			if (chosen == null)
				chosen = dflt;
			value = chosen;
			AppPreferences.firePropertyChange(name, oldValue, chosen);
		}
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:25,代碼來源:PrefMonitorStringOpts.java

示例6: initialize

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
protected void initialize ()
{
    loadAll ();

    getNode ().addPreferenceChangeListener ( this.listener = new PreferenceChangeListener () {

        @Override
        public void preferenceChange ( final PreferenceChangeEvent evt )
        {
            if ( PREF_NAME.equals ( evt.getKey () ) )
            {
                refresh ();
            }
        }
    } );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:17,代碼來源:AbstractPreferencesDiscoverer.java

示例7: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
    if (evt.getKey().startsWith(SvnModuleConfig.PROP_COMMIT_EXCLUSIONS)) {
        Runnable inAWT = new Runnable() {
            @Override
            public void run() {
                commitTable.dataChanged();
                listenerSupport.fireVersioningEvent(EVENT_SETTINGS_CHANGED);
            }
        };
        // this can be called from a background thread - e.g. change of exclusion status in Versioning view
        if (EventQueue.isDispatchThread()) {
            inAWT.run();
        } else {
            EventQueue.invokeLater(inAWT);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:CommitPanel.java

示例8: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
       public void preferenceChange(PreferenceChangeEvent e) {
                if(!e.getKey().startsWith(CHANNEL_PREFS_HEADER)) {
	return;
}

               // parse our the channel from the prefs key and then set properties of that channel
                String[] s=e.getKey().split("\\.");
                int chanNum=Integer.parseInt(s[4]);
                EqualizerChannel c=channels[chanNum];

               if (s[5].equals("qsos")) {
                   c.setQSOS(Integer.parseInt(e.getNewValue()));
               } else if (e.getKey().equals("qbpf")) {
                   c.setQBPF(Integer.parseInt(e.getNewValue()));
               } else if (e.getKey().equals("bpfkilled")) {
                   c.setBpfKilled(Boolean.parseBoolean(e.getNewValue()));
               } else if (e.getKey().equals("lpfkilled")) {
                   c.setLpfKilled(Boolean.parseBoolean(e.getNewValue()));
               }
       }
 
開發者ID:SensorsINI,項目名稱:jaer,代碼行數:22,代碼來源:CochleaAMS1c.java

示例9: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
    if (corePref.equals(evt.getNode()) && USAGE_STATISTICS_ENABLED.equals(evt.getKey())) {
        boolean newVal = Boolean.parseBoolean(evt.getNewValue());
        if (newVal != logMetricsEnabled) {
            corePref.putBoolean(USAGE_STATISTICS_SET_BY_IDE, true);
            logMetricsEnabled = newVal;
            Logger log = Logger.getLogger(METRICS_LOGGER_NAME);
            if (logMetricsEnabled) {
                log.setUseParentHandlers(true);
                log.setLevel(Level.FINEST);
                log.addHandler(metrics);
                MetricsHandler.setFlushOnRecord(false);
            } else {
                MetricsHandler.flushImmediatelly();
                closeLogStreamMetrics();
                log.removeHandler(metrics);
            }
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:Installer.java

示例10: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
    String settingName = evt == null ? null : evt.getKey();
    if (settingName == null || COMPLETION_CASE_SENSITIVE.equals(settingName)) {
        caseSensitive = preferences.getBoolean(COMPLETION_CASE_SENSITIVE, COMPLETION_CASE_SENSITIVE_DEFAULT);
    }
    if (settingName == null || SHOW_DEPRECATED_MEMBERS.equals(settingName)) {
        showDeprecatedMembers = preferences.getBoolean(SHOW_DEPRECATED_MEMBERS, SHOW_DEPRECATED_MEMBERS_DEFAULT);
    }
    if (settingName == null || JAVA_COMPLETION_BLACKLIST.equals(settingName)) {
        String blacklist = preferences.get(JAVA_COMPLETION_BLACKLIST, EMPTY);
        updateExcluder(excludeRef, blacklist);
    }
    if (settingName == null || JAVA_COMPLETION_WHITELIST.equals(settingName)) {
        String whitelist = preferences.get(JAVA_COMPLETION_WHITELIST, EMPTY);
        updateExcluder(includeRef, whitelist);
    }
    if (settingName == null || JAVA_COMPLETION_EXCLUDER_METHODS.equals(settingName)) {
        javaCompletionExcluderMethods = preferences.getBoolean(JAVA_COMPLETION_EXCLUDER_METHODS, JAVA_COMPLETION_EXCLUDER_METHODS_DEFAULT);
    }
    if (settingName == null || JAVA_COMPLETION_SUBWORDS.equals(settingName)) {
        javaCompletionSubwords = preferences.getBoolean(JAVA_COMPLETION_SUBWORDS, JAVA_COMPLETION_SUBWORDS_DEFAULT);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:Utilities.java

示例11: firePrefEvents

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
private void firePrefEvents(List<EventBag<PreferenceChangeListener, PreferenceChangeEvent>> events) {
    if (noEvents) {
        return;
    }
    
    for(EventBag<PreferenceChangeListener, PreferenceChangeEvent> bag : events) {
        for(PreferenceChangeEvent event : bag.getEvents()) {
            for(PreferenceChangeListener l : bag.getListeners()) {
                try {
                    l.preferenceChange(event);
                } catch (Throwable t) {
                    LOG.log(Level.WARNING, null, t);
                }
            }
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:ProxyPreferencesImpl.java

示例12: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
    if (evt.getKey().startsWith(HgModuleConfig.PROP_COMMIT_EXCLUSIONS)) {
        Runnable inAWT = new Runnable() {
            @Override
            public void run() {
                commitTable.dataChanged();
                listenerSupport.fireVersioningEvent(EVENT_SETTINGS_CHANGED);
            }
        };
        // this can be called from a background thread - e.g. change of exclusion status in Versioning view
        if (EventQueue.isDispatchThread()) {
            inAWT.run();
        } else {
            EventQueue.invokeLater(inAWT);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:CommitPanel.java

示例13: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent event) {
	Preferences prefs = event.getNode();
	String prop = event.getKey();
	String name = getIdentifier();
	if (prop.equals(name)) {
		boolean oldValue = value;
		boolean newValue = prefs.getBoolean(name, dflt);
		if (newValue != oldValue) {
			value = newValue;
			AppPreferences.firePropertyChange(name, oldValue, newValue);
		}
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:15,代碼來源:PrefMonitorBoolean.java

示例14: InstanceNodeChildren

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
InstanceNodeChildren(HudsonInstance instance) {
    this.instance = instance;
    instance.addHudsonChangeListener(this);
    instance.prefs().addPreferenceChangeListener(new PreferenceChangeListener() {
        @Override public void preferenceChange(PreferenceChangeEvent evt) {
            refreshKeys();
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:HudsonInstanceNode.java

示例15: preferenceChange

import java.util.prefs.PreferenceChangeEvent; //導入依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
    if (evt.getKey() != null && !isOverriden(evt.getKey())) {
        // jusr refires an event
        ignorePut.set(true);
        try {
            put(evt.getKey(), evt.getNewValue());
        } finally {
            ignorePut.set(false);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:InheritedPreferences.java


注:本文中的java.util.prefs.PreferenceChangeEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。