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


Java FacesContextEx.getCurrentInstance方法代码示例

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


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

示例1: show

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public void show(Map<String,String> parameters) {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    Map<String,String> p = new HashMap<String, String>();
    if(parameters!=null) {
        p.putAll(parameters);
    }
    p.put("$$createdialog", "false"); // $NON-NLS-1$ $NON-NLS-2$
    Action pendingAction = new Action(context,this,ACTION_SHOW_DIALOG,p);
    ExtLibUtil.postScript(context, pendingAction.generateClientScript());
    // Force the content to be recreated here so the JS code can access the dialog
    // components right after it is closed
    // Note that we should then prevent the dialog from being recreated during
    // the rendering phase of the popup panel, else the values will be lost
    PopupContent popup = getPopupContent();
    popup.createContent(context);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:17,代码来源:UIDialog.java

示例2: show

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的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

示例3: parseNameFormat

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
private NameFormat parseNameFormat(String nameFormatStr){
    if( null != nameFormatStr && nameFormatStr.length() > 0 ){
        // from returnNameFormat="common" to COMMON (only 4 possible values, don't care about locale)
        String upper = nameFormatStr.toUpperCase(Locale.US);
        try{
            NameFormat specified = NameFormat.valueOf(upper);
            return specified;
        }catch(IllegalArgumentException ex){
            // unknown string in XPage source default to unformatted,
            // not usually log (traceDebug is disabled by default).
            if( ExtlibDominoLogger.DOMINO.isTraceDebugEnabled() ){
                String debugMsg = "Unknown property value for valueNameFormat=\"{0}\" on the tag xe:dominoNABNamePicker in the XPage {1}."; //$NON-NLS-1$
                String pageName = "<unknown>"; //$NON-NLS-1$
                FacesContextEx context = FacesContextEx.getCurrentInstance();
                UIViewRootEx viewRoot = (null == context)? null : (UIViewRootEx)context.getViewRoot();
                String viewPageName = (null == viewRoot)? null : viewRoot.getPageName();
                if( null != viewPageName){
                    pageName = viewPageName;
                }
                debugMsg = StringUtil.format(debugMsg, nameFormatStr, pageName);
                ExtlibDominoLogger.DOMINO.traceDebugp(this, "parseNameFormat", ex, debugMsg); //$NON-NLS-1$
            }
        }
    }
    return NameFormat.UNFORMATTED;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:DominoNABNamePickerData.java

示例4: hide

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public void hide(String refreshId, Map<String,String> refreshParams) {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    PopupContent popup = getPopupContent();
    if(popup.isContentCreated()) {
        // Remove the content
        popup.deleteContent(context);
        Action pendingAction = new Action(context,this,ACTION_HIDE_DIALOG,refreshId,refreshParams);
        ExtLibUtil.postScript(context, pendingAction.generateClientScript());
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:UIDialog.java

示例5: UIDataView

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public UIDataView() {
	// The data iterator implements the FacesInstanceClass which means that
	// an instance of the component is created at design time, to get the actual
	// class to generate. At that time, there isn't any FacesContext object so
	// a call to ThemeUtil will fail -> we have to catch the exception....
	//setRendererType("com.ibm.xsp.extlib.data.OneUIDataView");
    if( null != FacesContextEx.getCurrentInstance() ){
        setRendererType(RENDERER_TYPE);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:UIDataView.java

示例6: show

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public void show(Map<String,String> parameters) {
    FacesContextEx context = FacesContextEx.getCurrentInstance();

    // Push the parameters to the request scope
    if(parameters!=null) { // TODO why? the requestScope already contains the params
        Map<String, Object> req = TypedUtil.getRequestMap(context.getExternalContext());
        for (Map.Entry<String, String> e : parameters.entrySet()) {
            req.put(e.getKey(), e.getValue());
        }
    }
    
    // Add the content
    createContent(context);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:15,代码来源:UIInPlaceForm.java

示例7: createMoveToAction

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public void createMoveToAction ( String targetID, int direction, String transitionType, Map<String,Object> hashParams ) {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    UIMobilePageContent popup = getPopupContent();
    if(popup.isContentCreated()) {
        // Remove the content
        pendingAction = new Action(context,this,ACTION_MOVETO_PAGE,targetID,direction,transitionType,hashParams);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:9,代码来源:UIMobilePage.java

示例8: getThemeFragmentAsStream

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
@Override
public InputStream getThemeFragmentAsStream(String themeId, int scope) {
    // no fragments, only full themes.
    if(scope == StyleKitFactory.STYLEKIT_GLOBAL) {
        if( "oneui_idx_v1.3".equals(themeId)  || "oneui_idx_v1.3_base".equals(themeId)){
            FacesContextEx context = FacesContextEx.getCurrentInstance();
            if(null != context && context.isRunningContext("mobile") ){
                // "mobile" is com.ibm.xsp.extlib.request.MobileConstants.MOBILE_CONTEXT
                String path = "resources/themes/";
                return getThemeFromBundle(path + "oneui_idx_v1.3_mobile_renderers_fragment.theme"); //$NON-NLS-1$
            }
        }
    }
    return null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:16,代码来源:OneUITestThemeFactory.java

示例9: getOpenPageURL

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public String getOpenPageURL(String pageName, boolean readOnly) {
   	try {
		FacesContextEx facesContext = FacesContextEx.getCurrentInstance();
		StringBuilder buff = new StringBuilder();

		// If there is a query string, preserve it
		String qs = null;
		if (StringUtil.isNotEmpty(pageName)) {
			int qsPos = pageName.indexOf('?');
			if(qsPos>=0) {
				qs = pageName.substring(qsPos+1);
				pageName =  pageName.substring(0,qsPos);
			}
		}
		
		if (StringUtil.isEmpty(pageName)) {
			pageName = DatabaseConstants.VIRTUAL_PAGE_NAME;
		}
		if (pageName.startsWith("/")) {
			ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
			pageName = viewHandler.getActionURL(facesContext, pageName);
		}
		buff.append(pageName).append('?'); //$NON-NLS-1$
		
		boolean includeDatabaseName;
		boolean suppressDatabaseNameParam = getBooleanProperty(facesContext,
				"xsp.dominoView.url.databaseName.suppress", //$NON-NLS-1$
				/*default*/false);
		if( suppressDatabaseNameParam ){
			// For SPR#MKEE9U9HF3 added an option to suppress the databaseName URL part.
			// The xsp.properties file has explicitly suppressed the databaseName in the URL.
			includeDatabaseName = false;
		}else{
			// MWD: no need to include databaseName parameter if this is Domino AND the dbName in the datasource is null
			// SPR# EGLN92PHT6 Without the databaseName the link will default to the current database anyway
			if( _wrappedObject instanceof DominoViewEntry 
					&& null == ((DominoViewEntry)_wrappedObject).getDatabaseName() ){
				includeDatabaseName = false;
			}else{
				includeDatabaseName = true;
			}
		}
		// PHIL: we use the universal ID here so we can easily transform this to an HTTP server URL
		if (includeDatabaseName) {
			String databaseName = getDatabaseName();
			if(StringUtil.isNotEmpty(databaseName)) {
				buff.append(DatabaseConstants.DATABASE_NAME).append('=').append(databaseName).append('&'); //$NON-NLS-1$ //$NON-NLS-2$
			}
		}
        buff.append(DatabaseConstants.DOCUMENT_ID).append('=').append(getUniversalID()).append('&'); //$NON-NLS-1$ //$NON-NLS-2$
		buff.append(DatabaseConstants.ACTION).append('=').append(getTarget(readOnly)); //$NON-NLS-1$ //$NON-NLS-2$
		if(qs!=null) {
			buff.append('&');
			buff.append(qs);
		}
		//According to Phil there was a problem with this being double-encoded
		//return URLUtil.encode(buff.toString(), "UTF-8"); //$NON-NLS-1$
        return buff.toString();
   	} catch(NotesException ex) {
   		throw new FacesExceptionEx(ex);
   	}
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:63,代码来源:ViewRowDataOverride.java

示例10: AbstractResourceProvider

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public AbstractResourceProvider() {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    this.cacheScope = readPropertyCacheScope(context, getCacheScopeProperty(), getDefaultCacheScope()); // $NON-NLS-1$
    this.cacheSize = readPropertyInt(context, getCacheSizeProperty(), getDefaultCacheSize());
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:6,代码来源:AbstractResourceProvider.java

示例11: hide

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public void hide() {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    
    // And remove the content
    deleteContent(context);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:7,代码来源:UIInPlaceForm.java

示例12: createTab

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
public UIDojoTabPane createTab(Map<String,String> parameters) {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    try {
        // Look if there is already a tab with this key
        // If we have it, then make it the selected one
        if(parameters!=null) {
            String uniqueKey = parameters.get(XSPTABUNIQUEKEY_PARAM);
            if(StringUtil.isNotEmpty(uniqueKey)) {
                for(UIComponent c: TypedUtil.getChildren(this)) {
                    if(c instanceof UIDojoTabPane) {
                        UIDojoTabPane pane = (UIDojoTabPane)c;
                        if(StringUtil.equals(pane.getTabUniqueKey(), uniqueKey)) {
                        
                            if( pane.isDelayedRemoveTab() ){
                                // remove the old closed tab before creating 
                                // a new tab with the same key.
                                pane.delayedRemove();
                            }else{
                                // switch to the existing tab
                                setSelectedTab(pane.getTabUniqueKey());
                                return null;
                            }
                        }
                    }
                }
            }
        }
        
        ExtLibUtil.pushParameters(context, parameters);
        
        // Create the new tab
        DynamicUIUtil.createChildren(context,this,getId());
        if(_constructedTabPane!=null) {
            // Create a new id to the tab, to avoid any collision with its future parent
            if(StringUtil.isEmpty(_constructedTabPane.getTabUniqueKey())) {
                _constructedTabPane.setUniqueTabIndex(++tabNextIndex);
            }

            // Add the parameters from the context
            String tabTitle = ExtLibUtil.readParameter(context,XSPTABTITLE_PARAM);
            if(StringUtil.isNotEmpty(tabTitle)) {
                _constructedTabPane.setTitle(tabTitle);
            }
            
            // Finally, apply the styles
            DynamicUIUtil.applyStyleKit(context,_constructedTabPane);
            
            // And make it the selected tab
            setSelectedTab(_constructedTabPane.getTabUniqueKey());
        }
        
        return _constructedTabPane;
    } finally {
        _constructingParentContainer = null;
        _constructedTabPane = null;
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:58,代码来源:UIDojoTabContainer.java

示例13: getFacesContext

import com.ibm.xsp.context.FacesContextEx; //导入方法依赖的package包/类
@Override
public FacesContext getFacesContext() {
	return FacesContextEx.getCurrentInstance();
}
 
开发者ID:OpenNTF,项目名称:xsp.extlib,代码行数:5,代码来源:XspQuery.java


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