本文整理汇总了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)));
}
}
}
}
示例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;
}
示例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, "");
}
}
}
}