summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSteffen Pingel2012-09-05 17:59:02 (EDT)
committer Steffen Pingel2012-09-05 17:59:02 (EDT)
commitca76a72dee39d02ef1cb4d7e80797c12c628c771 (patch)
treefb0e102965210783dce5d21bdb8ad42d7f223830
parent188df14afdf81663a425ca5a1a3d6d7538935fc1 (diff)
downloadegit-ca76a72dee39d02ef1cb4d7e80797c12c628c771.zip
egit-ca76a72dee39d02ef1cb4d7e80797c12c628c771.tar.gz
egit-ca76a72dee39d02ef1cb4d7e80797c12c628c771.tar.bz2
Improve performace when entering invalid name in Create Branch dialogrefs/changes/67/4767/2
This change improves performance on Gtk when entering invalid branch names: * Do not re-layout controls unless the layout has changed. * Invoke setErrorMessage() only once during validation to avoid updating of the layout more than once. Bug: 352253 Change-Id: Id24a951dafe4eed24c40a2d18d681882c13369d2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java
index 98dfbd3..c6952d9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java
@@ -8,6 +8,7 @@
* Contributors:
* Mathias Kinzler (SAP AG) - initial implementation
* Dariusz Luksza <dariusz@luksza.org>
+ * Steffen Pingel (Tasktop Technologies) - fixes for bug 352253
*******************************************************************************/
package org.eclipse.egit.ui.internal.repository;
@@ -378,20 +379,28 @@ class CreateBranchPage extends WizardPage {
}
private void checkPage() {
- setErrorMessage(null);
try {
+ boolean layoutChanged = false;
+
GridData gd = (GridData) warningComposite.getLayoutData();
- gd.exclude = !branchCombo.getText().startsWith(Constants.R_HEADS);
- warningComposite.setVisible(!gd.exclude);
+ if (gd.exclude != !branchCombo.getText().startsWith(Constants.R_HEADS)) {
+ gd.exclude = !branchCombo.getText().startsWith(Constants.R_HEADS);
+ warningComposite.setVisible(!gd.exclude);
+ layoutChanged = true;
+ }
warningComposite.getParent().getParent().layout(true);
boolean showRebase = !branchCombo.getText().startsWith(Constants.R_TAGS) && !ObjectId.isId(branchCombo.getText());
gd = (GridData) upstreamConfigGroup.getLayoutData();
- gd.exclude = !showRebase;
- upstreamConfigGroup.setVisible(!gd.exclude);
+ if (gd.exclude == showRebase) {
+ gd.exclude = !showRebase;
+ upstreamConfigGroup.setVisible(!gd.exclude);
+ layoutChanged = true;
+ }
- upstreamConfigGroup.getParent().layout(true);
+ if (layoutChanged)
+ upstreamConfigGroup.getParent().layout(true);
if (!gd.exclude)
buttonConfigMerge.setSelection(false);
@@ -422,6 +431,8 @@ class CreateBranchPage extends WizardPage {
setErrorMessage(message);
return;
}
+
+ setErrorMessage(null);
} finally {
setPageComplete(getErrorMessage() == null);
}