Java 类org.eclipse.jface.preference.PreferenceConverter 实例源码

项目:DarwinSPL    文件:DwprofileTokenScanner.java   
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);
}
项目:DarwinSPL    文件:DwprofileHighlighting.java   
/**
 * <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);
}
项目:DarwinSPL    文件:DwprofileBracketPreferencePage.java   
/**
 * 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);
    }
}
项目:DarwinSPL    文件:DwprofileBracketPreferencePage.java   
/**
 * 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);
}
项目:DarwinSPL    文件:HyexpressionHighlighting.java   
/**
 * <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);
}
项目:DarwinSPL    文件:HyexpressionTokenScanner.java   
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);
}
项目:DarwinSPL    文件:HyexpressionBracketPreferencePage.java   
/**
 * 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);
    }
}
项目:DarwinSPL    文件:HyexpressionBracketPreferencePage.java   
/**
 * 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);
}
项目:DarwinSPL    文件:HyvalidityformulaHighlighting.java   
/**
 * <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);
}
项目:DarwinSPL    文件:HyvalidityformulaTokenScanner.java   
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);
}
项目:DarwinSPL    文件:HyvalidityformulaBracketPreferencePage.java   
/**
 * 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);
    }
}
项目:DarwinSPL    文件:HyvalidityformulaBracketPreferencePage.java   
/**
 * 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);
}
项目:DarwinSPL    文件:HydatavalueTokenScanner.java   
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);
}
项目:DarwinSPL    文件:HydatavalueHighlighting.java   
/**
 * <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);
}
项目:DarwinSPL    文件:HydatavalueBracketPreferencePage.java   
/**
 * 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);
    }
}
项目:DarwinSPL    文件:HydatavalueBracketPreferencePage.java   
/**
 * Sets the default values for this preference page.
 */
protected void performDefaults() {
    IPreferenceStore preferenceStore = getPreferenceStore();
    enableCheckbox.setSelection(preferenceStore.getDefaultBoolean(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
    matchingBracketsColorButton.setEnabled(enableCheckbox.getSelection());
    matchingBracketsColorEditor.setColorValue(PreferenceConverter.getDefaultColor(preferenceStore, BRACKETS_COLOR));
    String defaultBrackets = preferenceStore.getDefaultString(language + eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePreferenceConstants.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);
}
项目:DarwinSPL    文件:HymappingTokenScanner.java   
public eu.hyvar.feature.mapping.resource.hymapping.IHymappingTokenStyle getStaticTokenStyle() {
    String tokenName = currentToken.getName();
    String enableKey = eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.StyleProperty.ENABLE);
    if (store == null) {
        return null;
    }

    boolean enabled = store.getBoolean(enableKey);
    if (!enabled) {
        return null;
    }

    String colorKey = eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.StyleProperty.COLOR);
    RGB foregroundRGB = PreferenceConverter.getColor(store, colorKey);
    RGB backgroundRGB = null;
    boolean bold = store.getBoolean(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.StyleProperty.BOLD));
    boolean italic = store.getBoolean(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.StyleProperty.ITALIC));
    boolean strikethrough = store.getBoolean(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.StyleProperty.STRIKETHROUGH));
    boolean underline = store.getBoolean(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingSyntaxColoringHelper.StyleProperty.UNDERLINE));
    return new eu.hyvar.feature.mapping.resource.hymapping.mopp.HymappingTokenStyle(convertToIntArray(foregroundRGB), convertToIntArray(backgroundRGB), bold, italic, strikethrough, underline);
}
项目:DarwinSPL    文件:HymappingHighlighting.java   
/**
 * <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 HymappingHighlighting(eu.hyvar.feature.mapping.resource.hymapping.IHymappingTextResource textResource, ProjectionViewer projectionViewer, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingColorManager colorManager, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingEditor editor) {
    this.display = Display.getCurrent();
    projectionViewer.getSelectionProvider();
    this.preferenceStore = eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingUIPlugin.getDefault().getPreferenceStore();
    this.editor = editor;
    this.textWidget = projectionViewer.getTextWidget();
    this.projectionViewer = projectionViewer;
    this.occurrence = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingOccurrence(textResource, projectionViewer);
    this.bracketSet = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBracketSet();
    this.colorManager = colorManager;
    this.isHighlightBrackets = preferenceStore.getBoolean(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX);
    this.bracketColor = colorManager.getColor(PreferenceConverter.getColor(preferenceStore, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR));
    this.black = colorManager.getColor(new RGB(0, 0, 0));

    addListeners(editor);
}
项目:DarwinSPL    文件:HymappingBracketPreferencePage.java   
/**
 * 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.mapping.resource.hymapping.ui.HymappingPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
    enableClosingInside.setSelection(false);
    matchingBracketsColorButton.setEnabled(getPreferenceStore().getBoolean(     eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPreferenceConstants.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.mapping.resource.hymapping.ui.HymappingPreferenceConstants.EDITOR_BRACKETS_SUFFIX));
    String[] brackets = bracketsTmp.getBracketArray();
    if (brackets != null) {
        bracketsList.setItems(brackets);
    }
}
项目:DarwinSPL    文件:HymappingBracketPreferencePage.java   
/**
 * Sets the default values for this preference page.
 */
