背景:有時,底層的資源會改變,使得啓動配置無效,不應該是可運行
爲什麼你想從歷史中刪除「無效」啓動配置,但離開它否則完好無損?如果無效,請將其全部刪除或修復它。但這只是我的兩分錢,卻不知道應用程序的細節。
如果您願意承擔風險並使用內部API,則您應該能夠通過DebugUIPlugin.getDefault().getLaunchConfigurationManager()lgetLaunchHistory()
獲取LaunchHistory
。
但是,您是否嘗試刪除並重新添加無效的啓動配置,只是將其從歷史記錄中刪除?
ILaunchConfigurationWorkingCopy workingCopy = launchConfig.getWorkingCopy();
workingCopy.delete();
ILaunchConfigurationType launchType = launchConfig.getType();
IContainer container = launchConfig.getFile() == null ? null : launchConfig.getFile().getParent();
ILaunchConfigurationWorkingCopy newLaunchConfig = launchType.newInstance(container, workingCopy.getName());
// copy all attributes from 'launchConfig' to 'newLaunchConfig'
newLaunchConfig.doSave();
你想完全刪除啓動配置(即刪除它),或只是從發佈歷史中刪除它? – 2014-11-04 12:41:02
只是從發佈歷史中刪除 – 2014-11-04 12:50:35