/** Unregister the component. If this is the last asks if it is * allowed to unregister it. * * @param c the component to unregister * @return true if the component agreed to be unregister */ private final boolean unregister (CloneableTopComponent c) { int componentCount; synchronized(LOCK) { if(!componentSet.contains(c)) { return true; } componentCount = componentSet.size(); } if (componentCount > 1 || c.closeLast()) { removeComponent(c); return true; } else { return false; } }
/** Unregister the component. If this is the last asks if it is * allowed to unregister it. * * @param c the component to unregister * @return true if the component agreed to be unregister */ private final boolean unregister (CloneableTopComponent c) { int componentCount; synchronized(LOCK) { if(!componentSet.contains(c)) { return true; } componentCount = componentSet.size(); } if (componentCount > 1 || c.closeLast()) { removeComponent(c); return true; } else { return false; } }