protected DocumentType createDoctype(EditDoctypeDialog dialog, Document document) { DocumentType result = null; if (document instanceof DocumentImpl) { IDOMDocument documentImpl = (IDOMDocument) document; IDOMDocumentType doctypeImpl = (IDOMDocumentType) documentImpl.createDoctype(dialog.getName()); doctypeImpl.setPublicId(dialog.getPublicId()); doctypeImpl.setSystemId(dialog.getSystemId()); result = doctypeImpl; } return result; }
Node parent = docType.getParentNode(); child = docType; docType = (IDOMDocumentType) document.createDoctype(name); parent.insertBefore(docType, child); parent.removeChild(child); docType = (IDOMDocumentType) document.createDoctype(name); document.insertBefore(docType, child); insertBreak(model, child);
DocumentTypeImpl docType = (DocumentTypeImpl) this.model.getDocument().createDoctype(name); if (docType == null) return;