public void selectionChanged(final SelectionChangedEvent event) {
handleSyntaxColorListSelection();
}
});
foregroundColorButton.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.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() {
@Override
public void widgetDefaultSelected(final SelectionEvent e) {
// do nothing
}