Hexise's Blog

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

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

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

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

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

          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);

          主站蜘蛛池模板: 苏州市| 荆门市| 贞丰县| 阿城市| 合山市| 新巴尔虎右旗| 封开县| 罗定市| 河北省| 小金县| 云霄县| 梁平县| 江都市| 祁东县| 鹤庆县| 东城区| 镇赉县| 长治县| 南京市| 当涂县| 高密市| 泌阳县| 兰考县| 鹤峰县| 泰和县| 东至县| 奎屯市| 河北区| 应城市| 承德县| 石河子市| 石台县| 阿拉善右旗| 和硕县| 思南县| 桐城市| 永兴县| 广州市| 任丘市| 乌拉特后旗| 临洮县|