public class AbstractPopup extends java.lang.Object implements JBPopup, ScreenAreaConsumer
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractPopup.MyContentPanel |
Disposable.Parent| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FIRST_TIME_SIZE |
protected boolean |
myOk |
protected java.awt.Component |
myOwner |
protected SpeedSearch |
mySpeedSearch |
protected SearchTextField |
mySpeedSearchPatternField |
static java.lang.String |
SHOW_HINTS |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPopup() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(JBPopupListener listener) |
protected void |
addPopupListener(JBPopupListener listener) |
void |
addResizeListener(java.lang.Runnable runnable,
Disposable parentDisposable)
Passed listener will be notified if popup is resized by user (using mouse)
|
protected void |
afterShow() |
protected void |
afterShowSync() |
protected boolean |
beforeShow() |
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.
|
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.
|
protected AbstractPopup.MyContentPanel |
createContentPanel(boolean resizable,
PopupBorder border,
boolean isToDrawMacCorner) |
boolean |
dispatchKeyEvent(java.awt.event.KeyEvent e)
This callback is called when new key event from the event queue is being processed.
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
focusPreferredComponent() |
java.awt.Point |
getBestPositionFor(DataContext dataContext)
Returns location most appropriate for the specified data context.
|
static java.awt.Point |
getCenterOf(java.awt.Component aContainer,
javax.swing.JComponent content) |
static java.util.List<JBPopup> |
getChildPopups(java.awt.Component component) |
javax.swing.JComponent |
getComponent() |
java.awt.Rectangle |
getConsumedScreenBounds() |
javax.swing.JComponent |
getContent()
Returns the Swing component contained in the popup.
|
java.lang.String |
getDimensionServiceKey() |
java.awt.Dimension |
getFooterPreferredSize() |
java.awt.Dimension |
getHeaderPreferredSize() |
java.awt.Point |
getLocationOnScreen() |
java.awt.Component |
getOwner() |
PopupBorder |
getPopupBorder() |
java.awt.Window |
getPopupWindow() |
Project |
getProject() |
java.awt.Dimension |
getSize() |
CaptionPanel |
getTitle() |
java.awt.Window |
getUnderlyingWindow() |
<T> T |
getUserData(java.lang.Class<T> userDataClass) |
protected AbstractPopup |
init(Project project,
javax.swing.JComponent component,
javax.swing.JComponent preferredFocusedComponent,
boolean requestFocus,
boolean focusable,
boolean movable,
java.lang.String dimensionServiceKey,
boolean resizable,
java.lang.String caption,
Computable<java.lang.Boolean> callback,
boolean cancelOnClickOutside,
java.util.Set<JBPopupListener> listeners,
boolean useDimServiceForXYLocation,
ActiveComponent commandButton,
IconButton cancelButton,
MouseChecker cancelOnMouseOutCallback,
boolean cancelOnWindow,
ActiveIcon titleIcon,
boolean cancelKeyEnabled,
boolean locateByContent,
boolean placeWithinScreenBounds,
java.awt.Dimension minSize,
float alpha,
MaskProvider maskProvider,
boolean inStack,
boolean modalContext,
java.awt.Component [] focusOwners,
java.lang.String adText,
int adTextAlignment,
boolean headerAlwaysFocusable,
java.util.List<? extends Pair<java.awt.event.ActionListener,javax.swing.KeyStroke>> keyboardActions,
java.awt.Component settingsButtons,
Processor<? super JBPopup> pinCallback,
boolean mayBeParent,
boolean showShadow,
boolean showBorder,
java.awt.Color borderColor,
boolean cancelOnWindowDeactivation,
BooleanFunction<? super java.awt.event.KeyEvent> keyEventHandler) |
protected boolean |
isBusy() |
boolean |
isCancelKeyEnabled() |
static boolean |
isCloseRequest(java.awt.event.KeyEvent e) |
boolean |
isDisposed() |
boolean |
isFocused() |
static boolean |
isFocused(java.awt.Component [] components) |
boolean |
isModalContext() |
boolean |
isNativePopup() |
boolean |
isPersistent() |
boolean |
isVisible()
Checks if the popup is currently visible.
|
static java.awt.Window |
moveTo(javax.swing.JComponent content,
java.awt.Point screenPoint,
java.awt.Dimension headerCorrectionSize) |
void |
moveToFitScreen() |
protected void |
onSpeedSearchPatternChanged() |
void |
pack(boolean width,
boolean height) |
protected void |
prepareToShow() |
void |
removeListener(JBPopupListener listener) |
protected boolean |
requestFocus() |
void |
setAdText(java.lang.String s) |
void |
setAdText(java.lang.String s,
int alignment) |
void |
setCaption(java.lang.String title) |
void |
setDataProvider(DataProvider dataProvider) |
void |
setDimensionServiceKey(java.lang.String dimensionServiceKey) |
void |
setFinalRunnable(java.lang.Runnable finalRunnable) |
protected void |
setHeaderComponent(javax.swing.JComponent c) |
void |
setLocation(java.awt.Point screenPoint)
Moves popup to the given point.
|
void |
setLocation(RelativePoint p) |
void |
setMinimumSize(java.awt.Dimension size) |
void |
setOk(boolean ok) |
void |
setOkHandler(java.lang.Runnable okHandler) |
void |
setRequestFocus(boolean requestFocus) |
void |
setShowHints(boolean show) |
void |
setSize(java.awt.Dimension size) |
static java.awt.Window |
setSize(javax.swing.JComponent content,
java.awt.Dimension size) |
void |
setSpeedSearchAlwaysShown(boolean value) |
void |
setUiVisible(boolean visible) |
void |
setUserData(java.util.List<java.lang.Object> userData) |
void |
setWarning(java.lang.String text) |
void |
show(java.awt.Component owner)
Shows in best position with a given owner
|
void |
show(java.awt.Component owner,
int aScreenX,
int aScreenY,
boolean considerForcedXY) |
void |
show(RelativePoint aPoint)
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 aComponent)
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 aComponent)
Shows the popup at the bottom left corner of the specified component.
|
void |
storeDimensionSize() |
public static final java.lang.String SHOW_HINTS
public static final java.lang.String FIRST_TIME_SIZE
protected java.awt.Component myOwner
protected boolean myOk
protected final SpeedSearch mySpeedSearch
protected SearchTextField mySpeedSearchPatternField
protected AbstractPopup init(Project project, javax.swing.JComponent component, javax.swing.JComponent preferredFocusedComponent, boolean requestFocus, boolean focusable, boolean movable, java.lang.String dimensionServiceKey, boolean resizable, java.lang.String caption, Computable<java.lang.Boolean> callback, boolean cancelOnClickOutside, java.util.Set<JBPopupListener> listeners, boolean useDimServiceForXYLocation, ActiveComponent commandButton, IconButton cancelButton, MouseChecker cancelOnMouseOutCallback, boolean cancelOnWindow, ActiveIcon titleIcon, boolean cancelKeyEnabled, boolean locateByContent, boolean placeWithinScreenBounds, java.awt.Dimension minSize, float alpha, MaskProvider maskProvider, boolean inStack, boolean modalContext, java.awt.Component [] focusOwners, java.lang.String adText, int adTextAlignment, boolean headerAlwaysFocusable, java.util.List<? extends Pair<java.awt.event.ActionListener,javax.swing.KeyStroke>> keyboardActions, java.awt.Component settingsButtons, Processor<? super JBPopup> pinCallback, boolean mayBeParent, boolean showShadow, boolean showBorder, java.awt.Color borderColor, boolean cancelOnWindowDeactivation, BooleanFunction<? super java.awt.event.KeyEvent> keyEventHandler)
protected AbstractPopup.MyContentPanel createContentPanel(boolean resizable, PopupBorder border, boolean isToDrawMacCorner)
public void setShowHints(boolean show)
public java.lang.String getDimensionServiceKey()
public void setDimensionServiceKey(java.lang.String dimensionServiceKey)
public void setAdText(java.lang.String s)
public PopupBorder getPopupBorder()
public void setAdText(java.lang.String s,
int alignment)
public static java.awt.Point getCenterOf(java.awt.Component aContainer,
javax.swing.JComponent content)
public void showCenteredInCurrentWindow(Project project)
JBPopupshowCenteredInCurrentWindow in interface JBPopupproject - the project in which the popup should be displayed.public void showInCenterOf(java.awt.Component aComponent)
JBPopupshowInCenterOf in interface JBPopupaComponent - the component at which the popup should be centered.public void showUnderneathOf(java.awt.Component aComponent)
JBPopupshowUnderneathOf in interface JBPopupaComponent - the component near which the popup should be displayed.public void show(RelativePoint aPoint)
JBPopuppublic void showInScreenCoordinates(java.awt.Component owner,
java.awt.Point point)
showInScreenCoordinates in interface JBPopuppublic java.awt.Point getBestPositionFor(DataContext dataContext)
JBPopupgetBestPositionFor in interface JBPopupJBPopup.showInBestPositionFor(DataContext),
JBPopup.setLocation(Point)public void showInBestPositionFor(DataContext dataContext)
JBPopupshowInBestPositionFor in interface JBPopupdataContext - the data context to which the popup is related.JBPopupFactory.guessBestPopupLocation(DataContext),
JBPopup.getBestPositionFor(DataContext)public void showInFocusCenter()
JBPopupshowInFocusCenter in interface JBPopuppublic void showInBestPositionFor(Editor editor)
JBPopupshowInBestPositionFor in interface JBPopupeditor - the editor relative to which the popup should be displayed.JBPopupFactory.guessBestPopupLocation(Editor)protected void addPopupListener(JBPopupListener listener)
public final void closeOk(java.awt.event.InputEvent e)
JBPopuppublic final void cancel()
JBPopuppublic void setRequestFocus(boolean requestFocus)
setRequestFocus in interface JBPopuprequestFocus - true if popup should request focus.public void cancel(java.awt.event.InputEvent e)
JBPopuppublic boolean canClose()
JBPopupcanClose in interface JBPopuptrue if the popup can be closed, false if a callback disallowed closing the popup.ComponentPopupBuilder.setCancelCallback(com.intellij.openapi.util.Computable)public boolean isVisible()
JBPopuppublic void show(java.awt.Component owner)
JBPopuppublic void show(java.awt.Component owner,
int aScreenX,
int aScreenY,
boolean considerForcedXY)
public void focusPreferredComponent()
protected void prepareToShow()
public boolean isDisposed()
isDisposed in interface JBPopupprotected boolean beforeShow()
protected void afterShow()
protected void afterShowSync()
protected final boolean requestFocus()
public javax.swing.JComponent getContent()
JBPopupgetContent in interface JBPopuppublic void setLocation(RelativePoint p)
public javax.swing.JComponent getComponent()
public Project getProject()
public void dispose()
Disposabledispose in interface Disposablepublic void storeDimensionSize()
public void setLocation(java.awt.Point screenPoint)
JBPopupsetLocation in interface JBPopupscreenPoint - Point to move to.public static java.awt.Window moveTo(javax.swing.JComponent content,
java.awt.Point screenPoint,
java.awt.Dimension headerCorrectionSize)
public java.awt.Point getLocationOnScreen()
getLocationOnScreen in interface JBPopuppublic void moveToFitScreen()
moveToFitScreen in interface JBPopuppublic static java.awt.Window setSize(javax.swing.JComponent content,
java.awt.Dimension size)
public void setCaption(java.lang.String title)
setCaption in interface JBPopuppublic void setSpeedSearchAlwaysShown(boolean value)
public boolean isPersistent()
isPersistent in interface JBPopuppublic boolean isNativePopup()
isNativePopup in interface JBPopuppublic void setUiVisible(boolean visible)
setUiVisible in interface JBPopuppublic java.awt.Window getPopupWindow()
public void setUserData(java.util.List<java.lang.Object> userData)
public <T> T getUserData(java.lang.Class<T> userDataClass)
getUserData in interface JBPopuppublic boolean isModalContext()
isModalContext in interface JBPopuppublic static boolean isFocused(java.awt.Component [] components)
public boolean isCancelKeyEnabled()
isCancelKeyEnabled in interface JBPopuppublic CaptionPanel getTitle()
protected void setHeaderComponent(javax.swing.JComponent c)
public void setWarning(java.lang.String text)
public void addListener(JBPopupListener listener)
addListener in interface JBPopuppublic void removeListener(JBPopupListener listener)
removeListener in interface JBPopupprotected void onSpeedSearchPatternChanged()
public void setMinimumSize(java.awt.Dimension size)
setMinimumSize in interface JBPopuppublic void setOkHandler(java.lang.Runnable okHandler)
public void setFinalRunnable(java.lang.Runnable finalRunnable)
setFinalRunnable in interface JBPopuppublic void setOk(boolean ok)
public void setDataProvider(DataProvider dataProvider)
setDataProvider in interface JBPopuppublic boolean dispatchKeyEvent(java.awt.event.KeyEvent e)
JBPopupdispatchKeyEvent in interface JBPopupe - new key event being processedtrue if the event is completely dispatched, i.e. no further processing is necessary;
false otherwisepublic java.awt.Dimension getHeaderPreferredSize()
public java.awt.Dimension getFooterPreferredSize()
public static boolean isCloseRequest(java.awt.event.KeyEvent e)
protected boolean isBusy()
public static java.util.List<JBPopup> getChildPopups(java.awt.Component component)
public boolean canShow()
JBPopuppublic java.awt.Rectangle getConsumedScreenBounds()
getConsumedScreenBounds in interface ScreenAreaConsumerpublic java.awt.Window getUnderlyingWindow()
getUnderlyingWindow in interface ScreenAreaConsumerpublic void addResizeListener(java.lang.Runnable runnable,
Disposable parentDisposable)