{
final ITaglibDomainMetaDataQuery query = MetaDataQueryFactory.getInstance().createQuery(metaDataContext);
final Model model = query.findTagLibraryModel(metaDataContext.getModelIdentifier());
if (model != null)
{
Trait trait = query.findTrait(model,
PaletteInfos.TRAIT_ID);
if (trait != null)
{
final PaletteInfos pis = (PaletteInfos) trait.getValue();
final PaletteInfo pi = pis.findPaletteInfoById(id);
if (pi != null)
{
return pi.getTagCreation();
}
}
// tag-creation trait on entity directly?
final Entity tag = query.findTagEntity(model, tagName);
if (tag != null)
{// metadata exists
trait = query.findTrait(tag,
"tag-create"); //$NON-NLS-1$
if (trait != null && trait.getValue() != null)
{
return (TagCreationInfo) trait.getValue();
}
}
}
return null;
}