Hexise's Blog

          業(yè)精于勤荒于嬉 行成于思毀于隨
          posts - 13, comments - 12, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          Eclipse插件如何刷新資源管理器?

          Posted on 2006-12-29 12:19 Hexise 閱讀(1597) 評論(0)  編輯  收藏 所屬分類: Eclipse Plugin

          最近項目中出現(xiàn)了一個bug,提示是Resource can not sync with file system.是文件系統(tǒng)不同步的問題,需要手動刷新一下資源管理器.

          刷新資源管理器調用方法:

          RefreshLocal

          public void refreshLocal(int depth, IProgressMonitor monitor)
          ????????????????? throws CoreException

          Refreshes the resource hierarchy from this resource and its children (to the specified depth) relative to the local file system. Creations, deletions, and changes detected in the local file system will be reflected in the workspace's resource tree. This resource need not exist or be local.
          This method may discover changes to resources; any such changes will be reported in a subsequent resource change event.

          If a new file or directory is discovered in the local file system at or below the location of this resource, any parent folders required to contain the new resource in the workspace will also be created automatically as required.

          This method is long-running; progress and cancellation are provided by the given progress monitor.


          Parameters:
          depth - valid values are DEPTH_ZERO, DEPTH_ONE, or DEPTH_INFINITE
          monitor - a progress monitor, or null if progress reporting is not desired
          Throws:
          CoreException - if this method fails. Reasons include:
          Resource changes are disallowed during certain types of resource change event notification. See IResourceChangeEvent for more details.
          OperationCanceledException - if the operation is canceled. Cancelation can occur even if no progress monitor is provided.
          See Also:
          DEPTH_ZERO, DEPTH_ONE, DEPTH_INFINITE, IResourceRuleFactory.refreshRule(IResource)

          該方法位于org.eclipse.core.resources.IResource

          我的調用方法是:

          ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, monitor);

          主站蜘蛛池模板: 普兰县| 房山区| 鄄城县| 财经| 上饶县| 吐鲁番市| 靖远县| 永昌县| 咸宁市| 山东省| 石阡县| 乌苏市| 佛山市| 同心县| 皋兰县| 博客| 松桃| 丹凤县| 固原市| 沾益县| 曲阳县| 喀什市| 福贡县| 合山市| 宁波市| 宁夏| 藁城市| 凤冈县| 灵璧县| 宜兰县| 丘北县| 黔东| 上犹县| 饶河县| 黑水县| 烟台市| 惠东县| 疏勒县| 根河市| 如皋市| 马鞍山市|