DocumentInterfaceImpl loadingDocumentInterface = new DocumentInterfaceImpl (context, undoRedoManager); documentInterfaces.add (new WeakReference<DocumentInterface> (loadingDocumentInterface)); final DesignDocument loadingDocument = new DesignDocument (loadingDocumentInterface); DocumentErrorHandler errorHandler = new DocumentErrorHandler(); DocumentLoad.load (context, loadingDocument, errorHandler);