本文整理汇总了Java中org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent类的典型用法代码示例。如果您正苦于以下问题:Java PreferenceChangeEvent类的具体用法?Java PreferenceChangeEvent怎么用?Java PreferenceChangeEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PreferenceChangeEvent类属于org.eclipse.core.runtime.preferences.IEclipsePreferences包,在下文中一共展示了PreferenceChangeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChangeListener
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
/**
* return the listener for preferences changes.
* @return the change listener
*/
private IEclipsePreferences.IPreferenceChangeListener getChangeListener() {
if (changeListener==null) {
changeListener = new IEclipsePreferences.IPreferenceChangeListener() {
@Override
public void preferenceChange(PreferenceChangeEvent pce) {
if (debug==true) System.out.println("Property '" + pce.getKey() + "' changed from " + pce.getOldValue() + " to "+ pce.getNewValue());
switch(pce.getKey()) {
case DEF_RUNAS:
boolean changedExecutionMode = (pce.getOldValue()!=null && pce.getNewValue()!=pce.getOldValue());
if (changedExecutionMode==true) {
if (debug==true) System.out.println("Changed Execution Mode: changed from " + pce.getOldValue() + " to "+ pce.getNewValue());
//TODO if the preference dialog was set to SWT!
}
}
}
};
}
return changeListener;
}
示例2: preferenceChange
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
@Override
public void preferenceChange(PreferenceChangeEvent event) {
if (tracking) {
String id = event.getSource().toString();
List<KeyValue> preferenceList = preferenceEntries.get(id);
if (null == preferenceList) {
preferenceList = new ArrayList<>();
preferenceEntries.put(id, preferenceList);
}
Optional<KeyValue> first = preferenceList.stream().filter(val -> val.getKey().equals(event.getKey())).findFirst();
if (first.isPresent()) {
first.get().setValue(PrefUIUtil.emptyIfNull(event.getNewValue()));
} else {
KeyValue toAdd = new KeyValue(id, event.getKey(), PrefUIUtil.emptyIfNull(event.getNewValue()));
preferenceList.add(toAdd);
}
firePreferencesUpdated(id);
}
}
示例3: isFormatPreferencesChanged
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
private boolean isFormatPreferencesChanged(PreferenceChangeEvent event) {
return TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_CONVERT_TABS_TO_SPACES.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_INDENT_SIZE.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_TAB_SIZE.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_COMMA_DELIMITER
.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR_STATEMENTS
.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_BEFORE_AND_AFTER_BINARY_OPERATORS
.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_KEYWORDS_IN_CONTROL_FLOW_STATEMENTS
.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_FUNCTION_KEYWORD_FOR_ANONYMOUS_FUNCTIONS
.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_OPENING_AND_BEFORE_CLOSING_NONEMPTY_PARENTHESIS
.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_OPENING_AND_BEFORE_CLOSING_NONEMPTY_BRACKETS
.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_PLACE_OPEN_BRACE_ON_NEW_LINE_FOR_FUNCTIONS
.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_PLACE_OPEN_BRACE_ON_NEW_LINE_FOR_CONTROL_BLOCKS
.equals(event.getKey());
}
示例4: start
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
final IEclipsePreferences node = getPreferencesRootNode();
repoSvc = new WorkflowRepositoryServiceImpl(node.get(REPOSITORY_LOCATION_PREFNAME, REPOSITORY_LOCATION_DEFVALUE));
preferenceChangeListener = new IPreferenceChangeListener() {
@Override
public void preferenceChange(PreferenceChangeEvent event) {
if(REPOSITORY_LOCATION_PREFNAME.equals(event.getKey()) && (repoSvc != null)) {
// it seems that when you Restore Defaults for preferences, this gives a new value null i.o. the default value!
String newValue = (event.getNewValue()!=null)? (String) event.getNewValue() : REPOSITORY_LOCATION_DEFVALUE;
repoSvc.setRootFolder(new File(newValue));
}
}
};
node.addPreferenceChangeListener(preferenceChangeListener);
Hashtable<String, String> svcProps = new Hashtable<>();
svcProps.put("type", "FILE");
repoSvcReg = context.registerService(WorkflowRepositoryService.class, repoSvc, svcProps);
}
示例5: createPreferenceListener
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
/**
* Creates a listener that appropriately adds, updates, or removes
* connections based on the values in the {@link #preferenceStore}.
*
* @return A new property change listener that can be registered with the
* preference store.
*/
private IPreferenceChangeListener createPreferenceListener() {
return new IPreferenceChangeListener() {
@Override
public void preferenceChange(PreferenceChangeEvent event) {
String name = event.getKey();
Object oldValue = event.getOldValue();
Object newValue = event.getNewValue();
// Add, update, or remove depending on whether the old/new
// values are null.
if (oldValue != null) {
if (newValue != null) {
updateConnection(name, newValue.toString());
} else {
removeConnection(name);
}
} else if (newValue != null) {
addConnection(name, newValue.toString());
}
return;
}
};
}
示例6: listenForThemeChanges
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
/**
* listenForThemeChanges
*/
private void listenForThemeChanges()
{
this.fThemeChangeListener = new IPreferenceChangeListener()
{
public void preferenceChange(PreferenceChangeEvent event)
{
if (event.getKey().equals(IThemeManager.THEME_CHANGED))
{
applyTheme();
}
}
};
EclipseUtil.instanceScope().getNode(ThemePlugin.PLUGIN_ID).addPreferenceChangeListener(this.fThemeChangeListener);
}
示例7: preferenceChange
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
/**
* Respond to preference change events
*/
public void preferenceChange(PreferenceChangeEvent event)
{
String key = event.getKey();
if (IPreferenceConstants.COMPLETION_PROPOSAL_ACTIVATION_CHARACTERS.equals(key))
{
_completionProposalChars = retrieveCAPreference(IPreferenceConstants.COMPLETION_PROPOSAL_ACTIVATION_CHARACTERS);
}
else if (IPreferenceConstants.CONTEXT_INFORMATION_ACTIVATION_CHARACTERS.equals(key))
{
_contextInformationChars = retrieveCAPreference(IPreferenceConstants.CONTEXT_INFORMATION_ACTIVATION_CHARACTERS);
}
else if (IPreferenceConstants.PROPOSAL_TRIGGER_CHARACTERS.equals(key))
{
_proposalTriggerChars = retrieveCAPreference(IPreferenceConstants.PROPOSAL_TRIGGER_CHARACTERS);
}
}
示例8: preferenceChange
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
@Override
public void preferenceChange(PreferenceChangeEvent event)
{
if( event.getKey().equals(JPFClasspathPlugin.PREF_REGISTRY_NAME) )
{
manager.modelChanged(this);
}
}
示例9: preferenceChange
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
@Override
public void preferenceChange(PreferenceChangeEvent event)
{
if( event.getKey().equals(JPFClasspathPlugin.PREF_PARENT_REGISTRIES) )
{
manager.modelChanged(this);
}
}
示例10: taggerConfigUpdated
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
private void taggerConfigUpdated(PreferenceChangeEvent e) {
if(e.getKey().equals(TermSuiteUIPreferences.TAGGERS)) {
Collection<String> configNames = context.get(TaggerService.class).getTaggerConfigNames();
EPipeline pipeline = this.pipelineValue.getValue();
if(!configNames.isEmpty()
&& pipeline.getTaggerConfigName() == null) {
pipeline.setTaggerConfigName(configNames.iterator().next());
}
}
}
示例11: preferenceChange
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
@Override
public void preferenceChange(PreferenceChangeEvent event) {
IThemeManager themeManager = TMUIPlugin.getThemeManager();
if (ThemeManager.E4_THEME_ID.equals(event.getKey())) {
preferenceThemeChange((String) event.getNewValue(), themeManager);
} else if (PreferenceConstants.THEME_ASSOCIATIONS.equals(event.getKey())) {
preferenceThemeChange(themeManager.getPreferenceE4CSSThemeId(), themeManager);
}
}
示例12: preferenceChange
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
public void preferenceChange(PreferenceChangeEvent event) {
synchronized (lock) {
if (currState != State.RECORDING) {
return;
}
changeLog.add(new PreferenceChanged(new Path(event.getNode().absolutePath()),
event.getKey(), (String) event.getNewValue()));
}
}
示例13: preferenceChange
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
/**
* Refreshes all notes when a change in the plugin's preferences is detected.
*
* @param event
*/
@Override
public void preferenceChange(PreferenceChangeEvent event) {
for (int tabIndex = 0; tabIndex < tabFolder.getItemCount(); ++tabIndex) {
getNote(tabIndex).setParametersFromPreferences();
}
}
示例14: preferenceChange
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
@Override
public void preferenceChange(PreferenceChangeEvent event) {
Object newValue = event.getNewValue();
if (PreferenceConstants.CLOUDSDK_PATH.equals(event.getKey())
&& (newValue == null || newValue instanceof String)) {
CloudSdkContextFunction.sdkPathChanged((String) newValue);
}
}
示例15: isTypeScriptRuntimePreferencesChanged
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; //导入依赖的package包/类
private boolean isTypeScriptRuntimePreferencesChanged(PreferenceChangeEvent event) {
return TypeScriptCorePreferenceConstants.USE_EMBEDDED_TYPESCRIPT.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.EMBEDDED_TYPESCRIPT_ID.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.INSTALLED_TYPESCRIPT_PATH.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.TSSERVER_TRACE_ON_CONSOLE.equals(event.getKey())
|| TypeScriptCorePreferenceConstants.TSSERVER_EMULATE_PLUGINS.equals(event.getKey());
}