use of com.intellij.openapi.wm.IdeFocusManager in project intellij-community by JetBrains.
the class EditableSchemesCombo method cancelEdit.
public void cancelEdit() {
mySchemesPanel.clearInfo();
myLayout.first(myRootPanel);
final IdeFocusManager focusManager = IdeFocusManager.getGlobalInstance();
focusManager.doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myRootPanel, true));
}
use of com.intellij.openapi.wm.IdeFocusManager in project intellij-community by JetBrains.
the class EditableSchemesCombo method startEdit.
public void startEdit() {
T scheme = getSelectedScheme();
if (scheme != null) {
showHint();
myNameEditorField.setText(scheme.getName());
myLayout.last(myRootPanel);
final IdeFocusManager focusManager = IdeFocusManager.getGlobalInstance();
focusManager.doWhenFocusSettlesDown(() -> focusManager.requestFocus(myNameEditorField, true));
}
}
use of com.intellij.openapi.wm.IdeFocusManager in project intellij-community by JetBrains.
the class WrapReturnValueDialog method toggleRadioEnablement.
private void toggleRadioEnablement() {
UIUtil.setEnabled(myExistingClassPanel, useExistingClassButton.isSelected(), true);
UIUtil.setEnabled(myNewClassPanel, createNewClassButton.isSelected(), true);
UIUtil.setEnabled(myCreateInnerPanel, myCreateInnerClassButton.isSelected(), true);
final IdeFocusManager focusManager = IdeFocusManager.getInstance(myProject);
if (useExistingClassButton.isSelected()) {
focusManager.requestFocus(existingClassField, true);
} else if (myCreateInnerClassButton.isSelected()) {
focusManager.requestFocus(myInnerClassNameTextField, true);
} else {
focusManager.requestFocus(classNameField, true);
}
validateButtons();
}
use of com.intellij.openapi.wm.IdeFocusManager in project android by JetBrains.
the class ThemeSelectionPanel method focus.
public void focus() {
final Project project = myConfiguration.getModule().getProject();
final IdeFocusManager focusManager = project.isDefault() ? IdeFocusManager.getGlobalInstance() : IdeFocusManager.getInstance(project);
focusManager.doWhenFocusSettlesDown(new Runnable() {
@Override
public void run() {
focusManager.requestFocus(myThemeList, true);
}
});
}
use of com.intellij.openapi.wm.IdeFocusManager in project intellij-community by JetBrains.
the class IdeEventQueue method storeLastFocusedComponent.
private static void storeLastFocusedComponent(@NotNull WindowEvent we) {
final Window eventWindow = we.getWindow();
if (we.getID() == WindowEvent.WINDOW_DEACTIVATED || we.getID() == WindowEvent.WINDOW_LOST_FOCUS) {
Component frame = UIUtil.findUltimateParent(eventWindow);
Component focusOwnerInDeactivatedWindow = eventWindow.getMostRecentFocusOwner();
IdeFrame[] allProjectFrames = WindowManager.getInstance().getAllProjectFrames();
if (focusOwnerInDeactivatedWindow != null) {
for (IdeFrame ideFrame : allProjectFrames) {
JFrame aFrame = WindowManager.getInstance().getFrame(ideFrame.getProject());
if (aFrame.equals(frame)) {
IdeFocusManager focusManager = IdeFocusManager.getGlobalInstance();
if (focusManager instanceof FocusManagerImpl) {
((FocusManagerImpl) focusManager).setLastFocusedAtDeactivation(ideFrame, focusOwnerInDeactivatedWindow);
}
}
}
}
}
}
Aggregations