From cf4d6d4abccbd9d311f61ac7e414fa01d2cade52 Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Tue, 6 Sep 2016 15:21:44 -0400 Subject: [PATCH] tmf: Update next input in custom parser wizard when removing input When removing an input that has a previous input child to the same parent input, the previous input's next input reference should be updated to the next input of the removed input. Otherwise the removed input may remain as a ghost next input and interfere with the previous input's child inputs. This is only a problem when testing the parsing of sample trace text from within the custom parser wizard, since the next input relation is not stored in the XML definition, it is always rebuilt from the parent-child relations when loading the definition from file into memory. Change-Id: I3531d705a46f13ac164325cd875e53d59b95ef1c Signed-off-by: Patrick Tasse Reviewed-on: https://git.eclipse.org/r/80516 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam Tested-by: Matthew Khouzam --- .../ui/parsers/wizards/CustomTxtParserInputWizardPage.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java index dde744266c..8f5c98f133 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java @@ -261,6 +261,10 @@ public class CustomTxtParserInputWizardPage extends WizardPage { if (inputLine.parentInput == null) { definition.inputs.remove(inputLine); } else { + int index = inputLine.parentInput.childrenInputs.indexOf(inputLine); + if (index > 0) { + inputLine.parentInput.childrenInputs.get(index - 1).nextInput = inputLine.nextInput; + } inputLine.parentInput.childrenInputs.remove(inputLine); } treeViewer.refresh(); -- 2.34.1