本文整理汇总了Java中com.ibm.xsp.designer.context.XSPContext类的典型用法代码示例。如果您正苦于以下问题:Java XSPContext类的具体用法?Java XSPContext怎么用?Java XSPContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSPContext类属于com.ibm.xsp.designer.context包,在下文中一共展示了XSPContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toolbarClick
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
/**
* Will be triggered by an outline onItemClick event. Can be used for toolbars, dropdown menus, etc.
*/
public void toolbarClick() {
XSPContext context=XSPContext.getXSPContext(FacesContext.getCurrentInstance());
String selection=context.getSubmittedValue();
if("selectAll".equals(selection)) {
selectAll();
} else if("deselectAll".equals(selection)) {
deselectAll();
} else if("removeSelected".equals(selection)) {
removeSelected();
} else if("toggleLcv".equals(selection)) {
toggleLcv();
} else if("sortByLcv".equals(selection)) {
sortByLcv();
} else if("sortByName".equals(selection)) {
sortByName();
}
}
示例2: getMyGroupsAndRoles
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<String> getMyGroupsAndRoles() {
List<String> lstRC = new ArrayList<String>();
try {
XSPContext xsp = ExtLibUtil.getXspContext();
DirectoryUser dirUser = xsp.getUser();
Name nonUser = ExtLibUtil.getCurrentSession().createName(ExtLibUtil.getCurrentSession().getEffectiveUserName());
lstRC.add(nonUser.getCanonical());
lstRC.add(nonUser.getAbbreviated());
lstRC.add(nonUser.getCommon());
lstRC.addAll(dirUser.getGroups());
lstRC.addAll(dirUser.getRoles());
} catch (Exception e) {
e.printStackTrace();
}
return lstRC;
}
示例3: initViewDefinition
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
@Override
protected void initViewDefinition(FacesContext context, AbstractDataView _dataView, ViewDefinition viewDef) {
UIForumView dataView = (UIForumView)_dataView;
super.initViewDefinition(context, dataView, viewDef);
// Define if the items must be rendered in a table,
// Use a table for IE as CSS float is largely buggy - Hope IE9 fixes this...
viewDef.viewforumRenderAsTable = XSPContext.getXSPContext(context).getUserAgent().isIE(0,8);
// It is only one or the other, never both...
viewDef.summaryOrDetailVisible = true;
// Just to be sure...
viewDef.collapsibleRows = false;
}
示例4: isRowRefresh
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
public boolean isRowRefresh(FacesContext context) {
if (ENABLE_PARTIAL_REFRESH_ROW) {
// This mode is only supported if a partial tree is rendered
if (((FacesContextEx) context).isAjaxWholeTreeRendered()) {
return false;
}
// There is an issue with IE refreshing a single row
if (/* ExtLibCompUtil.isXPages852() && */XSPContext
.getXSPContext(context).getUserAgent().isIE(0, 8)) {
return false;
}
return true;
}
return false;
}
示例5: isLoggedIn
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
protected boolean isLoggedIn() {
XSPContext ctx = XSPContext.getXSPContext(FacesContext.getCurrentInstance());
if(ctx!=null) {
com.ibm.designer.runtime.directory.DirectoryUser user = ctx.getUser();
return !user.isAnonymous();
}
return false;
}
示例6: renderService
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
@Override
public void renderService() throws ServiceException {
// SPR# LHEY8YSE4F - calendar data does not refresh on IE due to browser caching problem
// We override the renderService just to set the Expires header to -1 for IE only ...
// and only for this specific service! If others report same issue then promote fix accordingly.
super.renderService();
if (XSPContext.getXSPContext(FacesContext.getCurrentInstance()).getUserAgent().isIE()) {
getHttpResponse().setHeader("Expires", "-1"); // $NON-NLS-1$ $NON-NLS-2$
}
}
示例7: getXspProperty
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
/**
* Returns a XSP property value
*/
public static String getXspProperty(String name) {
XSPContext context = getXspContext();
if(context!=null)
return context.getProperty(name);
else
return null;
}
示例8: getStringProperty
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
public static String getStringProperty(XSPContext ctx, String propName, String defaultValue) {
String v = ctx.getProperty(propName);
if(v==null) {
return defaultValue;
}
return v;
}
示例9: getIntProperty
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
public static int getIntProperty(XSPContext ctx, String propName, int defaultValue) {
String v = ctx.getProperty(propName);
if(v==null) {
return defaultValue;
}
return Integer.valueOf(v);
}
示例10: getBooleanProperty
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
public static boolean getBooleanProperty(XSPContext ctx, String propName, boolean defaultValue) {
String v = ctx.getProperty(propName);
if(v==null) {
return defaultValue;
}
return Boolean.valueOf(v);
}
示例11: getUrl
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
public static XSPUrl getUrl() {
try {
return XSPContext.getXSPContext(getContext()).getUrl();
} catch (Exception e) {
return null;
}
}
示例12: getTranslationBundle
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
private ResourceBundle getTranslationBundle() throws IOException {
if(bundle_ == null) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ApplicationEx app = (ApplicationEx)facesContext.getApplication();
bundle_ = app.getResourceBundle("translation", XSPContext.getXSPContext(facesContext).getLocale());
}
return bundle_;
}
示例13: interpolate
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
@Override
public String interpolate(final String message, final MessageInterpolator.Context context) {
Locale locale;
if(FrameworkUtils.isFaces()) {
locale = XSPContext.getXSPContext(FacesContext.getCurrentInstance()).getLocale();
} else {
locale = Locale.getDefault();
}
return interpolate(message, context, locale);
}
示例14: getTranslationBundle
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
@Override
public ResourceBundle getTranslationBundle() {
FacesContext facesContext = FacesContext.getCurrentInstance();
ApplicationEx app = (ApplicationEx)facesContext.getApplication();
try {
return app.getResourceBundle("model_translation", XSPContext.getXSPContext(facesContext).getLocale());
} catch(IOException ioe) {
return null;
}
}
示例15: getStorageDatabase
import com.ibm.xsp.designer.context.XSPContext; //导入依赖的package包/类
private Database getStorageDatabase() {
XSPContext context = ExtLibUtil.getXspContext();
String databaseName = context.getProperty("frostillicus.dominostatemanager.database");
Session session = (Session)JSFUtil.getSession();
return session.getDatabase(databaseName);
}