use of org.eclipse.wst.css.core.internal.provisional.document.ICSSNode in project webtools.sourceediting by eclipse.
the class CSSModelUpdateContext method getCSSPrimitiveValueAny.
/**
*/
CSSPrimitiveValueImpl getCSSPrimitiveValueAny() {
ICSSNode node = getNode();
if (node instanceof CSSPrimitiveValueImpl) {
return (CSSPrimitiveValueImpl) node;
} else {
CSSUtil.debugOut(// $NON-NLS-1$
"CSSPrimitiveValueImpl is expected, but " + CSSUtil.getClassString(node));
ungetNode();
// $NON-NLS-1$
throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");
}
}
use of org.eclipse.wst.css.core.internal.provisional.document.ICSSNode in project webtools.sourceediting by eclipse.
the class CSSModelUpdateContext method getRect.
/**
*/
// ICSSNode getParentNode() {
// return fParentNode;
// }
/**
*/
RectImpl getRect() {
ICSSNode node = getNode();
if (node instanceof RectImpl) {
return (RectImpl) node;
} else {
CSSUtil.debugOut(// $NON-NLS-1$
"RectImpl is expected, but " + CSSUtil.getClassString(node));
ungetNode();
// $NON-NLS-1$
throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");
}
}
use of org.eclipse.wst.css.core.internal.provisional.document.ICSSNode in project webtools.sourceediting by eclipse.
the class CSSModelUpdateContext method setupContext.
/**
*/
void setupContext(short updateMode, ICSSNode parentNode, ICSSNode targetNode) {
fUpdateMode = updateMode;
ICSSNode traverseRoot;
if (updateMode == UPDATE_REMOVE_RCONTAINER || updateMode == UPDATE_INSERT_RCONTAINER || updateMode == UPDATE_CHANGE_RCONTAINER) {
traverseRoot = parentNode;
while (traverseRoot instanceof CSSRegionContainer) {
traverseRoot = traverseRoot.getParentNode();
}
} else {
traverseRoot = targetNode;
}
if (// region
updateMode == UPDATE_REMOVE_RCONTAINER || updateMode == UPDATE_INSERT_RCONTAINER || // node
updateMode == UPDATE_CHANGE_RCONTAINER || updateMode == UPDATE_REMOVE_FNCONTAINER) {
fDeletionTarget = traverseRoot;
if (fDeletionTarget == targetNode) {
fDeletionTargetParent = parentNode;
} else {
fDeletionTargetParent = fDeletionTarget.getParentNode();
}
} else {
fDeletionTarget = null;
fDeletionTargetParent = null;
}
if (// region
updateMode == UPDATE_INSERT_RCONTAINER || updateMode == UPDATE_INSERT_FNCONTAINER || updateMode == UPDATE_REMOVE_RCONTAINER || // node
updateMode == UPDATE_CHANGE_RCONTAINER) {
CSSNodeUpdateTraverser traverser = new CSSNodeUpdateTraverser();
traverser.apply(traverseRoot);
fNodeList = traverser.getNodeList();
} else {
fNodeList = null;
}
}
use of org.eclipse.wst.css.core.internal.provisional.document.ICSSNode in project webtools.sourceediting by eclipse.
the class CSSModelUpdateContext method getCSSCharsetRule.
/**
*/
CSSCharsetRuleImpl getCSSCharsetRule() {
ICSSNode node = getNode();
if (node instanceof CSSCharsetRuleImpl) {
return (CSSCharsetRuleImpl) node;
} else {
CSSUtil.debugOut(// $NON-NLS-1$
"CSSCharsetRuleImpl is expected, but " + CSSUtil.getClassString(node));
ungetNode();
// $NON-NLS-1$
throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");
}
}
use of org.eclipse.wst.css.core.internal.provisional.document.ICSSNode in project webtools.sourceediting by eclipse.
the class CSSNodeImpl method cloneChildNodes.
/**
* currently public but may be made default access protected in future.
*/
protected void cloneChildNodes(ICSSNode newParent, boolean deep) {
if (newParent == null || newParent == this)
return;
CSSNodeImpl container = (CSSNodeImpl) newParent;
container.removeChildNodes();
for (ICSSNode child = getFirstChild(); child != null; child = child.getNextSibling()) {
CSSNodeImpl cloned = (CSSNodeImpl) child.cloneNode(deep);
if (cloned != null)
container.appendChild(cloned);
}
}
Aggregations