This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 123931
Collapse All | Expand All

(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/HgModuleConfig.java (-5 / +5 lines)
Lines 76-82 Link Here
76
    private static final String RECENT_URL = "repository.recentURL";                                        // NOI18N
76
    private static final String RECENT_URL = "repository.recentURL";                                        // NOI18N
77
    private static final String SHOW_CLONE_COMPLETED = "cloneCompleted.showCloneCompleted";        // NOI18N  
77
    private static final String SHOW_CLONE_COMPLETED = "cloneCompleted.showCloneCompleted";        // NOI18N  
78
78
79
    private static final String OPEN_CLONED_PROJECT = "cloneCompleted.openClonedProject";        // NOI18N  
79
    private static final String SET_MAIN_PROJECT = "cloneCompleted.setMainProject";        // NOI18N  
80
80
81
    private static final String URL_EXP = "annotator.urlExp";                                               // NOI18N
81
    private static final String URL_EXP = "annotator.urlExp";                                               // NOI18N
82
    private static final String ANNOTATION_EXP = "annotator.annotationExp";                                 // NOI18N
82
    private static final String ANNOTATION_EXP = "annotator.annotationExp";                                 // NOI18N
Lines 104-111 Link Here
104
        return getPreferences().getBoolean(SHOW_CLONE_COMPLETED, true);
104
        return getPreferences().getBoolean(SHOW_CLONE_COMPLETED, true);
105
    }
105
    }
106
    
106
    
107
    public boolean getOpenClonedProject() {
107
    public boolean getSetMainProject() {
108
        return getPreferences().getBoolean(OPEN_CLONED_PROJECT, true);
108
        return getPreferences().getBoolean(SET_MAIN_PROJECT, true);
109
    }
109
    }
110
    
110
    
111
    public Pattern [] getIgnoredFilePatterns() {
111
    public Pattern [] getIgnoredFilePatterns() {
Lines 281-288 Link Here
281
        getPreferences().putBoolean(SHOW_CLONE_COMPLETED, bl);
281
        getPreferences().putBoolean(SHOW_CLONE_COMPLETED, bl);
282
    }
282
    }
283
    
283
    
284
    public void setOpenClonedProject(boolean bl) {
284
    public void setSetMainProject(boolean bl) {
285
        getPreferences().putBoolean(OPEN_CLONED_PROJECT, bl);
285
        getPreferences().putBoolean(SET_MAIN_PROJECT, bl);
286
    }
286
    }
287
    
287
    
