本文整理匯總了Java中org.eclipse.jface.preference.PreferenceConverter類的典型用法代碼示例。如果您正苦於以下問題:Java PreferenceConverter類的具體用法?Java PreferenceConverter怎麽用?Java PreferenceConverter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PreferenceConverter類屬於org.eclipse.jface.preference包,在下文中一共展示了PreferenceConverter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getStaticTokenStyle
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
public de.darwinspl.preferences.resource.dwprofile.IDwprofileTokenStyle getStaticTokenStyle() {
String tokenName = currentToken.getName();
String enableKey = de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.StyleProperty.ENABLE);
if (store == null) {
return null;
}
boolean enabled = store.getBoolean(enableKey);
if (!enabled) {
return null;
}
String colorKey = de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.StyleProperty.COLOR);
RGB foregroundRGB = PreferenceConverter.getColor(store, colorKey);
RGB backgroundRGB = null;
boolean bold = store.getBoolean(de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.StyleProperty.BOLD));
boolean italic = store.getBoolean(de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.StyleProperty.ITALIC));
boolean strikethrough = store.getBoolean(de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.StyleProperty.STRIKETHROUGH));
boolean underline = store.getBoolean(de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileSyntaxColoringHelper.StyleProperty.UNDERLINE));
return new de.darwinspl.preferences.resource.dwprofile.mopp.DwprofileTokenStyle(convertToIntArray(foregroundRGB), convertToIntArray(backgroundRGB), bold, italic, strikethrough, underline);
}
示例2: DwprofileHighlighting
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* <p>
* Creates the highlighting manager class.
* </p>
*
* @param textResource the text resource to be provided to other classes
* @param sourceviewer the source viewer converts offset between master and slave
* documents
* @param colorManager the color manager provides highlighting colors
* @param editor the editor that uses this highlighting object
*/
public DwprofileHighlighting(de.darwinspl.preferences.resource.dwprofile.IDwprofileTextResource textResource, ProjectionViewer projectionViewer, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileColorManager colorManager, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileEditor editor) {
this.display = Display.getCurrent();
projectionViewer.getSelectionProvider();
this.preferenceStore = de.darwinspl.preferences.resource.dwprofile.ui.DwprofileUIPlugin.getDefault().getPreferenceStore();
this.editor = editor;
this.textWidget = projectionViewer.getTextWidget();
this.projectionViewer = projectionViewer;
this.occurrence = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileOccurrence(textResource, projectionViewer);
this.bracketSet = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBracketSet();
this.colorManager = colorManager;
this.isHighlightBrackets = preferenceStore.getBoolean(de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX);
this.bracketColor = colorManager.getColor(PreferenceConverter.getColor(preferenceStore, de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR));
this.black = colorManager.getColor(new RGB(0, 0, 0));
addListeners(editor);
}
示例3: handleMatchingBracketsSelection
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* Initialize and handle the values of this preference page.
*/
private void handleMatchingBracketsSelection() {
// not for the case of none existing language
enableCheckbox.setSelection(getPreferenceStore().getBoolean(de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
enableClosingInside.setSelection(false);
matchingBracketsColorButton.setEnabled(getPreferenceStore().getBoolean( de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), BRACKETS_COLOR);
matchingBracketsColorEditor.setColorValue(rgb);
removeBracketButton.setEnabled(false);
initializeLanguage();
bracketsTmp.deserialize(getPreferenceStore().getString(language + de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_BRACKETS_SUFFIX));
String[] brackets = bracketsTmp.getBracketArray();
if (brackets != null) {
bracketsList.setItems(brackets);
}
}
示例4: performDefaults
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* Sets the default values for this preference page.
*/
protected void performDefaults() {
IPreferenceStore preferenceStore = getPreferenceStore();
enableCheckbox.setSelection(preferenceStore.getDefaultBoolean(de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
matchingBracketsColorButton.setEnabled(enableCheckbox.getSelection());
matchingBracketsColorEditor.setColorValue(PreferenceConverter.getDefaultColor(preferenceStore, BRACKETS_COLOR));
String defaultBrackets = preferenceStore.getDefaultString(language + de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePreferenceConstants.EDITOR_BRACKETS_SUFFIX);
bracketSetTemp.put(language, defaultBrackets);
bracketsTmp.deserialize(bracketSetTemp.get(language));
bracketsList.setItems(bracketsTmp.getBracketArray());
// Reset check boxes and disable them because no item is selected in the
// bracketsList component.
enableClosingInside.setSelection(false);
enableCloseAfterEnter.setSelection(false);
enableClosingInside.setEnabled(false);
enableCloseAfterEnter.setEnabled(false);
}
示例5: HyexpressionHighlighting
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* <p>
* Creates the highlighting manager class.
* </p>
*
* @param textResource the text resource to be provided to other classes
* @param sourceviewer the source viewer converts offset between master and slave
* documents
* @param colorManager the color manager provides highlighting colors
* @param editor the editor that uses this highlighting object
*/
public HyexpressionHighlighting(eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTextResource textResource, ProjectionViewer projectionViewer, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionColorManager colorManager, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionEditor editor) {
this.display = Display.getCurrent();
projectionViewer.getSelectionProvider();
this.preferenceStore = eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionUIPlugin.getDefault().getPreferenceStore();
this.editor = editor;
this.textWidget = projectionViewer.getTextWidget();
this.projectionViewer = projectionViewer;
this.occurrence = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionOccurrence(textResource, projectionViewer);
this.bracketSet = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBracketSet();
this.colorManager = colorManager;
this.isHighlightBrackets = preferenceStore.getBoolean(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX);
this.bracketColor = colorManager.getColor(PreferenceConverter.getColor(preferenceStore, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR));
this.black = colorManager.getColor(new RGB(0, 0, 0));
addListeners(editor);
}
示例6: getStaticTokenStyle
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
public eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTokenStyle getStaticTokenStyle() {
String tokenName = currentToken.getName();
String enableKey = eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.StyleProperty.ENABLE);
if (store == null) {
return null;
}
boolean enabled = store.getBoolean(enableKey);
if (!enabled) {
return null;
}
String colorKey = eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.StyleProperty.COLOR);
RGB foregroundRGB = PreferenceConverter.getColor(store, colorKey);
RGB backgroundRGB = null;
boolean bold = store.getBoolean(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.StyleProperty.BOLD));
boolean italic = store.getBoolean(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.StyleProperty.ITALIC));
boolean strikethrough = store.getBoolean(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.StyleProperty.STRIKETHROUGH));
boolean underline = store.getBoolean(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionSyntaxColoringHelper.StyleProperty.UNDERLINE));
return new eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionTokenStyle(convertToIntArray(foregroundRGB), convertToIntArray(backgroundRGB), bold, italic, strikethrough, underline);
}
示例7: handleMatchingBracketsSelection
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* Initialize and handle the values of this preference page.
*/
private void handleMatchingBracketsSelection() {
// not for the case of none existing language
enableCheckbox.setSelection(getPreferenceStore().getBoolean(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
enableClosingInside.setSelection(false);
matchingBracketsColorButton.setEnabled(getPreferenceStore().getBoolean( eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), BRACKETS_COLOR);
matchingBracketsColorEditor.setColorValue(rgb);
removeBracketButton.setEnabled(false);
initializeLanguage();
bracketsTmp.deserialize(getPreferenceStore().getString(language + eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_BRACKETS_SUFFIX));
String[] brackets = bracketsTmp.getBracketArray();
if (brackets != null) {
bracketsList.setItems(brackets);
}
}
示例8: performDefaults
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* Sets the default values for this preference page.
*/
protected void performDefaults() {
IPreferenceStore preferenceStore = getPreferenceStore();
enableCheckbox.setSelection(preferenceStore.getDefaultBoolean(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
matchingBracketsColorButton.setEnabled(enableCheckbox.getSelection());
matchingBracketsColorEditor.setColorValue(PreferenceConverter.getDefaultColor(preferenceStore, BRACKETS_COLOR));
String defaultBrackets = preferenceStore.getDefaultString(language + eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPreferenceConstants.EDITOR_BRACKETS_SUFFIX);
bracketSetTemp.put(language, defaultBrackets);
bracketsTmp.deserialize(bracketSetTemp.get(language));
bracketsList.setItems(bracketsTmp.getBracketArray());
// Reset check boxes and disable them because no item is selected in the
// bracketsList component.
enableClosingInside.setSelection(false);
enableCloseAfterEnter.setSelection(false);
enableClosingInside.setEnabled(false);
enableCloseAfterEnter.setEnabled(false);
}
示例9: HyvalidityformulaHighlighting
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* <p>
* Creates the highlighting manager class.
* </p>
*
* @param textResource the text resource to be provided to other classes
* @param sourceviewer the source viewer converts offset between master and slave
* documents
* @param colorManager the color manager provides highlighting colors
* @param editor the editor that uses this highlighting object
*/
public HyvalidityformulaHighlighting(eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaTextResource textResource, ProjectionViewer projectionViewer, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaColorManager colorManager, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaEditor editor) {
this.display = Display.getCurrent();
projectionViewer.getSelectionProvider();
this.preferenceStore = eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaUIPlugin.getDefault().getPreferenceStore();
this.editor = editor;
this.textWidget = projectionViewer.getTextWidget();
this.projectionViewer = projectionViewer;
this.occurrence = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaOccurrence(textResource, projectionViewer);
this.bracketSet = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBracketSet();
this.colorManager = colorManager;
this.isHighlightBrackets = preferenceStore.getBoolean(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX);
this.bracketColor = colorManager.getColor(PreferenceConverter.getColor(preferenceStore, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR));
this.black = colorManager.getColor(new RGB(0, 0, 0));
addListeners(editor);
}
示例10: getStaticTokenStyle
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
public eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaTokenStyle getStaticTokenStyle() {
String tokenName = currentToken.getName();
String enableKey = eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.StyleProperty.ENABLE);
if (store == null) {
return null;
}
boolean enabled = store.getBoolean(enableKey);
if (!enabled) {
return null;
}
String colorKey = eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.StyleProperty.COLOR);
RGB foregroundRGB = PreferenceConverter.getColor(store, colorKey);
RGB backgroundRGB = null;
boolean bold = store.getBoolean(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.StyleProperty.BOLD));
boolean italic = store.getBoolean(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.StyleProperty.ITALIC));
boolean strikethrough = store.getBoolean(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.StyleProperty.STRIKETHROUGH));
boolean underline = store.getBoolean(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaSyntaxColoringHelper.StyleProperty.UNDERLINE));
return new eu.hyvar.context.contextValidity.resource.hyvalidityformula.mopp.HyvalidityformulaTokenStyle(convertToIntArray(foregroundRGB), convertToIntArray(backgroundRGB), bold, italic, strikethrough, underline);
}
示例11: handleMatchingBracketsSelection
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* Initialize and handle the values of this preference page.
*/
private void handleMatchingBracketsSelection() {
// not for the case of none existing language
enableCheckbox.setSelection(getPreferenceStore().getBoolean(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
enableClosingInside.setSelection(false);
matchingBracketsColorButton.setEnabled(getPreferenceStore().getBoolean( eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), BRACKETS_COLOR);
matchingBracketsColorEditor.setColorValue(rgb);
removeBracketButton.setEnabled(false);
initializeLanguage();
bracketsTmp.deserialize(getPreferenceStore().getString(language + eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_BRACKETS_SUFFIX));
String[] brackets = bracketsTmp.getBracketArray();
if (brackets != null) {
bracketsList.setItems(brackets);
}
}
示例12: performDefaults
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* Sets the default values for this preference page.
*/
protected void performDefaults() {
IPreferenceStore preferenceStore = getPreferenceStore();
enableCheckbox.setSelection(preferenceStore.getDefaultBoolean(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
matchingBracketsColorButton.setEnabled(enableCheckbox.getSelection());
matchingBracketsColorEditor.setColorValue(PreferenceConverter.getDefaultColor(preferenceStore, BRACKETS_COLOR));
String defaultBrackets = preferenceStore.getDefaultString(language + eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPreferenceConstants.EDITOR_BRACKETS_SUFFIX);
bracketSetTemp.put(language, defaultBrackets);
bracketsTmp.deserialize(bracketSetTemp.get(language));
bracketsList.setItems(bracketsTmp.getBracketArray());
// Reset check boxes and disable them because no item is selected in the
// bracketsList component.
enableClosingInside.setSelection(false);
enableCloseAfterEnter.setSelection(false);
enableClosingInside.setEnabled(false);
enableCloseAfterEnter.setEnabled(false);
}
示例13: getStaticTokenStyle
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
public eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTokenStyle getStaticTokenStyle() {
String tokenName = currentToken.getName();
String enableKey = eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.StyleProperty.ENABLE);
if (store == null) {
return null;
}
boolean enabled = store.getBoolean(enableKey);
if (!enabled) {
return null;
}
String colorKey = eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.StyleProperty.COLOR);
RGB foregroundRGB = PreferenceConverter.getColor(store, colorKey);
RGB backgroundRGB = null;
boolean bold = store.getBoolean(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.StyleProperty.BOLD));
boolean italic = store.getBoolean(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.StyleProperty.ITALIC));
boolean strikethrough = store.getBoolean(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.StyleProperty.STRIKETHROUGH));
boolean underline = store.getBoolean(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueSyntaxColoringHelper.StyleProperty.UNDERLINE));
return new eu.hyvar.dataValues.resource.hydatavalue.mopp.HydatavalueTokenStyle(convertToIntArray(foregroundRGB), convertToIntArray(backgroundRGB), bold, italic, strikethrough, underline);
}
示例14: HydatavalueHighlighting
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* <p>
* Creates the highlighting manager class.
* </p>
*
* @param textResource the text resource to be provided to other classes
* @param sourceviewer the source viewer converts offset between master and slave
* documents
* @param colorManager the color manager provides highlighting colors
* @param editor the editor that uses this highlighting object
*/
public HydatavalueHighlighting(eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTextResource textResource, ProjectionViewer projectionViewer, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueColorManager colorManager, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueEditor editor) {
this.display = Display.getCurrent();
projectionViewer.getSelectionProvider();
this.preferenceStore = eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueUIPlugin.getDefault().getPreferenceStore();
this.editor = editor;
this.textWidget = projectionViewer.getTextWidget();
this.projectionViewer = projectionViewer;
this.occurrence = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueOccurrence(textResource, projectionViewer);
this.bracketSet = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBracketSet();
this.colorManager = colorManager;
this.isHighlightBrackets = preferenceStore.getBoolean(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX);
this.bracketColor = colorManager.getColor(PreferenceConverter.getColor(preferenceStore, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR));
this.black = colorManager.getColor(new RGB(0, 0, 0));
addListeners(editor);
}
示例15: handleMatchingBracketsSelection
import org.eclipse.jface.preference.PreferenceConverter; //導入依賴的package包/類
/**
* Initialize and handle the values of this preference page.
*/
private void handleMatchingBracketsSelection() {
// not for the case of none existing language
enableCheckbox.setSelection(getPreferenceStore().getBoolean(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
enableClosingInside.setSelection(false);
matchingBracketsColorButton.setEnabled(getPreferenceStore().getBoolean( eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), BRACKETS_COLOR);
matchingBracketsColorEditor.setColorValue(rgb);
removeBracketButton.setEnabled(false);
initializeLanguage();
bracketsTmp.deserialize(getPreferenceStore().getString(language + eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.EDITOR_BRACKETS_SUFFIX));
String[] brackets = bracketsTmp.getBracketArray();
if (brackets != null) {
bracketsList.setItems(brackets);
}
}