// only bother with all this if we care about the scope of this bean
if (isBeanScopeInMask(bean.getManagedBeanScope(), symbolScopeMask))
{
final String name = bean.getManagedBeanName().getTextContent();
final String detailedDescription = createAdditionalProposalInfo(bean);
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);
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
if (type != null)
{
IJavaTypeDescriptor2 javaTypeDescriptor =
SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
javaTypeDescriptor.setType(type);
symbol.setJavaTypeDescriptor(javaTypeDescriptor);
}
}
catch (JavaModelException t)
{
// do nothing; skip type info for this bean