mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -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<List<String>> myMessages = new TIntObjectHashMap<List<String>>();
|
||||
private final ProgressWindow myProgressWindow;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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<ContentManager> myContentManager;
|
||||
private InspectionResultsView myView = null;
|
||||
private Content myContent = null;
|
||||
|
||||
+1
-1
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+2
-1
@@ -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;
|
||||
|
||||
+15
-5
@@ -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) {
|
||||
|
||||
+4
@@ -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<AbstractCustomizeWizardStep> steps);
|
||||
|
||||
void addButtons(CustomizeIDEWizardDialog wizardDialog, JPanel buttonPanel, GridBagConstraints gbc);
|
||||
}
|
||||
-14
@@ -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
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user