use of org.openide.util.lookup.ProxyLookup in project ACS by ACS-Community.
the class TopComponent method getLookup.
/** Gets lookup which represents context of this component. By default
* the lookup delegates to result of <code>getActivatedNodes</code>
* method and result of this component <code>ActionMap</code> delegate.
*
* @return a lookup with designates context of this component
* @see org.openide.util.ContextAwareAction
* @see org.openide.util.Utilities#actionsToPopup(Action[], Lookup)
* @since 3.29
*/
public Lookup getLookup() {
synchronized (defaultLookupLock) {
Object l = defaultLookupRef.get();
if (l instanceof Lookup) {
return (Lookup) l;
}
Lookup lookup = new ProxyLookup(new Lookup[] { // Lookup of activated nodes.
new DefaultTopComponentLookup(this), // Action map lookup.
Lookups.singleton(new DelegateActionMap(this)) });
defaultLookupRef = new java.lang.ref.WeakReference(lookup);
return lookup;
}
}
Aggregations