1
如果您在Eclipse中進入Refactor - > History ...,您會看到一個對話框,其中包含工作區中所有重構的歷史記錄。如何以編程方式調用eclipse重構歷史記錄?
我想知道是否有一種方法可以創建一個插件,它簡單地記錄了重命名重構的歷史中有多少個。你會怎麼做?
如果您在Eclipse中進入Refactor - > History ...,您會看到一個對話框,其中包含工作區中所有重構的歷史記錄。如何以編程方式調用eclipse重構歷史記錄?
我想知道是否有一種方法可以創建一個插件,它簡單地記錄了重命名重構的歷史中有多少個。你會怎麼做?
IRefactoringHistoryService
接口有訪問重構歷史記錄的方法。
獲取與接口:
IRefactoringHistoryService service = RefactoringCore.getHistoryService();
然後,您可以使用得到歷史的一個項目:
IProject project = ... project you are interested in
RefactoringHistory history = service.getProjectHistory(project, progressMonitor);
有哪些讓你的工作空間的歷史,並指定啓動其他方法並結束時間戳。
歷史對象可以返回表示重構對象的數組:
RefactoringDescriptorProxy [] proxies = history.getDescriptors();
你可以從代理實際的重構描述:
RefactoringDescriptor desc = proxy.getDescription();
謝謝@格雷格-449 我嘗試過,它的工作 – myNameIsAlwaysTaken