private String getContentTypeId(Node node) { String contentTypeId = "org.eclipse.core.runtime.xml"; //$NON-NLS-1$ if (node instanceof IDOMNode) { IDOMNode domNode = (IDOMNode) node; contentTypeId = domNode.getModel().getContentTypeIdentifier(); } return contentTypeId; } }
protected boolean isXMLType(IDOMModel structuredModel) { boolean result = false; if (structuredModel != null && structuredModel != null) { IDOMDocument document = structuredModel.getDocument(); if (document != null) result = document.isXMLType(); } return result; }
protected void endRecording() { if (domNode != null) domNode.getModel().endRecording(this); }
public int getLength() { if (this.node.getNodeType() == Node.ELEMENT_NODE) { return ((IDOMElement) this.node).getStartEndOffset() - this.node.getStartOffset(); } return this.node.getLength(); }
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; }
/** */ private IDOMDocumentType findDocumentType(IDOMDocument document) { IDOMDocumentType documentType = (IDOMDocumentType) document.getDoctype(); if (documentType != null && documentType.getExistingAdapter(DocumentTypeAdapter.class) == null) { // watch future changes documentType.addAdapter(this); } return documentType; }
/** */ public void setElement(IDOMElement element) { this.element = element; if (this.element != null) { this.element.setCommentTag(true); if (this.type != MetaData.ANNOTATION) { this.element.setJSPTag(true); } } }
/** * The end tags of HTML EMPTY content type, such as IMG, and HTML * undefined tags are parsed separately from the start tags. So inserting * the missing start tag is useless and even harmful. */ private boolean isStartTagRequired(IDOMNode node) { if (node == null) return false; return node.isContainer(); }
public void dispose() { if (model != null) { model.releaseFromEdit(); } } }
/** */ public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) { if (eventType != INodeNotifier.STRUCTURE_CHANGED) return; if (notifier == null || !(notifier instanceof IDOMDocument)) return; this.documentType = ((IDOMDocument) notifier).getDoctype(); }
/** * @param label * @param node * the node must be a node in the IHTMLGraphicalViewer. */ public DesignerCommand(String label, IDOMNode node) { this(label, (IDOMDocument) node.getOwnerDocument()); }
/** * Insert the method's description here. Creation date: (9/7/2001 10:49:53 * AM) */ public void registerAsModelStateListener() { this.xmlModel.addModelStateListener(this); }
public static boolean isForeign(Element target) { if (!(target instanceof IDOMElement)) return true; IDOMElement element = (IDOMElement) target; return !element.isGlobalTag(); }
/** */ public void setEndData(String data) { this.endData = data; if (this.element != null) this.element.notifyEndTagChanged(); }
/** * Returns the content type id of the SSE DOM Node. * * @param node * @return */ public static String getContentTypeId(IDOMNode node) { if (node == null) { return null; } return node.getModel().getContentTypeIdentifier(); }
private boolean isXMLType(IDOMModel structuredModel) { boolean result = false; if (structuredModel != null && structuredModel != null) { IDOMDocument document = structuredModel.getDocument(); if (document != null) result = document.isXMLType(); } return result; }
protected boolean isEndTagRequired(IDOMNode node) { if (node == null) return false; return node.isContainer(); }
/** * Returns the content type id of the SSE DOM Node. * * @param node * @return */ public static String getContentTypeId(IDOMNode node) { if (node == null) { return null; } return node.getModel().getContentTypeIdentifier(); }
/** * The end tags of HTML EMPTY content type, such as IMG, and HTML * undefined tags are parsed separately from the start tags. So inserting * the missing start tag is useless and even harmful. */ protected boolean isStartTagRequired(IDOMNode node) { if (node == null) return false; return node.isContainer(); }