use of com.intellij.flex.uiDesigner.mxml.ProjectComponentReferenceCounter in project intellij-plugins by JetBrains.
the class Client method writeDocumentFactory.
/**
* You must rollback block out if this method returns false
*/
private boolean writeDocumentFactory(DocumentInfo documentInfo, Module module, XmlFile psiFile, ProblemsHolder problemsHolder) throws IOException {
final AccessToken token = ReadAction.start();
final int flags;
try {
final JSClass jsClass = XmlBackedJSClassFactory.getXmlBackedClass(psiFile);
assert jsClass != null;
out.writeAmfUtf(jsClass.getQualifiedName());
if (ActionScriptClassResolver.isParentClass(jsClass, FlexCommonTypeNames.SPARK_APPLICATION) || ActionScriptClassResolver.isParentClass(jsClass, FlexCommonTypeNames.MX_APPLICATION)) {
flags = 1;
} else if (ActionScriptClassResolver.isParentClass(jsClass, FlexCommonTypeNames.IUI_COMPONENT)) {
flags = 0;
} else {
flags = 2;
}
} finally {
token.finish();
}
out.write(flags);
Pair<ProjectComponentReferenceCounter, List<RangeMarker>> result = new MxmlWriter(out, problemsHolder, registeredModules.getInfo(module).getFlexLibrarySet().assetCounterInfo.demanded).write(psiFile);
if (result == null) {
return false;
}
blockOut.end();
documentInfo.setRangeMarkers(result.second);
return result.first.unregistered.isEmpty() || registerDocumentReferences(result.first.unregistered, module, problemsHolder);
}
Aggregations