--- a/core.ui/src/org/netbeans/core/ui/resources/layer.xml Tue Nov 09 06:28:26 2010 +0300
+++ a/core.ui/src/org/netbeans/core/ui/resources/layer.xml Tue Nov 09 16:53:04 2010 +0100
@@ -93,7 +93,9 @@
-
+
+
+
--- a/openide.actions/src/org/openide/actions/PasteAction.java Tue Nov 09 06:28:26 2010 +0300
+++ a/openide.actions/src/org/openide/actions/PasteAction.java Tue Nov 09 16:53:04 2010 +0100
@@ -88,6 +88,7 @@
import org.openide.util.NbBundle;
import org.openide.util.RequestProcessor;
import org.openide.util.UserCancelException;
+import org.openide.util.Utilities;
import org.openide.util.WeakListeners;
import org.openide.util.actions.CallbackSystemAction;
import org.openide.util.actions.Presenter;
@@ -114,6 +115,11 @@
/** All currently possible paste types. */
private static PasteType[] types;
+
+
+ static Action create() {
+ return PasteAction.get(PasteAction.class).createContextAwareInstance(Utilities.actionsGlobalContext());
+ }
/** Lazy initializtion of the global model */
private static synchronized ActSubMenuModel model() {
--- a/openide.windows/src/org/netbeans/modules/openide/windows/GlobalActionContextImpl.java Tue Nov 09 06:28:26 2010 +0300
+++ a/openide.windows/src/org/netbeans/modules/openide/windows/GlobalActionContextImpl.java Tue Nov 09 16:53:04 2010 +0100
@@ -45,6 +45,7 @@
package org.netbeans.modules.openide.windows;
import java.awt.EventQueue;
+import java.awt.KeyboardFocusManager;
import javax.swing.ActionMap;
import org.openide.util.Lookup;
import org.openide.util.ContextGlobalProvider;
@@ -69,6 +70,7 @@
public GlobalActionContextImpl (TopComponent.Registry r) {
this.registry = r;
+ KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener(this);
}
/** the lookup to temporarily use */
@@ -94,7 +96,7 @@
GlobalActionContextImpl g = (GlobalActionContextImpl)obj;
Lookup[] arr = {
- Lookups.singleton (map),
+ map == null ? Lookup.EMPTY : Lookups.singleton (map),
Lookups.exclude (g.getLookup (), new Class[] { javax.swing.ActionMap.class }),
};
@@ -136,6 +138,9 @@
if (TopComponent.Registry.PROP_ACTIVATED.equals (evt.getPropertyName())) {
org.openide.util.Utilities.actionsGlobalContext ().lookup (javax.swing.ActionMap.class);
}
+ if ("permanentFocusOwner".equals(evt.getPropertyName())) { // NOI18N
+ blickActionMap(null);
+ }
}
}
--- a/openide.windows/src/org/openide/windows/DelegateActionMap.java Tue Nov 09 06:28:26 2010 +0300
+++ a/openide.windows/src/org/openide/windows/DelegateActionMap.java Tue Nov 09 16:53:04 2010 +0100
@@ -43,8 +43,13 @@
*/
package org.openide.windows;
+import java.awt.Component;
+import java.awt.KeyboardFocusManager;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.JComponent;
@@ -100,7 +105,7 @@
}
}
- java.awt.Component owner = java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
+ Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
Action found = null;
while ((owner != null) && (owner != getComponent())) {
@@ -156,6 +161,23 @@
keys.addAll(l);
}
+
+ Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
+ List