Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2014-04-16 11:36:42 +0000
committerDani Megert2014-04-16 11:36:42 +0000
commitca57b300d79431c27b32ae2113919be546cc42d9 (patch)
tree786706a3f7bddfac50daa93877b8232cbc0e52ff
parent12e81d45ded84412e8efcc2435cd85c0c42e951e (diff)
downloadeclipse.platform.text-ca57b300d79431c27b32ae2113919be546cc42d9.tar.gz
eclipse.platform.text-ca57b300d79431c27b32ae2113919be546cc42d9.tar.xz
eclipse.platform.text-ca57b300d79431c27b32ae2113919be546cc42d9.zip
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
index ec3e2c5df..350a5e281 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1156,8 +1156,20 @@ class CompletionProposalPopup implements IContentAssistListener {
for (int i= 0; i < items.length; i++) {
TableItem item= items[i];
ICompletionProposal proposal= proposals[i];
- item.setText(proposal.getDisplayString());
- item.setImage(proposal.getImage());
+ Image image= null;
+ String displayString= null;
+ try {
+ displayString= proposal.getDisplayString();
+ image= proposal.getImage();
+ } catch (RuntimeException e) {
+ // On failures to retrieve the proposal's text, insert a dummy entry and log the error.
+ String PLUGIN_ID= "org.eclipse.jface.text"; //$NON-NLS-1$
+ ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID));
+ log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, JFaceTextMessages.getString("CompletionProposalPopup.unexpected_error"), e)); //$NON-NLS-1$
+ displayString= JFaceTextMessages.getString("CompletionProposalPopup.error_retrieving_proposal"); //$NON-NLS-1$
+ }
+ item.setText(displayString);
+ item.setImage(image);
item.setData(proposal);
}
fProposalTable.setRedraw(true);

Back to the top