summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorTomasz Zarna2012-07-13 05:16:10 (EDT)
committer Robin Stocker2012-07-15 08:18:17 (EDT)
commit9725ccd197e1b5a2bed090df1920e5daf32b65ef (patch)
treeeb7573b8a25ed642b41ec0432de5a66150e7c9f2
parentbd240a28adeecbbd14d30722f49c6888feb0b277 (diff)
downloadegit-9725ccd197e1b5a2bed090df1920e5daf32b65ef.zip
egit-9725ccd197e1b5a2bed090df1920e5daf32b65ef.tar.gz
egit-9725ccd197e1b5a2bed090df1920e5daf32b65ef.tar.bz2
NPE in SpellcheckableMessageArea$1.widgetDisposed when closing Eclipserefs/changes/56/6756/2
Allow to use a local service locator for retrieving IHandlerService. Use the workbench window's service locator if the local is not available e.g. in a dialog. Bug: 381052 Change-Id: Ie953df8983bf0fd28496feb886ca4e1ae7201b9f Signed-off-by: Robin Stocker <robin@nibor.org>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java16
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java4
2 files changed, 16 insertions, 4 deletions
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 11bb704..0a40adf 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
@@ -614,10 +614,18 @@ public class SpellcheckableMessageArea extends Composite {
};
}
- private IHandlerService getHandlerService() {
- final IHandlerService handlerService = (IHandlerService) PlatformUI
- .getWorkbench().getService(IHandlerService.class);
- return handlerService;
+ /**
+ * Return <code>IHandlerService</code>. The default implementation uses the
+ * workbench window's service locator. Subclasses may override to access the
+ * service by using a local service locator.
+ *
+ * @return <code>IHandlerService</code> using the workbench window's service
+ * locator. Can be <code>null</code> if the service could not be
+ * found.
+ */
+ protected IHandlerService getHandlerService() {
+ return (IHandlerService) PlatformUI.getWorkbench().getService(
+ IHandlerService.class);
}
private SourceViewerDecorationSupport configureAnnotationPreferences() {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
index ff7d8cf..927a53c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
@@ -405,6 +405,10 @@ public class StagingView extends ViewPart {
protected CommitProposalProcessor getCommitProposalProcessor() {
return commitProposalProcessor;
}
+ @Override
+ protected IHandlerService getHandlerService() {
+ return (IHandlerService) getSite().getService(IHandlerService.class);
+ }
};
commitMessageText.setData(FormToolkit.KEY_DRAW_BORDER,
FormToolkit.TEXT_BORDER);