• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ViewRowData类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.ibm.xsp.model.ViewRowData的典型用法代码示例。如果您正苦于以下问题:Java ViewRowData类的具体用法?Java ViewRowData怎么用?Java ViewRowData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ViewRowData类属于com.ibm.xsp.model包,在下文中一共展示了ViewRowData类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getColumnValue

点赞 3

import com.ibm.xsp.model.ViewRowData; //导入依赖的package包/类
protected Object getColumnValue(FacesContext context, UIDataSourceIterator c, ViewDefinition viewDef, ValueColumn vc) throws IOException {
    // Look for a computed value
    Object value = vc.getValue();
    if(value!=null) {
        return value;
    }
    
    // Look for a column name
    String colName = vc.getColumnName();
    if(StringUtil.isNotEmpty(colName)) {
        // Read from a rowData object
        Object rowData = viewDef.dataModel.getRowData();
        if(rowData instanceof ViewRowData) {
            ViewRowData vr = (ViewRowData)rowData;
            return vr.getColumnValue(colName);
        }
        // Use the JSF property resolver
        PropertyResolver pr = context.getApplication().getPropertyResolver();
        return pr.getValue(rowData, colName);
    }
    
    // Ok no value found
    return null;
}
 

开发者ID:OpenNTF,
项目名称:XPagesExtensionLibrary,
代码行数:25,
代码来源:DataSourceIteratorRenderer.java

示例2: getSummaryColumnUrl

点赞 3

import com.ibm.xsp.model.ViewRowData; //导入依赖的package包/类
protected String getSummaryColumnUrl(FacesContext context, AbstractDataView c, ViewDefinition viewDef) {
    // Try a fixed href
    String href = getColumnUrl(context, c, viewDef, viewDef.summaryColumn);
    if(StringUtil.isNotEmpty(href)) {
        return href;
    }
    // Try a URL for the row
    Object row = viewDef.dataModel.getRowData();
    if (row instanceof ViewRowData){
        ViewRowData viewRowData = (ViewRowData)row;
        String pageName = c.getPageName();
        boolean readOnly = c.isOpenDocAsReadonly();
        // SPR#PHAN9BMHN6 was always casting to ViewEntry, which gave ClassCastException
        // with 3rd party viewRowData implementations.
        if( viewRowData instanceof ViewEntry ){
            ViewRowDataOverride helper = new ViewRowDataOverride((ViewEntry)viewRowData);
            return helper.getOpenPageURL(pageName, readOnly);
        }else{ 
            return viewRowData.getOpenPageURL(pageName, readOnly);
        }
    }
    return null;
}
 

开发者ID:OpenNTF,
项目名称:XPagesExtensionLibrary,
代码行数:24,
代码来源:AbstractWebDataViewRenderer.java

示例3: getPageUrl

点赞 3

import com.ibm.xsp.model.ViewRowData; //导入依赖的package包/类
protected String getPageUrl(FacesContext context, AbstractDataView c,
        ViewDefinition viewDef) {
    String pageName = c.getPageName();
    if (StringUtil.isNotEmpty(pageName)) {
        Object row = viewDef.dataModel.getRowData();
        if (row instanceof ViewRowData) {
            ViewRowData viewRowData = (ViewRowData) row;
            boolean readOnly = c.isOpenDocAsReadonly();
            ViewRowDataOverride helper = new ViewRowDataOverride(
                    (ViewEntry) viewRowData);
            String url = helper.getOpenPageURL(pageName, readOnly);
            return url.replace("?", "&");
        }
    }
    return null;
}
 

开发者ID:OpenNTF,
项目名称:XPagesExtensionLibrary,
代码行数:17,
代码来源:MobileViewRenderer.java

示例4: getColumnInfo

点赞 2

import com.ibm.xsp.model.ViewRowData; //导入依赖的package包/类
public final ViewRowData.ColumnInfo getColumnInfo(final String key) {
	return null;
}
 

开发者ID:jesse-gallagher,
项目名称:Miscellany,
代码行数:4,
代码来源:AbstractModelObject.java

示例5: getAsString

点赞 2

import com.ibm.xsp.model.ViewRowData; //导入依赖的package包/类
@Override
public String getAsString(final FacesContext context, final UIComponent component, final Object value) {
	UIDynamicViewPanel panel = (UIDynamicViewPanel)FacesUtil.getComponentFor(context.getViewRoot(), panelId);

	// First, apply any column-color info needed
	ViewRowData entry = this.resolveViewEntry(context, panel.getVar());
	try {
		if(value instanceof DateTime) {
			return this.getValueDateTimeAsString(context, component, ((DateTime)value).toJavaDate());
		}
		if (value instanceof Date) {
			// return getValueDateTimeAsString(context, component, (Date) value);
			DateFormat fmt;
			switch (colDef.getTimeDateFmt()) {
			case ViewColumn.FMT_DATE: {
				fmt = com.ibm.commons.util.DateTime.getDefaultDateFormatter(FacesContext.getCurrentInstance().getViewRoot().getLocale());
			}
			break;
			case ViewColumn.FMT_TIME: {
				fmt = com.ibm.commons.util.DateTime.getDefaultTimeFormatter(FacesContext.getCurrentInstance().getViewRoot().getLocale());
			}
			break;
			default: {
				fmt = com.ibm.commons.util.DateTime.getDefaultDatetimeFormatter(FacesContext.getCurrentInstance().getViewRoot().getLocale());
			}
			break;
			}
			return fmt.format(value);
		}
		if(value instanceof Number) {
			return this.getValueNumberAsString(context, component, (Number)value);
		}
	} catch(NotesException ex) {}

	String stringValue = value.toString();

	if(entry instanceof ViewEntry) {
		try {
			stringValue = specialTextDecode(stringValue, (ViewEntry)entry);
		} catch(NotesException ne) {}
	}

	boolean isCategory = false;
	if(entry instanceof ViewEntry) {
		try {
			isCategory = ((ViewEntry)entry).isCategory();
		} catch(NotesException e) { }
	} else if(entry instanceof ModelObject) {
		isCategory = ((ModelObject)entry).category();
	}

	// Process the entry as Notes-style pass-through-HTML
	if(!isCategory) {
		stringValue = this.handlePassThroughHTML(stringValue);
	}

	// Add in some text for empty categories
	if(isCategory && stringValue.length() == 0) {
		stringValue = "(Not Categorized)";
	}

	// Include a   to avoid weird styling problems when the content
	// itself is empty or not visible
	return stringValue;
}
 

开发者ID:jesse-gallagher,
项目名称:XPages-Scaffolding,
代码行数:66,
代码来源:DynamicViewCustomizer.java

示例6: resolveViewEntry

点赞 2

import com.ibm.xsp.model.ViewRowData; //导入依赖的package包/类
private ViewRowData resolveViewEntry(final FacesContext context, final String var) {
	return (ViewRowData)context.getApplication().getVariableResolver().resolveVariable(context, var);
}
 

开发者ID:jesse-gallagher,
项目名称:XPages-Scaffolding,
代码行数:4,
代码来源:DynamicViewCustomizer.java

示例7: getColumnInfo

点赞 2

import com.ibm.xsp.model.ViewRowData; //导入依赖的package包/类
@Override
public final ViewRowData.ColumnInfo getColumnInfo(final String key) {
	return null;
}
 

开发者ID:jesse-gallagher,
项目名称:XPages-Scaffolding,
代码行数:5,
代码来源:AbstractModelObject.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)