add problems listener to update counter

This commit is contained in:
Konstantin Bulenkov
2014-07-21 18:25:08 +02:00
parent 22a3964246
commit 02939b8f7c
2 changed files with 12 additions and 2 deletions
@@ -45,9 +45,11 @@ public class ErrorPaneConfigurable extends JPanel implements Configurable, Dispo
private final Alarm myAlarm;
private final ArrayList<ConfigurationError> myErrors = new ArrayList<ConfigurationError>();
private final JTextPane myContent = new JTextPane();
private Runnable myOnErrorsChanged;
public ErrorPaneConfigurable(final Project project, StructureConfigurableContext context) {
public ErrorPaneConfigurable(final Project project, StructureConfigurableContext context, Runnable onErrorsChanged) {
super(new BorderLayout());
myOnErrorsChanged = onErrorsChanged;
myContent.setEditorKit(UIUtil.getHTMLEditorKit());
myContent.setEditable(false);
myContent.setBackground(UIUtil.getListBackground());
@@ -148,6 +150,9 @@ public class ErrorPaneConfigurable extends JPanel implements Configurable, Dispo
}
html += "</ol></body></html>";
myContent.setText(html);
if (myOnErrorsChanged != null) {
myOnErrorsChanged.run();
}
}
}, 100);
}
@@ -302,7 +302,12 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
}
private void addErrorPane() {
addConfigurable(new ErrorPaneConfigurable(myProject, myContext), true);
addConfigurable(new ErrorPaneConfigurable(myProject, myContext, new Runnable() {
@Override
public void run() {
mySidePanel.getList().repaint();
}
}), true);
}
private void addGlobalLibrariesConfig() {