Class IdentityBasedInstanceContent
java.lang.Object
org.openide.util.lookup.AbstractLookup.Content
org.jjazz.utilities.api.IdentityBasedInstanceContent
- All Implemented Interfaces:
Serializable
public class IdentityBasedInstanceContent
extends org.openide.util.lookup.AbstractLookup.Content
A drop-in replacement for InstanceContent that uses object identity (System.identityHashCode / ==) instead of the object's own hashCode/equals.
This avoids bug https://github.com/apache/netbeans/issues/9270/
Note that operations that use Convertor are not supported.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new, empty content.IdentityBasedInstanceContent(Executor notifyIn) Creates a content associated with an executor to handle dispatch of changes. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidThe method to add instance to the lookup with.final <T,R> void add(T inst, org.openide.util.lookup.InstanceContent.Convertor<T, R> conv) final voidRemove instance.final <T,R> void remove(T inst, org.openide.util.lookup.InstanceContent.Convertor<T, R> conv) final <T,R> void set(Collection<T> col, org.openide.util.lookup.InstanceContent.Convertor<T, R> conv) Methods inherited from class org.openide.util.lookup.AbstractLookup.Content
addPair, removePair, setPairs
-
Constructor Details
-
IdentityBasedInstanceContent
public IdentityBasedInstanceContent()Create a new, empty content. -
IdentityBasedInstanceContent
Creates a content associated with an executor to handle dispatch of changes.- Parameters:
notifyIn- the executor to notify changes in- Since:
- 7.16
-
-
Method Details
-
add
The method to add instance to the lookup with.- Parameters:
inst- instance
-
add
public final <T,R> void add(T inst, org.openide.util.lookup.InstanceContent.Convertor<T, R> conv) -
remove
-
remove
public final <T,R> void remove(T inst, org.openide.util.lookup.InstanceContent.Convertor<T, R> conv) -
set
public final <T,R> void set(Collection<T> col, org.openide.util.lookup.InstanceContent.Convertor<T, R> conv)
-