This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 161211
Collapse All | Expand All

(-)a/core.ui/src/org/netbeans/core/ui/resources/layer.xml (-1 / +3 lines)
Lines 93-99 Link Here
93
                <attr name="noIconInMenu" boolvalue="true"/>
93
                <attr name="noIconInMenu" boolvalue="true"/>
94
            </file>
94
            </file>
95
            <file name="org-openide-actions-GotoAction.instance"/>
95
            <file name="org-openide-actions-GotoAction.instance"/>
96
            <file name="org-openide-actions-PasteAction.instance"/>
96
            <file name="org-openide-actions-PasteAction.instance">
97
                <attr name="instanceCreate" methodvalue="org.openide.actions.PasteAction.create"/>
98
            </file>
97
            <file name="org-openide-actions-RedoAction.instance">
99
            <file name="org-openide-actions-RedoAction.instance">
98
                <attr name="instanceCreate" methodvalue="org.openide.actions.UndoRedoAction.create"/>
100
                <attr name="instanceCreate" methodvalue="org.openide.actions.UndoRedoAction.create"/>
99
                <attr name="redo" boolvalue="true"/>
101
                <attr name="redo" boolvalue="true"/>
(-)a/openide.actions/src/org/openide/actions/PasteAction.java (+6 lines)
Lines 88-93 Link Here
88
import org.openide.util.NbBundle;
88
import org.openide.util.NbBundle;
89
import org.openide.util.RequestProcessor;
89
import org.openide.util.RequestProcessor;
90
import org.openide.util.UserCancelException;
90
import org.openide.util.UserCancelException;
91
import org.openide.util.Utilities;
91
import org.openide.util.WeakListeners;
92
import org.openide.util.WeakListeners;
92
import org.openide.util.actions.CallbackSystemAction;
93
import org.openide.util.actions.CallbackSystemAction;
93
import org.openide.util.actions.Presenter;
94
import org.openide.util.actions.Presenter;
Lines 114-119 Link Here
114
115
115
    /** All currently possible paste types. */
116
    /** All currently possible paste types. */
116
    private static PasteType[] types;
117
    private static PasteType[] types;
118
    
119
    
120
    static Action create() {
121
        return PasteAction.get(PasteAction.class).createContextAwareInstance(Utilities.actionsGlobalContext());
122
    }
117
123
118
    /** Lazy initializtion of the global model */
124
    /** Lazy initializtion of the global model */
119
    private static synchronized ActSubMenuModel model() {
125
    private static synchronized ActSubMenuModel model() {
(-)a/openide.windows/src/org/netbeans/modules/openide/windows/GlobalActionContextImpl.java (-1 / +6 lines)
Lines 45-50 Link Here
45
package org.netbeans.modules.openide.windows;
45
package org.netbeans.modules.openide.windows;
46
46
47
import java.awt.EventQueue;
47
import java.awt.EventQueue;
48
import java.awt.KeyboardFocusManager;
48
import javax.swing.ActionMap;
49
import javax.swing.ActionMap;
49
import org.openide.util.Lookup;
50
import org.openide.util.Lookup;
50
import org.openide.util.ContextGlobalProvider;
51
import org.openide.util.ContextGlobalProvider;
Lines 69-74 Link Here
69
    
70
    
70
    public GlobalActionContextImpl (TopComponent.Registry r) {
71
    public GlobalActionContextImpl (TopComponent.Registry r) {
71
        this.registry = r;
72
        this.registry = r;
73
        KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener(this);
72
    }
74
    }
73
    
75
    
74
    /** the lookup to temporarily use */
76
    /** the lookup to temporarily use */
Lines 94-100 Link Here
94
            GlobalActionContextImpl g = (GlobalActionContextImpl)obj;
96
            GlobalActionContextImpl g = (GlobalActionContextImpl)obj;
95
            
97
            
96
            Lookup[] arr = {
98
            Lookup[] arr = {
97
                Lookups.singleton (map),
99
                map == null ? Lookup.EMPTY : Lookups.singleton (map),
98
                Lookups.exclude (g.getLookup (), new Class[] { javax.swing.ActionMap.class }),
100
                Lookups.exclude (g.getLookup (), new Class[] { javax.swing.ActionMap.class }),
99
            };
101
            };
100
            
102
            
Lines 136-141 Link Here
136
        if (TopComponent.Registry.PROP_ACTIVATED.equals (evt.getPropertyName())) {
138
        if (TopComponent.Registry.PROP_ACTIVATED.equals (evt.getPropertyName())) {
137
            org.openide.util.Utilities.actionsGlobalContext ().lookup (javax.swing.ActionMap.class);
139
            org.openide.util.Utilities.actionsGlobalContext ().lookup (javax.swing.ActionMap.class);
138
        }
140
        }
141
        if ("permanentFocusOwner".equals(evt.getPropertyName())) { // NOI18N
142
            blickActionMap(null);
143
        }
139
    }
144
    }
140
    
145
    
141
}
146
}
(-)a/openide.windows/src/org/openide/windows/DelegateActionMap.java (-1 / +23 lines)
Lines 43-50 Link Here
43
 */
43
 */
44
package org.openide.windows;
44
package org.openide.windows;
45
45
46
import java.awt.Component;
47
import java.awt.KeyboardFocusManager;
46
import java.lang.ref.Reference;
48
import java.lang.ref.Reference;
47
import java.lang.ref.WeakReference;
49
import java.lang.ref.WeakReference;
50
import java.util.ArrayList;
51
import java.util.Arrays;
52
import java.util.List;
48
import javax.swing.Action;
53
import javax.swing.Action;
49
import javax.swing.ActionMap;
54
import javax.swing.ActionMap;
50
import javax.swing.JComponent;
55
import javax.swing.JComponent;
Lines 100-106 Link Here
100
            }
105
            }
101
        }
106
        }
102
107
103
        java.awt.Component owner = java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
108
        Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
104
        Action found = null;
109
        Action found = null;
105
110
106
        while ((owner != null) && (owner != getComponent())) {
111
        while ((owner != null) && (owner != getComponent())) {
Lines 156-161 Link Here
156
161
157
            keys.addAll(l);
162
            keys.addAll(l);
158
        }
163
        }
164
        
165
        Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
166
        List<Object> focusKeys = new ArrayList<Object>();
167
        while ((owner != null) && (owner != getComponent())) {
168
            if (owner instanceof JComponent) {
169
                m = ((JComponent) owner).getActionMap();
170
                Object[] fk = m == null ? null : all ? m.allKeys() : m.keys();
171
                if (fk != null) {
172
                    focusKeys.addAll(Arrays.asList(fk));
173
                }
174
            }
175
176
            owner = owner.getParent();
177
        }
178
        if (owner == getComponent()) {
179
            keys.addAll(focusKeys);
180
        }
159
181
160
        return keys.toArray();
182
        return keys.toArray();
161
    }
183
    }

Return to bug 161211