288
    public RepositoryConnection getRepositoryConnection(String url) {
288
    public RepositoryConnection getRepositoryConnection(String url) {
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneAction.java (-9 / +1 lines)
Lines 138-152 Link Here
138
                    try {
138
                    try {
139
                        FileObject cloneProj = FileUtil.toFileObject(clonePrjFile);
139
                        FileObject cloneProj = FileUtil.toFileObject(clonePrjFile);
140
                        Project prj = projectManager.findProject(cloneProj);
140
                        Project prj = projectManager.findProject(cloneProj);
141
                        HgProjectUtils.openProject(prj, this);
141
                        HgProjectUtils.openProject(prj, this, HgModuleConfig.getDefault().getSetMainProject());
142
                        // TODO: figure out how to rename the cloned project
143
                        // Following brings up Rename Project Dialog but not with correct settings 
144
                        // - thought the ctx was ok but must not be
145
                        // HgProjectUtils.renameProject(prj);
146
147
                        hg.versionedFilesChanged();
142
                        hg.versionedFilesChanged();
148
                        hg.refreshAllAnnotations();
143
                        hg.refreshAllAnnotations();
149
                        //HgUtils.forceStatusRefresh(cloneFolder);
150
            
144
            
151
                    } catch (java.lang.Exception ex) {
145
                    } catch (java.lang.Exception ex) {
152
                        NotifyDescriptor.Exception e = new NotifyDescriptor.Exception(new HgException(ex.toString()));
146
                        NotifyDescriptor.Exception e = new NotifyDescriptor.Exception(new HgException(ex.toString()));
Lines 189-197 Link Here
189
183
190
                        FileObject cloneProj = FileUtil.toFileObject(clonePrjFile);
184
                        FileObject cloneProj = FileUtil.toFileObject(clonePrjFile);
191
                        if (isLocalClone){
185
                        if (isLocalClone){
192
                            if (HgModuleConfig.getDefault().getOpenClonedProject()) {
193
                                SwingUtilities.invokeLater(doOpenProject);
186
                                SwingUtilities.invokeLater(doOpenProject);
194
                            }
195
                        } else if (HgModuleConfig.getDefault().getShowCloneCompleted()) {
187
                        } else if (HgModuleConfig.getDefault().getShowCloneCompleted()) {
196
                            CloneCompleted cc = new CloneCompleted(cloneFolder);
188
                            CloneCompleted cc = new CloneCompleted(cloneFolder);
197
                            if (isCanceled()) {
189
                            if (isCanceled()) {
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/ClonePanel.form (-4 / +4 lines)
Lines 24-30 Link Here
24
                      <EmptySpace min="12" pref="12" max="12" attributes="0"/>
24
                      <EmptySpace min="12" pref="12" max="12" attributes="0"/>
25
                      <Group type="103" groupAlignment="0" attributes="0">
25
                      <Group type="103" groupAlignment="0" attributes="0">
26
                          <Component id="toNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
26
                          <Component id="toNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
27
                          <Component id="openProjectCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
27
                          <Component id="setMainCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
28
                      </Group>
28
                      </Group>
29
                  </Group>
29
                  </Group>
30
                  <Group type="102" attributes="0">
30
                  <Group type="102" attributes="0">
Lines 34-40 Link Here
34
              </Group>
34
              </Group>
35
              <EmptySpace max="-2" attributes="0"/>
35
              <EmptySpace max="-2" attributes="0"/>
36
              <Group type="103" groupAlignment="0" attributes="0">
36
              <Group type="103" groupAlignment="0" attributes="0">
37
                  <Component id="fromTextField" alignment="0" pref="234" max="32767" attributes="0"/>
37
                  <Component id="fromTextField" alignment="0" pref="253" max="32767" attributes="0"/>
38
                  <Group type="102" alignment="1" attributes="0">
38
                  <Group type="102" alignment="1" attributes="0">
39
                      <Group type="103" groupAlignment="1" attributes="0">
39
                      <Group type="103" groupAlignment="1" attributes="0">
40
                          <Component id="toCloneField" alignment="1" pref="165" max="32767" attributes="0"/>
40
                          <Component id="toCloneField" alignment="1" pref="165" max="32767" attributes="0"/>
Lines 70-76 Link Here
70
                  <Component id="toNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
70
                  <Component id="toNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
71
              </Group>
71
              </Group>
72
              <EmptySpace max="-2" attributes="0"/>
72
              <EmptySpace max="-2" attributes="0"/>
73
              <Component id="openProjectCheckBox" min="-2" pref="21" max="-2" attributes="0"/>
73
              <Component id="setMainCheckBox" min="-2" pref="21" max="-2" attributes="0"/>
74
              <EmptySpace max="-2" attributes="0"/>
74
              <EmptySpace max="-2" attributes="0"/>
75
          </Group>
75
          </Group>
76
      </Group>
76
      </Group>
Lines 133-139 Link Here
133
        </Property>
133
        </Property>
134
      </Properties>
134
      </Properties>
135
    </Component>
135
    </Component>
136
    <Component class="javax.swing.JCheckBox" name="openProjectCheckBox">
136
    <Component class="javax.swing.JCheckBox" name="setMainCheckBox">
137
      <Properties>
137
      <Properties>
138
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
138
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
139
          <ResourceString bundle="org/netbeans/modules/mercurial/ui/clone/Bundle.properties" key="openCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
139
          <ResourceString bundle="org/netbeans/modules/mercurial/ui/clone/Bundle.properties" key="openCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/ClonePanel.java (-10 / +10 lines)
Lines 69-79 Link Here
69
        repository = repo;
69
        repository = repo;
70
        initComponents();
70
        initComponents();
71
        browseButton.addActionListener(this);
71
        browseButton.addActionListener(this);
72
        openProjectCheckBox.addActionListener(this);
72
        setMainCheckBox.addActionListener(this);
73
        fromTextField.setText(repo.getAbsolutePath());
73
        fromTextField.setText(repo.getAbsolutePath());
74
        toTextField.setText(to.getParent());
74
        toTextField.setText(to.getParent());
75
        toCloneField.setText(to.getName());
75
        toCloneField.setText(to.getName());
76
        openProjectCheckBox.setSelected(HgModuleConfig.getDefault().getOpenClonedProject());
76
        setMainCheckBox.setSelected(HgModuleConfig.getDefault().getSetMainProject());
77
    }
77
    }
78
78
79
    public String getOutputFileName() {
79
    public String getOutputFileName() {
Lines 96-102 Link Here
96
        toNameLabel = new javax.swing.JLabel();
96
        toNameLabel = new javax.swing.JLabel();
97
        toCloneField = new javax.swing.JTextField();
97
        toCloneField = new javax.swing.JTextField();
98
        destinationLabel = new javax.swing.JLabel();
98
        destinationLabel = new javax.swing.JLabel();
99
        openProjectCheckBox = new javax.swing.JCheckBox();
99
        setMainCheckBox = new javax.swing.JCheckBox();
100
100
101
        fromLabel.setLabelFor(fromTextField);
101
        fromLabel.setLabelFor(fromTextField);
102
        org.openide.awt.Mnemonics.setLocalizedText(fromLabel, org.openide.util.NbBundle.getMessage(ClonePanel.class, "ClonePanel.fromLabel.text")); // NOI18N
102
        org.openide.awt.Mnemonics.setLocalizedText(fromLabel, org.openide.util.NbBundle.getMessage(ClonePanel.class, "ClonePanel.fromLabel.text")); // NOI18N
Lines 113-119 Link Here
113
113
114
        org.openide.awt.Mnemonics.setLocalizedText(destinationLabel, org.openide.util.NbBundle.getMessage(ClonePanel.class, "destinationLabel.text")); // NOI18N
114
        org.openide.awt.Mnemonics.setLocalizedText(destinationLabel, org.openide.util.NbBundle.getMessage(ClonePanel.class, "destinationLabel.text")); // NOI18N
115
115
116
        org.openide.awt.Mnemonics.setLocalizedText(openProjectCheckBox, org.openide.util.NbBundle.getMessage(ClonePanel.class, "openCheckbox.text")); // NOI18N
116
        org.openide.awt.Mnemonics.setLocalizedText(setMainCheckBox, org.openide.util.NbBundle.getMessage(ClonePanel.class, "openCheckbox.text")); // NOI18N
117
117
118
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
118
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
119
        this.setLayout(layout);
119
        this.setLayout(layout);
Lines 128-140 Link Here
128
                        .add(12, 12, 12)
128
                        .add(12, 12, 12)
129
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
129
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
130
                            .add(toNameLabel)
130
                            .add(toNameLabel)
131
                            .add(openProjectCheckBox)))
131
                            .add(setMainCheckBox)))
132
                    .add(layout.createSequentialGroup()
132
                    .add(layout.createSequentialGroup()
133
                        .add(12, 12, 12)
133
                        .add(12, 12, 12)
134
                        .add(toLabel)))
134
                        .add(toLabel)))
135
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
135
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
136
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
136
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
137
                    .add(fromTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
137
                    .add(fromTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 253, Short.MAX_VALUE)
138
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
138
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
139
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
139
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
140
                            .add(toCloneField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
140
                            .add(toCloneField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
Lines 162-168 Link Here
162
                    .add(toCloneField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
162
                    .add(toCloneField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
163
                    .add(toNameLabel))
163
                    .add(toNameLabel))
164
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
164
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
165
                .add(openProjectCheckBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
165
                .add(setMainCheckBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
166
                .addContainerGap())
166
                .addContainerGap())
167
        );
167
        );
168
    }// </editor-fold>//GEN-END:initComponents
168
    }// </editor-fold>//GEN-END:initComponents
Lines 171-178 Link Here
171
    public void actionPerformed(ActionEvent evt) {
171
    public void actionPerformed(ActionEvent evt) {
172
        if (evt.getSource() == browseButton) {
172
        if (evt.getSource() == browseButton) {
173
            onBrowseClick();
173
            onBrowseClick();
174
        } else if (evt.getSource() == openProjectCheckBox) {
174
        } else if (evt.getSource() == setMainCheckBox) {
175
            HgModuleConfig.getDefault().setOpenClonedProject(openProjectCheckBox.isSelected());
175
            HgModuleConfig.getDefault().setSetMainProject(setMainCheckBox.isSelected());
176
        }
176
        }
177
    }
177
    }
178
178
Lines 247-253 Link Here
247
    private javax.swing.JLabel destinationLabel;
247
    private javax.swing.JLabel destinationLabel;
248
    private javax.swing.JLabel fromLabel;
248
    private javax.swing.JLabel fromLabel;
249
    private javax.swing.JTextField fromTextField;
249
    private javax.swing.JTextField fromTextField;
250
    private javax.swing.JCheckBox openProjectCheckBox;
250
    private javax.swing.JCheckBox setMainCheckBox;
251
    private javax.swing.JTextField toCloneField;
251
    private javax.swing.JTextField toCloneField;
252
    private javax.swing.JLabel toLabel;
252
    private javax.swing.JLabel toLabel;
253
    private javax.swing.JLabel toNameLabel;
253
    private javax.swing.JLabel toNameLabel;
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/util/HgProjectUtils.java (-6 / +3 lines)
Lines 73-89 Link Here
73
        ctxAction.actionPerformed(new ActionEvent(caller, 0, "")); // NOI18N
73
        ctxAction.actionPerformed(new ActionEvent(caller, 0, "")); // NOI18N
74
    }
74
    }
75
75
76
    public static void openProject(Project p, Object caller) {
76
    public static void openProject(Project p, Object caller, boolean setMain) {
77
        Project[] projects = new Project[] {p};
77
        Project[] projects = new Project[] {p};
78
        OpenProjects.getDefault().open(projects, false);
78
        OpenProjects.getDefault().open(projects, false);
79
        if (setMain) {
79
        OpenProjects.getDefault().setMainProject(p);
80
        OpenProjects.getDefault().setMainProject(p);
81
        }
80
        
82
        
81
        // set as main project and expand
83
        // set as main project and expand
82
/*        ContextAwareAction action = (ContextAwareAction) CommonProjectActions.setAsMainProjectAction();
83
        Lookup ctx = Lookups.singleton(p);
84
        Action ctxAction = action.createContextAwareInstance(ctx);
85
        ctxAction.actionPerformed(new ActionEvent(caller, 0, "")); // NOI18N
86
*/
87
        selectAndExpandProject(p);
84
        selectAndExpandProject(p);
88
    }
85
    }
89
    
86
    

Return to bug 123931