startProfile(Operation.GET_SWF_TAGS);
final FXGSymbolClass symbolClass = semanticResults.symbolClass;
final Map<ITag, ITag> extraTags = semanticResults.extraTags;
final Collection<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
final DoABCTag abcTag = new DoABCTag();
try
{
abcTag.setName(qname);
abcTag.setABCData(byteResult.getABCBytes());
}
catch (Exception e)
{
ICompilerProblem problem = new InternalCompilerProblem2(getRootFileSpecification().getPath(), e, SUB_SYSTEM);
problems.add(problem);
}
finally
{
stopProfile(Operation.GET_SWF_TAGS);
}
return new ISWFTagsRequestResult()
{
@Override
public boolean addToFrame(SWFFrame frame)
{
ICharacterTag symbolTag = symbolClass.getSymbol();
List<ITag> symbolTags = TagSorter.sortFullGraph(Collections.singletonList((ITag)symbolTag));
for (ITag tag : symbolTags)
{
frame.addTag(tag);
if (extraTags.containsKey(tag))
{
frame.addTag(extraTags.get(tag));
}
}
if (symbolClass.getAdditionalSymbolClasses() != null )
{
for (FXGSymbolClass symbol : symbolClass.getAdditionalSymbolClasses())
{
frame.defineSymbol(symbol.getSymbol(), symbol.getQualifiedClassName());
}
}
frame.addTag(abcTag);
frame.defineSymbol(symbolClass.getSymbol(), qname);
return true;
}
@Override
public ICompilerProblem[] getProblems()
{
return problems.toArray(new ICompilerProblem[0]);
}
@Override
public String getDoABCTagName()
{
return abcTag.getName();
}
};
}