IDEA-57931 Use editor for managing commit message at vcs-diff panel idea/96.1028
authorDenis Zhdanov <Denis.Zhdanov@jetbrains.com>
Thu, 26 Aug 2010 08:19:18 +0000 (12:19 +0400)
committerDenis Zhdanov <Denis.Zhdanov@jetbrains.com>
Thu, 26 Aug 2010 08:21:08 +0000 (12:21 +0400)
Commit change list dialog uses properly configured commit message editor now

platform/platform-api/src/com/intellij/openapi/diff/DiffRequest.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java

index 34041fa45cb666ec89cdc18a460d8ae33a160170..11e83b66bdab72e24dd393bd6d38046959b7b323 100644 (file)
@@ -67,7 +67,7 @@ public abstract class DiffRequest {
   public abstract String getWindowTitle();
 
   /**
-   * <B>Work in progess. Don't rely on this functionality</B><br>
+   * <B>Work in progress. Don't rely on this functionality</B><br>
    */
   public void customizeToolbar(DiffToolbar toolbar) {
     myToolbarAddons.customize(toolbar);
@@ -106,7 +106,7 @@ public abstract class DiffRequest {
   }
 
   /**
-   * <B>Work in progess. Don't rely on this functionality</B><br>
+   * <B>Work in progress. Don't rely on this functionality</B><br>
    */
   public static interface ToolbarAddons {
     /**
index ab6e56194ed64da7db1bf420c5ce19c9bafe8886..9ad9eb7ce978724f46d9b7edb1d16fcc1145b53c 100644 (file)
@@ -38,8 +38,8 @@ import com.intellij.openapi.vcs.checkin.*;
 import com.intellij.openapi.vcs.ui.CommitMessage;
 import com.intellij.openapi.vcs.ui.RefreshableOnComponent;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.ui.EditorTextField;
 import com.intellij.ui.IdeBorderFactory;
-import com.intellij.ui.ScrollPaneFactory;
 import com.intellij.ui.SeparatorFactory;
 import com.intellij.util.Alarm;
 import org.jetbrains.annotations.NonNls;
@@ -979,24 +979,18 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
     }
   }
 
-  private static class DiffCommitMessageEditor extends JPanel implements Disposable {
+  private static class DiffCommitMessageEditor extends CommitMessage implements Disposable {
     private CommitChangeListDialog myCommitDialog;
-    private final JTextArea myArea = new JTextArea();
 
     public DiffCommitMessageEditor(final CommitChangeListDialog dialog) {
-      super(new BorderLayout());
-      myArea.setText(dialog.getCommitMessage());
-      myArea.setLineWrap(true);      
-      myArea.setWrapStyleWord(true);
-      JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myArea);
-      setBorder(IdeBorderFactory.createTitledBorder(VcsBundle.message("diff.commit.message.title")));
-      add(scrollPane, BorderLayout.CENTER);
+      super(dialog.getProject());
+      getEditorField().setText(dialog.getCommitMessage());
       myCommitDialog = dialog;
     }
 
     public void dispose() {
       if (myCommitDialog != null) {
-        myCommitDialog.setCommitMessageText(myArea.getText());
+        myCommitDialog.setCommitMessageText(getEditorField().getText());
         myCommitDialog = null;
       }
     }