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
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>
-rw-r--r--org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java3
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java3
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/SwitchToMenuTest.java10
-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
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java7
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestUtils.java6
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ImportChangedProjectsCommand.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveView.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportProjectsCommand.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashDropCommand.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/EditableRevision.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java3
24 files changed, 52 insertions, 57 deletions
diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java
index 2a56ceb36..68c0ee2d8 100644
--- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java
+++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java
@@ -41,6 +41,7 @@ import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
/**
@@ -107,12 +108,12 @@ public class FeatureFinishHandler extends AbstractGitFlowHandler {
private void postMerge(final GitFlowRepository gfRepo,
final String featureBranch, final boolean squash,
final MergeResult mergeResult) {
- Display display = Display.getDefault();
+ Display display = PlatformUI.getWorkbench().getDisplay();
display.asyncExec(new Runnable() {
@Override
public void run() {
- Shell activeShell = Display.getDefault().getActiveShell();
+ Shell activeShell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
if (squash && mergeResult.getMergedCommits().length > 1) {
try {
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java
index c944814b6..ab565fc8c 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java
@@ -22,6 +22,7 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.ui.PlatformUI;
public class GitImportRepoWizard {
@@ -107,7 +108,7 @@ public class GitImportRepoWizard {
// TODO: move this to some utility class
private void pressAltAndChar(final SWTBotShell shell, final char charToPress) {
- final Display display = Display.getDefault();
+ final Display display = PlatformUI.getWorkbench().getDisplay();
display.syncExec(new Runnable() {
@Override
public void run() {
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
index a1b6f4e8f..ccd8e682b 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
@@ -85,6 +85,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.ui.history.IHistoryView;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.ui.PlatformUI;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -781,7 +782,7 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
}
protected void pressAltAndChar(SWTBotShell shell, char charToPress) {
- Display display = Display.getDefault();
+ Display display = PlatformUI.getWorkbench().getDisplay();
Event evt = new Event();
// Alt down
evt.type = SWT.KeyDown;
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/SwitchToMenuTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/SwitchToMenuTest.java
index 768dc3892..3c8594784 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/SwitchToMenuTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/SwitchToMenuTest.java
@@ -34,12 +34,12 @@ import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.ui.ISources;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.services.IServiceLocator;
import org.junit.Before;
@@ -269,10 +269,10 @@ public class SwitchToMenuTest extends LocalRepositoryTestCase {
private MenuItem[] fillMenu() {
final MenuItem[][] items = new MenuItem[1][];
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
- Menu menu = new Menu(new Shell(Display.getDefault()));
+ Menu menu = new Menu(new Shell(PlatformUI.getWorkbench().getDisplay()));
switchToMenu.fill(menu, 0 /* index */);
items[0] = menu.getItems();
}
@@ -289,7 +289,7 @@ public class SwitchToMenuTest extends LocalRepositoryTestCase {
private static void assertTextEquals(final String expectedText,
final MenuItem item) {
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
assertEquals(expectedText, item.getText());
@@ -299,7 +299,7 @@ public class SwitchToMenuTest extends LocalRepositoryTestCase {
private static void assertStyleEquals(final int expectedStyle,
final MenuItem item) {
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
assertEquals(expectedStyle, item.getStyle());
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(
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java
index 185e8b128..d332f2516 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoHandlingTest.java
@@ -45,6 +45,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.ui.PlatformUI;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -74,7 +75,7 @@ public class GitRepositoriesViewRepoHandlingTest extends
final SWTBotTree tree = getOrOpenView().bot().tree();
tree.getAllItems()[0].select();
waitInUI();
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
@@ -106,13 +107,13 @@ public class GitRepositoriesViewRepoHandlingTest extends
final Exception[] exceptions = new Exception[1];
final SWTBotLabel label = getOrOpenView().bot().label(
UIText.RepositoriesView_messageEmpty);
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
Clipboard clip = null;
try {
- clip = new Clipboard(Display.getDefault());
+ clip = new Clipboard(PlatformUI.getWorkbench().getDisplay());
clip.setContents(new Object[] { repositoryFile.getPath() },
new Transfer[] { TextTransfer.getInstance() });
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestUtils.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestUtils.java
index 79df4a474..df7e6886a 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestUtils.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestUtils.java
@@ -26,9 +26,9 @@ import org.eclipse.egit.ui.internal.repository.tree.TagsNode;
import org.eclipse.egit.ui.internal.repository.tree.WorkingDirNode;
import org.eclipse.egit.ui.test.TestUtil;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.ui.PlatformUI;
public class GitRepositoriesViewTestUtils {
@@ -39,7 +39,7 @@ public class GitRepositoriesViewTestUtils {
*/
public static RepositoryTreeNodeLabelProvider createLabelProvider() {
final AtomicReference<RepositoryTreeNodeLabelProvider> providerRef = new AtomicReference<>();
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
@@ -62,7 +62,7 @@ public class GitRepositoriesViewTestUtils {
}
public void dispose() {
- Display.getDefault().syncExec(() -> labelProvider.dispose());
+ PlatformUI.getWorkbench().getDisplay().syncExec(() -> labelProvider.dispose());
}
public SWTBotTreeItem getLocalBranchesItem(SWTBotTree tree, File repo)
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java
index 990baf611..6afb055d1 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java
@@ -46,13 +46,13 @@ import org.eclipse.egit.ui.test.TestUtil;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.Status;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotLabel;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.ui.PlatformUI;
import org.hamcrest.Matcher;
import org.junit.Before;
import org.junit.Ignore;
@@ -312,7 +312,7 @@ public class SynchronizeViewGitChangeSetModelTest extends
FILE1, true);
// when
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
CommonUtils.runCommand("org.eclipse.compare.copyLeftToRight",
@@ -343,7 +343,7 @@ public class SynchronizeViewGitChangeSetModelTest extends
FILE1, true);
// when
- Display.getDefault().syncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
CommonUtils.runCommand("org.eclipse.compare.copyRightToLeft",
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java
index dc8082f80..988d9807c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java
@@ -21,7 +21,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.egit.ui.Activator;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
/**
@@ -53,7 +53,7 @@ public class ApplyPatchActionHandler extends RepositoryActionHandler {
op = new ApplyPatchOperation(HandlerUtil.getActivePart(event),
resource);
}
- BusyIndicator.showWhile(Display.getDefault(), op);
+ BusyIndicator.showWhile(PlatformUI.getWorkbench().getDisplay(), op);
return null;
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java
index 7f28177f8..f293ab6f7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneDropAdapter.java
@@ -69,7 +69,7 @@ public class GitCloneDropAdapter implements IStartup {
@Override
public void earlyStartup() {
- UIJob registerJob = new UIJob(Display.getDefault(),
+ UIJob registerJob = new UIJob(PlatformUI.getWorkbench().getDisplay(),
"Git Clone DND Initialization") { //$NON-NLS-1$
{
setPriority(Job.SHORT);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
index 5222a1af0..d2e2d763a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
@@ -56,7 +56,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IWorkingSet;
@@ -442,7 +441,7 @@ public class GitProjectsImportPage extends WizardPage {
if (selectedProjects.length == 0) {
// run in UI thread
- Display.getDefault().syncExec(() -> setErrorMessage(
+ PlatformUI.getWorkbench().getDisplay().syncExec(() -> setErrorMessage(
UIText.GitProjectsImportPage_NoProjectsMessage));
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
index 740c16bc2..3579ebb18 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
@@ -38,7 +38,6 @@ import org.eclipse.jgit.api.RebaseCommand.Operation;
import org.eclipse.jgit.api.RebaseResult.Status;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PartInitException;
@@ -112,7 +111,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
&& result.getSeverity() == IStatus.ERROR) {
handleBeginError(repository, result);
} else if (result.getSeverity() == IStatus.CANCEL)
- Display.getDefault().asyncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
// don't use getShell(event) here since
@@ -146,7 +145,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
private void setAmending(final boolean amending,
final boolean openStagingView) {
- Display.getDefault().asyncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
try {
@@ -165,7 +164,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
if (view instanceof StagingView) {
final StagingView sv = (StagingView) view;
sv.reload(repository);
- Display.getDefault().asyncExec(
+ PlatformUI.getWorkbench().getDisplay().asyncExec(
new Runnable() {
@Override
public void run() {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
index 36e5014bc..8d7810e86 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
@@ -88,7 +88,6 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
@@ -798,7 +797,7 @@ public class SpellcheckableMessageArea extends Composite {
protected void createMarginPainter() {
MarginPainter marginPainter = new MarginPainter(sourceViewer);
marginPainter.setMarginRulerColumn(MAX_LINE_WIDTH);
- marginPainter.setMarginRulerColor(Display.getDefault().getSystemColor(
+ marginPainter.setMarginRulerColor(PlatformUI.getWorkbench().getDisplay().getSystemColor(
SWT.COLOR_GRAY));
sourceViewer.addPainter(marginPainter);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ImportChangedProjectsCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ImportChangedProjectsCommand.java
index 9c85e42da..9a6f5f35c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ImportChangedProjectsCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ImportChangedProjectsCommand.java
@@ -35,7 +35,6 @@ import org.eclipse.egit.ui.internal.history.FileDiff;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
@@ -64,7 +63,7 @@ public class ImportChangedProjectsCommand
Set<File> dotProjectFiles = findDotProjectFiles(changedFiles,
repository);
if (dotProjectFiles.isEmpty()) {
- Display.getDefault().asyncExec(() -> {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(() -> {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
MessageDialog.openInformation(shell,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
index c97ed645d..9bc4abcd2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
@@ -62,7 +62,6 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
@@ -979,7 +978,7 @@ public class ConfigurationEditorComponent {
for (int i = 0; i < data.length; i++)
data[i].setStyle(data[i].getStyle() | SWT.BOLD);
- boldFont = new Font(Display.getDefault(), data);
+ boldFont = new Font(PlatformUI.getWorkbench().getDisplay(), data);
return boldFont;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveView.java
index d76d0f53b..8f87bef06 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveView.java
@@ -103,7 +103,6 @@ import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
@@ -351,7 +350,7 @@ public class RebaseInteractiveView extends ViewPart implements
return;
// Unselect repository as it has been removed
- Display.getDefault().asyncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
currentRepository = null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportProjectsCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportProjectsCommand.java
index f2bc3aa6f..2764ca825 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportProjectsCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportProjectsCommand.java
@@ -31,7 +31,6 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.wizards.IWizardDescriptor;
@@ -45,13 +44,13 @@ public class ImportProjectsCommand
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryTreeNode> selectedNodes = getSelectedNodes(event);
if (selectedNodes == null || selectedNodes.isEmpty()) {
- MessageDialog.openError(Display.getDefault().getActiveShell(),
+ MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
UIText.ImportProjectsWrongSelection,
UIText.ImportProjectsSelectionInRepositoryRequired);
return null;
}
if (!(((List) selectedNodes).get(0) instanceof RepositoryTreeNode)) {
- MessageDialog.openError(Display.getDefault().getActiveShell(),
+ MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
UIText.ImportProjectsWrongSelection,
UIText.ImportProjectsSelectionInRepositoryRequired);
return null;
@@ -119,7 +118,7 @@ public class ImportProjectsCommand
case FOLDER:
return ((FolderNode) node).getObject().getPath().toString();
default:
- MessageDialog.openError(Display.getDefault().getActiveShell(),
+ MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
UIText.ImportProjectsWrongSelection,
UIText.ImportProjectsSelectionInRepositoryRequired);
return null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashDropCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashDropCommand.java
index fad65b743..584c8f4ca 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashDropCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashDropCommand.java
@@ -36,7 +36,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorReference;
@@ -138,7 +137,7 @@ public class StashDropCommand extends
}
private void tryToCloseEditor(final StashedCommitNode node) {
- Display.getDefault().asyncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/EditableRevision.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/EditableRevision.java
index 35e9879fd..07395793f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/EditableRevision.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/EditableRevision.java
@@ -36,6 +36,7 @@ import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.texteditor.IDocumentProvider;
/**
@@ -207,7 +208,7 @@ public class EditableRevision extends FileRevisionTypedElement implements
}
};
if (Display.getCurrent() == null) {
- Display.getDefault().syncExec(runnable);
+ PlatformUI.getWorkbench().getDisplay().syncExec(runnable);
} else {
runnable.run();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
index eef1614ee..c82d236fb 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
@@ -35,7 +35,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
@@ -105,7 +104,7 @@ public class StashCreateUI {
}
private static void showNoChangesToStash() {
- Display.getDefault().asyncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {

Back to the top