本文整理汇总了Java中com.ibm.xsp.util.FacesUtil类的典型用法代码示例。如果您正苦于以下问题:Java FacesUtil类的具体用法?Java FacesUtil怎么用?Java FacesUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FacesUtil类属于com.ibm.xsp.util包,在下文中一共展示了FacesUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeAuthorName
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
@Override
protected void writeAuthorName(final FacesContext context, final ResponseWriter w, final UIForumPost c, final UIComponent facet) throws IOException {
w.startElement("div", null); // div.name
String styleClass = (String)getProperty(PROP_AUTHORNAMECLASS);
if(StringUtil.isNotEmpty(styleClass)) {
w.writeAttribute("class", styleClass, null);
}
String style = (String)getProperty(PROP_AUTHORNAMESTYLE);
if(StringUtil.isNotEmpty(style)) {
w.writeAttribute("style", style, null);
}
FacesUtil.renderComponent(context, facet);
w.endElement("div");
}
示例2: writeAuthorMeta
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
@Override
protected void writeAuthorMeta(final FacesContext context, final ResponseWriter w, final UIForumPost c, final UIComponent facet) throws IOException {
w.startElement("div", null); // div.name
String styleClass = (String)getProperty(PROP_AUTHORMETACLASS);
if(StringUtil.isNotEmpty(styleClass)) {
w.writeAttribute("class", styleClass, null);
}
String style = (String)getProperty(PROP_AUTHORMETASTYLE);
if(StringUtil.isNotEmpty(style)) {
w.writeAttribute("style", style, null);
}
FacesUtil.renderComponent(context, facet);
w.endElement("div");
}
示例3: writeDetail
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
@Override
protected void writeDetail(final FacesContext context, final ResponseWriter w, final AbstractDataView c, final ViewDefinition viewDef) throws IOException {
if(!viewDef.hasDetail) {
return;
}
// If the detail should not be displayed, then leave
boolean detailVisible = viewDef.rowDetailVisible;
if(!detailVisible && !viewDef.detailsOnClient) {
return;
}
UIComponent detail = viewDef.detailFacet;
if(detail != null) {
FacesUtil.renderComponent(context, detail);
}
}
示例4: restoreView
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
@Override
public UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId) {
SerializedView serView = restore();
Node node = (Node) serView.getStructure();
try {
UIViewRoot root = (UIViewRoot) node.restore(ClassLoaderUtil.getContextClassLoader(StateManagerTestImpl.class));
FacesUtil.setRestoreRoot(context, root);
UIViewRoot old = context.getViewRoot();
try {
context.setViewRoot(root);
root.processRestoreState(context, serView.getState());
} finally {
context.setViewRoot(old);
}
FacesUtil.setRestoreRoot(context, null);
return root;
} catch(Exception e) {
throw new FacesExceptionEx(e);
}
}
示例5: openView
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
public Container openView(final FacesContext context) throws IOException {
MethodBinding queryOpenView = getQueryOpenView();
if (queryOpenView != null && FacesUtil.isCancelled(queryOpenView.invoke(context, null))) {
return null;
}
ModelManager<?> manager = ModelUtils.findModelManager(context, managerName_);
Object listObject = manager.getValue(key_);
if(listObject == null) {
throw new IOException("Received null value when retrieving list object from manager using key '" + key_ + "'");
}
if(!(listObject instanceof AbstractModelList)) {
throw new IOException("Retrieved non-model-list object from manager using key '" + key_ + "'");
}
Container container = new Container(getBeanId(), getUniqueId(), (AbstractModelList<?>)listObject);
MethodBinding postOpenView = getPostOpenView();
if(postOpenView != null) {
postOpenView.invoke(context, null);
}
return container;
}
示例6: initDojoAttributes
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
protected void initDojoAttributes(FacesContext context, FacesDojoComponent dojoComponent, Map<String,String> attrs) throws IOException {
if(dojoComponent instanceof UITooltip) {
UITooltip c = (UITooltip)dojoComponent;
DojoRendererUtil.addDojoHtmlAttributes(attrs,"label",c.getLabel()); // $NON-NLS-1$
if(c.getShowDelay() != 0 )
DojoRendererUtil.addDojoHtmlAttributes(attrs,"showDelay",c.getShowDelay()); // $NON-NLS-1$
String _for = c.getFor();
if(StringUtil.isNotEmpty(_for)) {
UIComponent f = FacesUtil.getComponentFor(c, _for);
if(f==null) {
throw new FacesExceptionEx(null,"Unknown 'for' component {0}", _for); // $NLX-TooltipRenderer.Unknownforcomponent0-1$
}
DojoRendererUtil.addDojoHtmlAttributes(attrs,"connectId",f.getClientId(context)); // $NON-NLS-1$
}
DojoRendererUtil.addDojoHtmlAttributes(attrs,"position",c.getPosition()); // $NON-NLS-1$
}
}
示例7: writeAuthorName
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
protected void writeAuthorName(FacesContext context, ResponseWriter w, UIForumPost c, UIComponent facet) throws IOException {
if(facet==null) {
return;
}
w.startElement("div", c); // $NON-NLS-1$
String style = (String)getProperty(PROP_AUTHORNAMESTYLE);
if(StringUtil.isNotEmpty(style)) {
w.writeAttribute("style", style, null); // $NON-NLS-1$
}
String styleClass = (String)getProperty(PROP_AUTHORNAMECLASS);
if(StringUtil.isNotEmpty(styleClass)) {
w.writeAttribute("class", styleClass, null); // $NON-NLS-1$
}
FacesUtil.renderComponent(context, facet);
w.endElement("div"); // $NON-NLS-1$
}
示例8: writeIconColumn
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
@Override
protected void writeIconColumn(FacesContext context, ResponseWriter w,
AbstractDataView c, ViewDefinition viewDef) throws IOException {
if (viewDef.iconFacet != null) {
w.startElement("div", c); // $NON-NLS-1$
if (viewDef.iconColumn != null) {
String colStyle = viewDef.iconColumn.getStyle();
if (StringUtil.isNotEmpty(colStyle)) {
w.writeAttribute("style", colStyle, null); // $NON-NLS-1$
}
String colClazz = viewDef.iconColumn.getStyleClass();
if (!viewDef.hasCheckBoxColumn) {
colClazz = ExtLibUtil.concatStyleClasses(colClazz,
(String) getProperty(PROP_TABLEFIRSTCELLCLASS));
}
if (StringUtil.isNotEmpty(colClazz)) {
w.writeAttribute("class", colClazz, null); // $NON-NLS-1$
}
}
FacesUtil.renderComponent(context, viewDef.iconFacet);
w.endElement("div"); // $NON-NLS-1$
}
}
示例9: writePostTitle
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
protected void writePostTitle(FacesContext context, ResponseWriter w, UIForumPost c, UIComponent facet) throws IOException {
if(facet==null) {
return;
}
w.startElement("div", c); // $NON-NLS-1$
String style = (String)getProperty(PROP_POSTTITLESTYLE);
if(StringUtil.isNotEmpty(style)) {
w.writeAttribute("style", style, null); // $NON-NLS-1$
}
String styleClass = (String)getProperty(PROP_POSTTITLECLASS);
if(StringUtil.isNotEmpty(styleClass)) {
w.writeAttribute("class", styleClass, null); // $NON-NLS-1$
}
FacesUtil.renderComponent(context, facet);
w.endElement("div"); // $NON-NLS-1$
}
示例10: writePostMeta
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
protected void writePostMeta(FacesContext context, ResponseWriter w, UIForumPost c, UIComponent facet) throws IOException {
if(facet==null) {
return;
}
w.startElement("div", c); // $NON-NLS-1$
String style = (String)getProperty(PROP_POSTMETASTYLE);
if(StringUtil.isNotEmpty(style)) {
w.writeAttribute("style", style, null); // $NON-NLS-1$
}
String styleClass = (String)getProperty(PROP_POSTMETACLASS);
if(StringUtil.isNotEmpty(styleClass)) {
w.writeAttribute("class", styleClass, null); // $NON-NLS-1$
}
FacesUtil.renderComponent(context, facet);
w.endElement("div"); // $NON-NLS-1$
}
示例11: writeHeader
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
@Override
protected void writeHeader(FacesContext context, ResponseWriter w, UIWidgetContainer c) throws IOException {
UIComponent header = c.getFacet(UIWidgetContainer.FACET_HEADER);
if(header!=null) {
String tag = (String)getProperty(PROP_TAGHEADER);
w.startElement(tag, c);
//TODO Possible bug in extlib WidgetContainer. PROP_CSSHEADER & PROP_CSSSCROLLUP are
//both set to the same property value (41). Overriding the writeHeader method to fix it here
//but it may need to be fixed in extlib instead
String cls = (String)getProperty(PROP_CSSHEADERCLASS);
if(StringUtil.isNotEmpty(cls)) {
w.writeAttribute("class", cls, null); // $NON-NLS-1$
}
FacesUtil.renderChildren(context, header);
w.endElement(tag);
}
}
示例12: findViewKey
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
protected String findViewKey(FacesContext context) throws NotesException {
// Find the data store and the view it points to
String storeId = getStoreComponentId();
if(StringUtil.isNotEmpty(storeId)) {
UIComponent c = FacesUtil.getComponentFor(this, storeId);
if(c instanceof UIRestService) {
IRestService svc = ((UIRestService)c).getService();
if(svc instanceof DominoViewService) {
String databaseName = ((DominoViewService)svc).getDatabaseName();
String viewName = ((DominoViewService)svc).getViewName();
return ViewDesign.getViewKey(databaseName, viewName);
}
}
}
return null;
}
示例13: writeBodyContent
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
protected void writeBodyContent(FacesContext context, ResponseWriter w, UIWidgetContainer c) throws IOException {
FacesUtil.renderChildren(context, c);
if( c.getChildCount() == 0 ){
boolean isBodyPreventBlank = (Boolean) getProperty(PROP_BODY_PREVENT_BLANK);
if( isBodyPreventBlank ){
JSUtil.writeTextBlank(w); //
}
}
}
示例14: findDojoWidgetId
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
public static String findDojoWidgetId(FacesContext context, UIComponent from, String componentId) {
if(StringUtil.isNotEmpty(componentId)) {
UIComponent sc = FacesUtil.getComponentFor(from, componentId);
if( null == sc ){
return null;
}
if(!(sc instanceof FacesExtlibJsIdWidget)) {
Object jsId = sc.getAttributes().get("jsId"); //$NON-NLS-1$
if( jsId instanceof String ){
return (String)jsId;
}
}
return ((FacesExtlibJsIdWidget)sc).getDojoWidgetJsId(context);
}
return null;
}
示例15: save
import com.ibm.xsp.util.FacesUtil; //导入依赖的package包/类
@Override
public boolean save(FacesContext context, DataContainer data) throws FacesExceptionEx {
// invoke the query save method binding
Object object = ((Container)data).getObject();
if (_saveObject != null) {
Object[] params = null;
if(_saveObject instanceof MethodBindingEx){
params = new Object[] { object };
((MethodBindingEx)_saveObject).setComponent(getComponent());
((MethodBindingEx)_saveObject).setParamNames(s_saveObjectParamNames);
}
if (FacesUtil.isCancelled(_saveObject.invoke(context, params))) {
return false;
}
return true;
}
throw new FacesExceptionEx(null,"The save method has not been implemented in the data source"); // $NLX-ObjectDataSource.Missingsavemethodtothedatasource-1$
}