本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
}
示例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);
}
示例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$
}
示例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$
}
示例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$
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}