mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-86085 MultipleFileMergeDialog: resolve initial focus problem, set the default button.
* Make "Merge" button default. * Make the table to be preferred component to solve the issue with focus being left in the editor.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<text resource-bundle="messages/VcsBundle" key="multiple.file.merge.accept.theirs"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="39393" class="javax.swing.JButton" binding="myMergeButton" default-binding="true">
|
||||
<component id="39393" class="javax.swing.JButton" binding="myMergeButton" custom-create="true" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
|
||||
@@ -151,11 +151,6 @@ public class MultipleFileMergeDialog extends DialogWrapper {
|
||||
acceptRevision(false);
|
||||
}
|
||||
});
|
||||
myMergeButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showMergeDialog();
|
||||
}
|
||||
});
|
||||
myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
|
||||
public void valueChanged(final ListSelectionEvent e) {
|
||||
updateButtonState();
|
||||
@@ -327,6 +322,22 @@ public class MultipleFileMergeDialog extends DialogWrapper {
|
||||
MergeVersion.MergeDocumentVersion.reportProjectFileChangeIfNeeded(myProject, file);
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
Action mergeAction = new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showMergeDialog();
|
||||
}
|
||||
};
|
||||
mergeAction.putValue(DEFAULT_ACTION, Boolean.TRUE);
|
||||
myMergeButton = createJButtonForAction(mergeAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
return myTable;
|
||||
}
|
||||
|
||||
private static String decodeContent(final VirtualFile file, final byte[] content) {
|
||||
return StringUtil.convertLineSeparators(CharsetToolkit.bytesToString(content, file.getCharset()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user