mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection settings: request focus to the tree when description is applied (IDEA-165091)
This commit is contained in:
+7
-2
@@ -59,13 +59,15 @@ public abstract class AbstractDescriptionAwareSchemesPanel<T extends Scheme> ext
|
||||
myDescriptionTextField.registerKeyboardAction(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
applyDescription();
|
||||
showDescription();
|
||||
getConfigurableFocusComponent().requestFocus();
|
||||
}
|
||||
}, ESC_KEY_STROKE, JComponent.WHEN_FOCUSED);
|
||||
myDescriptionTextField.registerKeyboardAction(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showDescription();
|
||||
applyDescription();
|
||||
getConfigurableFocusComponent().requestFocus();
|
||||
}
|
||||
}, ENTER_KEY_STROKE, JComponent.WHEN_FOCUSED);
|
||||
|
||||
@@ -123,6 +125,9 @@ public abstract class AbstractDescriptionAwareSchemesPanel<T extends Scheme> ext
|
||||
myDescriptionTextField.requestFocus();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected abstract JComponent getConfigurableFocusComponent();
|
||||
|
||||
private void applyDescription() {
|
||||
(((DescriptionAwareSchemeActions<T>)getActions())).setDescription(getSelectedScheme(), myDescriptionTextField.getText());
|
||||
showDescription();
|
||||
|
||||
+7
@@ -42,6 +42,7 @@ import org.jdom.JDOMException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
@@ -275,4 +276,10 @@ public class InspectionProfileSchemesPanel extends AbstractDescriptionAwareSchem
|
||||
getModel().updatePanel(this);
|
||||
selectScheme(selected);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected JComponent getConfigurableFocusComponent() {
|
||||
return myConfigurable.getPreferredFocusedComponent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user