/** The method to add a pair to the associated {@link AbstractLookup}. * Preferably call this method when lookup is already associated with * this <em>content</em> (association is done by passing this object to some * {@link AbstractLookup#AbstractLookup(org.openide.util.lookup.AbstractLookup.Content) AbstractLookup's constructor} * once). * * @param pair class/instance pair * @throws NullPointerException may throw NullPointerException if called * before association with {@link AbstractLookup} */ public final void addPair(Pair<?> pair) { AbstractLookup a = al; Executor e = getExecutor(); if (a != null || e != null) { if (a == null) { throw new NullPointerException( "Adding a pair to Content not connected to Lookup is not supported!" // NOI18N ); } a.addPair(pair, e); } else { if (notifyIn == null) { notifyIn = new ArrayList<Pair>(3); } getEarlyPairs().add(pair); } }
/** The method to add instance to the lookup with. * @param pair class/instance pair */ public final void addPair (Pair pair) { AbstractLookup a = al; if (a != null) { a.addPair (pair); } else { if (earlyPairs == null) { earlyPairs = new ArrayList (3); } earlyPairs.add(pair); } }
/** The method to add instance to the lookup with. * @param pair class/instance pair */ public final void addPair (Pair pair) { AbstractLookup a = al; if (a != null) { a.addPair (pair); } else { if (earlyPairs == null) { earlyPairs = new ArrayList (3); } earlyPairs.add(pair); } }
/** The method to add instance to the lookup with. * @param pair class/instance pair */ public final void addPair(Pair<?> pair) { AbstractLookup a = al; Executor e = getExecutor(); if (a != null || e != null) { a.addPair(pair, e); } else { if (notifyIn == null) { notifyIn = new ArrayList<Pair>(3); } getEarlyPairs().add(pair); } }
/** The method to add a pair to the associated {@link AbstractLookup}. * Preferably call this method when lookup is already associated with * this <em>content</em> (association is done by passing this object to some * {@link AbstractLookup#AbstractLookup(org.openide.util.lookup.AbstractLookup.Content) AbstractLookup's constructor} * once). * * @param pair class/instance pair * @throws NullPointerException may throw NullPointerException if called * before association with {@link AbstractLookup} */ public final void addPair(Pair<?> pair) { AbstractLookup a = al; Executor e = getExecutor(); if (a != null || e != null) { if (a == null) { throw new NullPointerException( "Adding a pair to Content not connected to Lookup is not supported!" // NOI18N ); } a.addPair(pair, e); } else { if (notifyIn == null) { notifyIn = new ArrayList<Pair>(3); } getEarlyPairs().add(pair); } }