本文整理匯總了Java中org.eclipse.jface.preference.PreferenceConverter.setValue方法的典型用法代碼示例。如果您正苦於以下問題:Java PreferenceConverter.setValue方法的具體用法?Java PreferenceConverter.setValue怎麽用?Java PreferenceConverter.setValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.preference.PreferenceConverter
的用法示例。
在下文中一共展示了PreferenceConverter.setValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setColor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
@Override
public void setColor(String preferenceName, RGB color)
{
PreferenceConverter.setValue(m_preferences, preferenceName, color);
// Override color if already buffered
if (m_colors.containsKey(preferenceName))
{
m_colors.get(preferenceName).dispose();
boolean dark = preferenceName.endsWith("-DARK");
String prefCode = preferenceName.replace("-DARK","");
RGB rgb = PreferenceConverter.getColor(m_preferences, prefCode);
if (dark)
{
rgb.red -= 25;
rgb.blue -= 25;
rgb.green -= 25;
}
m_colors.put(preferenceName, new Color(Display.getDefault(), rgb));
}
}
示例2: updateActiveEditor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Sets the chosen options to the preference store and refreshes it in the editor.
*/
private void updateActiveEditor() {
// set the values after ok or apply
IPreferenceStore preferenceStore = getPreferenceStore();
PreferenceConverter.setValue(preferenceStore, BRACKETS_COLOR, matchingBracketsColorEditor.getColorValue());
preferenceStore.setValue(de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX, enableCheckbox.getSelection());
preferenceStore.setValue(language + de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_BRACKETS_SUFFIX, bracketSetTemp.get(language));
IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench();
IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null && editor instanceof de.darwinspl.preferences.resource.dwprofile.ui.DwprofileEditor) {
((de.darwinspl.preferences.resource.dwprofile.ui.DwprofileEditor) editor).invalidateTextRepresentation();
}
}
示例3: updateActiveEditor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Sets the chosen options to the preference store and refreshes it in the editor.
*/
private void updateActiveEditor() {
// set the values after ok or apply
IPreferenceStore preferenceStore = getPreferenceStore();
PreferenceConverter.setValue(preferenceStore, BRACKETS_COLOR, matchingBracketsColorEditor.getColorValue());
preferenceStore.setValue(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX, enableCheckbox.getSelection());
preferenceStore.setValue(language + eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_BRACKETS_SUFFIX, bracketSetTemp.get(language));
IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench();
IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null && editor instanceof eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionEditor) {
((eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionEditor) editor).invalidateTextRepresentation();
}
}
示例4: updateActiveEditor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Sets the chosen options to the preference store and refreshes it in the editor.
*/
private void updateActiveEditor() {
// set the values after ok or apply
IPreferenceStore preferenceStore = getPreferenceStore();
PreferenceConverter.setValue(preferenceStore, BRACKETS_COLOR, matchingBracketsColorEditor.getColorValue());
preferenceStore.setValue(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX, enableCheckbox.getSelection());
preferenceStore.setValue(language + eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_BRACKETS_SUFFIX, bracketSetTemp.get(language));
IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench();
IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null && editor instanceof eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaEditor) {
((eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaEditor) editor).invalidateTextRepresentation();
}
}
示例5: updateActiveEditor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Sets the chosen options to the preference store and refreshes it in the editor.
*/
private void updateActiveEditor() {
// set the values after ok or apply
IPreferenceStore preferenceStore = getPreferenceStore();
PreferenceConverter.setValue(preferenceStore, BRACKETS_COLOR, matchingBracketsColorEditor.getColorValue());
preferenceStore.setValue(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX, enableCheckbox.getSelection());
preferenceStore.setValue(language + eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.EDITOR_BRACKETS_SUFFIX, bracketSetTemp.get(language));
IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench();
IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null && editor instanceof eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueEditor) {
((eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueEditor) editor).invalidateTextRepresentation();
}
}
示例6: updateActiveEditor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Sets the chosen options to the preference store and refreshes it in the editor.
*/
private void updateActiveEditor() {
// set the values after ok or apply
IPreferenceStore preferenceStore = getPreferenceStore();
PreferenceConverter.setValue(preferenceStore, BRACKETS_COLOR, matchingBracketsColorEditor.getColorValue());
preferenceStore.setValue(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX, enableCheckbox.getSelection());
preferenceStore.setValue(language + eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPreferenceConstants.EDITOR_BRACKETS_SUFFIX, bracketSetTemp.get(language));
IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench();
IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null && editor instanceof eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingEditor) {
((eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingEditor) editor).invalidateTextRepresentation();
}
}
示例7: updateActiveEditor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Sets the chosen options to the preference store and refreshes it in the editor.
*/
private void updateActiveEditor() {
// set the values after ok or apply
IPreferenceStore preferenceStore = getPreferenceStore();
PreferenceConverter.setValue(preferenceStore, BRACKETS_COLOR, matchingBracketsColorEditor.getColorValue());
preferenceStore.setValue(eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX, enableCheckbox.getSelection());
preferenceStore.setValue(language + eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.EDITOR_BRACKETS_SUFFIX, bracketSetTemp.get(language));
IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench();
IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null && editor instanceof eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsEditor) {
((eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsEditor) editor).invalidateTextRepresentation();
}
}
示例8: updateActiveEditor
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Sets the chosen options to the preference store and refreshes it in the editor.
*/
private void updateActiveEditor() {
// set the values after ok or apply
IPreferenceStore preferenceStore = getPreferenceStore();
PreferenceConverter.setValue(preferenceStore, BRACKETS_COLOR, matchingBracketsColorEditor.getColorValue());
preferenceStore.setValue(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX, enableCheckbox.getSelection());
preferenceStore.setValue(language + eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.EDITOR_BRACKETS_SUFFIX, bracketSetTemp.get(language));
IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench();
IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null && editor instanceof eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestEditor) {
((eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestEditor) editor).invalidateTextRepresentation();
}
}
示例9: saveLocation
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Saves the location of a Shell
*/
private static void saveLocation(final Shell shell, final String id) {
log.debug("saving window location, id=" + id);
final Point location = shell.getLocation();
final Point size = shell.getSize();
final Rectangle rectangle = new Rectangle(location.x, location.y, size.x, size.y);
PreferenceConverter.setValue(ps, id, rectangle);
}
示例10: doStore
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
@Override
protected void doStore() {
if (chosenFont != null) {
PreferenceConverter.setValue(getPreferenceStore(), getPreferenceName(), chosenFont);
}
}
示例11: setToDefault
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
/**
* Store the default preference for the field being edited
*/
protected void setToDefault() {
final FontData[] defaultFontData = PreferenceConverter.getDefaultFontDataArray(
getPreferenceStore(),
getPreferenceName());
PreferenceConverter.setValue(getPreferenceStore(), getPreferenceName(), defaultFontData);
}
示例12: saveColors_GraphColors_InPrefStore
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
private static void saveColors_GraphColors_InPrefStore() {
final IPreferenceStore commonPrefStore = CommonActivator.getPrefStore();
for (final ColorDefinition graphDefinition : getInstance().getGraphColorDefinitions()) {
PreferenceConverter.setValue(
commonPrefStore,
graphDefinition.getGraphPrefName(PREF_COLOR_BRIGHT),
graphDefinition.getGradientBright_New());
PreferenceConverter.setValue(
commonPrefStore,
graphDefinition.getGraphPrefName(PREF_COLOR_DARK),
graphDefinition.getGradientDark_New());
PreferenceConverter.setValue(
commonPrefStore,
graphDefinition.getGraphPrefName(PREF_COLOR_LINE),
graphDefinition.getLineColor_New());
PreferenceConverter.setValue(
commonPrefStore,
graphDefinition.getGraphPrefName(PREF_COLOR_TEXT),
graphDefinition.getTextColor_New());
}
}
示例13: saveState
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
private void saveState() {
_prefStore.setValue(ITourbookPreferences.MAP_LAYOUT_PLOT_TYPE, getPlotType());
/*
* Line
*/
_prefStore.setValue(ITourbookPreferences.MAP_LAYOUT_SYMBOL_WIDTH, _spinnerLineWidth.getSelection());
/*
* Border
*/
_prefStore.setValue(ITourbookPreferences.MAP_LAYOUT_PAINT_WITH_BORDER, _chkPaintWithBorder.getSelection());
_prefStore.setValue(ITourbookPreferences.MAP_LAYOUT_BORDER_WIDTH, _spinnerBorderWidth.getSelection());
_prefStore.setValue(ITourbookPreferences.MAP_LAYOUT_BORDER_TYPE, getBorderType());
_prefStore.setValue(ITourbookPreferences.MAP_LAYOUT_BORDER_DIMM_VALUE,//
_spinnerBorderColorDarker.getSelection());
PreferenceConverter.setValue(_prefStore, ITourbookPreferences.MAP_LAYOUT_BORDER_COLOR,//
_colorBorderColor.getColorValue());
/*
* Map dimming
*/
PreferenceConverter.setValue(_prefStore, ITourbookPreferences.MAP_LAYOUT_MAP_DIMM_COLOR,//
_colorMapDimmColor.getColorValue());
_prefStore.setValue(ITourbookPreferences.MAP_LAYOUT_LIVE_UPDATE, _chkLiveUpdate.getSelection());
}
示例14: afterValueChange
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
@Override
public void afterValueChange(final GamaFont font) {
try {
final FontData newValue = new FontData(font.getName(), font.getSize(), font.getStyle());
PreferenceConverter.setValue(EditorsPlugin.getDefault().getPreferenceStore(),
JFaceResources.TEXT_FONT, newValue);
} catch (final Exception e) {}
}
示例15: apply
import org.eclipse.jface.preference.PreferenceConverter; //導入方法依賴的package包/類
public void apply(IPreferenceStore store) {
PreferenceConverter.setValue(store, getKey(), newValue);
}