diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ConfigurationError.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ConfigurationError.java index 4a60f0d041b1..fdd29a300176 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ConfigurationError.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ConfigurationError.java @@ -15,7 +15,6 @@ */ package com.intellij.openapi.roots.ui.configuration; -import com.intellij.util.messages.Topic; import org.jetbrains.annotations.NotNull; /** @@ -66,7 +65,14 @@ public abstract class ConfigurationError implements Comparable 0) { if (errors.size() == 1) { - add(wrapLabel(mySingleErrorLabel), BorderLayout.CENTER); + add(wrapLabel(mySingleErrorLabel, errors.get(0)), BorderLayout.CENTER); + mySingleErrorLabel.setToolTipText(errors.get(0).getDescription()); } else { add(myErrorsLabel, BorderLayout.CENTER); } @@ -539,7 +553,7 @@ public class ConfigurationErrorsComponent extends JPanel implements Disposable, repaint(); } - private JComponent wrapLabel(@NotNull final JLabel label) { + private JComponent wrapLabel(@NotNull final JLabel label, @NotNull final ConfigurationError configurationError) { final JPanel result = new JPanel(new BorderLayout()); result.setBackground(label.getBackground()); result.add(label, BorderLayout.CENTER); @@ -547,27 +561,47 @@ public class ConfigurationErrorsComponent extends JPanel implements Disposable, final JPanel buttonsPanel = new JPanel(); buttonsPanel.setOpaque(false); buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS)); - buttonsPanel.add(new ToolbarAlikeButton(FIX) { + + if (configurationError.canBeFixed()) { + buttonsPanel.add(new ToolbarAlikeButton(FIX) { + { + setToolTipText("Fix error"); + } + + @Override + public void onClick() { + final Object o = myModel.getElementAt(0); + if (o instanceof ConfigurationError) { + ((ConfigurationError)o).fix(); + updateView(); + final Container ancestor = SwingUtilities.getAncestorOfClass(ConfigurationErrorsComponent.class, this); + if (ancestor != null && ancestor instanceof JComponent) { + ((JComponent)ancestor).revalidate(); + ancestor.repaint(); + } + } + } + }); + + buttonsPanel.add(Box.createHorizontalStrut(3)); + } + + buttonsPanel.add(new ToolbarAlikeButton(NAVIGATE) { { - setToolTipText("Fix error"); + setToolTipText("Navigate to error"); } @Override public void onClick() { final Object o = myModel.getElementAt(0); if (o instanceof ConfigurationError) { - ((ConfigurationError)o).fix(); - updateView(); - final Container ancestor = SwingUtilities.getAncestorOfClass(ConfigurationErrorsComponent.class, this); - if (ancestor != null && ancestor instanceof JComponent) { - ((JComponent)ancestor).revalidate(); - ancestor.repaint(); - } + ((ConfigurationError)o).navigate(); } } }); buttonsPanel.add(Box.createHorizontalStrut(3)); + buttonsPanel.add(new ToolbarAlikeButton(IGNORE) { { setToolTipText("Ignore error"); diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectConfigurable.java index 42106158bcc3..9f7b743c4448 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectConfigurable.java @@ -348,6 +348,10 @@ public class ProjectConfigurable extends NamedConfigurable implements D @Override public void fix() { } + + @Override + public void navigate() { + } } private class MyJPanel extends JPanel { diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectConfigurationProblems.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectConfigurationProblems.java index b0f25e5bb636..bae70d3391ca 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectConfigurationProblems.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectConfigurationProblems.java @@ -87,6 +87,10 @@ public class ProjectConfigurationProblems { super(description.getMessage(), description.getMessage()); } + @Override + public void navigate() { + } + @Override public void fix() { }