protected void performDefaults() {
    IPreferenceStore preferenceStore = getPreferenceStore();
    enableCheckbox.setSelection(preferenceStore.getDefaultBoolean(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
    matchingBracketsColorButton.setEnabled(enableCheckbox.getSelection());
    matchingBracketsColorEditor.setColorValue(PreferenceConverter.getDefaultColor(preferenceStore, BRACKETS_COLOR));
    String defaultBrackets = preferenceStore.getDefaultString(language + eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPreferenceConstants.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);
}
项目:DarwinSPL    文件:HyconstraintsBracketPreferencePage.java   
/**
 * 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.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
    enableClosingInside.setSelection(false);
    matchingBracketsColorButton.setEnabled(getPreferenceStore().getBoolean(     eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.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.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.EDITOR_BRACKETS_SUFFIX));
    String[] brackets = bracketsTmp.getBracketArray();
    if (brackets != null) {
        bracketsList.setItems(brackets);
    }
}
项目:DarwinSPL    文件:HyconstraintsBracketPreferencePage.java   
/**
 * Sets the default values for this preference page.
 */
protected void performDefaults() {
    IPreferenceStore preferenceStore = getPreferenceStore();
    enableCheckbox.setSelection(preferenceStore.getDefaultBoolean(eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
    matchingBracketsColorButton.setEnabled(enableCheckbox.getSelection());
    matchingBracketsColorEditor.setColorValue(PreferenceConverter.getDefaultColor(preferenceStore, BRACKETS_COLOR));
    String defaultBrackets = preferenceStore.getDefaultString(language + eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.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);
}
项目:DarwinSPL    文件:HyconstraintsTokenScanner.java   
public eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsTokenStyle getStaticTokenStyle() {
    String tokenName = currentToken.getName();
    String enableKey = eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.StyleProperty.ENABLE);
    if (store == null) {
        return null;
    }

    boolean enabled = store.getBoolean(enableKey);
    if (!enabled) {
        return null;
    }

    String colorKey = eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.StyleProperty.COLOR);
    RGB foregroundRGB = PreferenceConverter.getColor(store, colorKey);
    RGB backgroundRGB = null;
    boolean bold = store.getBoolean(eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.StyleProperty.BOLD));
    boolean italic = store.getBoolean(eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.StyleProperty.ITALIC));
    boolean strikethrough = store.getBoolean(eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.StyleProperty.STRIKETHROUGH));
    boolean underline = store.getBoolean(eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsSyntaxColoringHelper.StyleProperty.UNDERLINE));
    return new eu.hyvar.feature.constraint.resource.hyconstraints.mopp.HyconstraintsTokenStyle(convertToIntArray(foregroundRGB), convertToIntArray(backgroundRGB), bold, italic, strikethrough, underline);
}
项目:DarwinSPL    文件:HyconstraintsHighlighting.java   
/**
 * <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 HyconstraintsHighlighting(eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsTextResource textResource, ProjectionViewer projectionViewer, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsColorManager colorManager, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsEditor editor) {
    this.display = Display.getCurrent();
    projectionViewer.getSelectionProvider();
    this.preferenceStore = eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsUIPlugin.getDefault().getPreferenceStore();
    this.editor = editor;
    this.textWidget = projectionViewer.getTextWidget();
    this.projectionViewer = projectionViewer;
    this.occurrence = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsOccurrence(textResource, projectionViewer);
    this.bracketSet = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBracketSet();
    this.colorManager = colorManager;
    this.isHighlightBrackets = preferenceStore.getBoolean(eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX);
    this.bracketColor = colorManager.getColor(PreferenceConverter.getColor(preferenceStore, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR));
    this.black = colorManager.getColor(new RGB(0, 0, 0));

    addListeners(editor);
}
项目:DarwinSPL    文件:HymanifestHighlighting.java   
/**
 * <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 HymanifestHighlighting(eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestTextResource textResource, ProjectionViewer projectionViewer, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestColorManager colorManager, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestEditor editor) {
    this.display = Display.getCurrent();
    projectionViewer.getSelectionProvider();
    this.preferenceStore = eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestUIPlugin.getDefault().getPreferenceStore();
    this.editor = editor;
    this.textWidget = projectionViewer.getTextWidget();
    this.projectionViewer = projectionViewer;
    this.occurrence = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestOccurrence(textResource, projectionViewer);
    this.bracketSet = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBracketSet();
    this.colorManager = colorManager;
    this.isHighlightBrackets = preferenceStore.getBoolean(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX);
    this.bracketColor = colorManager.getColor(PreferenceConverter.getColor(preferenceStore, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR));
    this.black = colorManager.getColor(new RGB(0, 0, 0));

    addListeners(editor);
}
项目:DarwinSPL    文件:HymanifestTokenScanner.java   
public eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestTokenStyle getStaticTokenStyle() {
    String tokenName = currentToken.getName();
    String enableKey = eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.StyleProperty.ENABLE);
    if (store == null) {
        return null;
    }

    boolean enabled = store.getBoolean(enableKey);
    if (!enabled) {
        return null;
    }

    String colorKey = eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.StyleProperty.COLOR);
    RGB foregroundRGB = PreferenceConverter.getColor(store, colorKey);
    RGB backgroundRGB = null;
    boolean bold = store.getBoolean(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.StyleProperty.BOLD));
    boolean italic = store.getBoolean(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.StyleProperty.ITALIC));
    boolean strikethrough = store.getBoolean(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.StyleProperty.STRIKETHROUGH));
    boolean underline = store.getBoolean(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.getPreferenceKey(languageId, tokenName, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestSyntaxColoringHelper.StyleProperty.UNDERLINE));
    return new eu.hyvar.mspl.manifest.resource.hymanifest.mopp.HymanifestTokenStyle(convertToIntArray(foregroundRGB), convertToIntArray(backgroundRGB), bold, italic, strikethrough, underline);
}
项目:DarwinSPL    文件:HymanifestBracketPreferencePage.java   
/**
 * 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.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
    enableClosingInside.setSelection(false);
    matchingBracketsColorButton.setEnabled(getPreferenceStore().getBoolean(     eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.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.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.EDITOR_BRACKETS_SUFFIX));
    String[] brackets = bracketsTmp.getBracketArray();
    if (brackets != null) {
        bracketsList.setItems(brackets);
    }
}
项目:DarwinSPL    文件:HymanifestBracketPreferencePage.java   
/**
 * Sets the default values for this preference page.
 */
