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


Java UIViewRootEx.addEncodeResource方法代码示例

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


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

示例1: preRenderTree

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
protected void preRenderTree(final FacesContext context, final ResponseWriter writer, final TreeContextImpl tree) throws IOException {
	// Add the JS support if necessary
	if(isExpandable()) {
		UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
		rootEx.setDojoTheme(true);
		//ExtLibResources.addEncodeResource(rootEx, BootstrapResources.bootstrapNavigator);
		// Specific dojo effects
		String effect = getExpandEffect();
		if(StringUtil.isNotEmpty(effect)) {
			rootEx.addEncodeResource(ExtLibResources.dojoFx);
			ExtLibResources.addEncodeResource(rootEx, ExtLibResources.dojoFx);
		}
	}
	super.preRenderTree(context, writer, tree);
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:17,代码来源:AceMenuRenderer.java

示例2: encodeBegin

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
   	ResponseWriter w = context.getResponseWriter();
   	UIFirebugLite firebug = (UIFirebugLite)component;
   	
   	boolean rendered = component.isRendered();
   	if(!rendered) {
   		return;
   	}
   	
   	// Get the URL
   	String url = firebug.findUrl(context);
   	
   	// Add a resource into the header
   	ScriptResource js = new ScriptResource();
   	js.setClientSide(true);
   	js.setSrc(url);
   	
   	UIViewRootEx vex = (UIViewRootEx)context.getViewRoot();
   	vex.addEncodeResource(js);
   }
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:22,代码来源:FirebugLiteRenderer.java

