本文整理汇总了Java中com.ibm.xsp.util.FacesUtil.getComponentFor方法的典型用法代码示例。如果您正苦于以下问题:Java FacesUtil.getComponentFor方法的具体用法?Java FacesUtil.getComponentFor怎么用?Java FacesUtil.getComponentFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.xsp.util.FacesUtil
的用法示例。
在下文中一共展示了FacesUtil.getComponentFor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initDojoAttributes
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
@Override
protected void initDojoAttributes(FacesContext context, FacesDojoComponent dojoComponent, Map<String,String> attrs) throws IOException {
super.initDojoAttributes(context, dojoComponent, attrs);
if(dojoComponent instanceof UITooltipDialog) {
UITooltipDialog c = (UITooltipDialog)dojoComponent;
String _for = c.getFor();
if(StringUtil.isNotEmpty(_for)) {
UIComponent uc = FacesUtil.getComponentFor(c,_for);
if(uc!=null) {
DojoRendererUtil.addDojoHtmlAttributes(attrs,"for",uc.getClientId(context)); // $NON-NLS-1$
}
}
DojoRendererUtil.addDojoHtmlAttributes(attrs,"label",c.getLabel()); // $NON-NLS-1$
}
}
示例2: 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$
}
}
示例3: findDataIterator
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
protected FacesDataIterator findDataIterator() {
String id = getFor();
if(StringUtil.isNotEmpty(id)) {
UIComponent c = FacesUtil.getComponentFor(getComponent(), id);
if(c==null) {
throw new FacesExceptionEx(null,"Component {0} does not exist",id); // $NLX-DataIteratorAddRows.Component0doesnotexist-1$
}
if(!(c instanceof FacesDataIterator)) {
throw new FacesExceptionEx(null,"Component {0} is not a data iterator",id); // $NLX-DataIteratorAddRows.Component0isnotadataiterator-1$
}
return (FacesDataIterator)c;
}
for(UIComponent c=getComponent(); c!=null; c=c.getParent()) {
if(c instanceof FacesDataIterator) {
return (FacesDataIterator)c;
}
}
throw new FacesExceptionEx(null,"The simple action cannot find a data iterator"); // $NLX-DataIteratorAddRows.Thesimpleactioncannotfindadataite-1$
}
示例4: getForComponent
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
/**
* Find the edit component associated to this row.
* @return the UIInput, or null if none is found
*/
public UIInput getForComponent() {
// Find the component based on its id
String id = getFor();
if(StringUtil.isNotEmpty(id)) {
UIComponent edit = FacesUtil.getComponentFor(this, id);
if(edit==null) {
throw new FacesExceptionEx(null,"Unknown component {0} assigned to the \"for\" property of the form row",id); // $NLX-UIFormLayoutRow.Unknowncomponent0assignedtothefor-1$
}
if(!(edit instanceof UIInput)) {
return null;
//throw new FacesExceptionEx(null,"The for component {0} must be an input component",id);
}
return (UIInput)edit;
}
// Else, look for the first child that is an edit component
return findEdit(this);
}
示例5: findDataIterator
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
public FacesDataIterator findDataIterator() {
if (dataIterator != null) {
return dataIterator;
}
String dataId = (String) getAttributes().get("for"); //$NON-NLS-1$
if (dataId != null) {
UIComponent data = findComponent(dataId);
if (null == data) {
// Scenario where a pager inside a custom control is
// attached to a data iterator outside that control
data = FacesUtil.getComponentFor(this, dataId);
}
if (data instanceof FacesDataIterator) {
dataIterator = (FacesDataIterator) data;
return dataIterator;
}
return null;
}
dataIterator = findDataParent(getParent());
return dataIterator;
}
示例6: 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;
}
示例7: 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;
}
示例8: getClientId
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
/**
* Calculate the client ID of a component, giving its id.
* The the id parameter is already a client ID, then it is returned as is.
* @return the clientId, or not if the component does not exist
*/
public static String getClientId(FacesContext context, UIComponent start, String id, boolean forRefresh) {
if(StringUtil.isNotEmpty(id)) {
// If it is a client id, then return it
if(id.indexOf(NamingContainer.SEPARATOR_CHAR)>=0) {
return id;
}
// Else, find the component and return its client id
UIComponent c = FacesUtil.getComponentFor(start, id);
if(c!=null) {
// In case of partial refresh, we look for a delegated id
if(forRefresh) {
if(c instanceof FacesNestedDataTable){
return ((FacesNestedDataTable)c).getOuterTableClientId(context);
}
if(c instanceof FacesRefreshableComponent) {
return ((FacesRefreshableComponent)c).getNonChildClientId(context);
}
}
return c.getClientId(context);
}
}
return null;
}
示例9: writeFormRowHelp
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
@Override
protected void writeFormRowHelp(FacesContext context, ResponseWriter w, FormLayout c, UIFormLayoutRow row, UIInput edit) throws IOException {
String helpId = row.getHelpId();
String helpStyle = (String)getProperty(PROP_HELPROWSTYLE);
if(StringUtil.isNotEmpty(helpStyle)) {
w.writeAttribute("style", helpStyle, null); // $NON-NLS-1$
}
if(StringUtil.isNotEmpty(helpId)) {
String forClientId = null;
UIComponent forComponent = FacesUtil.getComponentFor(c, helpId);
if(forComponent == null) {
UIComponent p = (UIComponent)FacesUtil.getNamingContainer(c);
if(p!=null) {
forClientId = p.getClientId(context)+":"+helpId;
}
} else {
forClientId = forComponent.getClientId(context);
}
writeFormRowDataHelp(context, w, c, row, edit, forClientId);
} else {
UIComponent facet = row.getFacet(UIFormLayoutRow.FACET_HELP);
if(facet!=null) {
writeFormRowDataHelpFacet(context, w, c, row, edit, facet);
}
}
}
示例10: findDataProvider
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
protected IPickerData findDataProvider() {
IPickerData d = getDataProvider();
if(d!=null) {
return d;
}
String control = getFor();
if(StringUtil.isNotEmpty(control)) {
UIComponent c = FacesUtil.getComponentFor(getComponent(), control);
if(c instanceof AbstractPicker) {
return ((AbstractPicker)c).getDataProvider();
}
}
return null;
}
示例11: writeFormRowHelp
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
protected void writeFormRowHelp(FacesContext context, ResponseWriter w, FormLayout c, UIFormLayoutRow row, UIInput edit) throws IOException {
String helpId = row.getHelpId();
String helpStyle = (String)getProperty(PROP_HELPROWSTYLE);
if(StringUtil.isNotEmpty(helpStyle)) {
w.writeAttribute("style", helpStyle, null); // $NON-NLS-1$
}
String helpClass = (String)getProperty(PROP_HELPROWCLASS);
if(StringUtil.isNotEmpty(helpClass)) {
w.writeAttribute("class", helpClass, null); // $NON-NLS-1$
}
if(StringUtil.isNotEmpty(helpId)) {
String forClientId = null;
UIComponent forComponent = FacesUtil.getComponentFor(c, helpId);
if(forComponent == null) {
UIComponent p = (UIComponent)FacesUtil.getNamingContainer(c);
if(p!=null) {
forClientId = p.getClientId(context)+":"+helpId;
}
} else {
forClientId = forComponent.getClientId(context);
}
writeFormRowDataHelp(context, w, c, row, edit, forClientId);
} else {
UIComponent facet = row.getFacet(UIFormLayoutRow.FACET_HELP);
if(facet!=null) {
writeFormRowDataHelpFacet(context, w, c, row, edit, facet);
} else {
JSUtil.writeTextBlank(w); //
}
}
}
示例12: getFor
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
protected UIComponent getFor(FacesContext context, AbstractPicker picker) {
// Associated control
String control = picker.getFor();
if(StringUtil.isNotEmpty(control)) {
UIComponent c = FacesUtil.getComponentFor(picker, control);
return c;
}
return null;
}
示例13: invoke
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
@Override
public Object invoke(FacesContext context, Object[] params) throws EvaluationException, MethodNotFoundException {
FacesDataIterator dt = findDataIterator();
String linkId = null;
String id = getDisableId();
if(StringUtil.isNotEmpty(id)) {
UIComponent l = FacesUtil.getComponentFor(getComponent(), id);
if(l!=null) {
linkId = l.getClientId(context);
}
}
String disabledFormat = getDisabledFormat();
disabledFormat = computeDisabledFormat(context, disabledFormat, /*rendererDefaultFormat*/null);
return generateJavaScript(context, dt, getRowCount(), isState(), linkId, disabledFormat);
}
示例14: getNodeClientId
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
/**
* Return the client id for a JSF component or generate an exception if it doesn't exist
*/
protected String getNodeClientId(FacesContext context, String componentId) {
if(StringUtil.isNotEmpty(componentId)) {
// Look for a component in the JSF hierarchy
UIComponent c = FacesUtil.getComponentFor(getComponent(), componentId);
if(c!=null) {
return c.getClientId(context);
}
}
throw new FacesExceptionEx(StringUtil.format("Unknown component id {0} in client side simple action",componentId)); // $NLX-AbstractDojoClientAction.Unknowncomponentid0inclientsidesi-1$
}
示例15: findRestServiceStoreId
import com.ibm.xsp.util.FacesUtil; //导入方法依赖的package包/类
public static String findRestServiceStoreId(FacesContext context, UIComponent from, String storeComponentId) {
if(StringUtil.isNotEmpty(storeComponentId)) {
UIComponent sc = FacesUtil.getComponentFor(from, storeComponentId);
if(!(sc instanceof UIBaseRestService)) {
throw new FacesExceptionEx(null,"Cannot find Rest Service component {0}",storeComponentId); // $NLX-UIBaseRestService.CannotfindRestServicecomponent0-1$
}
return ((UIBaseRestService)sc).getDojoStoreId(context);
}
return null;
}