本文整理汇总了Java中com.mendix.systemwideinterfaces.core.UserAction类的典型用法代码示例。如果您正苦于以下问题:Java UserAction类的具体用法?Java UserAction怎么用?Java UserAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserAction类属于com.mendix.systemwideinterfaces.core包,在下文中一共展示了UserAction类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: withSessionCache
import com.mendix.systemwideinterfaces.core.UserAction; //导入依赖的package包/类
public static <T> T withSessionCache(IContext c, final Function<T> worker) throws Exception {
try {
return Core.executeSync(new UserAction<T>(c) {
@Override
public T executeAction() throws Exception {
return worker.apply();
}
});
}
catch (Exception e) {
//executeSync wraps all thrown exeption 2 times in a CoreRuntimeException, unwrap it...
Throwable cause1 = e.getCause();
if (cause1 == null || cause1.getCause() == null)
throw e;
else if (cause1.getCause() instanceof Exception)
throw (Exception) cause1.getCause();
else
throw new RuntimeException(e);
}
}
示例2: addUserAction
import com.mendix.systemwideinterfaces.core.UserAction; //导入依赖的package包/类
/**
* Add the action specified by the given action name to action registry. This enables calling
* <code>Core.execute(actionName)</code> for this action.
* @param actionName the fully qualified class name of the action (e.g. com.mendix.action.MyAction).
*/
public static void addUserAction(Class<? extends UserAction<?>> userActionClass)
{
component.core().addUserAction(userActionClass);
}