当前位置: 首页>>代码示例>>Java>>正文


Java JavaScriptUtil.addNumber方法代码示例

本文整理汇总了Java中com.ibm.xsp.util.JavaScriptUtil.addNumber方法的典型用法代码示例。如果您正苦于以下问题:Java JavaScriptUtil.addNumber方法的具体用法?Java JavaScriptUtil.addNumber怎么用?Java JavaScriptUtil.addNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.xsp.util.JavaScriptUtil的用法示例。


在下文中一共展示了JavaScriptUtil.addNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeDetail

import com.ibm.xsp.util.JavaScriptUtil; //导入方法依赖的package包/类
protected void writeDetail(FacesContext context, ResponseWriter w, AbstractDataView c, ViewDefinition viewDef) throws IOException {
    if(!viewDef.hasDetail) {
        return;
    }

    String id = c.getClientId(context)+ID_DETAIL;
    
    // If the detail should not be displayed, then leave
    boolean detailVisible = viewDef.rowDetailVisible;
    if(!detailVisible && !viewDef.detailsOnClient) {
        return;
    }
    
    String hideStyle = null;
    if(!detailVisible) {
        // We must have then detailsOnClient
        // Just renders it invisible
        hideStyle = "display: none"; // $NON-NLS-1$
    } else {
        // TODO this fade effect doesn't change the tooltips and alt text from Show to Hide
        boolean dojoEffect = (Boolean)getProperty(PROP_SHOWHIDEDOJOEFFECT);
        if(dojoEffect && StringUtil.equals(c.getToggledVisibleDetail(), viewDef.rowPosition)) {
            hideStyle = "opacity: 0"; // $NON-NLS-1$
            UIScriptCollector collector = UIScriptCollector.find();
            String duration = (String)getProperty(PROP_SHOWHIDEDOJODURATION);
            StringBuilder b = new StringBuilder();
            b.append("dojo.fadeIn({node:"); // $NON-NLS-1$
            JavaScriptUtil.addString(b, id);
            b.append(", duration: "); // $NON-NLS-1$
            JavaScriptUtil.addNumber(b, Integer.parseInt(duration));
            b.append("}).play()"); // $NON-NLS-1$
            collector.addScriptOnLoad(b.toString());
        }
    }
    
    UIComponent detail = viewDef.detailFacet;  
    if(detail!=null) {
        String tagName = (String)getProperty(PROP_DETAILTAG);
        w.startElement(tagName,c);
        w.writeAttribute("id",id,null); // $NON-NLS-1$
        String style = (String)getProperty(PROP_DETAILSTYLE);
        String styleClass = (String)getProperty(PROP_DETAILCLASS);
        if(viewDef.collapsibleRows) {
            String collapsibleSize = "20px"; //(Boolean)getProperty(PROP_SHOWHIDEONCLIENT); $NON-NLS-1$
            style = ExtLibUtil.concatStyles(style, "padding-left: "+collapsibleSize); // $NON-NLS-1$
        }
        style = ExtLibUtil.concatStyles(style, hideStyle);
        if(StringUtil.isNotEmpty(style)) {
            w.writeAttribute("style",style,null); // $NON-NLS-1$
        }
        if(StringUtil.isNotEmpty(styleClass)) {
            w.writeAttribute("class",styleClass,null); // $NON-NLS-1$
        }
        FacesUtil.renderComponent(context, detail);
        w.endElement(tagName);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:58,代码来源:AbstractWebDataViewRenderer.java


注:本文中的com.ibm.xsp.util.JavaScriptUtil.addNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。