Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-04-26 12:41:38 -0400
committerMichael Keppler2019-05-01 06:41:51 -0400
commitf8800d8ed1b5002bcf4cccfa431d24b17f3b480a (patch)
treeb5c13f2b77eb7f5ffa4deaa9a3cc7bfdc8f6d61f /org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test
parentc14842f57dceb3d7c5e699f31c65c35d0967149a (diff)
downloadegit-f8800d8ed1b5002bcf4cccfa431d24b17f3b480a.tar.gz
egit-f8800d8ed1b5002bcf4cccfa431d24b17f3b480a.tar.xz
egit-f8800d8ed1b5002bcf4cccfa431d24b17f3b480a.zip
Get display instance from workbench
org.eclipse.ui.IWorkbench.getDisplay() recommends to always use that method instead of Display.getDefault(). Change-Id: I0d7512aa9b40ad26e0b71356aa90bebd5b7611f7 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java7
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CreatePatchActionTest.java3
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/trace/TraceConfigurationDialogTest.java6
5 files changed, 12 insertions, 13 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
index b6cf090f8..17e62768b 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
@@ -803,7 +803,7 @@ public class TestUtil {
}
public static SWTBotView showView(final String viewId) {
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench()
@@ -827,7 +827,7 @@ public class TestUtil {
}
public static void hideView(final String viewId) {
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
IWorkbenchWindow[] windows = PlatformUI.getWorkbench()
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
index f2a0d12ff..3e95720b0 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
@@ -38,7 +38,6 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
@@ -307,7 +306,7 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
table.getTableItem(0).select();
final RevCommit[] commit = new RevCommit[1];
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
@@ -365,7 +364,7 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
table.getTableItem(0).select();
final RevCommit[] commit = new RevCommit[1];
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
@@ -427,7 +426,7 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
table.getTableItem(line).select();
final RevCommit[] commit = new RevCommit[1];
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
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 65e0d934d..27bae49a9 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
@@ -52,7 +52,6 @@ import org.eclipse.jgit.lib.TagBuilder;
import org.eclipse.jgit.util.FileUtils;
import org.eclipse.jgit.util.RawParseUtils;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.utils.TableCollection;
@@ -211,7 +210,7 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase {
// repo relative path
assertEquals("ToBeDeleted", showUndeleted.bot().tree()
.getAllItems()[0].getItems()[0].getItems()[0].getText());
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
assertSame(folderImage, showUndeleted.bot().tree()
@@ -244,7 +243,7 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase {
// resource path
assertEquals("ToBeDeleted", showUndeleted.bot().tree()
.getAllItems()[0].getItems()[0].getItems()[0].getText());
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
assertSame(projectImage, showUndeleted.bot().tree()
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CreatePatchActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CreatePatchActionTest.java
index a70b671f0..e45b98ca0 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CreatePatchActionTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CreatePatchActionTest.java
@@ -35,6 +35,7 @@ import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.ui.PlatformUI;
import org.junit.Before;
import org.junit.Test;
@@ -236,7 +237,7 @@ public class CreatePatchActionTest extends LocalRepositoryTestCase {
private static void assertClipboard(final String expected) {
final String[] value = { null };
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
Clipboard clp = new Clipboard(Display.getCurrent());
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/trace/TraceConfigurationDialogTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/trace/TraceConfigurationDialogTest.java
index 3ba1d7729..5f7da3baa 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/trace/TraceConfigurationDialogTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/trace/TraceConfigurationDialogTest.java
@@ -20,7 +20,6 @@ import org.eclipse.egit.ui.common.EGitTestCase;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.egit.ui.internal.dialogs.GitTraceConfigurationDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
@@ -28,6 +27,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.ui.PlatformUI;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -154,14 +154,14 @@ public class TraceConfigurationDialogTest {
}
private void getDialog() {
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
if (configurationDialog != null)
configurationDialog.close();
GitTraceConfigurationDialog dlg = new GitTraceConfigurationDialog(
- new Shell(Display.getDefault()));
+ new Shell(PlatformUI.getWorkbench().getDisplay()));
dlg.setBlockOnOpen(false);
dlg.open();
configurationDialog = bot.shell(

Back to the top