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

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

本文整理了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

  1. /**
  2. * Call this method when the current (ajax) request shouldn't merge the changes that are
  3. * happening to the page with the previous version.
  4. *
  5. * This is for example needed when you want to redirect to this page in an ajax request and then
  6. * you do want to version normally..
  7. *
  8. * This method doesn't do anything if the getRequest().mergeVersion doesn't return true.
  9. */
  10. public final void ignoreVersionMerge()
  11. {
  12. if (getRequest().mergeVersion())
  13. {
  14. mayTrackChangesFor(this, null);
  15. if (versionManager != null)
  16. {
  17. versionManager.ignoreVersionMerge();
  18. }
  19. }
  20. }

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

  1. /**
  2. * Call this method when the current (ajax) request shouldn't merge the changes that are
  3. * happening to the page with the previous version.
  4. *
  5. * This is for example needed when you want to redirect to this page in an ajax request and then
  6. * you do want to version normally..
  7. *
  8. * This method doesn't do anything if the getRequest().mergeVersion doesn't return true.
  9. */
  10. public final void ignoreVersionMerge()
  11. {
  12. if (getRequest().mergeVersion())
  13. {
  14. mayTrackChangesFor(this, null);
  15. if (versionManager != null)
  16. {
  17. versionManager.ignoreVersionMerge();
  18. }
  19. }
  20. }

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

  1. /**
  2. * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR OVERRIDE.
  3. *
  4. */
  5. private final void endVersion()
  6. {
  7. // Any changes to the page after this point will be tracked by the
  8. // page's version manager. Since trackChanges is never set to false,
  9. // this effectively means that change tracking begins after the
  10. // first request to a page completes.
  11. setFlag(FLAG_TRACK_CHANGES, true);
  12. // If a new version was created
  13. if (getFlag(FLAG_NEW_VERSION))
  14. {
  15. // Reset boolean for next request
  16. setFlag(FLAG_NEW_VERSION, false);
  17. // We're done with this version
  18. if (versionManager != null)
  19. {
  20. versionManager.endVersion(getRequest().mergeVersion());
  21. }
  22. // Evict any page version(s) as need be
  23. getApplication().getSessionSettings().getPageMapEvictionStrategy().evict(getPageMap());
  24. }
  25. }

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

  1. /**
  2. * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR OVERRIDE.
  3. *
  4. */
  5. private final void endVersion()
  6. {
  7. // Any changes to the page after this point will be tracked by the
  8. // page's version manager. Since trackChanges is never set to false,
  9. // this effectively means that change tracking begins after the
  10. // first request to a page completes.
  11. setFlag(FLAG_TRACK_CHANGES, true);
  12. // If a new version was created
  13. if (getFlag(FLAG_NEW_VERSION))
  14. {
  15. // Reset boolean for next request
  16. setFlag(FLAG_NEW_VERSION, false);
  17. // We're done with this version
  18. if (versionManager != null)
  19. {
  20. versionManager.endVersion(getRequest().mergeVersion());
  21. }
  22. // Evict any page version(s) as need be
  23. getApplication().getSessionSettings().getPageMapEvictionStrategy().evict(getPageMap());
  24. }
  25. }

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

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

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

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

相关文章