本文整理匯總了Java中org.eclipse.jface.preference.PreferenceConverter.getDefaultColor方法的典型用法代碼示例。如果您正苦於以下問題:Java PreferenceConverter.getDefaultColor方法的具體用法?Java PreferenceConverter.getDefaultColor怎麽用?Java PreferenceConverter.getDefaultColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.preference.PreferenceConverter
的用法示例。
在下文中一共展示了PreferenceConverter.getDefaultColor方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createColor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Creates a color from the information stored in the given preference delta. Returns
* <code>null</code> if there is no such information available. TODO: move or fix store.getColor
*
* @param delta the delta to read from
* @param key the key used for the lookup in the preference delta
* @param display the display used create the color
* @return the created color according to the specification in the preference delta
*/
public Color createColor(IPreferenceStore store, String key, Display display) {
RGB rgb = null;
if (store.contains(key)) {
if (store.isDefault(key)) {
rgb = PreferenceConverter.getDefaultColor(store, key);
} else {
rgb = PreferenceConverter.getColor(store, key);
}
if (rgb != null) return new Color(display, rgb);
}
return null;
}
示例2: getDefaultColor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
public RGB getDefaultColor(String key) {
return PreferenceConverter.getDefaultColor(this, key);
}
示例3: initializeValue
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
void initializeValue(boolean setDefault) {
IPreferenceStore store = getPreferenceStore();
this.value = setDefault
? PreferenceConverter.getDefaultColor(store, preferenceKey)
: PreferenceConverter.getColor(store, preferenceKey);
}
示例4: setDefaultAndFireEvent
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Sets the default value and fires a property change event if necessary.
*
* @param store
* the preference store
* @param key
* the preference key
* @param newValue
* the new value
*
*/
private static void setDefaultAndFireEvent(IPreferenceStore store, String key, RGB newValue) {
RGB oldValue = null;
if (store.isDefault(key))
oldValue = PreferenceConverter.getDefaultColor(store, key);
PreferenceConverter.setDefault(store, key, newValue);
if (oldValue != null && !oldValue.equals(newValue))
store.firePropertyChangeEvent(key, oldValue, newValue);
}