* Gets the current BeanContext from itself, if it's been set and
* the provided PlugIn wants/can be added to the BeanContext, it
* assumes it was and removes it from the BeanContext.
*/
public void removePlugInFromBeanContext(PlugIn pi) {
BeanContext bc = getBeanContext();
if (bc != null
&& pi != null
&&
(pi instanceof BeanContextChild || (pi instanceof AbstractPlugIn && ((AbstractPlugIn) pi).getAddToBeanContext()))) {
// Of course, we don't need all these conditions met to
// order the removal, but they are the ones in place that would
// cause it to be added, so we don't waste the effort
// unless the same conditions are met.
bc.remove(pi);
}
}