use of org.sonarlint.intellij.ui.nodes.SummaryNode in project sonarlint-intellij by SonarSource.
the class FlowsTreeModelBuilder method setSingleFlow.
private void setSingleFlow(LiveIssue.Flow flow, RangeMarker rangeMarker, @Nullable String message) {
summary = new SummaryNode();
LocationNode primaryLocation = new LocationNode(rangeMarker, message);
primaryLocation.setBold(true);
summary.add(primaryLocation);
List<LiveIssue.IssueLocation> reversedLocations = new ArrayList<>(flow.locations());
Collections.reverse(reversedLocations);
int i = 1;
for (LiveIssue.IssueLocation location : reversedLocations) {
LocationNode locationNode = new LocationNode(i++, location.location(), location.message());
primaryLocation.add(locationNode);
}
model.setRoot(summary);
}
use of org.sonarlint.intellij.ui.nodes.SummaryNode 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);
}
use of org.sonarlint.intellij.ui.nodes.SummaryNode in project sonarlint-intellij by SonarSource.
the class FlowsTreeModelBuilder method setFlatList.
private void setFlatList(List<LiveIssue.Flow> flows, RangeMarker rangeMarker, @Nullable String message) {
summary = new SummaryNode();
LocationNode primaryLocation = new LocationNode(rangeMarker, message);
primaryLocation.setBold(true);
summary.add(primaryLocation);
flows.stream().flatMap(flow -> flow.locations().stream()).sorted(Comparator.comparing(i -> i.location().getStartOffset())).forEachOrdered(location -> {
LocationNode locationNode = new LocationNode(location.location(), location.message());
primaryLocation.add(locationNode);
});
model.setRoot(summary);
}
use of org.sonarlint.intellij.ui.nodes.SummaryNode in project sonarlint-intellij by SonarSource.
the class FlowsTreeModelBuilder method createModel.
public DefaultTreeModel createModel() {
summary = new SummaryNode();
model = new DefaultTreeModel(summary);
model.setRoot(summary);
return model;
}
use of org.sonarlint.intellij.ui.nodes.SummaryNode in project sonarlint-intellij by SonarSource.
the class IssueTreeModelBuilder method createModel.
/**
* Creates the model with a basic root
*/
public DefaultTreeModel createModel() {
summary = new SummaryNode();
model = new DefaultTreeModel(summary);
model.setRoot(summary);
return model;
}
Aggregations