public interface JBPopup extends Disposable
JBPopupFactory
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY |
Modifier and Type | Method and Description |
---|---|
void |
addListener(JBPopupListener listener) |
void |
cancel()
Cancels the popup as if Esc was pressed or any other "cancel" action.
|
void |
cancel(java.awt.event.InputEvent e)
Cancels the popup as a response to some mouse action.
|
boolean |
canClose()
Checks if it's currently allowed to close the popup.
|
default boolean |
canShow()
Whether it's OK to invoke one of the 'show' methods.
|
void |
closeOk(java.awt.event.InputEvent e)
Hides popup as if Enter was pressed or or any other "accept" action.
|
boolean |
dispatchKeyEvent(java.awt.event.KeyEvent e)
This callback is called when new key event from the event queue is being processed.
|
java.awt.Point |
getBestPositionFor(DataContext dataContext)
Returns location most appropriate for the specified data context.
|
javax.swing.JComponent |
getContent()
Returns the Swing component contained in the popup.
|
java.awt.Point |
getLocationOnScreen() |
java.awt.Component |
getOwner() |
java.awt.Dimension |
getSize() |
<T> T |
getUserData(java.lang.Class<T> userDataClass) |
boolean |
isCancelKeyEnabled() |
boolean |
isDisposed() |
boolean |
isFocused() |
boolean |
isModalContext() |
boolean |
isNativePopup() |
boolean |
isPersistent() |
boolean |
isVisible()
Checks if the popup is currently visible.
|
void |
moveToFitScreen() |
void |
pack(boolean width,
boolean height) |
void |
removeListener(JBPopupListener listener) |
void |
setAdText(java.lang.String s,
int alignment) |
void |
setCaption(java.lang.String title) |
void |
setDataProvider(DataProvider dataProvider) |
void |
setFinalRunnable(java.lang.Runnable runnable) |
void |
setLocation(java.awt.Point screenPoint)
Moves popup to the given point.
|
void |
setMinimumSize(java.awt.Dimension size) |
void |
setRequestFocus(boolean b) |
void |
setSize(java.awt.Dimension size) |
void |
setUiVisible(boolean visible) |
void |
show(java.awt.Component owner)
Shows in best position with a given owner
|
void |
show(RelativePoint point)
Shows the popup at the specified point.
|
void |
showCenteredInCurrentWindow(Project project)
Shows the popup in the center of the active window in the IDE frame for the specified project.
|
void |
showInBestPositionFor(DataContext dataContext)
Shows the popup in the position most appropriate for the specified data context.
|
void |
showInBestPositionFor(Editor editor)
Shows the popup near the cursor location in the specified editor.
|
void |
showInCenterOf(java.awt.Component component)
Shows the popup in the center of the specified component.
|
void |
showInFocusCenter()
Shows the popups in the center of currently focused component
|
void |
showInScreenCoordinates(java.awt.Component owner,
java.awt.Point point) |
void |
showUnderneathOf(java.awt.Component componentUnder)
Shows the popup at the bottom left corner of the specified component.
|
dispose
static final java.lang.String KEY
void showUnderneathOf(java.awt.Component componentUnder)
componentUnder
- the component near which the popup should be displayed.void show(RelativePoint point)
point
- the relative point where the popup should be displayed.void showInScreenCoordinates(java.awt.Component owner, java.awt.Point point)
java.awt.Point getBestPositionFor(DataContext dataContext)
void showInBestPositionFor(DataContext dataContext)
dataContext
- the data context to which the popup is related.JBPopupFactory.guessBestPopupLocation(DataContext)
,
getBestPositionFor(DataContext)
void showInBestPositionFor(Editor editor)
editor
- the editor relative to which the popup should be displayed.JBPopupFactory.guessBestPopupLocation(Editor)
void showInCenterOf(java.awt.Component component)
component
- the component at which the popup should be centered.void showInFocusCenter()
void show(java.awt.Component owner)
void showCenteredInCurrentWindow(Project project)
project
- the project in which the popup should be displayed.void closeOk(java.awt.event.InputEvent e)
void cancel()
void setRequestFocus(boolean b)
b
- true
if popup should request focus.void cancel(java.awt.event.InputEvent e)
boolean canClose()
true
if the popup can be closed, false
if a callback disallowed closing the popup.ComponentPopupBuilder.setCancelCallback(com.intellij.openapi.util.Computable)
boolean isVisible()
true
if the popup is visible, false
otherwise.javax.swing.JComponent getContent()
void setLocation(java.awt.Point screenPoint)
screenPoint
- Point to move to.void setSize(java.awt.Dimension size)
java.awt.Dimension getSize()
void setCaption(java.lang.String title)
boolean isPersistent()
boolean isModalContext()
boolean isNativePopup()
void setUiVisible(boolean visible)
<T> T getUserData(java.lang.Class<T> userDataClass)
boolean isFocused()
boolean isCancelKeyEnabled()
void addListener(JBPopupListener listener)
void removeListener(JBPopupListener listener)
boolean isDisposed()
java.awt.Component getOwner()
void setMinimumSize(java.awt.Dimension size)
void setFinalRunnable(java.lang.Runnable runnable)
void moveToFitScreen()
java.awt.Point getLocationOnScreen()
void pack(boolean width, boolean height)
void setAdText(java.lang.String s, int alignment)
void setDataProvider(DataProvider dataProvider)
boolean dispatchKeyEvent(java.awt.event.KeyEvent e)
e
- new key event being processedtrue
if the event is completely dispatched, i.e. no further processing is necessary;
false
otherwisedefault boolean canShow()