dir-diff: cleanup
authorAleksey Pivovarov <AMPivovarov@gmail.com>
Thu, 20 Jan 2022 06:18:44 +0000 (09:18 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 27 Jan 2022 09:31:01 +0000 (09:31 +0000)
GitOrigin-RevId: e745f566965465a91741bc5d89001440848757b0

platform/diff-api/resources/messages/DiffBundle.properties
platform/diff-impl/src/com/intellij/openapi/diff/impl/dir/DirDiffPanel.java

index 4b7ed6a573c0dbf512ce514699b47ba3f7f906fb..4ef82074e98cd551cc430b1a63e0cf4b1bc69ad1 100644 (file)
@@ -117,7 +117,6 @@ error.message.cannot.show.diff=Can't show diff
 error.message.cannot.show.merge=Can't show merge
 label.cant.show.diff.with.description=Can''t show diff: {0}
 label.cant.show.merge.with.description=Can''t show merge: {0}
-action.Anonymous.text.change.diff.operation=Change diff operation
 action.Anonymous.text.apply.non.conflicting.changes=Apply non-conflicting changes:
 action.presentation.RefreshDirDiffAction.text=Refresh
 continue.merge=Continue Merge
index 33ebbe7605f5db51b065d391c88ac446a98bffd2..597c47541892fbf0754e72fd828043415170258a 100644 (file)
@@ -133,12 +133,8 @@ public class DirDiffPanel implements Disposable, DataProvider {
       }
     });
     if (model.isOperationsEnabled()) {
-      new DumbAwareAction(DiffBundle.messagePointer("action.Anonymous.text.change.diff.operation")) {
-        @Override
-        public void actionPerformed(@NotNull AnActionEvent e) {
-          changeOperationForSelection();
-        }
-      }.registerCustomShortcutSet(CustomShortcutSet.fromString("SPACE"), myTable);
+      DumbAwareAction.create(e -> changeOperationForSelection())
+        .registerCustomShortcutSet(new CustomShortcutSet(KeyEvent.VK_SPACE), myTable);
       new ClickListener() {
         @Override
         public boolean onClick(@NotNull MouseEvent e, int clickCount) {
@@ -207,11 +203,11 @@ public class DirDiffPanel implements Disposable, DataProvider {
     sourcePanel.setBorder(JBUI.Borders.empty(0, 8));
     targetPanel.setBorder(JBUI.Borders.empty(0, 8));
 
-    GridBag gb = new GridBag();
+    GridBag gb = new GridBag().setDefaultFill(GridBagConstraints.HORIZONTAL).setDefaultWeightX(1);
     JPanel headerPanel = new JPanel(new GridBagLayout());
     headerPanel.add(myToolbarPanel, gb.nextLine().next().coverLine());
-    headerPanel.add(sourcePanel, gb.next().fillCellHorizontally().weightx(1));
-    headerPanel.add(targetPanel, gb.next().fillCellHorizontally().weightx(1));
+    headerPanel.add(sourcePanel, gb.nextLine().next());
+    headerPanel.add(targetPanel, gb.next());
 
     Splitter tableSplitter = new OnePixelSplitter(true, SPLITTER_PROPORTION_KEY, 0.4f);
     tableSplitter.setFirstComponent(JBUI.Panels.simplePanel(filesPanel)