void handleSyntaxColorListSelection() { final TokenHighlight item = getHighlight(); fEnableCheckbox.setEnabled(item != null); fSyntaxForegroundColorEditor.getButton().setEnabled(item != null); fColorEditorLabel.setEnabled(item != null); fBoldCheckBox.setEnabled(item != null); fItalicCheckBox.setEnabled(item != null); fStrikethroughCheckBox.setEnabled(item != null); fUnderlineCheckBox.setEnabled(item != null); if (item == null) { return; } final HighlightStyle style = item.getStyle(fOverlayStore); fSyntaxForegroundColorEditor.setColorValue(style.getColor()); fBoldCheckBox.setSelection(style.hasStyle(SWT.BOLD)); fItalicCheckBox.setSelection(style.hasStyle(SWT.ITALIC)); fStrikethroughCheckBox.setSelection(style.hasStyle(TextAttribute.STRIKETHROUGH)); fUnderlineCheckBox.setSelection(style.hasStyle(TextAttribute.UNDERLINE)); // if (item instanceof SemanticHighlightingColorListItem) { // fEnableCheckbox.setEnabled(true); // final boolean enable = getPreferenceStore().getBoolean( // ((SemanticHighlightingColorListItem) item).getEnableKey()); // fEnableCheckbox.setSelection(enable); // fSyntaxForegroundColorEditor.getButton().setEnabled(enable); // fColorEditorLabel.setEnabled(enable); // fBoldCheckBox.setEnabled(enable); // fItalicCheckBox.setEnabled(enable); // fStrikethroughCheckBox.setEnabled(enable); // fUnderlineCheckBox.setEnabled(enable); // } }
public void storeHighlight( final IPreferenceStore store, final TokenHighlight th, HighlightStyle style) { if (store != null) { store.setValue(th.getColorKey(), StringConverter.asString(style.getColor())); store.setValue(th.getStylesKey(), style.getStyles()); } }
private void loadDefaultEditorColors() { final IPreferenceStore rootStore = getPreferenceStore(); for (final TokenHighlight th : TokenHighlight.values()) { final HighlightStyle data = th.getDefaultStyle(); rootStore.setDefault(th.getColorKey(), StringConverter.asString(data.getColor())); rootStore.setDefault(th.getStylesKey(), data.getStyles()); } }