diff options
author | Remy Suen | 2011-10-11 17:13:15 +0000 |
---|---|---|
committer | Remy Suen | 2011-10-11 17:13:15 +0000 |
commit | fe151ae06283473ece668a3546071848336d8798 (patch) | |
tree | 5db9f39f8efe1da10f05c99da0caf0649dcc343f | |
parent | c721288d1b51c52bed784ab29a9a2045833148df (diff) | |
download | eclipse.platform.ui-fe151ae06283473ece668a3546071848336d8798.tar.gz eclipse.platform.ui-fe151ae06283473ece668a3546071848336d8798.tar.xz eclipse.platform.ui-fe151ae06283473ece668a3546071848336d8798.zip |
Bug 231555 [EditorMgmt] EditorHistory shouldn't store invalid items
There is little point in storing items that are invalid. We
should check if an entry is valid when it is first added to the
history and then ignore them if they are not.
-rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorHistory.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorHistory.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorHistory.java index ed381727767..e6e9c603658 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorHistory.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorHistory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,7 +47,9 @@ public class EditorHistory { * Adds an item to the history. Added in fifo fashion. */ public void add(IEditorInput input, IEditorDescriptor desc) { - add(new EditorHistoryItem(input, desc), 0); + if (input != null && input.exists()) { + add(new EditorHistoryItem(input, desc), 0); + } } /** |