Java Code Examples for org.openide.util.lookup.InstanceContent#Convertor

The following examples show how to use org.openide.util.lookup.InstanceContent#Convertor . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainLookup.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Unregisters the service registered with a convertor.
 */
public static <T,R> void unregister (T obj, InstanceContent.Convertor<T,R> conv) {
    instanceContent.remove (obj, conv);
}
 
Example 2
Source File: CookieSetLkp.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public final <T,R> void add(T inst, InstanceContent.Convertor<T,R> conv) {
    addPair(new ConvertingItem<T,R>(inst, conv));
}
 
Example 3
Source File: CookieSetLkp.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public final <T,R> void remove(T inst, InstanceContent.Convertor<T,R> conv) {
    removePair(new ConvertingItem<T,R>(inst, conv));
}
 
Example 4
Source File: CookieSetLkp.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Create an item.
 * @obj object to register
 * @conv a convertor, can be <code>null</code>.
 */
public ConvertingItem(T obj, InstanceContent.Convertor<? super T,R> conv) {
    this.obj = obj;
    this.conv = conv;
}
 
Example 5
Source File: MainLookup.java    From netbeans with Apache License 2.0 2 votes vote down vote up
/** Register new instance.
 * @param obj source
 * @param conv convertor which postponing an instantiation
 */
public static <T,R> void register(T obj, InstanceContent.Convertor<T,R> conv) {
    instanceContent.add(obj, conv);
}