本文整理汇总了Java中com.taobao.weex.dom.WXDomObject.traverseTree方法的典型用法代码示例。如果您正苦于以下问题:Java WXDomObject.traverseTree方法的具体用法?Java WXDomObject.traverseTree怎么用?Java WXDomObject.traverseTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.weex.dom.WXDomObject
的用法示例。
在下文中一共展示了WXDomObject.traverseTree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeDom
import com.taobao.weex.dom.WXDomObject; //导入方法依赖的package包/类
@Override
public void executeDom(DOMActionContext context) {
if (context.isDestory() || mData == null) {
return;
}
WXSDKInstance instance = context.getInstance();
WXDomObject domObject = context.getDomByRef(mRef);
if (domObject == null) {
if (instance != null) {
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, WXErrorCode.WX_ERR_DOM_UPDATESTYLE);
}
return;
}
mPadding = domObject.getPadding();
mBorder = domObject.getBorder();
Map<String, Object> animationMap = new ArrayMap<>(2);
animationMap.put(WXDomObject.TRANSFORM, mData.get(WXDomObject.TRANSFORM));
animationMap.put(WXDomObject.TRANSFORM_ORIGIN, mData.get(WXDomObject.TRANSFORM_ORIGIN));
context.addAnimationForElement(mRef, animationMap);
if (!mData.isEmpty()) {
domObject.updateStyle(mData, mIsCausedByPesudo);
domObject.traverseTree(context.getApplyStyleConsumer());
context.postRenderTask(this);
}
if (instance != null) {
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, WXErrorCode.WX_SUCCESS);
}
}
示例2: executeDom
import com.taobao.weex.dom.WXDomObject; //导入方法依赖的package包/类
@Override
public void executeDom(DOMActionContext context) {
if (context.isDestory()) {
return;
}
WXSDKInstance instance = context.getInstance();
WXDomObject domObject = context.getDomByRef(mRef);
if (domObject == null) {
if (instance != null) {
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, WXErrorCode.WX_ERR_DOM_REMOVEELEMENT);
}
return;
}
WXDomObject parent = domObject.parent;
if (parent == null) {
if (instance != null) {
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, WXErrorCode.WX_ERR_DOM_REMOVEELEMENT);
}
return;
}
domObject.traverseTree(context.getRemoveElementConsumer());
parent.remove(domObject);
context.unregisterDOMObject(mRef);
context.postRenderTask(this);
if (instance != null) {
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, WXErrorCode.WX_SUCCESS);
}
}
示例3: addDomInternal
import com.taobao.weex.dom.WXDomObject; //导入方法依赖的package包/类
/**
* Add DOM node.
*/
protected void addDomInternal(DOMActionContext context, JSONObject dom) {
if (context.isDestory()) {
return;
}
WXSDKInstance instance = context.getInstance();
if (instance == null) {
return;
}
WXErrorCode errCode = getErrorCode();
if (dom == null) {
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, errCode);
}
//only non-root has parent.
WXDomObject domObject = WXDomObject.parse(dom, instance);
if (domObject == null || context.getDomByRef(domObject.getRef()) != null) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.e("[DOMActionContextImpl] " + getStatementName() + " error,DOM object is null or already registered!!");
}
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, errCode);
return;
}
appendDomToTree(context, domObject);
domObject.traverseTree(
context.getAddDOMConsumer(),
context.getApplyStyleConsumer()
);
//Create component in dom thread
WXComponent component = createComponent(context, domObject);
if (component == null) {
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, errCode);
//stop redner, some fatal happened.
return;
}
context.addDomInfo(domObject.getRef(), component);
context.postRenderTask(this);
addAnimationForDomTree(context, domObject);
instance.commitUTStab(IWXUserTrackAdapter.DOM_MODULE, WXErrorCode.WX_SUCCESS);
}