From 10f1fcfea0a5de880af1d35033760af19da2eed7 Mon Sep 17 00:00:00 2001 From: Kushal Munir < kmunir@ca.ibm.com> Date: Fri, 25 May 2007 15:06:06 +0000 Subject: [PATCH] [160280] Could not remove object from remote scratchpad if same object added multiple times. Do not allow same object to be added more than once to Scratchpad. --- .../org/eclipse/rse/ui/internal/model/SystemScratchpad.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemScratchpad.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemScratchpad.java index 03683ca09c7..25281ebf45f 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemScratchpad.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemScratchpad.java @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core + * Kevin Doyle (IBM) - [160280] Added a check to see if the item to be added already exists ********************************************************************************/ package org.eclipse.rse.ui.internal.model; @@ -63,7 +64,8 @@ public class SystemScratchpad implements IAdaptable public void addChild(Object child) { - _children.add(child); + if (!contains(child)) + _children.add(child); } public void removeChild(Object child)