Search in sources :

Example 1 with EditorHistory

use of org.eclipse.ui.internal.EditorHistory in project translationstudio8 by heartsome.

the class CommonFunction method refreshHistoryWhenDelete.

/**
	 * 当删除一个文件时,刷新历史记录	--robert	2012-11-20
	 */
@SuppressWarnings("restriction")
public static void refreshHistoryWhenDelete(IEditorInput input) {
    IWorkbench workbench = PlatformUI.getWorkbench();
    if (workbench instanceof Workbench) {
        EditorHistory history = ((Workbench) workbench).getEditorHistory();
        for (EditorHistoryItem item : history.getItems()) {
            if (item.matches(input)) {
                history.remove(item);
            }
        }
        history.refresh();
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) EditorHistory(org.eclipse.ui.internal.EditorHistory) EditorHistoryItem(org.eclipse.ui.internal.EditorHistoryItem) Workbench(org.eclipse.ui.internal.Workbench) IWorkbench(org.eclipse.ui.IWorkbench)

Aggregations

IWorkbench (org.eclipse.ui.IWorkbench)1 EditorHistory (org.eclipse.ui.internal.EditorHistory)1 EditorHistoryItem (org.eclipse.ui.internal.EditorHistoryItem)1 Workbench (org.eclipse.ui.internal.Workbench)1