Package org.erlide.ui.prefs

Examples of org.erlide.ui.prefs.TokenHighlight


        }
        super.dispose();
    }

    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));
View Full Code Here


                // do nothing
            }

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final TokenHighlight item = getHighlight();
                final HighlightStyle data = item.getStyle(fOverlayStore);
                if (data == null) {
                    return;
                }
                data.setColor(fSyntaxForegroundColorEditor.getColorValue());
                storeHighlight(fOverlayStore, item, data);
                fPreviewViewer.invalidateTextPresentation();
            }
        });

        fBoldCheckBox.addSelectionListener(new SelectionListener() {
            @Override
            public void widgetDefaultSelected(final SelectionEvent e) {
                // do nothing
            }

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final TokenHighlight item = getHighlight();
                final HighlightStyle data = item.getStyle(fOverlayStore);
                if (data == null) {
                    return;
                }
                data.setStyle(SWT.BOLD, fBoldCheckBox.getSelection());
                storeHighlight(fOverlayStore, item, data);
                fPreviewViewer.invalidateTextPresentation();
            }
        });

        fItalicCheckBox.addSelectionListener(new SelectionListener() {
            @Override
            public void widgetDefaultSelected(final SelectionEvent e) {
                // do nothing
            }

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final TokenHighlight item = getHighlight();
                final HighlightStyle data = item.getStyle(fOverlayStore);
                if (data == null) {
                    return;
                }
                data.setStyle(SWT.ITALIC, fItalicCheckBox.getSelection());
                storeHighlight(fOverlayStore, item, data);
            }
        });
        fStrikethroughCheckBox.addSelectionListener(new SelectionListener() {
            @Override
            public void widgetDefaultSelected(final SelectionEvent e) {
                // do nothing
            }

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final TokenHighlight item = getHighlight();
                final HighlightStyle data = item.getStyle(fOverlayStore);
                if (data == null) {
                    return;
                }
                data.setStyle(TextAttribute.STRIKETHROUGH,
                        fStrikethroughCheckBox.getSelection());
                storeHighlight(fOverlayStore, item, data);
            }
        });

        fUnderlineCheckBox.addSelectionListener(new SelectionListener() {
            @Override
            public void widgetDefaultSelected(final SelectionEvent e) {
                // do nothing
            }

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final TokenHighlight item = getHighlight();
                final HighlightStyle data = item.getStyle(fOverlayStore);
                if (data == null) {
                    return;
                }
                data.setStyle(TextAttribute.UNDERLINE, fUnderlineCheckBox.getSelection());
                storeHighlight(fOverlayStore, item, data);
View Full Code Here

TOP

Related Classes of org.erlide.ui.prefs.TokenHighlight

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.