Search in sources :

Example 6 with TokenHighlight

use of org.erlide.ui.prefs.TokenHighlight in project erlide_eclipse by erlang.

the class ColoringPreferencePage method handleSyntaxColorListSelection.

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);
// }
}
Also used : HighlightStyle(org.erlide.ui.prefs.HighlightStyle) TokenHighlight(org.erlide.ui.prefs.TokenHighlight)

Aggregations

TokenHighlight (org.erlide.ui.prefs.TokenHighlight)6 HighlightStyle (org.erlide.ui.prefs.HighlightStyle)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 ColorManager (org.erlide.ui.util.ColorManager)2 IColorManager (org.erlide.ui.util.IColorManager)2 OverlayPreferenceStore (org.erlide.ui.util.OverlayPreferenceStore)2 ColorSelector (org.eclipse.jface.preference.ColorSelector)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 Document (org.eclipse.jface.text.Document)1 IDocument (org.eclipse.jface.text.IDocument)1 SourceViewer (org.eclipse.jface.text.source.SourceViewer)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 ViewerComparator (org.eclipse.jface.viewers.ViewerComparator)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 SelectionListener (org.eclipse.swt.events.SelectionListener)1 Cursor (org.eclipse.swt.graphics.Cursor)1