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


Java TypedUtil类代码示例

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


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

示例1: getExtraFacet

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
public UIComponent getExtraFacet(AbstractDataView dataView, int index){
    // the "extra" facets are row facets [see AbstractDataView.getRowFacetNames()]
    List<UIComponent> children = TypedUtil.getChildren(dataView);
    if( children.isEmpty() ){
        // Note, children will only be empty in JUnit tests 
        // where UIDataView.buildContents is not called.
        return null;
    }
    UIComponent row = children.get(0);
    if(index==0) {
        UIComponent c = row.getFacet(UIDataView.FACET_EXTRA_N);
        if(c!=null) {
            return c;
        }
    }
    return row.getFacet(UIDataView.FACET_EXTRA_N+index);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:DataViewRenderer.java

示例2: getCategoryRowFacet

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
public UIComponent getCategoryRowFacet(AbstractDataView dataView, int index){
    // the "categoryRow" facets are row facets [see AbstractDataView.getRowFacetNames()]
    List<UIComponent> children = TypedUtil.getChildren(dataView);
    if( children.isEmpty() ){
        // Note, children will only be empty in JUnit tests 
        // where UIDataView.buildContents is not called.
        return null;
    }
    UIComponent row = children.get(0);
    if(index==0) {
        UIComponent c = row.getFacet(UIDataView.FACET_CATEGORY_N);
        if(c!=null) {
            return c;
        }
    }
    return row.getFacet(UIDataView.FACET_CATEGORY_N+index);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:DataViewRenderer.java

示例3: writeOneColumnRows

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
protected void writeOneColumnRows(FacesContext context, ResponseWriter w, FormLayout c, UIComponent parent, ComputedFormData formData) throws IOException {
    List<UIComponent> children = TypedUtil.getChildren(parent);
    for(UIComponent child: children) {
        if(!child.isRendered()) {
            continue;
        }
        if(child instanceof UIFormLayoutRow) {
            newLine(w);
            writeFormRow(context, w, c, formData, (UIFormLayoutRow)child);
        } else {
            if( !(child instanceof FormLayout) ){
                writeChildRows(context, w, c, child, formData);
            }// do not recurse through FormLayout descendants
        }
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:17,代码来源:FormTableRenderer.java

示例4: initFromState

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
protected void initFromState(FacesContext context) {
	// Look if the state should be restored
	boolean shouldRestoreState = RedirectMapUtil.get(context, RESTORE_KEY)!=null;
	
	FacesDataIteratorStateManager m = FacesDataIteratorStateManager.get(); 
	for(UIComponent c: getBeanData(context).keySet()) {
		Map<String, Object> attributes = TypedUtil.getAttributes(c);
		if(attributes.get("xsp.initviewstate")==null) { //$NON-NLS-1$
			attributes.put("xsp.initviewstate",Boolean.TRUE); //$NON-NLS-1$
		
			String key = findStateKey(context, c);
			if(StringUtil.isNotEmpty(key)) {
				m.restoreState(context, c, key, shouldRestoreState);
				if(TRACE) {
					System.out.println("View, initFromState: "+key); //$NON-NLS-1$
				}
			}
		}
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:21,代码来源:ViewStateBean.java

示例5: deleteContent

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
@Override
protected void deleteContent(FacesContextEx context) {
    if(!getDialog().isKeepComponents()) {
        // Remove the EventHandlers add to the dialog
        List<UIComponent> l = TypedUtil.getChildren(getDialog());
        for(int i=0; i<l.size(); ) {
            UIComponent c = l.get(i);
            if(c instanceof UIEventHandler) {
                l.remove(i);
            } else {
                i++;
            }
        }
        // Then delete the content of the panel
        super.deleteContent(context);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:UIDialog.java

示例6: isDialogCreateRequest

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
public boolean isDialogCreateRequest(FacesContextEx context) {
    // The current panel is the current one if the request is
    // a partial refresh, where the panel is the target component
    // The request must also include a $$showdialog=true param in the URL
    Map<String, String> params = TypedUtil.getRequestParameterMap(context.getExternalContext());
    if(StringUtil.equals(params.get("$$showdialog"),"true")) { // $NON-NLS-1$ $NON-NLS-2$
        // If the creation had been prohibited, then do not create it
        if(StringUtil.equals(params.get("$$createdialog"),"false")) { // $NON-NLS-1$ $NON-NLS-2$
            return false;
        }
        if(context.isAjaxPartialRefresh()) {
            String id = context.getPartialRefreshId();
            if(DIALOG_NEXT) {
                if(StringUtil.equals(getPopupContent(), id)) {
                    return true;
                }
            } else {
                if(StringUtil.equals(getPopupContent().getClientId(context), id)) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:UIDialog.java

示例7: buildContents

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
protected void buildContents(FacesContext context, FacesComponentBuilder builder, UIComponent parent) throws FacesException {
    if(DynamicUIUtil.isDynamicallyConstructing(context)) {
        // We should reset the dynamically constructing flag as we don't want it to be
        // propagated to its children (ex: nested dialogs...)
        UIComponent c = DynamicUIUtil.getDynamicallyConstructedComponent(context); 
        DynamicUIUtil.setDynamicallyConstructing(context, null);
        try {
            builder.buildAll(context, this, false);
            return;
        } finally {
            DynamicUIUtil.setDynamicallyConstructing(context, c);
        }
    } else {
        PopupContent content = new PopupContent();
        content.setId("_content"); // $NON-NLS-1$
        TypedUtil.getChildren(parent).add(content);
        // Set the source page name for creating the inner content
        content.setSourcePageName(DynamicUIUtil.getSourcePageName(builder));
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:21,代码来源:UIDialog.java

示例8: buildContents

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
@Override
public void buildContents(FacesContext context, FacesComponentBuilder builder) throws FacesException {
    if(!isDynamicContent()) {
        builder.buildAll(context, this, true);
        return;
    }
    if(DynamicUIUtil.isDynamicallyConstructing(context)) {
        // We should reset the dynamically constructing flag as we don't want it to be
        // propagated to its children (ex: nested tooltip...)
        UIComponent c = DynamicUIUtil.getDynamicallyConstructedComponent(context); 
        DynamicUIUtil.setDynamicallyConstructing(context, null);
        try {
            builder.buildAll(context, this, false);
            return;
        } finally {
            DynamicUIUtil.setDynamicallyConstructing(context, c);
        }
    } else {
        PopupContent content = new PopupContent();
        content.setId("_content"); // $NON-NLS-1$
        TypedUtil.getChildren(this).add(content);
        // Set the source page name for creating the inner content
        content.setSourcePageName(DynamicUIUtil.getSourcePageName(builder));
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:UITooltip.java

示例9: restoreValueHolderState

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")//$NON-NLS-1$
@Override
protected void restoreValueHolderState(FacesContext context,
        UIComponent component) {
    super.restoreValueHolderState(context, component);

    // start workaround for MKEE89RPXF
    if (ExtLibUtil.isXPages852()) {
        if (component.getFacetCount() > 0) {
            Map<String, UIComponent> facets;
            if (disableGetFacets && component == this) {
                facets = super.getFacets();
            }
            else {
                facets = TypedUtil.getFacets(component);
            }
            for (UIComponent c : facets.values()) {
                if (c != null) {
                    restoreValueHolderState(context, c);
                }
            }
        }
    }
    // end workaround for MKEE89RPXF
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:AbstractDataView.java

示例10: saveValueHolderState

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")//$NON-NLS-1$
@Override
protected void saveValueHolderState(FacesContext context,
        UIComponent component) {
    super.saveValueHolderState(context, component);

    // start workaround for MKEE89RPXF
    if (ExtLibUtil.isXPages852()) {
        if (component.getFacetCount() > 0) {
            Map<String, UIComponent> facets;
            if (disableGetFacets && component == this) {
                facets = super.getFacets();
            }
            else {
                facets = TypedUtil.getFacets(component);
            }
            for (UIComponent c : facets.values()) {
                if (c != null) {
                    saveValueHolderState(context, c);
                }
            }
        }
    }
    // end workaround for MKEE89RPXF
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:AbstractDataView.java

示例11: show

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
public void show(String facet, Map<String,String> parameters) {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    
    if( StringUtil.isEmpty(facet) ){
        // when the empty string is passed in, load -default-
        facet = PSEUDO_FACET_DEFAULT;
    }
    if ( PSEUDO_FACET_DEFAULT.equals(facet) ){
        // recompute the default facet and load that
        facet = getDefaultFacet();
        if( StringUtil.isEmpty(facet) || PSEUDO_FACET_DEFAULT.equals(facet) ){
            // when the defaultFacet is empty, load -children-
            facet = PSEUDO_FACET_CHILDREN;
        }
    }
    // facet is non-empty here
    if( !StringUtil.equals(PSEUDO_FACET_EMPTY, facet) ) {
        pushParameters(context, parameters);
        TypedUtil.getRequestMap(context.getExternalContext()).put(XSPCONTENT_PARAM,facet);
        createContent(context);
    } else {
        deleteContent(context);
        currentFacet = facet;
    }
    updateHash(facet, parameters);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:UIDynamicContent.java

示例12: _findPickerFor

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
static private AbstractPicker _findPickerFor(UIComponent parent, String id) {
    if(parent.getChildCount()>0 || parent.getFacetCount() > 0) {
        for (Iterator<UIComponent> i = TypedUtil.getFacetsAndChildren(parent); i.hasNext();) {
            UIComponent next = i.next();
            // Look if this child is the label
            if(next instanceof AbstractPicker) {
                AbstractPicker lbl = (AbstractPicker)next;
                String _for = lbl.getFor();
                if(StringUtil.equals(_for, id)) {
                    return lbl;
                }
            }
            if (!(next instanceof NamingContainer)) {
                AbstractPicker n = _findPickerFor(next, id);
                if (n != null) {
                    return n;
                }
            }
        }
    }
    return null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:UIDojoExtListTextBox.java

示例13: processAjaxRequest

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
public void processAjaxRequest(FacesContext context) throws IOException {
        // Note, the errorCode is never written to the response header
        // because this method always gives 200 OK.
        //int errorCode = 200; // OK
        StringBuilder b = new StringBuilder();
        
        // Find the command
        Map<String, String> params = TypedUtil.getRequestParameterMap(context.getExternalContext());
        
        // Create a new tab
        String command = params.get("_action"); // $NON-NLS-1$
        if(StringUtil.equals(command, "createTab")) { // $NON-NLS-1$
//            errorCode = 
            axCreateTab(context, b, params);
        }

        // Return the Javascript snippet
        // TODO: add the header...
        AjaxUtil.initRender(context);
        ResponseWriter writer = context.getResponseWriter();
        writer.write(b.toString());
    }
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:UIDojoTabContainer.java

示例14: delayedRemoveChildren

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
private void delayedRemoveChildren() {
    if( this.getChildCount() > 0 ){
        List<UIComponent> kids = TypedUtil.getChildren(this);
        // give the child an opportunity to remove itself from the children list.
        // note getChildCount will be changing.
        for (int i = 0; i < this.getChildCount(); i++) {
            UIComponent child = kids.get(i);
            if(child instanceof UIDojoTabPane){
                UIDojoTabPane pane = (UIDojoTabPane) child;
                if( pane.isDelayedRemoveTab() ){
                    pane.delayedRemove();
                    if( (i < this.getChildCount()) && pane != kids.get(i) ){
                        i--;
                    }
                }
            }// else probably xp:eventHandler
        }
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:UIDojoTabContainer.java

示例15: processAjaxRequest

import com.ibm.xsp.util.TypedUtil; //导入依赖的package包/类
public void processAjaxRequest(FacesContext context) throws IOException {
    int errorCode = 200; // OK
    StringBuilder b = new StringBuilder();
    
    // Find the command
    Map<String, String> params = TypedUtil.getRequestParameterMap(context.getExternalContext());
    
    // Create a new tab
    String command = params.get("_action"); // $NON-NLS-1$
    if(StringUtil.equals(command, "closeTab")) { // $NON-NLS-1$
        errorCode = axDeleteTab(context, b, params);
    }

    // Return the Javascript snippet
    // TODO: add the header...
    AjaxUtil.initRender(context);
    ResponseWriter writer = context.getResponseWriter();
    writer.write(b.toString());
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:UIDojoTabPane.java


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