diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java index b2b0091fc949..601ec7957849 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java @@ -38,7 +38,7 @@ import java.util.Collections; import java.util.List; public class HotSwapProgressImpl extends HotSwapProgress{ - static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("HotSwap", ToolWindowId.DEBUG, true); + static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("HotSwap", ToolWindowId.DEBUG); TIntObjectHashMap> myMessages = new TIntObjectHashMap>(); private final ProgressWindow myProgressWindow; diff --git a/java/testFramework/src/com/intellij/testFramework/CompilerTester.java b/java/testFramework/src/com/intellij/testFramework/CompilerTester.java index 00780b9b76ce..a3c05c6ec3fd 100644 --- a/java/testFramework/src/com/intellij/testFramework/CompilerTester.java +++ b/java/testFramework/src/com/intellij/testFramework/CompilerTester.java @@ -232,7 +232,7 @@ public class CompilerTester { CompilerMessage[] messages = compileContext.getMessages(category); for (CompilerMessage message : messages) { final String text = message.getMessage(); - if (category != CompilerMessageCategory.INFORMATION || !(text.startsWith("Compilation completed successfully") || text.startsWith("Using javac"))) { + if (category != CompilerMessageCategory.INFORMATION || !(text.contains("Compilation completed successfully") || text.startsWith("Using javac"))) { myMessages.add(message); } } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/AbstractExternalSystemToolWindowFactory.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/AbstractExternalSystemToolWindowFactory.java index 1e08045faeea..a5bf2827ef26 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/AbstractExternalSystemToolWindowFactory.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/AbstractExternalSystemToolWindowFactory.java @@ -28,6 +28,8 @@ import com.intellij.ui.content.ContentManager; import com.intellij.ui.content.impl.ContentImpl; import org.jetbrains.annotations.NotNull; +import java.util.Locale; + /** * @author Denis Zhdanov * @since 5/13/13 4:15 PM @@ -39,9 +41,8 @@ public abstract class AbstractExternalSystemToolWindowFactory implements ToolWin protected AbstractExternalSystemToolWindowFactory(@NotNull ProjectSystemId id) { myExternalSystemId = id; - myNotificationGroup = NotificationGroup.toolWindowGroup("notification.group.id." + id.toString().toLowerCase(), - myExternalSystemId.getReadableName(), - true); + myNotificationGroup = NotificationGroup.toolWindowGroup("notification.group.id." + id.toString().toLowerCase(Locale.ENGLISH), + myExternalSystemId.getReadableName()); } @Override diff --git a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java index 0d15a272498c..b6c300c3f7e2 100644 --- a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java +++ b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java @@ -31,6 +31,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; +import com.intellij.openapi.ui.Messages; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.ui.content.Content; import com.intellij.util.ObjectUtils; @@ -65,18 +66,19 @@ public class ExecutionUtil { @NotNull final String toolWindowId, @NotNull String taskName, @NotNull ExecutionException e) { - if (e instanceof RunCanceledByUserException) return; + if (e instanceof RunCanceledByUserException) { + return; + } LOG.debug(e); String description = e.getMessage(); - HyperlinkListener listener = null; - if (description == null) { LOG.warn("Execution error without description", e); description = "Unknown error"; } + HyperlinkListener listener = null; if ((description.contains("87") || description.contains("111") || description.contains("206")) && e instanceof ProcessNotCreatedException && !PropertiesComponent.getInstance(project).isTrueValue("dynamic.classpath")) { @@ -110,7 +112,14 @@ public class ExecutionUtil { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - ToolWindowManager.getInstance(project).notifyByBalloon(toolWindowId, MessageType.ERROR, fullMessage, null, finalListener); + ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project); + if (toolWindowManager.canShowNotification(toolWindowId)) { + //noinspection SSBasedInspection + toolWindowManager.notifyByBalloon(toolWindowId, MessageType.ERROR, fullMessage, null, finalListener); + } + else { + Messages.showErrorDialog(project, fullMessage, ""); + } NotificationListener notificationListener = ObjectUtils.tryCast(finalListener, NotificationListener.class); ourNotificationGroup.createNotification(title, finalDescription, NotificationType.ERROR, notificationListener).notify(project); } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index 5ef41fb00c45..695c2a72d200 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -80,7 +80,7 @@ import java.util.*; public class GlobalInspectionContextImpl extends GlobalInspectionContextBase implements GlobalInspectionContext { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.ex.GlobalInspectionContextImpl"); - private static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Inspection Results", ToolWindowId.INSPECTION, true); + private static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Inspection Results", ToolWindowId.INSPECTION); private final NotNullLazyValue myContentManager; private InspectionResultsView myView = null; private Content myContent = null; diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/actions/AnalyzeDependenciesOnSpecifiedTargetHandler.java b/platform/lang-impl/src/com/intellij/packageDependencies/actions/AnalyzeDependenciesOnSpecifiedTargetHandler.java index ffc682269563..7aebba7dfe41 100644 --- a/platform/lang-impl/src/com/intellij/packageDependencies/actions/AnalyzeDependenciesOnSpecifiedTargetHandler.java +++ b/platform/lang-impl/src/com/intellij/packageDependencies/actions/AnalyzeDependenciesOnSpecifiedTargetHandler.java @@ -36,7 +36,7 @@ import java.util.*; */ public class AnalyzeDependenciesOnSpecifiedTargetHandler extends DependenciesHandlerBase { private static final NotificationGroup NOTIFICATION_GROUP = - NotificationGroup.toolWindowGroup("Dependencies", ToolWindowId.DEPENDENCIES, true); + NotificationGroup.toolWindowGroup("Dependencies", ToolWindowId.DEPENDENCIES); private final GlobalSearchScope myTargetScope; public AnalyzeDependenciesOnSpecifiedTargetHandler(@NotNull Project project, @NotNull AnalysisScope scope, @NotNull GlobalSearchScope targetScope) { diff --git a/platform/platform-api/src/com/intellij/notification/NotificationGroup.java b/platform/platform-api/src/com/intellij/notification/NotificationGroup.java index 7285a8e1ffd6..df68daff1584 100644 --- a/platform/platform-api/src/com/intellij/notification/NotificationGroup.java +++ b/platform/platform-api/src/com/intellij/notification/NotificationGroup.java @@ -66,6 +66,10 @@ public final class NotificationGroup { return new NotificationGroup(displayId, NotificationDisplayType.TOOL_WINDOW, logByDefault, toolWindowId); } + public static NotificationGroup toolWindowGroup(@NotNull String displayId, @NotNull String toolWindowId) { + return toolWindowGroup(displayId, toolWindowId, true); + } + public String getDisplayId() { return myDisplayId; } diff --git a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeFeaturedPluginsStepPanel.java b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeFeaturedPluginsStepPanel.java index 1072fbc252a2..c4bb120bce09 100644 --- a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeFeaturedPluginsStepPanel.java +++ b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeFeaturedPluginsStepPanel.java @@ -18,6 +18,7 @@ package com.intellij.ide.customize; import com.intellij.CommonBundle; import com.intellij.icons.AllIcons; import com.intellij.ide.plugins.IdeaPluginDescriptor; +import com.intellij.ide.plugins.PluginManagerCore; import com.intellij.ide.plugins.PluginNode; import com.intellij.openapi.progress.util.ProgressIndicatorBase; import com.intellij.openapi.ui.VerticalFlowLayout; @@ -78,7 +79,7 @@ public class CustomizeFeaturedPluginsStepPanel extends AbstractCustomizeWizardSt final String pluginId = s.substring(j + 1); IdeaPluginDescriptor foundDescriptor = null; for (IdeaPluginDescriptor descriptor : pluginsFromRepository) { - if (descriptor.getPluginId().getIdString().equals(pluginId)) { + if (descriptor.getPluginId().getIdString().equals(pluginId) && !PluginManagerCore.isBrokenPlugin(descriptor)) { foundDescriptor = descriptor; isEmptyOrOffline = false; break; diff --git a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java index 19aea68db7af..9ef8749674f2 100644 --- a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java +++ b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java @@ -80,6 +80,12 @@ public class CustomizeIDEWizardDialog extends DialogWrapper implements ActionLis protected void initSteps() { provider.initSteps(this, mySteps); } + + @Override + protected void createButtons(JPanel buttonPanel, GridBagConstraints gbc) { + provider.addButtons(this, buttonPanel, gbc); + super.createButtons(buttonPanel, gbc); + } }.show(); } @@ -131,6 +137,15 @@ public class CustomizeIDEWizardDialog extends DialogWrapper implements ActionLis gbc.fill = GridBagConstraints.BOTH; gbc.gridx = 0; gbc.gridy = 0; + createButtons(buttonPanel, gbc); + buttonPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0)); + myButtonWrapper.add(buttonPanel, BUTTONS); + myButtonWrapper.add(new JLabel(), NOBUTTONS); + myButtonWrapperLayout.show(myButtonWrapper, BUTTONS); + return myButtonWrapper; + } + + protected void createButtons(JPanel buttonPanel, GridBagConstraints gbc) { buttonPanel.add(myBackButton, gbc); gbc.gridx++; gbc.weightx = 1; @@ -140,11 +155,6 @@ public class CustomizeIDEWizardDialog extends DialogWrapper implements ActionLis buttonPanel.add(myNextButton, gbc); gbc.gridx++; buttonPanel.add(myStartUsingButton, gbc); - buttonPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0)); - myButtonWrapper.add(buttonPanel, BUTTONS); - myButtonWrapper.add(new JLabel(), NOBUTTONS); - myButtonWrapperLayout.show(myButtonWrapper, BUTTONS); - return myButtonWrapper; } void setButtonsVisible(boolean visible) { diff --git a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardStepsProvider.java b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardStepsProvider.java index ceea34db05fd..4f44dae0ebc3 100644 --- a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardStepsProvider.java +++ b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardStepsProvider.java @@ -15,6 +15,8 @@ */ package com.intellij.ide.customize; +import javax.swing.*; +import java.awt.*; import java.util.List; /** @@ -22,4 +24,6 @@ import java.util.List; */ public interface CustomizeIDEWizardStepsProvider { void initSteps(CustomizeIDEWizardDialog wizardDialog, List steps); + + void addButtons(CustomizeIDEWizardDialog wizardDialog, JPanel buttonPanel, GridBagConstraints gbc); } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java index 0adc8957f596..e10367d583bf 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java @@ -42,8 +42,6 @@ import com.intellij.util.ui.update.Update; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import static com.intellij.openapi.options.ex.MixedConfigurableGroup.getGroupWeight; - import javax.swing.*; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeExpansionListener; @@ -66,7 +64,6 @@ import java.util.List; */ final class SettingsTreeView extends JComponent implements Disposable, OptionsEditorColleague { private static final Color NORMAL_NODE = new JBColor(Gray._60, Gray._140); - private static final Color HIDDEN_NODE = JBColor.GRAY; private static final Color WRONG_CONTENT = JBColor.RED; private static final Color MODIFIED_CONTENT = JBColor.BLUE; @@ -531,17 +528,6 @@ final class SettingsTreeView extends JComponent implements Disposable, OptionsEd else if (myFilter.myContext.getModified().contains(configurable)) { myTextLabel.setForeground(MODIFIED_CONTENT); } - else { - SimpleNode simpleNode = node; - while (simpleNode != null) { - SimpleNode parent = simpleNode.getParent(); - if (parent != null && myRoot == parent.getParent() && getGroupWeight(getConfigurable(simpleNode)) == 0) { - myTextLabel.setForeground(HIDDEN_NODE); - parent = null; - } - simpleNode = parent; - } - } } } // configure project icon diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java index 8cb7e55ea290..9394eabc2a57 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java @@ -114,7 +114,7 @@ public class SearchCommand { new Runnable() { @Override public void run() { - NotificationGroup.toolWindowGroup("Structural Search", ToolWindowId.FIND, true) + NotificationGroup.toolWindowGroup("Structural Search", ToolWindowId.FIND) .createNotification(SSRBundle.message("problem", e.getMessage()), MessageType.ERROR).notify(project); } }, diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java index 4b7f6baf2616..985f383ecbc6 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java @@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable; public class VcsNotifier { private static final NotificationGroup NOTIFICATION_GROUP_ID = NotificationGroup.toolWindowGroup( - "Vcs Messages", ChangesViewContentManager.TOOLWINDOW_ID, true); + "Vcs Messages", ChangesViewContentManager.TOOLWINDOW_ID); private static final NotificationGroup IMPORTANT_ERROR_NOTIFICATION = new NotificationGroup( "Vcs Important Messages", NotificationDisplayType.STICKY_BALLOON, true); private static final NotificationGroup MINOR_NOTIFICATION = new NotificationGroup( diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java index 908a3d9f8433..82ff0bcc6e5a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java @@ -37,7 +37,7 @@ import javax.swing.event.HyperlinkEvent; */ public class VcsBalloonProblemNotifier implements Runnable { public static final NotificationGroup - NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Common Version Control Messages", ChangesViewContentManager.TOOLWINDOW_ID, true); + NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Common Version Control Messages", ChangesViewContentManager.TOOLWINDOW_ID); private final Project myProject; private final String myMessage; private final MessageType myMessageType; diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/StudyDocumentListener.java b/python/edu/learn-python/src/com/jetbrains/python/edu/StudyDocumentListener.java index 9fdcf704a29b..6ce1d0991dff 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/StudyDocumentListener.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/StudyDocumentListener.java @@ -52,6 +52,9 @@ public class StudyDocumentListener extends DocumentAdapter { if (myTaskWindow != null) { int newLength = myTaskWindow.getLength() + change; myTaskWindow.setLength(newLength <= 0 ? 0 : newLength); + if (e.getNewFragment().equals("\n")) { + myTaskWindow.setLength(myTaskWindow.getLength() + 1); + } } int newEnd = offset + event.getNewLength(); int newLine = document.getLineNumber(newEnd); diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/course/TaskFile.java b/python/edu/learn-python/src/com/jetbrains/python/edu/course/TaskFile.java index 5791aa178fe1..c46c4f56f937 100644 --- a/python/edu/learn-python/src/com/jetbrains/python/edu/course/TaskFile.java +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/course/TaskFile.java @@ -173,7 +173,18 @@ public class TaskFile implements Stateful { for (TaskWindow w : taskWindows) { if ((w.getLine() == line) && (w.getStart() >= oldEndOffsetInLine)) { int distance = w.getStart() - oldEndOffsetInLine; - if (lineChange != 0 || newEndOffsetInLine <= w.getStart()) { + boolean coveredByPrevTW = false; + int prevIndex = w.getIndex() - 1; + if (StudyUtils.indexIsValid(prevIndex, taskWindows)) { + TaskWindow prevTW = taskWindows.get(prevIndex); + if (prevTW.getLine() == line) { + int endOffset = prevTW.getStart() + prevTW.getLength(); + if (endOffset >= newEndOffsetInLine) { + coveredByPrevTW = true; + } + } + } + if (lineChange != 0 || newEndOffsetInLine <= w.getStart() || coveredByPrevTW) { w.setStart(distance + newEndOffsetInLine); w.setLine(line + lineChange); }