📄 preferencesproxy.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 + -