Example usage for com.intellij.openapi.ui.popup ListPopup isVisible

List of usage examples for com.intellij.openapi.ui.popup ListPopup isVisible

Introduction

In this page you can find the example usage for com.intellij.openapi.ui.popup ListPopup isVisible.

Prototype

boolean isVisible();

Source Link

Document

Checks if the popup is currently visible.

Usage

From source file:net.groboclown.idea.p4ic.ui.P4MultipleConnectionWidget.java

License:Apache License

private void showPopup(@NotNull MouseEvent event) {
    // it isn't getting bubbled up to the parent
    DataContext dataContext = getContext();
    final ListPopup popup = createListPopup(dataContext);
    if (popup.isVisible()) {
        popup.cancel();/*from   www. ja  v  a2s. co m*/
        return;
    }
    final Dimension dimension = popup.getContent().getPreferredSize();
    final Point at = new Point(0, -dimension.height);
    popup.show(new RelativePoint(event.getComponent(), at));
    Disposer.register(this, popup); // destroy popup on unexpected project close
}