Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemy Suen2011-10-11 17:20:11 +0000
committerRemy Suen2011-10-11 17:20:11 +0000
commit6ab89bba030ab5dd4aa52c35cc3720a2156bafcc (patch)
tree9a6324f3b0ee8b016c98b95383e3d571ebe1cca9
parent62d79803400497d84a183475b22454a502fd63fb (diff)
downloadeclipse.platform.ui-6ab89bba030ab5dd4aa52c35cc3720a2156bafcc.tar.gz
eclipse.platform.ui-6ab89bba030ab5dd4aa52c35cc3720a2156bafcc.tar.xz
eclipse.platform.ui-6ab89bba030ab5dd4aa52c35cc3720a2156bafcc.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.java6
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 198e6e2070e..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, 2006 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);
+ }
}
/**

Back to the top