本文整理汇总了Java中com.ibm.xsp.component.UIViewRootEx类的典型用法代码示例。如果您正苦于以下问题:Java UIViewRootEx类的具体用法?Java UIViewRootEx怎么用?Java UIViewRootEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIViewRootEx类属于com.ibm.xsp.component包,在下文中一共展示了UIViewRootEx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: encodeBegin
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
ResponseWriter w = context.getResponseWriter();
AbstractPicker picker = (AbstractPicker)component;
IPickerData data = picker.getDataProvider();
String dojoType = picker.getDojoType();
if(StringUtil.isEmpty(dojoType)) {
dojoType = getDefaultDojoType(); //"extlib.dijit.ValuePickerList";
}
dojoType = encodeDojoType(dojoType);
// Encode the necessary resources
UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
rootEx.setDojoTheme(true);
rootEx.setDojoParseOnLoad(true);
ExtLibResources.addEncodeResource(rootEx, ExtLibResources.extlibPicker);
encodeExtraResources(context, picker, data, rootEx, dojoType);
writeLink(context, w, picker, data, dojoType);
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:AbstractPickerRenderer.java
示例4: writeDefaultDojoModule
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
protected void writeDefaultDojoModule(FacesContext context, UIViewRootEx viewEx, FacesDojoComponent dojoComponent, String dojoType) {
// Add the default modules
DojoModuleResource module = getDefaultDojoModule(context, dojoComponent);
if(module!=null) {
ExtLibResources.addEncodeResource(viewEx, module);
}
if (module != null &&
module.getName().equals(ExtLibResources.dojoxGridDataGrid.getName())) {
// 1.6.1 loads dojox.grid.DataGrid, which loads dojox.html.metrics, which adds one extra IFrame
ExtLibResources.addEncodeResource(viewEx, ExtLibResources.dojoIFrameAdjuster);
}
// Add the extra resources
Resource[] res = getExtraResources(context, dojoComponent);
if(res!=null) {
for(int i=0; i<res.length; i++) {
ExtLibResources.addEncodeResource(viewEx, res[i]);
}
}
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:DojoWidgetBaseRenderer.java
示例5: findDefaultStateKey
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
/**
* Compose the unique key for an iterator.
* @param context
* @param iterator
* @return
*/
protected String findDefaultStateKey(FacesContext context, UIComponent c) {
if(c instanceof FacesDataIteratorStateHandler) {
c = (UIComponent)((FacesDataIteratorStateHandler)c).getFacesDataIterator(context);
}
if(c!=null) {
UIViewRootEx root = (UIViewRootEx)context.getViewRoot();
StringBuilder b = new StringBuilder();
b.append(root.getPageName());
String id = c.getId();
if(StringUtil.isNotEmpty(id)) {
b.append('_');
b.append(id);
}
if(TRACE) {
System.out.println("View key: "+b.toString()); //$NON-NLS-1$
}
return b.toString();
}
return null;
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:ViewStateBean.java
示例6: getAjaxUrl
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
public String getAjaxUrl(FacesContext context) {
UIViewRootEx root = (UIViewRootEx)context.getViewRoot();
// Compute a partial refresh URL...
StringBuilder b = new StringBuilder();
String actionURL = context.getApplication().getViewHandler().getActionURL(context, root.getViewId());
b.append(actionURL);
b.append("?$$ajaxid="); // $NON-NLS-1$
b.append(getClientId(context));
b.append("&$$ajaxinner=content"); // $NON-NLS-1$
String uniqueId = root.getUniqueViewId();
if(StringUtil.isNotEmpty(uniqueId)) {
b.append("&$$viewid="); // $NON-NLS-1$
b.append(uniqueId);
}
return b.toString();
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:21,代码来源:UIDojoContentPane.java
示例7: parseNameFormat
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
private NameFormat parseNameFormat(String nameFormatStr){
if( null != nameFormatStr && nameFormatStr.length() > 0 ){
// from returnNameFormat="common" to COMMON (only 4 possible values, don't care about locale)
String upper = nameFormatStr.toUpperCase(Locale.US);
try{
NameFormat specified = NameFormat.valueOf(upper);
return specified;
}catch(IllegalArgumentException ex){
// unknown string in XPage source default to unformatted,
// not usually log (traceDebug is disabled by default).
if( ExtlibDominoLogger.DOMINO.isTraceDebugEnabled() ){
String debugMsg = "Unknown property value for valueNameFormat=\"{0}\" on the tag xe:dominoNABNamePicker in the XPage {1}."; //$NON-NLS-1$
String pageName = "<unknown>"; //$NON-NLS-1$
FacesContextEx context = FacesContextEx.getCurrentInstance();
UIViewRootEx viewRoot = (null == context)? null : (UIViewRootEx)context.getViewRoot();
String viewPageName = (null == viewRoot)? null : viewRoot.getPageName();
if( null != viewPageName){
pageName = viewPageName;
}
debugMsg = StringUtil.format(debugMsg, nameFormatStr, pageName);
ExtlibDominoLogger.DOMINO.traceDebugp(this, "parseNameFormat", ex, debugMsg); //$NON-NLS-1$
}
}
}
return NameFormat.UNFORMATTED;
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:DominoNABNamePickerData.java
示例8: 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
示例9: addPendingScript
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
/**
* This is left for compatibility, but should be avoided. Prefer
* - addScript() when you want to render a script during render time, and when the control
* is actually rendered
* - postScript() to post a script at anytime (any JSF phase), and regardless of what control
* is being rendered.
* @deprecated
*/
public static void addPendingScript(FacesContext context, String script) {
// Note that this should change with the new feature in 853 for contributing script!
if(AjaxUtil.isAjaxPartialRefresh(context)) {
boolean isRendering = AjaxUtil.isRendering(context);
AjaxUtil.setRendering(context, true);
try {
ScriptResource r = new ScriptResource();
r.setClientSide(true);
r.setContents(script);
((UIViewRootEx)context.getViewRoot()).addEncodeResource(r);
return;
} finally {
AjaxUtil.setRendering(context, isRendering);
}
}
UIScriptCollector sc = UIScriptCollector.find();
sc.addScript(script);
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:ExtLibUtil.java
示例10: 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
示例11: 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
示例12: encodeResourcesList
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
@Override
protected void encodeResourcesList(final FacesContext facesContext, final UIViewRootEx viewRoot, final ResponseWriter writer, final List<Resource> resources) throws IOException {
if(resources != null && !resources.isEmpty()) {
for(Resource resource : resources) {
if(!isPageJSResource(resource)) {
encodeResource(facesContext, viewRoot, writer, resource);
}
}
}
}
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:11,代码来源:AceViewRootRenderer.java
示例13: encodeEndPage
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
@Override
protected void encodeEndPage(final FacesContext facesContext, final ResponseWriter writer, final UIViewRootEx viewRoot) throws IOException {
List<Resource> resources = buildResourceList(facesContext, viewRoot, true, true, true, true);
for(Resource resource : resources) {
if(isPageJSResource(resource)) {
encodeResource(facesContext, viewRoot, writer, resource);
}
}
super.encodeEndPage(facesContext, writer, viewRoot);
}
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:12,代码来源:AceViewRootRenderer.java
示例14: addEncodeResources
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
public static void addEncodeResources(UIViewRootEx rootEx, Resource[] resources) {
if (resources != null) {
for (Resource resource : resources) {
addEncodeResource(rootEx, resource);
}
}
}
开发者ID:OpenNTF,项目名称:BuildAndTestPattern4Xpages,代码行数:8,代码来源:Resources.java
示例15: 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
示例16: preRenderTree
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
@Override
protected void preRenderTree(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
AbstractOutline outline = (AbstractOutline)tree.getComponent();
UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
rootEx.setDojoTheme(true);
rootEx.setDojoParseOnLoad(true);
writer.startElement("div", null); // $NON-NLS-1$
String id = getClientId();
if(StringUtil.isNotEmpty(id)) {
writer.writeAttribute("id",id,null); // $NON-NLS-1$
}
String dojoType = outline.getDojoType();
if(StringUtil.isEmpty(dojoType)) {
dojoType = "dijit.layout.AccordionContainer"; // $NON-NLS-1$
ExtLibResources.addEncodeResource(rootEx, ExtLibResources.dijitLayoutAccordion);
}
String style = outline.getStyle();
if(StringUtil.isNotEmpty(style)) {
writer.writeAttribute("style",style,null); // $NON-NLS-1$
}
String styleClass = outline.getStyleClass();
if(StringUtil.isNotEmpty(styleClass)) {
writer.writeAttribute("class",styleClass,null); // $NON-NLS-1$
}
Map<String,String> attrs = DojoRendererUtil.createMap(context);
DojoRendererUtil.getDojoAttributeMap(outline,attrs);
initDojoAttributes(context, outline, attrs);
DojoUtil.addDojoHtmlAttributes(context,dojoType,null,attrs);
writer.write('\n');
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:37,代码来源:DojoAccordionRenderer.java
示例17: preRenderTree
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
@Override
protected void preRenderTree(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
rootEx.setDojoTheme(true);
rootEx.setDojoParseOnLoad(true);
writer.startElement("div", null); // $NON-NLS-1$
String id = getClientId();
if(StringUtil.isNotEmpty(id)) {
writer.writeAttribute("id",id,null); // $NON-NLS-1$
}
String dojoType = component!=null ? (String)component.getAttributes().get("dojoType") : null; // $NON-NLS-1$
if(StringUtil.isEmpty(dojoType)) {
dojoType = "dijit.Toolbar"; // $NON-NLS-1$
ExtLibResources.addEncodeResource(rootEx, ExtLibResources.dijitToolbar);
}
ExtLibResources.addEncodeResource(rootEx, ExtLibResources.dijitFormButton);
String style = component!=null ? (String)component.getAttributes().get("style") : null; // $NON-NLS-1$
if(StringUtil.isNotEmpty(style)) {
writer.writeAttribute("style",style,null); // $NON-NLS-1$
}
String styleClass = component!=null ? (String)component.getAttributes().get("styleClass") : null; // $NON-NLS-1$
if(StringUtil.isNotEmpty(styleClass)) {
writer.writeAttribute("class",styleClass,null); // $NON-NLS-1$
}
Map<String,String> attrs = null;
if(component instanceof FacesDojoComponent) {
attrs = DojoRendererUtil.createMap(context);
DojoRendererUtil.getDojoAttributeMap((FacesDojoComponent)component,attrs);
initDojoAttributes(context, (FacesDojoComponent)component, attrs);
}
DojoUtil.addDojoHtmlAttributes(context,dojoType,null,attrs);
JSUtil.writeln(writer);
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:39,代码来源:DojoToolbarRenderer.java
示例18: preRenderTree
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
@Override
protected void preRenderTree(FacesContext context, ResponseWriter writer, TreeContextImpl tree) throws IOException {
UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
rootEx.setDojoTheme(true);
rootEx.setDojoParseOnLoad(true);
ExtLibResources.addEncodeResource(rootEx, ExtLibResources.dijitTree);
writer.startElement("div", null); // $NON-NLS-1$
if(StringUtil.isNotEmpty(treeClientId)) {
writer.writeAttribute("id",treeClientId,null); // $NON-NLS-1$
}
writer.writeAttribute("dojoType", "dijit.Tree",null); // $NON-NLS-1$ $NON-NLS-2$
JSUtil.writeln(writer);
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:15,代码来源:DojoTreeRenderer.java
示例19: placeHolderEncodeBegin
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
public void placeHolderEncodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
ResponseWriter w = context.getResponseWriter();
UIDialog dialog = (UIDialog)component;
// Add the dojo module
UIViewRootEx rootEx = (UIViewRootEx)context.getViewRoot();
ExtLibResources.addEncodeResource(rootEx, getDefaultDojoModule(context,dialog));
rootEx.setDojoParseOnLoad(true);
rootEx.setDojoTheme(true);
String clientId = component.getClientId(context);
w.startElement("span", component); // $NON-NLS-1$
Map<String,String> attrs = DojoRendererUtil.createMap(context);
String dojoType = getPlaceHolderWrapperType(); // $NON-NLS-1$
attrs.put("dialogId", clientId); // $NON-NLS-1$ $NON-NLS-2$
DojoRendererUtil.writeDojoHtmlAttributes(context, component, dojoType, attrs);
String style = ExtLibUtil.concatStyles("display:none", dialog.getStyle()); // $NON-NLS-1$
if(StringUtil.isNotEmpty(style)) {
w.writeAttribute("style", style, null); // $NON-NLS-1$
}
String styleClass = dialog.getStyleClass();
if(StringUtil.isNotEmpty(styleClass)) {
w.writeAttribute("class", styleClass, null); // $NON-NLS-1$
}
w.startElement("span", component); // $NON-NLS-1$
w.writeAttribute("id", clientId, "id"); // $NON-NLS-1$ $NON-NLS-2$
w.endElement("span"); // $NON-NLS-1$
w.endElement("span"); // $NON-NLS-1$
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:39,代码来源:DialogRenderer.java
示例20: encodeBeginOriginal
import com.ibm.xsp.component.UIViewRootEx; //导入依赖的package包/类
public void encodeBeginOriginal(FacesContext context, UIComponent component)
throws IOException {
ResponseWriter w = context.getResponseWriter();
UIDialog dialog = (UIDialog)component;
String clientId = dialog.getClientId(context);
// Add the dojo module
UIViewRootEx rootEx = (UIViewRootEx)context.getViewRoot();
ExtLibResources.addEncodeResource(rootEx, getDefaultDojoModule(context,dialog));
rootEx.setDojoParseOnLoad(true);
rootEx.setDojoTheme(true);
// Main dialog div
w.startElement("span", component); // $NON-NLS-1$
w.writeAttribute("id", clientId, "id"); // $NON-NLS-1$ $NON-NLS-2$
// The dialog should be hidden by default
// Else, the tooltip dialog will be popep-up twice, thus sending the
// onShow events twice...
w.writeAttribute("style", ExtLibUtil.concatStyles("display: none",dialog.getStyle()), "style"); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
// Compose the list of attributes from the list of dojo attributes
// Note that we ignore the dojoType as we don't want the tag to be parsed.
// -> we only write the attributes
Map<String,String> attrs = DojoRendererUtil.createMap(context);
DojoRendererUtil.getDojoAttributeMap(dialog,attrs);
initDojoAttributes(context, dialog, attrs);
DojoUtil.writeDojoHtmlAttributesMap(context,attrs);
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:32,代码来源:DialogRenderer.java
注:本文中的com.ibm.xsp.component.UIViewRootEx类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论