protected void performDefaults() {
    IPreferenceStore preferenceStore = getPreferenceStore();
    enableCheckbox.setSelection(preferenceStore.getDefaultBoolean(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.EDITOR_MATCHING_BRACKETS_CHECKBOX));
    matchingBracketsColorButton.setEnabled(enableCheckbox.getSelection());
    matchingBracketsColorEditor.setColorValue(PreferenceConverter.getDefaultColor(preferenceStore, BRACKETS_COLOR));
    String defaultBrackets = preferenceStore.getDefaultString(language + eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPreferenceConstants.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);
}
项目:statecharts    文件:RegionViewFactory.java   
@Override
protected void initializeFromPreferences(View view) {
    super.initializeFromPreferences(view);
    IPreferenceStore store = (IPreferenceStore) getPreferencesHint()
            .getPreferenceStore();
    if (store == null) {
        return;
    }

    // Create region default styles
    ShapeStyle style = (ShapeStyle) view
            .getStyle(NotationPackage.Literals.SHAPE_STYLE);
    RGB fillRGB = PreferenceConverter.getColor(store,
            StatechartPreferenceConstants.PREF_REGION_BACKGROUND);
    style.setFillColor(FigureUtilities.RGBToInteger(fillRGB));
    RGB lineRGB = PreferenceConverter.getColor(store,
            StatechartPreferenceConstants.PREF_REGION_LINE);
    style.setLineColor(FigureUtilities.RGBToInteger(lineRGB));
}
项目:LogViewer    文件:LogFileViewer.java   
public LogFileViewer(Composite parent, int style) {
    store = LogViewerPlugin.getDefault().getPreferenceStore();
    if (store.getBoolean(ILogViewerConstants.PREF_WORD_WRAP))
        style |= SWT.WRAP;
    showWhenUpdated = store.getBoolean(ILogViewerConstants.PREF_SHOW_WHEN_UPDATED);
    showTopOfFile = store.getBoolean(ILogViewerConstants.PREF_SHOW_TOP_OF_FILE);
    txtViewer = new SourceViewer(parent,null,style);
    FontData[] fontData = PreferenceConverter.getFontDataArray(store,ILogViewerConstants.PREF_EDITOR_FONT_STYLE);
    if(fontData == null) {
        fontData = JFaceResources.getDefaultFont().getFontData();
    }
    txtViewer.getTextWidget().setFont(new Font(Display.getCurrent(),fontData));
    propertyChangeListener = new PropertyChangeListener();
    store.addPropertyChangeListener(propertyChangeListener);
    createCursorLinePainter();
    createAndInstallPresentationReconciler();
}
项目:mytourbook    文件:ActionSelectMapProvider.java   
private void selectMapProviderInTheMap(final MP mp) {

        // check if a new map provider is selected
        if (_selectedMP != null && _selectedMP == mp) {
            return;
        }

        _selectedMP = mp;

        final Map map = _mapView.getMap();

        map.setMapProvider(mp);

        // reset overlays must be done after the new map provider is set
//      map.resetOverlays();

        // set map dim level
        final IPreferenceStore store = TourbookPlugin.getDefault().getPreferenceStore();
        final RGB dimColor = PreferenceConverter.getColor(store, ITourbookPreferences.MAP_LAYOUT_MAP_DIMM_COLOR);
        map.setDimLevel(_mapView.getMapDimLevel(), dimColor);

        // update tooltip, show selected map provider
        setToolTipText(mp.getName());
    }
