# HG changeset patch # User jrice@netbeans.org # Date 1201720638 0 # Node ID 2bfe3308b32071a2e7abef43cb85094350d31491 # Parent 79247dd7bad16de8488b5bd8802db5009038e75d #126311: Optimize UI for large repos - Status View, export and Import startup diff -r 79247dd7bad1 -r 2bfe3308b320 mercurial/src/org/netbeans/modules/mercurial/ui/diff/Bundle.properties --- a/mercurial/src/org/netbeans/modules/mercurial/ui/diff/Bundle.properties Wed Jan 30 10:14:12 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/diff/Bundle.properties Wed Jan 30 19:17:18 2008 +0000 @@ -86,6 +86,7 @@ ImportBrowse_title=Browse for the Import MSG_Refreshing_Revisions = Refreshing Revisions MSG_Revision_Default = +MSG_EXPORT_NOTHING = No revisions available, nothing to export. ExportDiffPanel.revisionsLabel.text=&Export from: ExportDiffPanel.fileLabel.text=&Output File: ExportDiffPanel.browseButtonl.text=&Browse... @@ -93,7 +94,7 @@ MSG_EXPORT_TITLE = Mercurial Export MSG_EXPORT_TITLE = Mercurial Export MSG_EXPORT_TITLE_SEP = ---------------- MSG_EXPORT_DONE = INFO: End of Export -MSG_EXPORT_NOTHING = Nothing yet comitted, so nothing to Export. +MSG_EXPORT_NOTHING = Nothing comitted, so nothing to Export. MSG_IMPORT_TITLE = Mercurial Import MSG_IMPORT_TITLE_SEP = ---------------- @@ -118,3 +119,5 @@ ACSD_DiffTable = Shows lists of files th ACSD_DiffTable = Shows lists of files that have changed refreshButton.toolTipText=Refresh Diff + +MSG_Fetching_Revisions = Fetching Revisions... diff -r 79247dd7bad1 -r 2bfe3308b320 mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffAction.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffAction.java Wed Jan 30 10:14:12 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffAction.java Wed Jan 30 19:17:18 2008 +0000 @@ -76,18 +76,6 @@ public class ExportDiffAction extends Ab public void actionPerformed(ActionEvent e) { if(!Mercurial.getInstance().isGoodVersionAndNotify()) return; - if(!HgRepositoryContextCache.hasHistory(context)){ - HgUtils.outputMercurialTabInRed( - NbBundle.getMessage(ExportDiffAction.class, - "MSG_EXPORT_TITLE")); // NOI18N - HgUtils.outputMercurialTabInRed( - NbBundle.getMessage(ExportDiffAction.class, - "MSG_EXPORT_TITLE_SEP")); // NOI18N - HgUtils.outputMercurialTab(NbBundle.getMessage(ExportDiffAction.class, "MSG_EXPORT_NOTHING")); // NOI18N - HgUtils.outputMercurialTabInRed(NbBundle.getMessage(ExportDiffAction.class, "MSG_EXPORT_DONE")); // NOI18N - HgUtils.outputMercurialTab(""); // NOI18N - return; - } exportDiff(context); } @@ -131,9 +119,16 @@ public class ExportDiffAction extends Ab HgUtils.outputMercurialTabInRed( NbBundle.getMessage(ExportDiffAction.class, "MSG_EXPORT_TITLE_SEP")); // NOI18N - - List list = HgCommand.doExport(repository, revStr, outputFileName); - HgUtils.outputMercurialTab(list); // NOI18N + + if (NbBundle.getMessage(ExportDiffAction.class, + "MSG_Revision_Default").startsWith(revStr)) { + HgUtils.outputMercurialTab( + NbBundle.getMessage(ExportDiffAction.class, + "MSG_EXPORT_NOTHING")); // NOI18N + } else { + List list = HgCommand.doExport(repository, revStr, outputFileName); + HgUtils.outputMercurialTab(list); // NOI18N + } } catch (HgException ex) { NotifyDescriptor.Exception e = new NotifyDescriptor.Exception(ex); DialogDisplayer.getDefault().notifyLater(e); diff -r 79247dd7bad1 -r 2bfe3308b320 mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffPanel.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffPanel.java Wed Jan 30 10:14:12 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffPanel.java Wed Jan 30 19:17:18 2008 +0000 @@ -155,8 +155,13 @@ public class ExportDiffPanel extends jav */ private void setupModels() { // XXX attach Cancelable hook - final ProgressHandle ph = ProgressHandleFactory.createHandle(NbBundle.getMessage(ExportDiffPanel.class, "MSG_Refreshing_Revisions")); // NOI18N + final ProgressHandle ph = ProgressHandleFactory.createHandle(NbBundle.getMessage(ExportDiffPanel.class, "MSG_Fetching_Revisions")); // NOI18N try { + Set initislRevsSet = new LinkedHashSet(); + + initislRevsSet.add(NbBundle.getMessage(ExportDiffPanel.class, "MSG_Fetching_Revisions")); // NOI18N + ComboBoxModel targetsModel = new DefaultComboBoxModel(new Vector(initislRevsSet)); + revisionsComboBox.setModel(targetsModel); refreshViewThread = Thread.currentThread(); Thread.interrupted(); // clear interupted status ph.start(); diff -r 79247dd7bad1 -r 2bfe3308b320 mercurial/src/org/netbeans/modules/mercurial/ui/diff/ImportDiffAction.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ImportDiffAction.java Wed Jan 30 10:14:12 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ImportDiffAction.java Wed Jan 30 19:17:18 2008 +0000 @@ -79,18 +79,6 @@ public class ImportDiffAction extends Ab public void actionPerformed(ActionEvent e) { if(!Mercurial.getInstance().isGoodVersionAndNotify()) return; - if(!HgRepositoryContextCache.hasHistory(context)){ - HgUtils.outputMercurialTabInRed( - NbBundle.getMessage(ImportDiffAction.class, - "MSG_IMPORT_TITLE")); // NOI18N - HgUtils.outputMercurialTabInRed( - NbBundle.getMessage(ImportDiffAction.class, - "MSG_IMPORT_TITLE_SEP")); // NOI18N - HgUtils.outputMercurialTab(NbBundle.getMessage(ImportDiffAction.class, "MSG_IMPORT_NOTHING")); // NOI18N - HgUtils.outputMercurialTabInRed(NbBundle.getMessage(ImportDiffAction.class, "MSG_IMPORT_DONE")); // NOI18N - HgUtils.outputMercurialTab(""); // NOI18N - return; - } importDiff(context); } diff -r 79247dd7bad1 -r 2bfe3308b320 mercurial/src/org/netbeans/modules/mercurial/ui/status/VersioningPanel.form --- a/mercurial/src/org/netbeans/modules/mercurial/ui/status/VersioningPanel.form Wed Jan 30 10:14:12 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/status/VersioningPanel.form Wed Jan 30 19:17:18 2008 +0000 @@ -189,22 +189,6 @@ - - - - - - - - - - - - - - - - diff -r 79247dd7bad1 -r 2bfe3308b320 mercurial/src/org/netbeans/modules/mercurial/ui/status/VersioningPanel.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/status/VersioningPanel.java Wed Jan 30 10:14:12 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/status/VersioningPanel.java Wed Jan 30 19:17:18 2008 +0000 @@ -136,38 +136,6 @@ class VersioningPanel extends JPanel imp } } - public void refreshUpdateTargets(File repository) { - if( repository == null) return; - - java.util.List targetRevsList = HgCommand.getRevisions(repository, HG_UPDATE_TARGET_LIMIT); - Set targetRevsSet = new LinkedHashSet(); - - int size; - if( targetRevsList == null){ - size = 0; - targetRevsSet.add(NbBundle.getMessage(VersioningPanel.class, "MSG_Update_Target_Default")); // NOI18N - }else{ - size = targetRevsList.size(); - int i = 0 ; - while(i < size){ - targetRevsSet.add(targetRevsList.get(i)); - i++; - } - } - - // TODO: need to add action handle so when Otehr is selected a - // dialog is brought up to select revision - //if(size > HG_UPDATE_TARGET_LIMIT){ - // targetRevsSet.add(NbBundle.getMessage(VersioningPanel.class, "MSG_Target_Other")); // NOI18N - //} - - ComboBoxModel targetsModel = new DefaultComboBoxModel(new Vector(targetRevsSet)); - updateTargetComboBox.setModel(targetsModel); - - if (targetRevsSet.size() > 0 ) { - updateTargetComboBox.setSelectedIndex(0); - } - } public void propertyChange(PropertyChangeEvent evt) { @@ -261,13 +229,13 @@ class VersioningPanel extends JPanel imp public void run() { syncTable.setTableModel(new SyncFileNode[0]); File root = HgUtils.getRootFile(HgUtils.getCurrentContext(null)); - if (root != null) { + /* #126311: Optimize UI for Large repos + if (root != null) { String[] info = getRepositoryBranchInfo(root); String rev = info != null ? info[1] : null; String changeset = info != null ? info[2] : null; setRepositoryBranchInfo(rev, changeset); - refreshUpdateTargets(root); - } + }*/ } }); return; @@ -290,6 +258,7 @@ class VersioningPanel extends JPanel imp File [] files = context.getRootFiles().toArray(new File[context.getRootFiles().size()]); if (files == null || files.length == 0) return; + /* #126311: Optimize UI for Large repos File root = mercurial.getTopmostManagedParent(files[0]); String[] info = getRepositoryBranchInfo(root); String branchName = info != null ? info[0] : null; @@ -299,7 +268,7 @@ class VersioningPanel extends JPanel imp branchTitle = NbBundle.getMessage(VersioningPanel.class, "CTL_VersioningView_BranchTitle", branchName); // NOI18N } else { branchTitle = NbBundle.getMessage(VersioningPanel.class, "CTL_VersioningView_UnnamedBranchTitle"); // NOI18N - } + }*/ if (nodes.length > 0) { boolean stickyCommon = false; for (int i = 1; i < nodes.length; i++) { @@ -312,16 +281,17 @@ class VersioningPanel extends JPanel imp } else { tableColumns = null; } + /* #126311: Optimize UI for Large repos setRepositoryBranchInfo(rev, changeset); - refreshUpdateTargets(root); - + */ SwingUtilities.invokeLater(new Runnable() { public void run() { if (nodes.length > 0) { syncTable.setColumns(tableColumns); setVersioningComponent(syncTable.getComponent()); } else { - parentTopComponent.setBranchTitle(branchTitle); + /* #126311: Optimize UI for Large repos + parentTopComponent.setBranchTitle(branchTitle); */ setVersioningComponent(noContentComponent); } syncTable.setTableModel(nodes); @@ -397,14 +367,7 @@ class VersioningPanel extends JPanel imp * Performs the "cvs update" command on all diplayed roots. // NOI18N */ private void onUpdateAction() { - int index = updateTargetComboBox.getSelectedIndex(); - if(index == 0){ - UpdateAction.update(context, null); - }else{ - String revStr = (String) updateTargetComboBox.getSelectedItem(); - revStr = revStr.substring(0, revStr.indexOf(" ")); // NOI18N - UpdateAction.update(context, revStr); - } + UpdateAction.update(context, null); parentTopComponent.contentRefreshed(); } @@ -730,8 +693,6 @@ class VersioningPanel extends JPanel imp btnUpdate = new javax.swing.JButton(); btnCommit = new javax.swing.JButton(); jPanel5 = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - updateTargetComboBox = new javax.swing.JComboBox(); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); @@ -797,12 +758,6 @@ class VersioningPanel extends JPanel imp jPanel5.setOpaque(false); jPanel2.add(jPanel5); - jLabel1.setText(org.openide.util.NbBundle.getMessage(VersioningPanel.class, "CTL_Versioning_Status_Update_Target")); // NOI18N - jPanel2.add(jLabel1); - - updateTargetComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" })); - jPanel2.add(updateTargetComboBox); - gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; @@ -823,11 +778,11 @@ class VersioningPanel extends JPanel imp else if (evt.getSource() == btnDiff) { VersioningPanel.this.btnDiffActionPerformed(evt); } + else if (evt.getSource() == btnUpdate) { + VersioningPanel.this.btnUpdateActionPerformed(evt); + } else if (evt.getSource() == btnCommit) { VersioningPanel.this.btnCommitActionPerformed(evt); - } - else if (evt.getSource() == btnUpdate) { - VersioningPanel.this.btnUpdateActionPerformed(evt); } }// //GEN-END:initComponents @@ -854,7 +809,6 @@ private void btnRefreshActionPerformed(j private javax.swing.JButton btnRefresh; private javax.swing.JButton btnUpdate; private javax.swing.JComboBox jComboBox1; - private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JToolBar jPanel2; private javax.swing.JPanel jPanel3; @@ -863,7 +817,6 @@ private void btnRefreshActionPerformed(j private javax.swing.JSeparator jSeparator1; private javax.swing.JSeparator jSeparator2; private javax.swing.JLabel statusLabel; - private javax.swing.JComboBox updateTargetComboBox; // End of variables declaration//GEN-END:variables }