Search in sources :

Example 1 with LabelNode

use of org.sonarlint.intellij.ui.nodes.LabelNode in project sonarlint-intellij by SonarSource.

the class FlowsTreeModelBuilder method setMultipleFlows.

private void setMultipleFlows(List<LiveIssue.Flow> flows, RangeMarker rangeMarker, @Nullable String message) {
    summary = new SummaryNode();
    LocationNode primaryLocation = new LocationNode(rangeMarker, message);
    summary.add(primaryLocation);
    int i = 1;
    for (LiveIssue.Flow f : flows) {
        LabelNode label = new LabelNode("Flow " + i);
        primaryLocation.add(label);
        List<LiveIssue.IssueLocation> reversedLocations = new ArrayList<>(f.locations());
        Collections.reverse(reversedLocations);
        int j = 1;
        for (LiveIssue.IssueLocation location : reversedLocations) {
            LocationNode locationNode = new LocationNode(j, location.location(), location.message());
            label.add(locationNode);
            j++;
        }
        i++;
    }
    model.setRoot(summary);
}
Also used : LabelNode(org.sonarlint.intellij.ui.nodes.LabelNode) LiveIssue(org.sonarlint.intellij.issue.LiveIssue) SummaryNode(org.sonarlint.intellij.ui.nodes.SummaryNode) LocationNode(org.sonarlint.intellij.ui.nodes.LocationNode) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 LiveIssue (org.sonarlint.intellij.issue.LiveIssue)1 LabelNode (org.sonarlint.intellij.ui.nodes.LabelNode)1 LocationNode (org.sonarlint.intellij.ui.nodes.LocationNode)1 SummaryNode (org.sonarlint.intellij.ui.nodes.SummaryNode)1