Package org.jjazz.utilities.api
Class MutableInstanceContent
java.lang.Object
org.openide.util.lookup.AbstractLookup.Content
org.jjazz.utilities.api.MutableInstanceContent
- All Implemented Interfaces:
Serializable
public class MutableInstanceContent
extends org.openide.util.lookup.AbstractLookup.Content
A special InstanceContent directly copied from the original source code (NB7), but which uses MutableInstanceContent internally
to allow handling of mutable objects. Note that the equals() and hashCode() functions of the stored objects will no longer be
used.
With the default InstanceContent implementation, this does not work, when stored objects are modified, objects removing may fail because their hashCode() has changed.
Note that operations that use Convertor are not supported.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate a new, empty content.MutableInstanceContent
(Executor notifyIn) Creates a content associated with an executor to handle dispatch of changes. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
The 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 void
Remove 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
-
MutableInstanceContent
public MutableInstanceContent()Create a new, empty content. -
MutableInstanceContent
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 instance.- Parameters:
inst
- instance
-
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)
-