/** */ public void setCommentTag(boolean isCommentTag) { IDOMNode parent = (IDOMNode) getParentNode(); if (parent != null && !parent.isChildEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } this.isCommentTag = isCommentTag; }
/** * setEmptyTag method * * @param isEmptyTag * boolean */ public void setEmptyTag(boolean isEmptyTag) { IDOMNode parent = (IDOMNode) getParentNode(); if (parent != null && !parent.isChildEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } this.isEmptyTag = isEmptyTag; }
/** * setJSPTag method * * @param isJSPTag * boolean */ public void setJSPTag(boolean isJSPTag) { IDOMNode parent = (IDOMNode) getParentNode(); if (parent != null && !parent.isChildEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } this.isJSPTag = isJSPTag; }
/** */ public void setPrefix(String prefix) throws DOMException { IDOMNode parent = (IDOMNode) getParentNode(); if (parent != null && !parent.isChildEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } int prefixLength = (prefix != null ? prefix.length() : 0); String localName = getLocalName(); if (prefixLength == 0) { if (localName == null || localName.length() == 0) { // invalid local name return; } setTagName(localName); } else { int localLength = (localName != null ? localName.length() : 0); StringBuffer buffer = new StringBuffer(prefixLength + 1 + localLength); buffer.append(prefix); buffer.append(':'); if (localName != null) buffer.append(localName); setTagName(buffer.toString()); } boolean changeEndTag = hasEndTag(); notifyStartTagChanged(); if (changeEndTag) notifyEndTagChanged(); }
/** * lock itself and all descendants */ void lockDeep(IDOMNode node) { if (node == null) { return; } int offset = node.getStartOffset(); int length = node.getEndOffset() - offset; boolean canInsert = true; IDOMNode parent = (IDOMNode) node.getParentNode(); if (parent != null && !parent.isChildEditable()) { canInsert = false; } lock(node.getStructuredDocument(), offset, length, canInsert, canInsert); }
/** * This method is used from parent's setChildEditable() * * case 1:<parent><node attr="value"/> <node2></parent> * x####################x case 2:<parent><node attr="value"> <child> * </child> </node> </parent> x###################? ?#######x (? : * editable if node.isEditable() == true) */ void lockBoth(IDOMNode node) { if (node == null) { return; } IStructuredDocumentRegion flatNode; boolean canInsert = false; // end node (element) if (node.getNodeType() == Node.ELEMENT_NODE) { flatNode = node.getEndStructuredDocumentRegion(); if (flatNode != null) { canInsert = node.isChildEditable(); lock(flatNode, canInsert, false); } } // start node flatNode = node.getStartStructuredDocumentRegion(); if (flatNode != null) { lock(flatNode, false, canInsert); } }
flatNode = node.getEndStructuredDocumentRegion(); if (flatNode != null) { canInsert = node.isChildEditable(); lock(flatNode, canInsert, false);