tmf: Update next input in custom parser wizard when removing input
authorPatrick Tasse <patrick.tasse@gmail.com>
Tue, 6 Sep 2016 19:21:44 +0000 (15:21 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Thu, 22 Sep 2016 17:07:49 +0000 (13:07 -0400)
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 <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/80516
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java

index dde744266ccb78e5765495b6f867f16382079a84..8f5c98f133f215ef945053b456ca266bc6cdf7c2 100644 (file)
@@ -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();
This page took 0.030828 seconds and 5 git commands to generate.