The color settings can be changed in Window > Preferences > General >
Appearance > Colors and Fonts > Tracing.
Change-Id: I3bda3530657797cf434e86a7e6055a64066a4e51
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/45177
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
themes.category.label = Tracing
font.eventtable.label = Trace event table font
font.eventraw.label = Trace event raw text font
themes.category.label = Tracing
font.eventtable.label = Trace event table font
font.eventraw.label = Trace event raw text font
+color.eventtable.highlight.label = Trace event table highlight color
# Tracing wizards
project.new.category.name = Tracing
# Tracing wizards
project.new.category.name = Tracing
isEditable="true"
label="%font.eventraw.label">
</fontDefinition>
isEditable="true"
label="%font.eventraw.label">
</fontDefinition>
+ <colorDefinition
+ categoryId="org.eclipse.tracecompass.tmf.ui.theme.category"
+ id="org.eclipse.tracecompass.tmf.ui.color.eventtable.highlight"
+ isEditable="true"
+ label="%color.eventtable.highlight.label"
+ value="COLOR_YELLOW">
+ </colorDefinition>
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventFilterAppliedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventSearchAppliedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventSelectedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventFilterAppliedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventSearchAppliedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventSelectedSignal;
-import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
+import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
private static final boolean IS_LINUX = System.getProperty("os.name").contains("Linux") ? true : false; //$NON-NLS-1$ //$NON-NLS-2$
private static final String FONT_DEFINITION_ID = "org.eclipse.tracecompass.tmf.ui.font.eventtable"; //$NON-NLS-1$
private static final boolean IS_LINUX = System.getProperty("os.name").contains("Linux") ? true : false; //$NON-NLS-1$ //$NON-NLS-2$
private static final String FONT_DEFINITION_ID = "org.eclipse.tracecompass.tmf.ui.font.eventtable"; //$NON-NLS-1$
+ private static final String HIGHLIGHT_COLOR_DEFINITION_ID = "org.eclipse.tracecompass.tmf.ui.color.eventtable.highlight"; //$NON-NLS-1$
private static final Image BOOKMARK_IMAGE = Activator.getDefault().getImageFromPath(
"icons/elcl16/bookmark_obj.gif"); //$NON-NLS-1$
private static final Image BOOKMARK_IMAGE = Activator.getDefault().getImageFromPath(
"icons/elcl16/bookmark_obj.gif"); //$NON-NLS-1$
private LocalResourceManager fResourceManager = new LocalResourceManager(JFaceResources.getResources());
private Color fGrayColor;
private Color fGreenColor;
private LocalResourceManager fResourceManager = new LocalResourceManager(JFaceResources.getResources());
private Color fGrayColor;
private Color fGreenColor;
+ private Color fHighlightColor;
private Font fFont;
private Font fBoldFont;
private Font fFont;
private Font fBoldFont;
createResources();
initializeFonts();
createResources();
initializeFonts();
PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(this);
ColorSettingsManager.addColorSettingsListener(this);
PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(this);
ColorSettingsManager.addColorSettingsListener(this);
int start = matcher.start();
int length = matcher.end() - start;
Color foreground = colorSetting.getForegroundColor();
int start = matcher.start();
int length = matcher.end() - start;
Color foreground = colorSetting.getForegroundColor();
- Color background = item.getDisplay().getSystemColor(SWT.COLOR_YELLOW);
+ Color background = fHighlightColor;
StyleRange styleRange = new StyleRange(start, length, foreground, background);
styleRange.data = index;
styleRanges.add(styleRange);
StyleRange styleRange = new StyleRange(start, length, foreground, background);
styleRange.data = index;
styleRanges.add(styleRange);
/* Column header font cannot be set. See Bug 63038 */
}
/* Column header font cannot be set. See Bug 63038 */
}
+ /**
+ * Initialize the colors.
+ * @since 1.0
+ */
+ protected void initializeColors() {
+ ColorRegistry colorRegistry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+ fHighlightColor = colorRegistry.get(HIGHLIGHT_COLOR_DEFINITION_ID);
+ }
+
initializeFonts();
fTable.refresh();
}
initializeFonts();
fTable.refresh();
}
+ if ((IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty())) ||
+ (HIGHLIGHT_COLOR_DEFINITION_ID.equals(event.getProperty()))) {
+ initializeColors();
+ fTable.refresh();
+ }