mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-10 12:10:14 +00:00
fix: focus on new editor action and refresh editor actions on apply (#518)
This commit is contained in:
parent
8de72b3301
commit
1415f387ff
2 changed files with 8 additions and 2 deletions
|
|
@ -28,7 +28,6 @@ import ee.carlrobert.codegpt.ui.UIUtil;
|
|||
import java.awt.Dimension;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JComponent;
|
||||
|
|
@ -191,7 +190,12 @@ public class ConfigurationComponent {
|
|||
private JPanel createTablePanel() {
|
||||
return ToolbarDecorator.createDecorator(table)
|
||||
.setPreferredSize(new Dimension(table.getPreferredSize().width, 140))
|
||||
.setAddAction(anActionButton -> getModel().addRow(new Object[]{"", ""}))
|
||||
.setAddAction(anActionButton -> {
|
||||
getModel().addRow(new Object[]{"", ""});
|
||||
int lastRowIndex = getModel().getRowCount() - 1;
|
||||
table.changeSelection(lastRowIndex, 0, false, false);
|
||||
table.editCellAt(lastRowIndex, 0);
|
||||
})
|
||||
.setRemoveAction(anActionButton -> getModel().removeRow(table.getSelectedRow()))
|
||||
.disableUpAction()
|
||||
.disableDownAction()
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.intellij.openapi.Disposable;
|
|||
import com.intellij.openapi.options.Configurable;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import ee.carlrobert.codegpt.CodeGPTBundle;
|
||||
import ee.carlrobert.codegpt.actions.editor.EditorActionsUtil;
|
||||
import javax.swing.JComponent;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
|
@ -39,6 +40,7 @@ public class ConfigurationConfigurable implements Configurable {
|
|||
@Override
|
||||
public void apply() {
|
||||
ConfigurationSettings.getInstance().loadState(component.getCurrentFormState());
|
||||
EditorActionsUtil.refreshActions();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue