本文整理汇总了Java中com.haulmont.cuba.core.global.AppBeans.getPrototype方法的典型用法代码示例。如果您正苦于以下问题:Java AppBeans.getPrototype方法的具体用法?Java AppBeans.getPrototype怎么用?Java AppBeans.getPrototype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.core.global.AppBeans
的用法示例。
在下文中一共展示了AppBeans.getPrototype方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openUrl
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
protected void openUrl(Entity entity) {
ScreenHistoryEntity screenHistoryEntity = (ScreenHistoryEntity) entity;
Map<String, String> paramsScreen = new HashMap<>();
String url = screenHistoryEntity.getUrl();
url = url.substring(url.indexOf("\u003f") + 1);
paramsScreen.put("local", "true");
String[] params = url.split("&");
for (String param : params) {
String name = param.split("=")[0];
String value = param.split("=")[1];
paramsScreen.put(name, value);
}
List<String> actions = configuration.getConfig(WebConfig.class).getLinkHandlerActions();
LinkHandler linkHandler = AppBeans.getPrototype(LinkHandler.NAME,
App.getInstance(),
actions.isEmpty() ? "open" : actions.get(0),
paramsScreen);
if (linkHandler.canHandleLink()) {
linkHandler.handle();
}
}
示例2: addCondition
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
/**
* Opens AddCondition window. When condition is selected/created a {@code Handler#handle} method will be called
*
* @param conditionsTree conditions tree is necessary for custom condition editing. It is used for suggestion of
* other component names in 'param where' field.
*/
public void addCondition(final ConditionsTree conditionsTree) {
Map<String, Object> params = new HashMap<>();
ConditionDescriptorsTreeBuilderAPI descriptorsTreeBuilder = AppBeans.getPrototype(ConditionDescriptorsTreeBuilderAPI.NAME,
filter,
PROPERTIES_HIERARCHY_DEPTH,
hideDynamicAttributes,
hideCustomConditions,
conditionsTree);
Tree<AbstractConditionDescriptor> descriptorsTree = descriptorsTreeBuilder.build();
params.put("descriptorsTree", descriptorsTree);
WindowInfo windowInfo = windowConfig.getWindowInfo("addCondition");
AddConditionWindow window = (AddConditionWindow) windowManager.openWindow(windowInfo, WindowManager.OpenType.DIALOG, params);
window.addCloseListener(actionId -> {
if (Window.COMMIT_ACTION_ID.equals(actionId)) {
Collection<AbstractConditionDescriptor> descriptors = window.getDescriptors();
if (descriptors != null) {
for (AbstractConditionDescriptor descriptor : descriptors) {
_addCondition(descriptor, conditionsTree);
}
}
}
});
}
示例3: processExternalLink
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
@Override
public void processExternalLink(VaadinRequest request) {
WrappedSession wrappedSession = request.getWrappedSession();
String action = (String) wrappedSession.getAttribute(LAST_REQUEST_ACTION_ATTR);
if (NexbitLinkHandler.RESET_ACTION.equals(action)) {
//noinspection unchecked
Map<String, String> params =
(Map<String, String>) wrappedSession.getAttribute(LAST_REQUEST_PARAMS_ATTR);
if (params == null) {
log.warn("Unable to process the external link: lastRequestParams not found in session");
return;
}
try {
LinkHandler linkHandler = AppBeans.getPrototype(LinkHandler.NAME, app, action, params);
if (((NexbitLinkHandler)linkHandler).canHandleLink(action, params)) {
linkHandler.handle();
wrappedSession.setAttribute(LAST_REQUEST_ACTION_ATTR, null);
return;
}
} catch (Exception e) {
error(new com.vaadin.server.ErrorEvent(e));
}
}
super.processExternalLink(request);
}
示例4: navigateTo
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
/**
* Initialize new TopLevelWindow and replace current
*
* @param topLevelWindowId target top level window id
*/
public void navigateTo(String topLevelWindowId) {
WebWindowManager wm = AppBeans.getPrototype(WebWindowManager.NAME);
wm.setUi(AppUI.getCurrent());
wm.createTopLevelWindow(windowConfig.getWindowInfo(topLevelWindowId));
}
示例5: generateInsertScript
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
@Override
public String generateInsertScript(Entity entity) {
Preconditions.checkNotNullArgument(entity);
EntitySqlGenerator generator = AppBeans.getPrototype(EntitySqlGenerator.NAME, entity.getClass());
entity = reload(entity);
return generator.generateInsertScript(entity);
}
示例6: generateUpdateScript
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
@Override
public String generateUpdateScript(Entity entity) {
Preconditions.checkNotNullArgument(entity);
EntitySqlGenerator generator = AppBeans.getPrototype(EntitySqlGenerator.NAME, entity.getClass());
entity = reload(entity);
return generator.generateUpdateScript(entity);
}
示例7: createInstance
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
@Override
public UI createInstance(UICreateEvent event) {
return AppBeans.getPrototype(AppUI.NAME);
}
示例8: createConnection
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
protected Connection createConnection() {
return AppBeans.getPrototype(Connection.NAME);
}
示例9: loadMenu
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
@Override
public void loadMenu() {
MenuBuilder menuBuilder = AppBeans.getPrototype(MenuBuilder.NAME);
menuBuilder.build(this);
}
示例10: loadMenuConfig
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
@Override
public void loadMenuConfig() {
SideMenuBuilder menuBuilder = AppBeans.getPrototype(SideMenuBuilder.NAME);
menuBuilder.build(this);
}
示例11: generateSelectScript
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
@Override
public String generateSelectScript(Entity entity) {
Preconditions.checkNotNullArgument(entity);
EntitySqlGenerator generator = AppBeans.getPrototype(EntitySqlGenerator.NAME, entity.getClass());
return generator.generateSelectScript(entity);
}
示例12: create
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
/**
* Creates an action with default id. Autocommit is set to true.
* @param target component containing this action
*/
public static RemoveAction create(ListComponent target) {
return AppBeans.getPrototype("cuba_RemoveAction", target);
}
示例13: create
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
/**
* Creates an action with the given id.
* @param target component containing this action
*/
public static RelatedAction create(String id, ListComponent target, MetaClass metaClass, MetaProperty metaProperty) {
return AppBeans.getPrototype("cuba_RelatedAction", id, target, metaClass, metaProperty);
}
示例14: create
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
/**
* Creates an action with default id.
* @param target component containing this action
* @param openType how to open the editor screen
*/
public static EditAction create(ListComponent target, OpenType openType) {
return AppBeans.getPrototype("cuba_EditAction", target, openType);
}
示例15: create
import com.haulmont.cuba.core.global.AppBeans; //导入方法依赖的package包/类
/**
* Creates an action with default id.
* @param target component containing this action
*/
public static BulkEditAction create(ListComponent target) {
return AppBeans.getPrototype("cuba_BulkEditAction", target);
}