summaryrefslogtreecommitdiff
path: root/platform/platform-api/src/com/intellij/openapi/wm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/platform-api/src/com/intellij/openapi/wm')
-rw-r--r--platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java6
-rw-r--r--platform/platform-api/src/com/intellij/openapi/wm/IdeFocusManager.java5
-rw-r--r--platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.java5
-rw-r--r--platform/platform-api/src/com/intellij/openapi/wm/ToolWindowManager.java25
4 files changed, 27 insertions, 14 deletions
diff --git a/platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java b/platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java
index 6c40a04f5831..38dcb877e030 100644
--- a/platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java
+++ b/platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java
@@ -192,7 +192,7 @@ public abstract class FocusCommand extends ActiveRunnable implements Expirable {
LOG.info("We could not request focus in window on " + myToFocus.getClass().getName());
LOG.info(myAllocation);
}
- if (!SystemInfo.isMac || isForced() ) {
+ if (isForced()) {
myToFocus.requestFocus();
if (shouldLogFocuses) {
LOG.info("Force request focus on " + myToFocus.getClass().getName());
@@ -217,10 +217,6 @@ public abstract class FocusCommand extends ActiveRunnable implements Expirable {
if (myToFocus == null) {
return true;
}
- if (SwingUtilities.getWindowAncestor(myToFocus) == null) {
- clear();
- return true;
- }
return false;
}
diff --git a/platform/platform-api/src/com/intellij/openapi/wm/IdeFocusManager.java b/platform/platform-api/src/com/intellij/openapi/wm/IdeFocusManager.java
index d8f7e86d4b9e..6b4852319899 100644
--- a/platform/platform-api/src/com/intellij/openapi/wm/IdeFocusManager.java
+++ b/platform/platform-api/src/com/intellij/openapi/wm/IdeFocusManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -163,9 +163,8 @@ public abstract class IdeFocusManager implements FocusRequestor {
public abstract void toFront(JComponent c);
public static IdeFocusManager getInstance(@Nullable Project project) {
- if (project == null) return getGlobalInstance();
+ if (project == null || project.isDisposed() || !project.isInitialized()) return getGlobalInstance();
- if (project.isDisposed() || !project.isInitialized()) return getGlobalInstance();
return project.getComponent(IdeFocusManager.class);
}
diff --git a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.java b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.java
index 477ff28baef6..cc198e18a140 100644
--- a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.java
+++ b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
package com.intellij.openapi.wm;
import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
/**
* Performs lazy initialization of a toolwindow registered in plugin.xml.
@@ -25,5 +26,5 @@ import com.intellij.openapi.project.Project;
* @see ToolWindowEP
*/
public interface ToolWindowFactory {
- void createToolWindowContent(Project project, ToolWindow toolWindow);
+ void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow);
}
diff --git a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowManager.java b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowManager.java
index 0e7ddb332151..b616429a11c8 100644
--- a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowManager.java
+++ b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,16 +47,25 @@ public abstract class ToolWindowManager {
* @return tool window
* @deprecated {@link com.intellij.openapi.wm.ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
*/
- public abstract ToolWindow registerToolWindow(@NotNull String id,@NotNull JComponent component,@NotNull ToolWindowAnchor anchor);
+ @Deprecated
+ @NotNull
+ public abstract ToolWindow registerToolWindow(@NotNull String id, @NotNull JComponent component, @NotNull ToolWindowAnchor anchor);
/**
* @deprecated {@link com.intellij.openapi.wm.ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
*/
- public abstract ToolWindow registerToolWindow(@NotNull String id,@NotNull JComponent component,@NotNull ToolWindowAnchor anchor, Disposable parentDisposable);
+ @Deprecated
+ @NotNull
+ public abstract ToolWindow registerToolWindow(@NotNull String id,
+ @NotNull JComponent component,
+ @NotNull ToolWindowAnchor anchor,
+ @NotNull Disposable parentDisposable);
/**
* @deprecated {@link com.intellij.openapi.wm.ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
*/
+ @Deprecated
+ @NotNull
public abstract ToolWindow registerToolWindow(@NotNull String id,
@NotNull JComponent component,
@NotNull ToolWindowAnchor anchor,
@@ -65,6 +74,8 @@ public abstract class ToolWindowManager {
/**
* @deprecated {@link com.intellij.openapi.wm.ToolWindowManager#registerToolWindow(String, boolean, ToolWindowAnchor)}
*/
+ @Deprecated
+ @NotNull
public abstract ToolWindow registerToolWindow(@NotNull String id,
@NotNull JComponent component,
@NotNull ToolWindowAnchor anchor,
@@ -72,12 +83,16 @@ public abstract class ToolWindowManager {
boolean canWorkInDumbMode,
boolean canCloseContents);
+ @NotNull
public abstract ToolWindow registerToolWindow(@NotNull String id, boolean canCloseContent, @NotNull ToolWindowAnchor anchor);
+ @NotNull
public abstract ToolWindow registerToolWindow(@NotNull String id, boolean canCloseContent, @NotNull ToolWindowAnchor anchor, boolean secondary);
+ @NotNull
public abstract ToolWindow registerToolWindow(@NotNull String id, boolean canCloseContent, @NotNull ToolWindowAnchor anchor, Disposable parentDisposable, boolean canWorkInDumbMode);
+ @NotNull
public ToolWindow registerToolWindow(@NotNull final String id,
final boolean canCloseContent,
@NotNull final ToolWindowAnchor anchor,
@@ -102,6 +117,7 @@ public abstract class ToolWindowManager {
/**
* @return array of <code>id</code>s of all registered tool windows.
*/
+ @NotNull
public abstract String[] getToolWindowIds();
/**
@@ -120,11 +136,12 @@ public abstract class ToolWindowManager {
/**
* Puts specified runnable to the tail of current command queue.
*/
- public abstract void invokeLater(Runnable runnable);
+ public abstract void invokeLater(@NotNull Runnable runnable);
/**
* Utility method for quick access to the focus manager
*/
+ @NotNull
public abstract IdeFocusManager getFocusManager();
public abstract void notifyByBalloon(@NotNull final String toolWindowId, @NotNull final MessageType type, @NotNull final String htmlBody);