diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/ManageCodeStyleSchemesDialog.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/ManageCodeStyleSchemesDialog.java index fa93e04f6d81..455bd02cb300 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/ManageCodeStyleSchemesDialog.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/ManageCodeStyleSchemesDialog.java @@ -70,6 +70,8 @@ public class ManageCodeStyleSchemesDialog extends DialogWrapper { updateActions(); } }); + setDefaultSelection(); + myDeleteButton.addActionListener(new ActionListener() { @Override @@ -345,5 +347,14 @@ public class ManageCodeStyleSchemesDialog extends DialogWrapper { mySchemesTableModel.copyToProject(getSelectedScheme()); } + private void setDefaultSelection() { + CodeStyleScheme selectedScheme = myModel.getSelectedScheme(); + for (int i = 0; i < mySchemesTableModel.getRowCount(); i ++) { + if (mySchemesTableModel.getSchemeAt(i).equals(selectedScheme)) { + mySchemesTable.getSelectionModel().setSelectionInterval(i, i); + return; + } + } + } }