private JEditorPane measuresEditor;
private JScrollPane scmTab;
private JEditorPane scmEditor;
+ private JScrollPane activeRuleTab;
+ private JEditorPane activeRuleEditor;
/**
* Create the application.
metadata = reader.readMetadata();
updateTitle();
loadComponents();
+ updateActiveRules();
}
private void loadComponents() {
}
}
+ private void updateActiveRules() {
+ activeRuleEditor.setText("");
+
+ StringBuilder builder = new StringBuilder();
+ try (CloseableIterator<ScannerReport.ActiveRule> activeRuleCloseableIterator = reader.readActiveRules()) {
+ while (activeRuleCloseableIterator.hasNext()) {
+ builder.append(activeRuleCloseableIterator.next().toString()).append("\n");
+ }
+ activeRuleEditor.setText(builder.toString());
+ }
+ }
+
private void updateHighlighting(Component component) {
highlightingEditor.setText("");
try (CloseableIterator<ScannerReport.SyntaxHighlightingRule> it = reader.readComponentSyntaxHighlighting(component.getRef())) {
scmEditor = new JEditorPane();
scmTab.setViewportView(scmEditor);
+ activeRuleTab = new JScrollPane();
+ tabbedPane.addTab("ActiveRules", null, activeRuleTab, null);
+
+ activeRuleEditor = new JEditorPane();
+ activeRuleTab.setViewportView(activeRuleEditor);
+
treeScrollPane = new JScrollPane();
treeScrollPane.setPreferredSize(new Dimension(200, 400));
splitPane.setLeftComponent(treeScrollPane);