本文整理汇总了Java中com.ibm.xsp.component.UIViewRootEx类的典型用法代码示例。如果您正苦于以下问题:Java UIViewRootEx类的具体用法?Java UIViewRootEx怎么用?Java UIViewRootEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIViewRootEx类属于com.ibm.xsp.component包,在下文中一共展示了UIViewRootEx类的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: 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);
}
示例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]);
}
}
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
}
示例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);
}
示例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);
}
}
}
示例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);
}