From ca169d198b06ddf0fd4749c70c548df309670553 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 19 Dec 2012 15:10:22 +0400 Subject: [PATCH 1/5] JBLabel: let override the foreground Setting foreground was not possible with current getForeground implementation and impossibility to set myFontColor to null from the ouside. --- .../src/com/intellij/ui/components/JBLabel.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/platform-api/src/com/intellij/ui/components/JBLabel.java b/platform/platform-api/src/com/intellij/ui/components/JBLabel.java index e67264e452a0..6db708d599f2 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBLabel.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBLabel.java @@ -97,6 +97,12 @@ public class JBLabel extends JLabel implements AnchorableComponent { return super.getForeground(); } + @Override + public void setForeground(Color fg) { + myFontColor = null; + super.setForeground(fg); + } + @Override public void setAnchor(@Nullable JComponent anchor) { myAnchor = anchor; From f0b3b031775e758597acdce771befa29d1f455ee Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 19 Dec 2012 15:11:23 +0400 Subject: [PATCH 2/5] IDEA-97748 Fix the foreground for darcula. --- .../vcs/configurable/VcsDirectoryConfigurationPanel.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsDirectoryConfigurationPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsDirectoryConfigurationPanel.java index 7ffdef919493..024b8952e34e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsDirectoryConfigurationPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsDirectoryConfigurationPanel.java @@ -535,6 +535,9 @@ public class VcsDirectoryConfigurationPanel extends PanelWithButtons implements setBackground(new Color(255, 186, 192)); JBLabel label = new JBLabel(title); + if( UIUtil.isUnderDarcula()) { + label.setForeground(UIUtil.getPanelBackground()); + } myAddLabel = new LinkLabel("Add root", null); From 0763cbb96ca183109d3c43d1f47bc45d7052bc8a Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 19 Dec 2012 14:51:00 +0400 Subject: [PATCH 3/5] remove deprecated method --- platform/platform-api/src/com/intellij/ide/XmlRpcServer.java | 5 ----- .../platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java | 5 ----- 2 files changed, 10 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ide/XmlRpcServer.java b/platform/platform-api/src/com/intellij/ide/XmlRpcServer.java index 25e91cadb272..61caaf83d7d2 100644 --- a/platform/platform-api/src/com/intellij/ide/XmlRpcServer.java +++ b/platform/platform-api/src/com/intellij/ide/XmlRpcServer.java @@ -25,11 +25,6 @@ public interface XmlRpcServer { boolean hasHandler(String name); void removeHandler(String name); - /** - * @deprecated use {@link org.jetbrains.ide.WebServerManager#getInstance().getPort()} (to remove in IDEA 13) - */ - int getPortNumber(); - final class SERVICE { private SERVICE() { } diff --git a/platform/platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java b/platform/platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java index 360bcc3d040e..f476eff7c225 100644 --- a/platform/platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java @@ -29,7 +29,6 @@ import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponse; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.ide.WebServerManager; import org.jetbrains.io.Responses; import java.util.Arrays; @@ -80,10 +79,6 @@ public class XmlRpcServerImpl extends SimpleChannelUpstreamHandler implements Xm pipeline.addLast("pluggable_xmlRpc", this); } - public int getPortNumber() { - return WebServerManager.getInstance().getPort(); - } - @Override public boolean hasHandler(String name) { return handlerMapping.handlers.containsKey(name); From 0fe126de1fb4f0e452a0458c8f684c83ef0ba95e Mon Sep 17 00:00:00 2001 From: "Nadya.Zabrodina" Date: Wed, 19 Dec 2012 15:24:58 +0400 Subject: [PATCH 4/5] HG: Refactor changes for IDEA-71317. --- .../HgSwitchWorkingDirectoryAction.java | 3 -- .../zmlx/hg4idea/command/HgCloneCommand.java | 7 +--- .../zmlx/hg4idea/command/HgInitCommand.java | 2 +- .../zmlx/hg4idea/command/HgMergeCommand.java | 2 +- .../zmlx/hg4idea/command/HgPullCommand.java | 3 -- .../zmlx/hg4idea/command/HgPushCommand.java | 2 +- .../command/HgRemoteChangesetsCommand.java | 3 -- .../zmlx/hg4idea/command/HgUpdateCommand.java | 8 ++--- .../hg4idea/execution/HgCommandExecutor.java | 33 +++++-------------- .../hg4idea/provider/HgCheckoutProvider.java | 3 -- 10 files changed, 14 insertions(+), 52 deletions(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgSwitchWorkingDirectoryAction.java b/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgSwitchWorkingDirectoryAction.java index e4c8ca9ca229..68609ced395d 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgSwitchWorkingDirectoryAction.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/action/HgSwitchWorkingDirectoryAction.java @@ -63,9 +63,6 @@ public class HgSwitchWorkingDirectoryAction extends HgAbstractGlobalAction { @Override public void run() { HgCommandResult result = command.execute(); - if (HgErrorUtil.isAuthorizationError(result)) { - result = command.execute(true); - } if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(project).notifyError(result, "", "Update failed"); } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCloneCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCloneCommand.java index ff0ebc80dd41..b3bfe7e5b8c7 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCloneCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCloneCommand.java @@ -28,16 +28,11 @@ public class HgCloneCommand { @Nullable public HgCommandResult execute() { - return execute(false); - } - - @Nullable - public HgCommandResult execute(boolean forceAuthorization) { final List arguments = new ArrayList(2); arguments.add(repositoryURL); arguments.add(directory); final HgCommandExecutor executor = new HgCommandExecutor(project); executor.setShowOutput(true); - return executor.executeInCurrentThread(null, "clone", arguments, forceAuthorization); + return executor.executeInCurrentThread(null, "clone", arguments); } } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgInitCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgInitCommand.java index 67614e0886c4..4c78dba985fc 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgInitCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgInitCommand.java @@ -32,7 +32,7 @@ public class HgInitCommand { public void process(@Nullable HgCommandResult result) { resultHandler.process(result); } - }, true); + }); } } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgMergeCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgMergeCommand.java index 8fce3d349f87..d8d70f0c5cc8 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgMergeCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgMergeCommand.java @@ -57,7 +57,7 @@ public class HgMergeCommand { arguments.add(branch); } final HgCommandResult result = - commandExecutor.executeInCurrentThread(repo, "merge", arguments, new HgDeleteModifyPromptHandler(), false); + commandExecutor.executeInCurrentThread(repo, "merge", arguments, new HgDeleteModifyPromptHandler()); project.getMessageBus().syncPublisher(HgVcs.BRANCH_TOPIC).update(project, null); return result; } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPullCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPullCommand.java index 1f6780f16035..2acb55db2ed4 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPullCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPullCommand.java @@ -76,9 +76,6 @@ public class HgPullCommand { final HgCommandExecutor executor = new HgCommandExecutor(project); executor.setShowOutput(true); HgCommandResult result = executor.executeInCurrentThread(repo, "pull", arguments); - if (HgErrorUtil.isAuthorizationError(result)) { - result = executor.executeInCurrentThread(repo, "pull", arguments, true); - } if (HgErrorUtil.isAuthorizationError(result)) { new HgCommandResultNotifier(project) .notifyError(result, "Authorization required", "http authorization required for " + source + ""); diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPushCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPushCommand.java index 3c999baf6416..2ebc13f46523 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPushCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgPushCommand.java @@ -78,7 +78,7 @@ public class HgPushCommand { } resultHandler.process(result); } - }, true); + }); } public VirtualFile getRepo() { diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRemoteChangesetsCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRemoteChangesetsCommand.java index 5d96ddc0de73..12650c7c3fa4 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRemoteChangesetsCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRemoteChangesetsCommand.java @@ -67,9 +67,6 @@ public abstract class HgRemoteChangesetsCommand extends HgChangesetsCommand { } HgCommandExecutor executor = new HgCommandExecutor(project); HgCommandResult result = executor.executeInCurrentThread(repo, command, args); - if (HgErrorUtil.isAuthorizationError(result)) { - result = executor.executeInCurrentThread(repo, command, args, true); - } if (result == HgCommandResult.CANCELLED || HgErrorUtil.isAuthorizationError(result)) { final HgVcs vcs = HgVcs.getInstance(project); if (vcs == null) { diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgUpdateCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgUpdateCommand.java index 3856a9856c65..660ff40baebe 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgUpdateCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgUpdateCommand.java @@ -52,13 +52,9 @@ public class HgUpdateCommand { this.clean = clean; } - @Nullable - public HgCommandResult execute() { - return execute(false); - } @Nullable - public HgCommandResult execute(boolean forceAuthorization) { + public HgCommandResult execute() { List arguments = new LinkedList(); if (clean) { arguments.add("--clean"); @@ -74,7 +70,7 @@ public class HgUpdateCommand { final HgCommandExecutor executor = new HgCommandExecutor(project); executor.setShowOutput(true); final HgCommandResult result = - executor.executeInCurrentThread(repo, "update", arguments, new HgDeleteModifyPromptHandler(), forceAuthorization); + executor.executeInCurrentThread(repo, "update", arguments, new HgDeleteModifyPromptHandler()); project.getMessageBus().syncPublisher(HgVcs.BRANCH_TOPIC).update(project, null); VfsUtil.markDirtyAndRefresh(true, true, false, repo); return result; diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java index 55f98c781737..832fc1f971d7 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java @@ -88,31 +88,10 @@ public final class HgCommandExecutor { final String operation, final List arguments, @Nullable final HgCommandResultHandler handler) { - execute(repo, operation, arguments, handler, false); - } - - /** - * Method is called with forceAutorization = true, if authorization may be failed and update login_password dialog required - * f.e. if repository password was changed, but idea was not restarted. - * - * @param repo - * @param operation - * @param arguments - * @param handler - * @param forceAuthorization - */ - public void execute(@Nullable final VirtualFile repo, - final String operation, - final List arguments, - @Nullable final HgCommandResultHandler handler, - final boolean forceAuthorization) { HgUtil.executeOnPooledThreadIfNeeded(new Runnable() { @Override public void run() { HgCommandResult result = executeInCurrentThread(repo, operation, arguments); - if (forceAuthorization && HgErrorUtil.isAuthorizationError(result)) { - result = executeInCurrentThread(repo, operation, arguments, true); - } if (handler != null) { handler.process(result); } @@ -122,14 +101,18 @@ public final class HgCommandExecutor { @Nullable public HgCommandResult executeInCurrentThread(@Nullable final VirtualFile repo, @NotNull final String operation, - @Nullable final List arguments, boolean forceAuthorization) { - return executeInCurrentThread(repo, operation, arguments, null, forceAuthorization); + @Nullable final List arguments) { + return executeInCurrentThread(repo, operation, arguments, null); } @Nullable public HgCommandResult executeInCurrentThread(@Nullable final VirtualFile repo, @NotNull final String operation, - @Nullable final List arguments) { - return executeInCurrentThread(repo, operation, arguments, false); + @Nullable final List arguments, @Nullable HgPromptHandler handler) { + HgCommandResult result = executeInCurrentThread(repo, operation, arguments, handler, false); + if (HgErrorUtil.isAuthorizationError(result)) { + result = executeInCurrentThread(repo, operation, arguments, handler, true); + } + return result; } @Nullable diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCheckoutProvider.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCheckoutProvider.java index e8a3b57ae463..71c49931c129 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCheckoutProvider.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCheckoutProvider.java @@ -68,9 +68,6 @@ public class HgCheckoutProvider implements CheckoutProvider { // handle result HgCommandResult myCloneResult = clone.execute(); - if (HgErrorUtil.isAuthorizationError(myCloneResult)) { - myCloneResult = clone.execute(true); - } if (myCloneResult == null) { new HgCommandResultNotifier(project).notifyError(myCloneResult, "Clone failed", "Clone failed due to unknown error"); } else if (HgErrorUtil.hasErrorsInCommandExecution(myCloneResult)) { From 9df99186b2ad97e64c982730fa8c3c97edfc0920 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 19 Dec 2012 12:31:42 +0100 Subject: [PATCH 5/5] EA-42011 (postpone file watcher initialization) --- .../intellij/openapi/vfs/impl/local/FileWatcher.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java index ed8863ce6c04..8fa592866b1e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java @@ -168,13 +168,17 @@ public class FileWatcher { return null; } - private void notifyOnFailure(String cause, @Nullable NotificationListener listener) { + private void notifyOnFailure(final String cause, @Nullable final NotificationListener listener) { LOG.warn(cause); if (!myFailureShownToTheUser) { myFailureShownToTheUser = true; - String title = ApplicationBundle.message("watcher.slow.sync"); - Notifications.Bus.notify(NOTIFICATION_GROUP.getValue().createNotification(title, cause, NotificationType.WARNING, listener)); + ApplicationManager.getApplication().invokeLater(new Runnable() { + public void run() { + String title = ApplicationBundle.message("watcher.slow.sync"); + Notifications.Bus.notify(NOTIFICATION_GROUP.getValue().createNotification(title, cause, NotificationType.WARNING, listener)); + } + }); } }