当前位置: 首页>>代码示例>>Java>>正文


Java IPreferenceStore.contains方法代码示例

本文整理汇总了Java中org.eclipse.jface.preference.IPreferenceStore.contains方法的典型用法代码示例。如果您正苦于以下问题:Java IPreferenceStore.contains方法的具体用法?Java IPreferenceStore.contains怎么用?Java IPreferenceStore.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.preference.IPreferenceStore的用法示例。


在下文中一共展示了IPreferenceStore.contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDescriptorValuesFromPreferences

import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
private void setDescriptorValuesFromPreferences(IPreferenceStore preferenceStore, String outputName,
		DESCR_TYPE newCompilerDescriptor) {
	for (IComponentProperties<DESCR_TYPE> prop : getComponentPropertiesValues()) {
		if (preferenceStore.contains(prop.getKey(outputName))) {
			if (prop.getType() == Boolean.class) {
				prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
						preferenceStore.getBoolean(prop.getKey(outputName)));
			} else { // String
				prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
						preferenceStore.getString(prop.getKey(outputName)));
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:15,代码来源:AbstractN4JSPreferencePage.java

示例2: toStyledText

import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
/**
 * Creates and returns with a new {@link StyledText styled text} instance hooked up to the given parent composite.
 *
 * @param parent
 *            the parent of the styled text control.
 * @param style
 *            style bits for the new text control.
 * @return a new styled text control initialized from the descriptor.
 */
default StyledText toStyledText(final Composite parent, final int style) {

	final StyledText text = new StyledText(parent, READ_ONLY | style);
	text.setText(getText());
	text.setStyleRanges(getRanges());
	text.setFont(getFont());
	text.setEditable(false);
	text.setEnabled(false);

	final AtomicReference<Color> colorRef = new AtomicReference<>();
	final IPreferenceStore prefStore = EditorsUI.getPreferenceStore();
	if (null == prefStore
			|| prefStore.getBoolean(PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)) {

		colorRef.set(getDefault().getSystemColor(COLOR_LIST_BACKGROUND));

	} else {

		RGB rgb = null;
		if (prefStore.contains(PREFERENCE_COLOR_BACKGROUND)) {
			if (prefStore.isDefault(PREFERENCE_COLOR_BACKGROUND)) {
				rgb = getDefaultColor(prefStore, PREFERENCE_COLOR_BACKGROUND);
			} else {
				rgb = getColor(prefStore, PREFERENCE_COLOR_BACKGROUND);
			}
			if (rgb != null) {
				colorRef.set(new Color(text.getDisplay(), rgb));
			}
		}

	}

	if (null != colorRef.get()) {
		text.setBackground(colorRef.get());
		text.addDisposeListener(e -> {
			if (!colorRef.get().isDisposed()) {
				colorRef.get().dispose();
			}
		});
	}

	text.pack();
	return text;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:54,代码来源:StyledTextDescriptor.java

示例3: storeToPreference

import org.eclipse.jface.preference.IPreferenceStore; //导入方法依赖的package包/类
public void storeToPreference(IPreferenceStore store){
	store.setValue(bdfVersionKey, bdfVersion);
	if(this.customBorderColor!=null){
		String customBorderColorStr=this.customBorderColor.red+","+this.customBorderColor.green+","+this.customBorderColor.blue;
		store.setValue(customBorderColorStoreKey, customBorderColorStr);
	}else{
		if(store.contains(customBorderColorStoreKey)){
			store.setValue(customBorderColorStoreKey, "");
		}
	}
	if(this.customBackgroundColor!=null){
		String customBackgroundColorStr=this.customBackgroundColor.red+","+this.customBackgroundColor.green+","+this.customBackgroundColor.blue;
		store.setValue(customBackgroundColorStoreKey, customBackgroundColorStr);
	}else{
		if(store.contains(customBackgroundColorStoreKey)){
			store.setValue(customBackgroundColorStoreKey, "");
		}
	}
	if(this.customTransitionColor!=null){
		String customTransitionColorStr=this.customTransitionColor.red+","+this.customTransitionColor.green+","+this.customTransitionColor.blue;
		store.setValue(customTransitionColorStoreKey, customTransitionColorStr);
	}else{
		if(store.contains(customTransitionColorStoreKey)){
			store.setValue(customTransitionColorStoreKey, "");
		}
	}
	for(NodeImageConfig config:this.nodeImageConfigs){
		String key=config.getNodeName()+this.nodeImageKey;
		if(config.getCustomImage()!=null && config.getCustomImagePath()!=null){
			store.setValue(key, config.getCustomImagePath());
		}else{
			if(store.contains(key)){
				store.setValue(key, "");
			}
		}
		key=config.getNodeName()+this.nodeSmallImageKey;
		if(config.getCustomSmallImage()!=null && config.getCustomSmallImagePath()!=null){
			store.setValue(key, config.getCustomSmallImagePath());
		}else{
			if(store.contains(key)){
				store.setValue(key, "");
			}
		}
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:46,代码来源:Preference.java


注:本文中的org.eclipse.jface.preference.IPreferenceStore.contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。