use of com.intellij.flex.uiDesigner.DocumentFactoryManager.DocumentInfo in project intellij-plugins by JetBrains.
the class Client method renderDocument.
/**
* final, full render document - responsible for handle problemsHolder and assetCounter - you must not do it
*/
public AsyncResult<DocumentInfo> renderDocument(Module module, XmlFile psiFile, ProblemsHolder problemsHolder) {
VirtualFile virtualFile = psiFile.getVirtualFile();
final int factoryId = registerDocumentFactoryIfNeed(module, psiFile, virtualFile, false, problemsHolder);
final AsyncResult<DocumentInfo> result = new AsyncResult<>();
if (factoryId == -1) {
result.setRejected();
return result;
}
FlexLibrarySet flexLibrarySet = registeredModules.getInfo(module).getFlexLibrarySet();
if (flexLibrarySet != null) {
fillAssetClassPoolIfNeed(flexLibrarySet);
}
if (!problemsHolder.isEmpty()) {
DocumentProblemManager.getInstance().report(module.getProject(), problemsHolder);
}
final ActionCallback callback = new ActionCallback("renderDocument");
boolean hasError = true;
try {
beginMessage(ClientMethod.renderDocument, callback, result, () -> result.setDone(DocumentFactoryManager.getInstance().getInfo(factoryId)));
out.writeShort(factoryId);
hasError = false;
} finally {
finalizeMessageAndFlush(hasError);
}
return result;
}
use of com.intellij.flex.uiDesigner.DocumentFactoryManager.DocumentInfo in project intellij-plugins by JetBrains.
the class AppTest method applicationLaunchedAndInitialized.
@Override
protected void applicationLaunchedAndInitialized() {
((MySocketInputHandler) SocketInputHandler.getInstance()).fail = fail;
((MySocketInputHandler) SocketInputHandler.getInstance()).semaphore = semaphore;
MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect(myModule);
connection.subscribe(DesignerApplicationManager.MESSAGE_TOPIC, new DocumentRenderedListener() {
@Override
public void documentRendered(DocumentInfo info) {
semaphore.up();
}
@Override
public void errorOccurred() {
fail.set(true);
semaphore.up();
}
});
}
Aggregations