From 5ee0501716a5aeaddd05a679f59cc868ba443799 Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Thu, 22 May 2014 11:56:01 -0400 Subject: [PATCH] tmf: Fix custom parser wizard preview table Since the preview table is built using a temporary trace file with a fixed name, its persistent index was not being rebuilt when the parser and/or the preview input was changed. The preview table is now built using a trace class implementation that is overridden to use the in-memory checkpoint indexer. Change-Id: I5cd04f26dea7ab005823317fed68130477bf8e0d Signed-off-by: Patrick Tasse Reviewed-on: https://git.eclipse.org/r/27124 Reviewed-by: Bernd Hufmann Tested-by: Bernd Hufmann Tested-by: Hudson CI --- .../wizards/CustomTxtParserOutputWizardPage.java | 11 +++++++++-- .../wizards/CustomXmlParserOutputWizardPage.java | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java index 0136eb0b1a..dce509a0cd 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java @@ -24,10 +24,12 @@ import org.eclipse.linuxtools.internal.tmf.ui.Activator; import org.eclipse.linuxtools.internal.tmf.ui.Messages; import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomEventsTable; import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; +import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTraceDefinition.OutputColumn; import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTxtTrace; import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTxtTraceDefinition; -import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTraceDefinition.OutputColumn; import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange; +import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer; +import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.ScrolledComposite; @@ -222,7 +224,12 @@ public class CustomTxtParserOutputWizardPage extends WizardPage { } try { - final CustomTxtTrace trace = new CustomTxtTrace(null, definition, tmpFile.getAbsolutePath(), CACHE_SIZE); + final CustomTxtTrace trace = new CustomTxtTrace(null, definition, tmpFile.getAbsolutePath(), CACHE_SIZE) { + @Override + protected ITmfTraceIndexer createIndexer(int interval) { + return new TmfCheckpointIndexer(this, interval); + } + }; trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, false); previewTable.dispose(); previewTable = new CustomEventsTable(definition, tableContainer, CACHE_SIZE); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java index a43674b961..bed243744d 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java @@ -25,10 +25,12 @@ import org.eclipse.linuxtools.internal.tmf.ui.Messages; import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomEventsTable; import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTraceDefinition; +import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTraceDefinition.OutputColumn; import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomXmlTrace; import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomXmlTraceDefinition; -import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTraceDefinition.OutputColumn; import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange; +import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer; +import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.ScrolledComposite; @@ -223,7 +225,12 @@ public class CustomXmlParserOutputWizardPage extends WizardPage { } try { - final CustomXmlTrace trace = new CustomXmlTrace(null, definition, tmpFile.getAbsolutePath(), CACHE_SIZE); + final CustomXmlTrace trace = new CustomXmlTrace(null, definition, tmpFile.getAbsolutePath(), CACHE_SIZE) { + @Override + protected ITmfTraceIndexer createIndexer(int interval) { + return new TmfCheckpointIndexer(this, interval); + } + }; trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, false); previewTable.dispose(); previewTable = new CustomEventsTable(definition, tableContainer, CACHE_SIZE); -- 2.34.1