org.apache.wicket.Request.mergeVersion()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中org.apache.wicket.Request.mergeVersion方法的一些代码示例,展示了Request.mergeVersion的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.mergeVersion方法的具体详情如下:
包路径:org.apache.wicket.Request
类名称:Request
方法名:mergeVersion

Request.mergeVersion介绍

[英]A request can say if the current request should generated a new version number. If this returns true, then all the changes on a page that has versioning enabled is merged with the latest version. Else it will just create a new version.
[中]请求可以说明当前请求是否应生成新版本号。如果返回true,则启用版本控制的页面上的所有更改都将与最新版本合并。否则它只会创建一个新版本。

代码示例

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Call this method when the current (ajax) request shouldn't merge the changes that are
 * happening to the page with the previous version.
 * 
 * This is for example needed when you want to redirect to this page in an ajax request and then
 * you do want to version normally..
 * 
 * This method doesn't do anything if the getRequest().mergeVersion doesn't return true.
 */
public final void ignoreVersionMerge()
{
  if (getRequest().mergeVersion())
  {
    mayTrackChangesFor(this, null);
    if (versionManager != null)
    {
      versionManager.ignoreVersionMerge();
    }
  }
}

代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Call this method when the current (ajax) request shouldn't merge the changes that are
 * happening to the page with the previous version.
 * 
 * This is for example needed when you want to redirect to this page in an ajax request and then
 * you do want to version normally..
 * 
 * This method doesn't do anything if the getRequest().mergeVersion doesn't return true.
 */
public final void ignoreVersionMerge()
{
  if (getRequest().mergeVersion())
  {
    mayTrackChangesFor(this, null);
    if (versionManager != null)
    {
      versionManager.ignoreVersionMerge();
    }
  }
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR OVERRIDE.
 * 
 */
private final void endVersion()
{
  // Any changes to the page after this point will be tracked by the
  // page's version manager. Since trackChanges is never set to false,
  // this effectively means that change tracking begins after the
  // first request to a page completes.
  setFlag(FLAG_TRACK_CHANGES, true);
  // If a new version was created
  if (getFlag(FLAG_NEW_VERSION))
  {
    // Reset boolean for next request
    setFlag(FLAG_NEW_VERSION, false);
    // We're done with this version
    if (versionManager != null)
    {
      versionManager.endVersion(getRequest().mergeVersion());
    }
    // Evict any page version(s) as need be
    getApplication().getSessionSettings().getPageMapEvictionStrategy().evict(getPageMap());
  }
}

代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR OVERRIDE.
 * 
 */
private final void endVersion()
{
  // Any changes to the page after this point will be tracked by the
  // page's version manager. Since trackChanges is never set to false,
  // this effectively means that change tracking begins after the
  // first request to a page completes.
  setFlag(FLAG_TRACK_CHANGES, true);
  // If a new version was created
  if (getFlag(FLAG_NEW_VERSION))
  {
    // Reset boolean for next request
    setFlag(FLAG_NEW_VERSION, false);
    // We're done with this version
    if (versionManager != null)
    {
      versionManager.endVersion(getRequest().mergeVersion());
    }
    // Evict any page version(s) as need be
    getApplication().getSessionSettings().getPageMapEvictionStrategy().evict(getPageMap());
  }
}

代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket

versionManager.beginVersion(getRequest().mergeVersion());
setFlag(FLAG_NEW_VERSION, true);

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

versionManager.beginVersion(getRequest().mergeVersion());
setFlag(FLAG_NEW_VERSION, true);

相关文章