项目:JuliaDT    文件:JuliaEditorPreferencesInitializer.java   
public void initializeDefaultPreferences() {
  IPreferenceStore store = JuliaEditorPlugin.getDefault().getPreferenceStore();
  EditorsUI.useAnnotationsPreferencePage(store);
  EditorsUI.useQuickDiffPreferencePage(store);
  PreferenceConstants.initializeDefaultValues(store);
  PreferenceConverter.setDefault(store, JuliaColourConstants.COMMENT, COMMENT_COLOUR);
  PreferenceConverter.setDefault(store, JuliaColourConstants.KEYWORD, KEYWORD_COLOUR);
  PreferenceConverter.setDefault(store, JuliaColourConstants.STRING, STRING_COLOUR);

  store.setDefault(JuliaColourConstants.COMMENT + PreferenceConstants.EDITOR_BOLD_SUFFIX, false);
  store
      .setDefault(JuliaColourConstants.COMMENT + PreferenceConstants.EDITOR_ITALIC_SUFFIX, false);

  store.setDefault(JuliaColourConstants.KEYWORD + PreferenceConstants.EDITOR_BOLD_SUFFIX, true);
  store
      .setDefault(JuliaColourConstants.KEYWORD + PreferenceConstants.EDITOR_ITALIC_SUFFIX, false);

  store.setDefault(PreferenceConstants.EDITOR_TAB_WIDTH, 4);
  store.setDefault(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE, true);

  store.setDefault(CodeFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.TAB);
  store.setDefault(CodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  store.setDefault(CodeFormatterConstants.FORMATTER_INDENTATION_SIZE, "4");
}
项目:SMVHunter    文件:LogCatPanel.java   
private void setupDefaultPreferences() {
    PreferenceConverter.setDefault(mPrefStore, LogCatPanel.LOGCAT_VIEW_FONT_PREFKEY,
            DEFAULT_LOGCAT_FONTDATA);
    mPrefStore.setDefault(LogCatMessageList.MAX_MESSAGES_PREFKEY,
            LogCatMessageList.MAX_MESSAGES_DEFAULT);
    mPrefStore.setDefault(DISPLAY_FILTERS_COLUMN_PREFKEY, true);

    /* Default Colors for different log levels. */
    PreferenceConverter.setDefault(mPrefStore, LogCatPanel.VERBOSE_COLOR_PREFKEY,
            new RGB(0, 0, 0));
    PreferenceConverter.setDefault(mPrefStore, LogCatPanel.DEBUG_COLOR_PREFKEY,
            new RGB(0, 0, 127));
    PreferenceConverter.setDefault(mPrefStore, LogCatPanel.INFO_COLOR_PREFKEY,
            new RGB(0, 127, 0));
    PreferenceConverter.setDefault(mPrefStore, LogCatPanel.WARN_COLOR_PREFKEY,
            new RGB(255, 127, 0));
    PreferenceConverter.setDefault(mPrefStore, LogCatPanel.ERROR_COLOR_PREFKEY,
            new RGB(255, 0, 0));
    PreferenceConverter.setDefault(mPrefStore, LogCatPanel.ASSERT_COLOR_PREFKEY,
            new RGB(255, 0, 0));
}
项目:velocity-edit    文件:VelocityColorProvider.java   
/**
 * Set default colors in given preference store.
 */
public static void initializeDefaults(IPreferenceStore aStore)
{
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DEFAULT, RGB_DEFAULT);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_TAG, RGB_DIRECTIVE);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_SCRIPT, RGB_SCRIPT);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_COMMENT, RGB_COMMENT);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DOC_COMMENT, RGB_DOC_COMMENT);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DIRECTIVE, RGB_DIRECTIVE);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_STRING, RGB_STRING);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_REFERENCE, RGB_REFERENCE);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_STRING_REFERENCE, RGB_STRING_REFERENCE);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_RGB_HTML_String, RGB_HTML_String);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_RGB_HTML_ENDTAG, RGB_HTML_ENDTAG);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_RGB_HTML_TAG, RGB_HTML_TAG);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_RGB_HTML_ATTRIBUTE, RGB_HTML_ATTRIBUTE);
}
项目:velocity-edit    文件:VelocityColorProvider.java   
/**
 * Returns specified color that is stored in the color table. If color not
 * found in color table then a new instance is created from according
 * preferences value and stored in color table.
 */
