[Mercurial] Removed dependancy on idea-ui. Removed option "open project for parent...
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Fri, 25 Jun 2010 09:11:40 +0000 (13:11 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Fri, 25 Jun 2010 09:11:40 +0000 (13:11 +0400)
plugins/hg4idea/hg4idea.iml
plugins/hg4idea/resources/org/zmlx/hg4idea/HgVcsMessages.properties
plugins/hg4idea/src/org/zmlx/hg4idea/action/HgInit.java
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgInitAlreadyUnderHgDialog.form
plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgInitAlreadyUnderHgDialog.java

index 2a8478c7fc0899d717460cde579cee46840f2609..169abf6dc8a0edcaea860d76b97009bfce785c1f 100644 (file)
@@ -13,7 +13,6 @@
     <orderEntry type="library" name="commons-lang" level="project" />
     <orderEntry type="library" scope="TEST" name="TestNG" level="project" />
     <orderEntry type="module" module-name="testFramework" scope="TEST" />
-    <orderEntry type="module" module-name="idea-ui" />
     <orderEntry type="module" module-name="platform-api" />
     <orderEntry type="module" module-name="vcs-impl" />
   </component>
index 80359c1166845a5c4c1014eed89d20244058615f..6c60e5c4fdd4e0a1ce8f74f97f3f6ad1354c09ff 100644 (file)
@@ -31,7 +31,6 @@ hg4idea.init.this.is.hg.root=The selected folder {0} is already a Mercurial root
 hg4idea.init.already.under.hg.description=<html>The selected directory <b><code>{0}</code></b> is already under Mercurial: <b><code>{1}</code></b><br/>Would you like to create new repository in the selected folder or use the parent one?</html>
 hg4idea.init.already.under.hg.title=This directory is already under hg
 hg4idea.init.already.under.hg.dialog.title=Directory is under hg
-hg4idea.init.already.under.hg.option.create.project.at.parent=Use parent repository and create IDEA project for it.
 hg4idea.init.already.under.hg.option.use.parent=Use parent repository, but keep working in this project.
 hg4idea.init.already.under.hg.option.create.repo.here=Create new repository here.
 hg4idea.init.created.notification.title=Mercurial repository created
index 57c61e8634e1c4f07ceae8feea211571d2c6e296..f9b1b02702c40870e635bc86e5dabb3b30e3b333 100644 (file)
@@ -1,6 +1,5 @@
 package org.zmlx.hg4idea.action;
 
-import com.intellij.ide.impl.NewProjectUtil;
 import com.intellij.notification.Notification;
 import com.intellij.notification.NotificationType;
 import com.intellij.notification.Notifications;
@@ -65,10 +64,7 @@ public class HgInit extends DumbAwareAction {
         return;
       }
 
-      if (dialog.getAnswer() == HgInitAlreadyUnderHgDialog.Answer.CREATE_PROJECT_AT_PARENT) {
-        NewProjectUtil.createNewProject(myProject, vcsRoot.getPath());
-        return;
-      } else if (dialog.getAnswer() == HgInitAlreadyUnderHgDialog.Answer.USE_PARENT_REPO_BUT_THIS_PROJECT) {
+      if (dialog.getAnswer() == HgInitAlreadyUnderHgDialog.Answer.USE_PARENT_REPO) {
         mapRoot = vcsRoot;
       } else if (dialog.getAnswer() == HgInitAlreadyUnderHgDialog.Answer.CREATE_REPO_HERE) {
         createRepository(selectedRoot);
index ba638f81ca587b807b956b88b61b3e78301aa06b..900f624bd161c2fd47ed8ad03dde483316ca22b7 100644 (file)
@@ -8,7 +8,7 @@
     <properties/>
     <border type="none"/>
     <children>
-      <grid id="e3588" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+      <grid id="e3588" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
         <margin top="0" left="0" bottom="0" right="0"/>
         <constraints>
           <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
         <properties/>
         <border type="none"/>
         <children>
-          <component id="1b523" class="javax.swing.JRadioButton" binding="myCreateNewRepositoryHereRadioButton" default-binding="true">
+          <component id="1b523" class="javax.swing.JRadioButton" binding="myCreateNewRepoButton" default-binding="true">
             <constraints>
-              <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+              <grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
             </constraints>
             <properties>
+              <selected value="true"/>
               <text resource-bundle="org/zmlx/hg4idea/HgVcsMessages" key="hg4idea.init.already.under.hg.option.create.repo.here"/>
             </properties>
           </component>
               <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
             </constraints>
           </vspacer>
-          <component id="ef06d" class="javax.swing.JRadioButton" binding="myUseParentRepoButThisProjectButton">
-            <constraints>
-              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
-            </constraints>
-            <properties>
-              <text resource-bundle="org/zmlx/hg4idea/HgVcsMessages" key="hg4idea.init.already.under.hg.option.use.parent"/>
-            </properties>
-          </component>
-          <component id="f180f" class="javax.swing.JRadioButton" binding="myUseParentRepoAndCreateProjectButton">
+          <component id="ef06d" class="javax.swing.JRadioButton" binding="myUseParentRepoButton">
             <constraints>
               <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
             </constraints>
             <properties>
-              <text resource-bundle="org/zmlx/hg4idea/HgVcsMessages" key="hg4idea.init.already.under.hg.option.create.project.at.parent"/>
+              <text resource-bundle="org/zmlx/hg4idea/HgVcsMessages" key="hg4idea.init.already.under.hg.option.use.parent"/>
             </properties>
           </component>
           <component id="244a3" class="com.intellij.openapi.ui.TitlePanel" binding="myTitlePanel" custom-create="true">
index ecb0fc2e2b2a97ea4ca78bda371e7c71eee633dd..92ccab07658925476bb28f1336ffec2188526e77 100644 (file)
@@ -29,16 +29,14 @@ import javax.swing.*;
  */
 public class HgInitAlreadyUnderHgDialog extends DialogWrapper {
   private JPanel contentPane;
-  private JRadioButton myCreateNewRepositoryHereRadioButton;
-  private JRadioButton myUseParentRepoButThisProjectButton;
-  private JRadioButton myUseParentRepoAndCreateProjectButton;
+  private JRadioButton myCreateNewRepoButton;
+  private JRadioButton myUseParentRepoButton;
   private TitlePanel myTitlePanel;
   private String myParentRoot;
   private String mySelectedRoot;
 
   public enum Answer {
-    CREATE_PROJECT_AT_PARENT,
-    USE_PARENT_REPO_BUT_THIS_PROJECT,
+    USE_PARENT_REPO,
     CREATE_REPO_HERE
   }
 
@@ -51,12 +49,10 @@ public class HgInitAlreadyUnderHgDialog extends DialogWrapper {
   }
 
   public Answer getAnswer() {
-    if (myCreateNewRepositoryHereRadioButton.isSelected()) {
+    if (myCreateNewRepoButton.isSelected()) {
       return Answer.CREATE_REPO_HERE;
-    } else if (myUseParentRepoAndCreateProjectButton.isSelected()) {
-      return Answer.CREATE_PROJECT_AT_PARENT;
     } else {
-      return Answer.USE_PARENT_REPO_BUT_THIS_PROJECT;
+      return Answer.USE_PARENT_REPO;
     }
   }
 
@@ -64,9 +60,8 @@ public class HgInitAlreadyUnderHgDialog extends DialogWrapper {
   protected void init() {
     super.init();
     final ButtonGroup buttonGroup = new ButtonGroup();
-    buttonGroup.add(myCreateNewRepositoryHereRadioButton);
-    buttonGroup.add(myUseParentRepoAndCreateProjectButton);
-    buttonGroup.add(myUseParentRepoButThisProjectButton);
+    buttonGroup.add(myCreateNewRepoButton);
+    buttonGroup.add(myUseParentRepoButton);
   }
 
   @Override