示例3: addEncodeResource

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@SuppressWarnings("unchecked") // $NON-NLS-1$
public static void addEncodeResource(UIViewRootEx rootEx, Resource resource) {
    if(ExtLibUtil.isXPages852()) {
        // The XPages runtime add all the resources and does a check when it starts to
        // generate all the resources at the very end.
        // For performance reasons, and until the XPages runtime optimizes this, we ensure
        // that the same resource (the exact same object - identity comparison) is not
        // added multiple times.
        // Already optimized in post 852
        IdentityHashMap<Resource, Boolean> m = (IdentityHashMap<Resource, Boolean>)rootEx.getEncodeProperty("extlib.EncodeResource"); // $NON-NLS-1$
        if(m==null) {
            m = new IdentityHashMap<Resource, Boolean>();
        } else {
            if(m.containsKey(resource)) {
                return;
            }
        }
        m.put(resource, Boolean.TRUE);
    }
    rootEx.addEncodeResource(resource);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:22,代码来源:ExtLibResources.java

示例4: preRenderTree

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
protected void preRenderTree(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
    // Add the JS support if necessary
    if(isExpandable()) {
        UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
        rootEx.setDojoTheme(true);
        ExtLibResources.addEncodeResource(rootEx, Resources.bootstrapNavigator);
        ExtLibResources.addEncodeResource(rootEx, ExtLibResources.extlibExtLib);
        // Specific dojo effects
        String effect = getExpandEffect();
        if(StringUtil.isNotEmpty(effect)) {
            rootEx.addEncodeResource(ExtLibResources.dojoFx);
            ExtLibResources.addEncodeResource(rootEx, ExtLibResources.dojoFx);
        }
    }
    super.preRenderTree(context, writer, tree);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:MenuRenderer.java

示例5: preRenderTree

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
protected void preRenderTree(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
    // Add the JS support if necessary
    if(isExpandable()) {
        UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
        rootEx.setDojoTheme(true);
        ExtLibResources.addEncodeResource(rootEx, OneUIResources.oneUINavigator);
        // Specific dojo effects
        String effect = getExpandEffect();
        if(StringUtil.isNotEmpty(effect)) {
            rootEx.addEncodeResource(ExtLibResources.dojoFx);
            ExtLibResources.addEncodeResource(rootEx, ExtLibResources.dojoFx);
        }
    }
    super.preRenderTree(context, writer, tree);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:17,代码来源:OneUIMenuRenderer.java

示例6: addEncodeResource

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static void addEncodeResource(UIViewRootEx rootEx, Resource resource) {
	IdentityHashMap<Resource, Boolean> m = (IdentityHashMap<Resource, Boolean>) rootEx.getEncodeProperty("starter.EncodeResource");
	if (m == null) {
		m = new IdentityHashMap<Resource, Boolean>();
	} else {
		if (m.containsKey(resource)) {
			return;
		}
	}
	m.put(resource, Boolean.TRUE);

	rootEx.addEncodeResource(resource);
}
 
开发者ID:OpenNTF,项目名称:BuildAndTestPattern4Xpages,代码行数:15,代码来源:Resources.java

示例7: encodeBegin

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
public void encodeBegin(FacesContext context, UIComponent component)
        throws IOException {
    super.encodeBegin(context, component);
    ResponseWriter w = context.getResponseWriter();

    String clientId = component.getClientId(context);
    
    w.startElement("div", component); // $NON-NLS-1$
    w.writeAttribute("id", clientId, "id"); // $NON-NLS-1$ $NON-NLS-2$
    //w.writeAttribute("style", "display: none", "style");
    
    // Add the newly added resources, if some
    if(AbstractDynamicContent.USE_DYNAMIC_RESOURCES) {
        Integer rc = (Integer)context.getExternalContext().getRequestMap().get(AbstractDynamicContent.DYNAMIC_RESOURCES);
        if(rc!=null) {
            UIViewRootEx rootEx = (UIViewRootEx)context.getViewRoot();
            List<Resource> resources = rootEx.getResources();
            int count = resources.size();
            boolean isTraceDebug = ExtlibControlsLogger.CONTROLS.isTraceDebugEnabled();
            for(int i=rc; i<count; i++) {
                Resource resource = resources.get(i);
                if( isTraceDebug ){
                    ExtlibControlsLogger.CONTROLS.traceDebugp(this, "encodeBegin", //$NON-NLS-1$ 
                        StringUtil.format("Added a dynamic resource, {0}", resource.getClass().getName())); //$NON-NLS-1$
                }
                rootEx.addEncodeResource(resource);
            }
        }
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:32,代码来源:DynamicControlRenderer.java

示例8: writeSlider

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
protected void writeSlider(FacesContext context, ResponseWriter writer, UITagCloud tagCloud) throws IOException {
    UIViewRootEx ex = (UIViewRootEx)context.getViewRoot();
    ex.addEncodeResource(context, ExtLibResources.xspTagCloudSlider);
    ex.setDojoParseOnLoad(true);
    ex.setDojoTheme(true);
    
    writer.startElement("div", null); // $NON-NLS-1$

    String sliderId = tagCloud.getClientId(context)+"_slider"; // $NON-NLS-1$
    
    Map<String, String> attrs = DojoRendererUtil.createMap(context);
    
    writer.startElement("div", null); // $NON-NLS-1$
    writer.writeAttribute("id", sliderId, null); // $NON-NLS-1$
    String dojoType = "ibm.xsp.widget.layout.TagCloudSlider"; // $NON-NLS-1$ $NON-NLS-2$

    String title = tagCloud.getAriaLabel();
    if (StringUtil.isNotEmpty(title)) {
        attrs.put("title", title); // $NON-NLS-1$
    }

    attrs.put("clickSelect", "true"); // $NON-NLS-1$ $NON-NLS-2$
    attrs.put("showButtons", "false"); // $NON-NLS-1$ $NON-NLS-2$
    attrs.put("value", "0"); // $NON-NLS-1$
    attrs.put("minimum", "0"); // $NON-NLS-1$
    attrs.put("maximum", "10"); // $NON-NLS-1$
    attrs.put("intermediateChanges", "true"); // $NON-NLS-1$ $NON-NLS-2$
    attrs.put("pageIncrement", "20"); // $NON-NLS-1$
    String tagId = tagCloud.getClientId(context)+"_tg"; // $NON-NLS-1$
    StringBuilder b = new StringBuilder();
    b.append("XSP.tagCloudSliderOnChange(parseInt(arguments[0]), "); //$NON-NLS-1$
    JSUtil.addSingleQuoteString(b, tagId);
    b.append(");"); //$NON-NLS-1$
    attrs.put("onChange", b.toString()); //$NON-NLS-1$
    DojoRendererUtil.writeDojoHtmlAttributes(context, tagCloud, dojoType, attrs);
    writer.endElement("div"); // $NON-NLS-1$
    
    writer.endElement("div"); // $NON-NLS-1$
    JSUtil.writeTextln(writer);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:41,代码来源:AbstractTagCloudRenderer.java

示例9: encodeBegin

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
public void encodeBegin(FacesContext context, UIComponent component)
        throws IOException {
    ResponseWriter w = context.getResponseWriter();
    UINotesListViewDesign uiComponent = (UINotesListViewDesign) component;
    boolean rendered = component.isRendered();
    if (!rendered)
        return;

    UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
    rootEx.addEncodeResource(DojoResources.dominoDesignStore);
    rootEx.setDojoParseOnLoad(true);

    String url = getDbUrl(context, uiComponent);

    w.startElement("span", null); // $NON-NLS-1$
    w.writeAttribute(DojoResourceConstants.dojoType,
            DojoResourceConstants.DominoReadDesign, null);
    String id = uiComponent.getClientId(context);
    if (StringUtil.isNotEmpty(id))
        w.writeAttribute("id", id, null); // $NON-NLS-1$
    String jsId = uiComponent.getDojoWidgetJsId(context);
    if (StringUtil.isNotEmpty(jsId))
        w.writeAttribute("jsId", jsId, null); // $NON-NLS-1$
    w.writeAttribute("url", url, null); // $NON-NLS-1$
    w.writeAttribute("dwa", "false", null); // $NON-NLS-1$ $NON-NLS-2$
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:28,代码来源:NotesListViewDesignRenderer.java

示例10: encodeBegin

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
public void encodeBegin(FacesContext context, UIComponent component)
        throws IOException {
    ResponseWriter w = context.getResponseWriter();
    UINotesListViewStore uiComponent = (UINotesListViewStore) component;
    boolean rendered = component.isRendered();
    if (!rendered)
        return;

    UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
    rootEx.addEncodeResource(DojoResources.dominoDataStore);
    rootEx.setDojoParseOnLoad(true);

    String url = getDbUrl(context, uiComponent);

    w.startElement("span", null); // $NON-NLS-1$
    w.writeAttribute(DojoResourceConstants.dojoType,
            DojoResourceConstants.DominoDataStore, null);
    String id = uiComponent.getClientId(context);
    if (StringUtil.isNotEmpty(id))
        w.writeAttribute("id", id, null); // $NON-NLS-1$
    String jsId = uiComponent.getDojoWidgetJsId(context);
    if (StringUtil.isNotEmpty(jsId))
        w.writeAttribute("jsId", jsId, null); // $NON-NLS-1$

    String folderName = uiComponent.getViewName();
    if(null != folderName)
        w.writeAttribute("folderName", folderName, null); // $NON-NLS-1$
    if(StringUtil.isNotEmpty(url)){
        url=URLEncoder.encode(url,"UTF_8"); //$NON-NLS-1$
        w.writeAttribute("url", url, null); // $NON-NLS-1$
    }
    w.writeAttribute("dwa", "false", null); // $NON-NLS-1$ $NON-NLS-2$
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:35,代码来源:NotesListViewStoreRenderer.java

示例11: preRenderTree

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
  protected void preRenderTree(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
      
if(isExpandable()) {
          UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
          rootEx.setDojoTheme(true);
          ExtLibResources.addEncodeResource(rootEx, OneUIResources.oneUINavigator);
          // Specific dojo effects
          String effect = getExpandEffect();
          if(StringUtil.isNotEmpty(effect)) {
              rootEx.addEncodeResource(ExtLibResources.dojoFx);
              ExtLibResources.addEncodeResource(rootEx, ExtLibResources.dojoFx);
          }
      }

writer.startElement("div", null); // $NON-NLS-1$
      writer.writeAttribute("class", (String)getProperty(PROP_MENU_MENU),null); // $NON-NLS-1$
      writer.writeAttribute("role", "navigation",null); // $NON-NLS-1$ $NON-NLS-2$
      writer.writeAttribute("aria-label", "Menu navigation", null); // $NON-NLS-1$ // $NLS-OneUIv302MenuRenderer_NavAriaLabel_MenuNavigation-2$
      writeClientIdIfNecessary(context, writer, tree);
      writer.startElement("div", null); // $NON-NLS-1$
      writer.writeAttribute("class", (String)getProperty(PROP_MENU_BOTTOMCORNER),null); // $NON-NLS-1$
      writer.startElement("div", null); // $NON-NLS-1$
      writer.writeAttribute("class", (String)getProperty(PROP_MENU_INNER),null); // $NON-NLS-1$ $NON-NLS-2$
      writer.startElement("div", null); // $NON-NLS-1$
      writer.writeAttribute("class", (String)getProperty(PROP_MENU_HEADER), null);//$NON-NLS-1$
      writer.writeAttribute("role", "tree", null); // $NON-NLS-1$ // $NON-NLS-2$
      
  }
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:30,代码来源:OneUIv302MenuRenderer.java

示例12: addEncodeResource

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static void addEncodeResource(UIViewRootEx rootEx, Resource resource) {
	IdentityHashMap<Resource, Boolean> m = (IdentityHashMap<Resource, Boolean>) rootEx
			.getEncodeProperty("genesis.EncodeResource");
	if (m == null) {
		m = new IdentityHashMap<Resource, Boolean>();
	} else {
		if (m.containsKey(resource)) {
			return;
		}
	}
	m.put(resource, Boolean.TRUE);

	rootEx.addEncodeResource(resource);
}
 
开发者ID:OpenNTF,项目名称:xsp.extlib,代码行数:16,代码来源:Resources.java

示例13: encodeBegin

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
	UINamePicker uit = (UINamePicker) component;
	if (!uit.isRendered()) {
		return;
	}
	ResponseWriter writer = context.getResponseWriter();
	// Only if the control is not readOnyl
	if (!isReadOnly(uit)) {
		UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
		DojoLibrary djLib = DojoLibraryFactory.getDefaultLibrary();
		boolean pre17 = djLib.getVersionNumber() < 10700;
		if (pre17) {
			rootEx.addEncodeResource(context, XPTONEUIResourceProvider.XPTONEUI_NAMEPICKER_TYPEAHED_DATASTORE_161);
			rootEx.addEncodeResource(context, XPTONEUIResourceProvider.XPTONEUI_NAMEPICKER_TYPEAHED_WIDGET_161);

		} else {
			rootEx.addEncodeResource(context, XPTONEUIResourceProvider.XPTONEUI_NAMEPICKER_TYPEAHED_DATASTORE);
			rootEx.addEncodeResource(context, XPTONEUIResourceProvider.XPTONEUI_NAMEPICKER_TYPEAHED_WIDGET);
		}
		rootEx.setDojoParseOnLoad(true);
		// MVSEP und MV Check
		rootEx.addScriptOnce(buildScript(uit.buildJSFunctionName(), uit.getClientId(context), !StringUtil.isEmpty(uit.getMultipleSeparator()), uit.getMultipleSeparator()));
		writeInputField(context, writer, uit, pre17);
	}
	super.encodeBegin(context, component);
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:28,代码来源:NamePickerRenderer.java

示例14: encodeBegin

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
	if (component instanceof UIAgentList) {
		UIAgentList agl = (UIAgentList) component;
		if (!agl.isRendered()) {
			return;
		}
		String strClientID = agl.getClientId(context);

		String url = agl.getUrl(context);
		url = url.replace("\\", "/");
		UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
		rootEx.addEncodeResource(context, XPTAgentResourceProvider.XPTAGENTS_AGENTLIST_CONTROLLER);
		rootEx.addEncodeResource(context, XPTAgentResourceProvider.XPTAGENTS_AGENTLIST_CSS);
		rootEx.setDojoParseOnLoad(true);

		StringBuilder b = new StringBuilder(256);
		b.append("agCont = new xptagents.login.controller({\n"); // $NON-NLS-1$
		b.append(" serviceurl: \"");
		b.append(url);
		b.append("\",\n"); // $NON-NLS-1$
		b.append(" targetid: \"");
		b.append(strClientID + "_run");
		b.append("\",\n"); // $NON-NLS-1$
		b.append(" refreshid: \"");
		b.append(strClientID);
		b.append("\"});\n"); // $NON-NLS-1$

		UIScriptCollector sc = UIScriptCollector.find();
		sc.addScriptOnLoad(b.toString());

		ResponseWriter rw = context.getResponseWriter();
		writeMainElement(context, rw, agl, strClientID);
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:36,代码来源:AgentListRenderer.java

示例15: addEncodeResources

import com.ibm.xsp.component.UIViewRootEx; //导入方法依赖的package包/类
protected void addEncodeResources(FacesContext context, UITagCloud tagCloud, UIViewRootEx viewEx) throws IOException {
    viewEx.addEncodeResource(context, ExtLibResources.extlibCloudCSS);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:4,代码来源:AbstractTagCloudRenderer.java


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