def load_document(self, document, file=None, language=None):
        """
        Loads given document into the editor.

        :param document: Document to load.
        :type document: QTextDocument
        :param file: File.
        :type file: unicode
        :param language: Editor language.
        :type language: unicode
        :return: Method success.
        :rtype: bool
        """

        document.setDocumentLayout(QPlainTextDocumentLayout(document))
        self.setDocument(document)
        self.set_file(file)
        self.set_language(language)
        self.__set_document_signals()

        self.file_loaded.emit()
        return True