public Color getColor(String aName)
{
    Color color = (Color) fColorTable.get(aName);
    if (color == null)
    {
        IPreferenceStore store = VelocityPlugin.getDefault().getPreferenceStore();
        RGB rgb = PreferenceConverter.getColor(store, aName);
        if (rgb != null)
        {
            color = new Color(Display.getCurrent(), rgb);
        } else
        {
            color = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
            VelocityPlugin.logErrorMessage("Undefined color '" + aName + "'");
        }
        fColorTable.put(aName, color);
    }
    return color;
}
项目:velocity-edit    文件:EditorPreferencePage.java   
/**
 * 
 */
public static void initDefaults(IPreferenceStore aStore)
{
    PreferenceConverter.setDefault(aStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB());
    aStore.setDefault(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, true);
    PreferenceConverter.setDefault(aStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB());
    aStore.setDefault(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, true);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DEFAULT, RGB_DEFAULT);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_TAG, RGB_DIRECTIVE);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_SCRIPT, RGB_SCRIPT);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_COMMENT, RGB_COMMENT);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DOC_COMMENT, RGB_DOC_COMMENT);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DIRECTIVE, RGB_DIRECTIVE);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_STRING, RGB_STRING);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_REFERENCE, RGB_REFERENCE);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_STRING_REFERENCE, RGB_STRING_REFERENCE);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_RGB_HTML_String, RGB_HTML_String);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_RGB_HTML_ENDTAG, RGB_HTML_ENDTAG);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_RGB_HTML_TAG, RGB_HTML_TAG);
    PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_RGB_HTML_ATTRIBUTE, RGB_HTML_ATTRIBUTE);
}
项目:mytourbook    文件:PhotoUI.java   
/**
 * Set photo colors in the JFace color registry from the pref store
 */
