Package org.erlide.ui.prefs

Examples of org.erlide.ui.prefs.HighlightStyle


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


            }

            @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);
            }
        });

        fEnableCheckbox.addSelectionListener(new SelectionListener() {
View Full Code Here

    }

    @Override
    public boolean performOk() {
        for (final TokenHighlight th : fColors) {
            final HighlightStyle data = th.getStyle(fOverlayStore);
            storeHighlight(fOverlayStore, th, data);
        }
        fOverlayStore.propagate();
        return super.performOk();
    }
View Full Code Here

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

    // "when", "bnot", "not", "div", "rem", "band", "and", "bor", "bxor",
    // "bsl", "bsr", "or", "xor", "spec", });

    protected TextAttribute getTextAttribute(final TokenHighlight th) {
        final IPreferenceStore store = ErlideUIPlugin.getDefault().getPreferenceStore();
        final HighlightStyle data = th.getStyle(store);
        // load from prefsstore
        return new TextAttribute(fColorManager.getColor(data.getColor()), null,
                data.getStyles());
    }
View Full Code Here

TOP

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

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.