if (getFlag(flags, T_CATEGORY) && type.exists()) { try { String[] categories= type.getCategories(); if (categories.length > 0) { buf.append(CONCAT_STRING); buf.append(Messages.format(JavaUIMessages.JavaElementLabels_category , categories[0]));				} } catch (JavaModelException e) {  } }
	public static void getTypeLabel(IType type, long flags, StringBuffer buf) {				// category		if (getFlag(flags, T_CATEGORY) && type.exists()) {			try {				String[] categories= type.getCategories();				if (categories.length > 0) {					buf.append(categories[0]);					buf.append(CONCAT_STRING);				}			} catch (JavaModelException e) {				// ignore			}		}				if (getFlag(flags, T_FULLY_QUALIFIED)) {			IPackageFragment pack= type.getPackageFragment();			if (!pack.isDefaultPackage()) {				getPackageFragmentLabel(pack, (flags & QUALIFIER_FLAGS), buf);				buf.append('.');			}		}		if (getFlag(flags, T_FULLY_QUALIFIED | T_CONTAINER_QUALIFIED)) {			IType declaringType= type.getDeclaringType();			if (declaringType != null) {				getTypeLabel(declaringType, T_CONTAINER_QUALIFIED | (flags & QUALIFIER_FLAGS), buf);				buf.append('.');			}			int parentType= type.getParent().getElementType();			if (parentType == IJavaElement.METHOD || parentType == IJavaElement.FIELD || parentType == IJavaElement.INITIALIZER) { // anonymous or local				getElementLabel(type.getParent(), 0, buf);				buf.append('.');			}		}				String typeName= type.getElementName();		if (typeName.length() == 0) { // anonymous			try {				if (type.getParent() instanceof IField && type.isEnum()) {					typeName= '{' + ELLIPSIS_STRING + '}'; 				} else {					String supertypeName;					String[] superInterfaceNames= type.getSuperInterfaceNames();					if (superInterfaceNames.length > 0) {						supertypeName= Signature.getSimpleName(superInterfaceNames[0]);					} else {						supertypeName= Signature.getSimpleName(type.getSuperclassName());					}					typeName= Messages.format(JavaUIMessages.JavaElementLabels_anonym_type , supertypeName); 				}			} catch (JavaModelException e) {				//ignore				typeName= JavaUIMessages.JavaElementLabels_anonym; 			}		}		buf.append(typeName);		if (getFlag(flags, T_TYPE_PARAMETERS)) {			if (getFlag(flags, USE_RESOLVED) && type.isResolved()) {				BindingKey key= new BindingKey(type.getKey());				if (key.isParameterizedType()) {					String[] typeArguments= key.getTypeArguments();					getTypeArgumentSignaturesLabel(typeArguments, flags, buf);				} else {					String[] typeParameters= Signature.getTypeParameters(key.toSignature());					getTypeParameterSignaturesLabel(typeParameters, flags, buf);				}			} else if (type.exists()) {				try {					getTypeParametersLabel(type.getTypeParameters(), flags, buf);				} catch (JavaModelException e) {					// ignore				}			}		}		// post qualification		if (getFlag(flags, T_POST_QUALIFIED)) {			buf.append(CONCAT_STRING);			IType declaringType= type.getDeclaringType();			if (declaringType != null) {				getTypeLabel(declaringType, T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf);				int parentType= type.getParent().getElementType();				if (parentType == IJavaElement.METHOD || parentType == IJavaElement.FIELD || parentType == IJavaElement.INITIALIZER) { // anonymous or local					buf.append('.');					getElementLabel(type.getParent(), 0, buf);				}			} else {				getPackageFragmentLabel(type.getPackageFragment(), flags & QUALIFIER_FLAGS, buf);			}		}	}