popup.setContentElement(renderer.renderDom());
popup.setCaptureOutsideClickOnClose(shouldCaptureOutsideClickOnClose);
setPopupPartnersEnabled(popupPartnerElements, true);
final Timer showTimer = new Timer() {
@Override
public void run() {
positionerBuilder.setVerticalAlign(verticalAlign);
popup.show(positionerBuilder.buildAnchorPositioner(popupDummyElement));
if (lineRenderer != null) {
editor.addLineRenderer(lineRenderer);
requestRenderLines(lineRenderer);
}
}
};
if (delayMs <= 0) {
showTimer.run();
} else {
showTimer.schedule(delayMs);
}
final com.google.collide.shared.util.ListenerRegistrar.Remover scrollListenerRemover =
editor.getBuffer().getScrollListenerRegistrar().add(scrollListener);
return (currentPopupRemover = new Remover() {
@Override
public boolean isVisibleOrPending() {
return this == currentPopupRemover;
}
@Override
public void remove() {
showTimer.cancel();
if (isVisibleOrPending()) {
currentPopupRemover = null;
detachPopupDummyElement();
setPopupPartnersEnabled(popupPartnerElements, false);