diff options
author | Matthias Sohn | 2016-05-30 20:22:13 +0000 |
---|---|---|
committer | Matthias Sohn | 2016-05-31 11:19:03 +0000 |
commit | 731c6831299213ceaec40d85be6e8a47b7146e97 (patch) | |
tree | 01c7ec04788ea71a51cfaa5d892959a6c8870a9a | |
parent | e5f719a2df244c80412c66da3f3d27b84001fccb (diff) | |
download | egit-731c6831299213ceaec40d85be6e8a47b7146e97.tar.gz egit-731c6831299213ceaec40d85be6e8a47b7146e97.tar.xz egit-731c6831299213ceaec40d85be6e8a47b7146e97.zip |
Enable copying source branch in "Create Branch" dialog to clipboard
Bug: 494943
Change-Id: Ib7db01442c1e6ead995b3c363f43a1512f38611b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java index 6e2ad4139d..bec7c1c63d 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java @@ -59,8 +59,8 @@ import org.eclipse.swtbot.swt.finder.SWTBot; import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; import org.eclipse.swtbot.swt.finder.utils.TableCollection; import org.eclipse.swtbot.swt.finder.waits.ICondition; -import org.eclipse.swtbot.swt.finder.widgets.SWTBotLabel; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText; import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarDropDownButton; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; @@ -326,7 +326,7 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase { TestUtil.getChildNode(tags, "SomeTag").select(); sourceSelectionDialog.bot().button(IDialogConstants.OK_LABEL).click(); - SWTBotLabel sourceLabel = createBranchDialog.bot().label(3); + SWTBotStyledText sourceLabel = createBranchDialog.bot().styledText(0); assertEquals("SomeTag", sourceLabel.getText()); createBranchDialog.bot().textWithId("BranchName") 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 b1bc99e91d..dec9e32205 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 @@ -47,6 +47,7 @@ import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; @@ -117,7 +118,7 @@ class CreateBranchPage extends WizardPage { private Label sourceIcon; - private Label sourceNameLabel; + private StyledText sourceNameLabel; private String sourceRefName = ""; //$NON-NLS-1$ @@ -188,7 +189,9 @@ class CreateBranchPage extends WizardPage { sourceIcon.setLayoutData(GridDataFactory.fillDefaults() .align(SWT.END, SWT.CENTER).create()); - sourceNameLabel = new Label(main, SWT.NONE); + sourceNameLabel = new StyledText(main, SWT.NONE); + sourceNameLabel.setBackground(main.getBackground()); + sourceNameLabel.setEditable(false); sourceNameLabel.setLayoutData(GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.CENTER) .grab(true, false).create()); |