public final class FocusManagerImpl extends IdeFocusManager implements Disposable
Disposable.Parent
Constructor and Description |
---|
FocusManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
doWhenFocusSettlesDown(ExpirableRunnable runnable)
Executes given runnable after all focus activities are finished.
|
void |
doWhenFocusSettlesDown(java.lang.Runnable runnable)
Executes given runnable after all focus activities are finished.
|
void |
doWhenFocusSettlesDown(java.lang.Runnable runnable,
ModalityState modality)
Executes given runnable after all focus activities are finished, immediately or later with the given modality state.
|
java.awt.Component |
getFocusedDescendantFor(java.awt.Component comp)
Finds focused component among descendants of the given component.
|
java.awt.Component |
getFocusOwner()
Computes effective focus owner.
|
javax.swing.JComponent |
getFocusTargetFor(javax.swing.JComponent comp)
Finds most suitable component to request focus to.
|
static IdeFocusManager |
getInstance() |
java.awt.Component |
getLastFocusedFor(java.awt.Window frame)
Returns last focused component for the given IDE
Window . |
IdeFrame |
getLastFocusedFrame()
Returns last focused
IdeFrame . |
java.awt.Window |
getLastFocusedIdeWindow() |
java.util.List<FocusRequestInfo> |
getRequests() |
boolean |
isFocusTransferEnabled()
Reports of focus transfer is enabled right now.
|
void |
recordFocusRequest(java.awt.Component c,
boolean forced) |
ActionCallback |
requestDefaultFocus(boolean forced)
Requests default focus.
|
ActionCallback |
requestFocus(java.awt.Component c,
boolean forced)
Requests focus on a component
|
ActionCallback |
requestFocusInProject(java.awt.Component c,
Project project) |
void |
runOnOwnContext(DataContext context,
java.lang.Runnable runnable)
Runs runnable for which
DataContext will not be computed from the current focus owner,
but using given one. |
void |
setLastFocusedAtDeactivation(java.awt.Window frame,
java.awt.Component c) |
void |
setTypeaheadEnabled(boolean enabled)
Enables or disables typeahead.
|
void |
toFront(javax.swing.JComponent c)
Put the container window to front.
|
void |
typeAheadUntil(ActionCallback callback,
java.lang.String cause)
Aggregates all key events until given callback object is processed.
|
findInstance, findInstanceByComponent, findInstanceByContext, getFurtherRequestor, getGlobalInstance, getInstance, typeAheadUntil
public IdeFrame getLastFocusedFrame()
IdeFocusManager
IdeFrame
.getLastFocusedFrame
in class IdeFocusManager
public java.awt.Window getLastFocusedIdeWindow()
getLastFocusedIdeWindow
in class IdeFocusManager
@DirtyUI public ActionCallback requestFocusInProject(java.awt.Component c, Project project)
requestFocusInProject
in class IdeFocusManager
public ActionCallback requestFocus(java.awt.Component c, boolean forced)
FocusRequestor
requestFocus
in interface FocusRequestor
c
- - component to request focus toforced
- - if true - focus request is explicit, must be fulfilled, if false - can be droppedpublic java.util.List<FocusRequestInfo> getRequests()
public void recordFocusRequest(java.awt.Component c, boolean forced)
public static IdeFocusManager getInstance()
@DirtyUI public void dispose()
Disposable
dispose
in interface Disposable
dispose
in class IdeFocusManager
public void doWhenFocusSettlesDown(ExpirableRunnable runnable)
IdeFocusManager
doWhenFocusSettlesDown
in class IdeFocusManager
public void doWhenFocusSettlesDown(java.lang.Runnable runnable)
IdeFocusManager
doWhenFocusSettlesDown
in class IdeFocusManager
public void doWhenFocusSettlesDown(java.lang.Runnable runnable, ModalityState modality)
IdeFocusManager
doWhenFocusSettlesDown
in class IdeFocusManager
public void setTypeaheadEnabled(boolean enabled)
IdeFocusManager
setTypeaheadEnabled
in class IdeFocusManager
IdeFocusManager.typeAheadUntil(ActionCallback)
public void typeAheadUntil(ActionCallback callback, java.lang.String cause)
IdeFocusManager
typeAheadUntil
in class IdeFocusManager
callback
- action callback@DirtyUI public java.awt.Component getFocusOwner()
IdeFocusManager
getFocusOwner
in class IdeFocusManager
@DirtyUI public void runOnOwnContext(DataContext context, java.lang.Runnable runnable)
IdeFocusManager
DataContext
will not be computed from the current focus owner,
but using given one.runOnOwnContext
in class IdeFocusManager
public java.awt.Component getLastFocusedFor(java.awt.Window frame)
IdeFocusManager
Window
.
Only IDE window (that's implementing IdeFrame
).getLastFocusedFor
in class IdeFocusManager
public void setLastFocusedAtDeactivation(java.awt.Window frame, java.awt.Component c)
public void toFront(javax.swing.JComponent c)
IdeFocusManager
window.toFront()
.toFront
in class IdeFocusManager
public javax.swing.JComponent getFocusTargetFor(javax.swing.JComponent comp)
IdeFocusManager
getFocusTargetFor
in class IdeFocusManager
public java.awt.Component getFocusedDescendantFor(java.awt.Component comp)
IdeFocusManager
getFocusedDescendantFor
in class IdeFocusManager
public ActionCallback requestDefaultFocus(boolean forced)
IdeFocusManager
requestDefaultFocus
in class IdeFocusManager
public boolean isFocusTransferEnabled()
IdeFocusManager
FocusCommand
can be executed on an inactive app.isFocusTransferEnabled
in class IdeFocusManager