Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2012-06-13 23:45:57 +0000
committerMatthias Sohn2012-06-13 23:45:57 +0000
commita8e64f029f49f2750bc5c0831346f85f2a596fab (patch)
treefc80cf7b71f45aafe4af2f8e0a5a76cec867e7ce /org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java
parent5ba9d0bd7a9bfbb955c29ac65309d3412734ba27 (diff)
parent0ad9896204bc99b369878b811ee3ffb34ef6bc30 (diff)
downloadegit-a8e64f029f49f2750bc5c0831346f85f2a596fab.tar.gz
egit-a8e64f029f49f2750bc5c0831346f85f2a596fab.tar.xz
egit-a8e64f029f49f2750bc5c0831346f85f2a596fab.zip
Merge branch 'stable-2.0'
* stable-2.0: Prepare post 2.0.0.201206130900-r builds EGit v2.0.0.201206130900-r [stagingView] Don't show other warnings when commit is not allowed Update documentation for EGit 2.0 Show more descriptive message when authorization fails Add org.eclipse.jgit.pgm feature to p2 repository [sync] Use IndexDiffFilter instead of ANY_DIFF Use correct path when comparing with previous revision [historyView] Support blaming commit scoped to single file Add a "Previous Version" option to the Replace With menu [historyView] Suggest first found remote when creating a branch [reflogView] Add a "copy" command and some minor UI improvements Change-Id: Ieb5949875876e57c090fbe9fd8e53ef4d6b51738 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java43
1 files changed, 26 insertions, 17 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 081df79074..98dfbd3856 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
@@ -91,7 +91,7 @@ class CreateBranchPage extends WizardPage {
if (sourceName.startsWith(Constants.R_TAGS))
return sourceName.substring(Constants.R_TAGS.length());
- return null;
+ return ""; //$NON-NLS-1$
}
private final Repository myRepository;
@@ -196,6 +196,22 @@ class CreateBranchPage extends WizardPage {
GridDataFactory.fillDefaults().span(2, 1).grab(true, false).applyTo(
this.branchCombo);
+ Label nameLabel = new Label(main, SWT.NONE);
+ nameLabel.setText(UIText.CreateBranchPage_BranchNameLabel);
+
+ // we visualize the prefix here
+ Text prefix = new Text(main, SWT.NONE);
+ prefix.setText(Constants.R_HEADS);
+ prefix.setEnabled(false);
+
+ nameText = new Text(main, SWT.BORDER);
+ // give focus to the nameText if label is activated using the mnemonic
+ nameLabel.addTraverseListener(new TraverseListener() {
+ public void keyTraversed(TraverseEvent e) {
+ nameText.setFocus();
+ }
+ });
+
if (this.myBaseCommit != null) {
this.branchCombo.add(myBaseCommit.name());
this.branchCombo.setText(myBaseCommit.name());
@@ -209,10 +225,18 @@ class CreateBranchPage extends WizardPage {
}
map = myRepository.getRefDatabase()
.getRefs(Constants.R_REMOTES);
+ String firstRemote = null;
for (Entry<String, Ref> entry : map.entrySet()) {
if (entry.getValue().getLeaf().getObjectId()
- .equals(myBaseCommit))
+ .equals(myBaseCommit)) {
this.branchCombo.add(entry.getValue().getName());
+ if (firstRemote == null)
+ firstRemote = entry.getValue().getName();
+ }
+ }
+ if (firstRemote != null) {
+ this.branchCombo.setText(firstRemote);
+ suggestBranchName(firstRemote);
}
} catch (IOException e) {
// bad luck, we can't extend the drop down; let's log an error
@@ -254,21 +278,6 @@ class CreateBranchPage extends WizardPage {
}
});
- Label nameLabel = new Label(main, SWT.NONE);
- nameLabel.setText(UIText.CreateBranchPage_BranchNameLabel);
-
- // we visualize the prefix here
- Text prefix = new Text(main, SWT.NONE);
- prefix.setText(Constants.R_HEADS);
- prefix.setEnabled(false);
-
- nameText = new Text(main, SWT.BORDER);
- // give focus to the nameText if label is activated using the mnemonic
- nameLabel.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- nameText.setFocus();
- }
- });
nameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
nameIsSuggestion = false;

Back to the top