⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 preferencesproxy.java

📁 adf-faces 甲骨文的jsf组件,功能很强.开源免费.
💻 JAVA
字号:
package oracle.adfdemo.view.faces;

import java.util.Collections;

import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;

/**
 * A proxy class to ask the e-mail demo for preferences information,
 * but only when we're inside the e-mail demo!
 */
public class PreferencesProxy
{
  public Object getProxy()
  {
    // If we're in the e-mail demo, use its preferences
    FacesContext context = FacesContext.getCurrentInstance();
    if ((context.getViewRoot() != null) &&
        (context.getViewRoot().getViewId().indexOf("/email/") >= 0))
    {
      ValueBinding vb =
        context.getApplication().createValueBinding("#{email.preferences}");
      return vb.getValue(context);
    }
    // If we are showing the SkinDemo page, get the skinFamily from the 
    // sessionScope.
    else if ((context.getViewRoot() != null) &&
        (context.getViewRoot().getViewId().indexOf("SkinDemo") >= 0))
    {
      ValueBinding vb =
        context.getApplication().createValueBinding("#{sessionScope}");
      return vb.getValue(context);     
    }
    // Otherwise, go to an empty map (blank preferences)
    else
      return Collections.EMPTY_MAP;

  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -