preferencesproxy.java
来自「adf-faces 甲骨文的jsf组件,功能很强.开源免费.」· Java 代码 · 共 40 行
JAVA
40 行
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 + =
减小字号Ctrl + -
显示快捷键?