Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcbateman2009-01-27 23:46:59 +0000
committercbateman2009-01-27 23:46:59 +0000
commit6eed1fa5ffb55739ec6237d7006d01fef4b7fc05 (patch)
tree590c5c21b809abad26c901d659001ffdbbb5ef27
parent4c7916d0b186635acfb995167c315e3105924796 (diff)
downloadwebtools.jsf-6eed1fa5ffb55739ec6237d7006d01fef4b7fc05.tar.gz
webtools.jsf-6eed1fa5ffb55739ec6237d7006d01fef4b7fc05.tar.xz
webtools.jsf-6eed1fa5ffb55739ec6237d7006d01fef4b7fc05.zip
Forward patch fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=234709 from 3.0.4 stream.
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java50
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/edit/provider/ManagedBeanTypeItemProvider.java3
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner.jsf.ui/src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java22
3 files changed, 51 insertions, 24 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java
index 2f6181642..540d47257 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java
@@ -131,14 +131,17 @@ public class DefaultBeanSymbolSourceProvider
{
final String name = bean.getManagedBeanName().getTextContent();
final String detailedDescription = createAdditionalProposalInfo(bean);
- IBeanInstanceSymbol symbol = SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
+ final IBeanInstanceSymbol symbol = SymbolFactory.eINSTANCE.createIBeanInstanceSymbol();
symbol.setName(name);
+ if (detailedDescription.length() > 0)
symbol.setDetailedDescription(detailedDescription);
symbol.setRuntimeSource(ERuntimeSource.MANAGED_BEAN_SYMBOL_LITERAL);
try
{
IJavaProject javaProject = JavaCore.create(iProject);
- IType type = javaProject.findType(bean.getManagedBeanClass().getTextContent());
+ final String typeName = bean.getManagedBeanClass() != null?
+ bean.getManagedBeanClass().getTextContent() : ""; //$NON-NLS-1$
+ final IType type = javaProject.findType(typeName);
// don't bother setting a type descriptor if we
// can't find a type
@@ -164,20 +167,37 @@ public class DefaultBeanSymbolSourceProvider
private String createAdditionalProposalInfo(ManagedBeanType beanType)
{
- StringBuffer additionalInfo = new StringBuffer("<p><b>"); //$NON-NLS-1$
- additionalInfo.append(Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Name")); //$NON-NLS-1$
- additionalInfo.append(" </b>"); //$NON-NLS-1$
- additionalInfo.append(beanType.getManagedBeanName().getTextContent());
- additionalInfo.append("</p><p><b>"); //$NON-NLS-1$
- additionalInfo.append(Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Type")); //$NON-NLS-1$
- additionalInfo.append(" </b>"); //$NON-NLS-1$
- additionalInfo.append(beanType.getManagedBeanClass().getTextContent());
- additionalInfo.append("</p><p><b>"); //$NON-NLS-1$
- additionalInfo.append(Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Scope")); //$NON-NLS-1$
- additionalInfo.append(" </b>"); //$NON-NLS-1$
- additionalInfo.append(beanType.getManagedBeanScope().getTextContent());
- additionalInfo.append("</p>"); //$NON-NLS-1$
+ final String beanName = beanType.getManagedBeanName() != null ?
+ beanType.getManagedBeanName().getTextContent() : null;
+
+ StringBuffer additionalInfo = new StringBuffer();
+ if (beanName != null)
+ {
+ additionalInfo.append("<p><b>"+Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Name")); //$NON-NLS-1$ //$NON-NLS-2$
+ additionalInfo.append(" </b>"); //$NON-NLS-1$
+ additionalInfo.append(beanName);
+ additionalInfo.append("</p>"); //$NON-NLS-1$
+ }
+
+ final String beanClass = beanType.getManagedBeanClass() != null ?
+ beanType.getManagedBeanClass().getTextContent() : null;
+ if (beanClass != null)
+ {
+ additionalInfo.append("<p><b>"+Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Type")); //$NON-NLS-1$ //$NON-NLS-2$
+ additionalInfo.append(" </b>"); //$NON-NLS-1$
+ additionalInfo.append(beanClass);
+ additionalInfo.append("</p>"); //$NON-NLS-1$
+ }
+ final String beanScope = beanType.getManagedBeanScope() != null ?
+ beanType.getManagedBeanScope().getTextContent() : null;
+ if (beanScope != null)
+ {
+ additionalInfo.append("<p><b>"+Messages.getString("DefaultBeanSymbolSourceProvider.AdditionalInformation.Scope")); //$NON-NLS-1$ //$NON-NLS-2$
+ additionalInfo.append(" </b>"); //$NON-NLS-1$
+ additionalInfo.append(beanScope);
+ additionalInfo.append("</p>"); //$NON-NLS-1$
+ }
StringBuffer descBuffer = new StringBuffer();
for (final Iterator it = beanType.getDescription().iterator(); it.hasNext();)
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/edit/provider/ManagedBeanTypeItemProvider.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/edit/provider/ManagedBeanTypeItemProvider.java
index 250251f78..53c22af95 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/edit/provider/ManagedBeanTypeItemProvider.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/edit/provider/ManagedBeanTypeItemProvider.java
@@ -226,9 +226,10 @@ public class ManagedBeanTypeItemProvider
public String getText(Object object) {
String label = null;
if (((ManagedBeanType) object).getManagedBeanName() != null)
+ {
label = ((ManagedBeanType) object).getManagedBeanName()
.getTextContent();
-
+ }
if (label == null || label.length() == 0) {
if (((ManagedBeanType) object).getManagedBeanClass() != null)
label = ((ManagedBeanType) object).getManagedBeanClass()
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner.jsf.ui/src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java b/jsf/plugins/org.eclipse.jst.pagedesigner.jsf.ui/src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java
index bd2ed892f..b718752af 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner.jsf.ui/src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner.jsf.ui/src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java
@@ -176,7 +176,10 @@ public class JSFAddActionGroup {
ValidatorType validator = (ValidatorType) it.next();
ValidatorIdType validatorId = validator.getValidatorId();
if (validatorId != null)
- result[i++] = validatorId.getTextContent().trim();
+ {
+ result[i++] = validatorId.getTextContent() != null ?
+ validatorId.getTextContent().trim() : ""; //$NON-NLS-1$
+ }
}
}
return result;
@@ -196,15 +199,18 @@ public class JSFAddActionGroup {
if (appConfigMgr != null)
{
final List list = appConfigMgr.getConverters();
- result = new String[list.size()];
+ result = new String[list.size()];
int i = 0;
- for (final Iterator it = list.iterator(); it.hasNext();)
+ for (final Iterator it = list.iterator(); it.hasNext();)
{
- ConverterType converter = (ConverterType) it.next();
- ConverterIdType converterId = converter.getConverterId();
- if (converterId != null)
- result[i++] = converterId.getTextContent().trim();
- }
+ ConverterType converter = (ConverterType) it.next();
+ ConverterIdType converterId = converter.getConverterId();
+ if (converterId != null)
+ {
+ result[i++] = converterId.getTextContent() != null ?
+ converterId.getTextContent().trim() : ""; //$NON-NLS-1$
+ }
+ }
}
return result;
}

Back to the top