public static void setPhotoColorsFromPrefStore() {

    // pref store var cannot be set from a static field because it can be null !!!
    final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();

    final ColorRegistry colorRegistry = JFaceResources.getColorRegistry();

    colorRegistry.put(IPhotoPreferences.PHOTO_VIEWER_COLOR_FOREGROUND, //
            PreferenceConverter.getColor(prefStore, IPhotoPreferences.PHOTO_VIEWER_COLOR_FOREGROUND));

    colorRegistry.put(IPhotoPreferences.PHOTO_VIEWER_COLOR_BACKGROUND, //
            PreferenceConverter.getColor(prefStore, IPhotoPreferences.PHOTO_VIEWER_COLOR_BACKGROUND));

    colorRegistry.put(IPhotoPreferences.PHOTO_VIEWER_COLOR_SELECTION_FOREGROUND, //
            PreferenceConverter.getColor(prefStore, IPhotoPreferences.PHOTO_VIEWER_COLOR_SELECTION_FOREGROUND));

    colorRegistry.put(IPhotoPreferences.PHOTO_VIEWER_COLOR_FOLDER, //
            PreferenceConverter.getColor(prefStore, IPhotoPreferences.PHOTO_VIEWER_COLOR_FOLDER));

    colorRegistry.put(IPhotoPreferences.PHOTO_VIEWER_COLOR_FILE, //
            PreferenceConverter.getColor(prefStore, IPhotoPreferences.PHOTO_VIEWER_COLOR_FILE));
}
项目:SPELL    文件:ConfigurationManager.java   
@Override
public Color getColor(String preferenceName)
{
    if (!m_colors.containsKey(preferenceName))
    {
        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));
    }
    return m_colors.get(preferenceName);
}
项目:SPELL    文件:ConfigurationManager.java   
@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));
    }
}
项目:SPELL    文件:GUIPreferencesSaver.java   
/***************************************************************************
 * 
 **************************************************************************/
private void dumpFonts(IPreferenceStore store, PrintWriter writer)
{
    writer.println("        <fonts>");
    for (FontKey key : FontKey.values())
    {
        try
        {
            FontData data = PreferenceConverter.getFontData(store,
                    key.getPreferenceName());
            String styleStr = "norm";
            if (data.getStyle() == SWT.BOLD) styleStr = "bold";
            if (data.getStyle() == SWT.ITALIC) styleStr = "italic";
            if (data.getStyle() == (SWT.BOLD | SWT.ITALIC)) styleStr = "bold-italic";
            dumpFont(key.tag, data.getName(),
                    Integer.toString((int) data.height), styleStr, writer);
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }
    writer.println("        </fonts>");
}