当前位置: 首页>>代码示例>>Java>>正文


Java ExtLibUtil.getComponentFor方法代码示例

本文整理汇总了Java中com.ibm.xsp.extlib.util.ExtLibUtil.getComponentFor方法的典型用法代码示例。如果您正苦于以下问题:Java ExtLibUtil.getComponentFor方法的具体用法?Java ExtLibUtil.getComponentFor怎么用?Java ExtLibUtil.getComponentFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.xsp.extlib.util.ExtLibUtil的用法示例。


在下文中一共展示了ExtLibUtil.getComponentFor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterCreateColumn

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
@Override
public void afterCreateColumn(final FacesContext context, final int index, final ColumnDef colDef, final IControl column) {
	UIDynamicViewPanel panel = (UIDynamicViewPanel)ExtLibUtil.getComponentFor(context.getViewRoot(), panelId);

	// Patch in a converter to handle special text and icon columns
	UIDynamicViewPanel.DynamicColumn col = (UIDynamicViewPanel.DynamicColumn)column.getComponent();
	if(colDef.isIcon()) {
		// For icons, override the default behavior so it can handle
		// string-based ones
		col.setValueBinding("iconSrc", null);
		col.setDisplayAs("");
		col.setConverter(new IconColumnConverter(null, colDef, panel));
	} else {
		col.setConverter(new ExtendedViewColumnConverter(null, colDef, panel));
	}

	// Apply a general style class to indicate that it's not just some
	// normal view panel column
	// Many style attributes will be class-based both for flexibility and
	// because headers can't have style applied directly
	String styleClass = " notesViewColumn";
	String headerStyleClass = "";

	// Add an extra class for category columns
	if(colDef.isCategorized()) {
		styleClass += " notesViewCategory";
	}

	// We'll handle escaping the HTML manually, to support
	// [<b>Notes-style</b>] pass-through-HTML and icon columns
	col.setContentType("html");

	// Deal with any twistie images and color columns
	if(colDef instanceof DynamicViewFactory.ExtendedColumnDef) {
		DynamicViewFactory.ExtendedColumnDef extColDef = (DynamicViewFactory.ExtendedColumnDef)colDef;

		if(extColDef.twistieImage.length() > 0) {
			// Assume that it's a multi-image well for now
			col.setCollapsedImage("/.ibmxspres/domino/__" + extColDef.twistieReplicaId + ".nsf/" + extColDef.twistieImage.replaceAll("\\\\", "/") + "?Open&ImgIndex=2");
			col.setExpandedImage("/.ibmxspres/domino/__" + extColDef.twistieReplicaId + ".nsf/" + extColDef.twistieImage.replaceAll("\\\\", "/") + "?Open&ImgIndex=1");
		}

		// The style applies to the contents of the column as well as the
		// column itself, which messes with icon columns
		// For now, don't apply it at all to those columns
		String style = "";
		//			if(!extColDef.extendColumn) {
		//				style = "max-width: " + (extColDef.actualWidth * extColDef.fontPointSize * 1.3) + "px; min-width: " + (extColDef.actualWidth * extColDef.fontPointSize * 1.3) + "px";
		//			} else {
		//				style = "width: 100%";
		//			}

		// Check for left or right alignment
		switch(extColDef.getAlignment()) {
			case ViewColumn.ALIGN_CENTER:
				styleClass += " notesViewAlignCenter";
				break;
			case ViewColumn.ALIGN_RIGHT:
				styleClass += " notesViewAlignRight";
				break;
		}

		// Add font information
		styleClass += this.fontStyleToStyleClass(extColDef.fontStyle);
		headerStyleClass += this.fontStyleToStyleClass(extColDef.headerFontStyle);
		style += "; color: " + this.notesColorToCSS(extColDef.fontColor);

		if(extColDef.colorColumn.length() > 0) {
			String styleFormula = "#{javascript:'" + style.replace("'", "\\'") + ";' + " + this.getClass().getName() + ".colorColumnToStyle(" + panel.getVar() + ".getColumnValue('"
			+ extColDef.colorColumn + "'))}";
			ValueBinding styleBinding = context.getApplication().createValueBinding(styleFormula);
			col.setValueBinding("style", styleBinding);
		} else {
			col.setStyle(style);
		}

	}
	col.setStyleClass((col.getStyleClass() == null ? "" : col.getStyleClass()) + styleClass);
	col.setHeaderClass((col.getHeaderClass() == null ? "" : col.getHeaderClass()) + headerStyleClass);
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:81,代码来源:DynamicViewCustomizer.java


注:本文中的com.ibm.xsp.extlib.util.ExtLibUtil.getComponentFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。