当前位置: 首页>>代码示例>>Java>>正文


Java Page.getDefaultModelObject方法代码示例

本文整理汇总了Java中org.apache.wicket.Page.getDefaultModelObject方法的典型用法代码示例。如果您正苦于以下问题:Java Page.getDefaultModelObject方法的具体用法?Java Page.getDefaultModelObject怎么用?Java Page.getDefaultModelObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.Page的用法示例。


在下文中一共展示了Page.getDefaultModelObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tryPageFactoryCache

import org.apache.wicket.Page; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private <C extends IRequestablePage> C tryPageFactoryCache(final C newPage) {
    if (newPage instanceof Page) {
        final Page cNewPage = (Page) newPage;
        final Object modelObject = cNewPage.getDefaultModelObject();
        if (modelObject != null) {
            try {
                final Page page = PageFactory.get().getRegisteredPage(modelObject);
                if (page != null) {
                    return (C) page;
                }
            } catch (final Throwable t) {
                LOG.catching(Level.WARN,
                        new RuntimeException(
                                "Not a generated model page or no suitable constructor available, falling back to default created page.",
                                t));
                return newPage;
            }
        }
    }
    return newPage;
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:23,代码来源:ModelCacheUsingPageFactory.java

示例2: postProcessUsedPage

import org.apache.wicket.Page; //导入方法依赖的package包/类
public static <C extends IRequestablePage> C postProcessUsedPage(final Object newModelObject, final C usedPage) {
    if (usedPage instanceof Page) {
        final Page cUsedPage = (Page) usedPage;
        if (cUsedPage.getDefaultModelObject() != null && usedPage instanceof IPageFactoryHook) {
            final IPageFactoryHook hook = (IPageFactoryHook) usedPage;
            hook.onPageModelRefresh(newModelObject);
        }
    }
    return usedPage;
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:11,代码来源:ModelCacheUsingPageFactory.java

示例3: extractNewModelObject

import org.apache.wicket.Page; //导入方法依赖的package包/类
private Object extractNewModelObject(final IRequestablePage newPage) {
    if (newPage instanceof Page) {
        final Page cNewPage = (Page) newPage;
        return cNewPage.getDefaultModelObject();
    } else {
        return null;
    }
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:9,代码来源:ModelCacheUsingPageFactory.java

示例4: updatePage

import org.apache.wicket.Page; //导入方法依赖的package包/类
public void updatePage(final Page page) {
    final Object modelObject = page.getDefaultModelObject();
    if (modelObject == null) {
        return;
    }
    // clean up existing page references if they are equal to the new one
    final List<PageReferenceAndModel> pageReferences = getPageReferencesForModel(modelObject);
    synchronized (pageReferences) {
        for (final PageReferenceAndModel existingPageReference : pageReferences) {
            try {
                //see: http://mail-archives.apache.org/mod_mbox/wicket-users/201211.mbox/%[email protected].com%3E
                final PageAccessSynchronizer pageAccessSynchronizer = new PageAccessSynchronizer(
                        org.apache.wicket.util.time.Duration.ONE_SECOND);
                pageAccessSynchronizer.lockPage(existingPageReference.getPageId());
                try {
                    final Page existingPage = existingPageReference.getPage();
                    //remove if page reference is lost or if its an equal model (which might be outdated)
                    if (existingPage == null || modelObject.equals(existingPage.getDefaultModelObject())) {
                        pageReferences.remove(existingPageReference);
                    }
                } finally {
                    pageAccessSynchronizer.unlockPage(existingPageReference.getPageId());
                }
                //CHECKSTYLE:OFF
            } catch (final CouldNotLockPageException e) {
                //CHECKSTYLE:ON
                //ignore, next call might clean up the existing references
            }
        }
        pageReferences.add(new PageReferenceAndModel(page));
    }
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:33,代码来源:PageFactory.java

示例5: PageReferenceAndModel

import org.apache.wicket.Page; //导入方法依赖的package包/类
PageReferenceAndModel(final Page page) {
    this.pageReference = page.getPageReference();
    this.modelObject = page.getDefaultModelObject();
    Assertions.assertThat(modelObject).isNotNull();
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:6,代码来源:PageFactory.java


注:本文中的org.apache.wicket.Page.getDefaultModelObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。