### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.ui Index: UI/org/eclipse/rse/internal/ui/view/scratchpad/SystemScratchpadView.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/scratchpad/SystemScratchpadView.java,v retrieving revision 1.11 diff -u -r1.11 SystemScratchpadView.java --- UI/org/eclipse/rse/internal/ui/view/scratchpad/SystemScratchpadView.java 23 May 2007 14:28:15 -0000 1.11 +++ UI/org/eclipse/rse/internal/ui/view/scratchpad/SystemScratchpadView.java 5 Jun 2007 13:56:47 -0000 @@ -13,6 +13,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Kevin Doyle (IBM) - [189150] _selectionFlagsUpdated reset after clear action performed ********************************************************************************/ package org.eclipse.rse.internal.ui.view.scratchpad; @@ -579,13 +580,17 @@ public void selectionChanged(SelectionChangedEvent event) { - + // Set _selectionFlagsUpdate to false, so the next time the context menu + // is requested we rescan the selections to determine which actions + // to show and enable/disable. + // Setting this to false will force a rescan because in fillContextMenu() + // if this is false it will call scanSelections(); + _selectionFlagsUpdated = false; IStructuredSelection sel = (IStructuredSelection)event.getSelection(); Object firstSelection = sel.getFirstElement(); if (firstSelection == null) return; - _selectionFlagsUpdated = false; ISystemViewElementAdapter adapter = getViewAdapter(firstSelection); if (adapter != null) { @@ -1218,6 +1223,8 @@ */ protected boolean showRefresh() { + if (!_selectionFlagsUpdated) + scanSelections(); return _selectionShowRefreshAction; } Index: UI/org/eclipse/rse/internal/ui/view/scratchpad/ClearSelectedAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/scratchpad/ClearSelectedAction.java,v retrieving revision 1.4 diff -u -r1.4 ClearSelectedAction.java --- UI/org/eclipse/rse/internal/ui/view/scratchpad/ClearSelectedAction.java 14 May 2007 13:04:58 -0000 1.4 +++ UI/org/eclipse/rse/internal/ui/view/scratchpad/ClearSelectedAction.java 5 Jun 2007 13:56:47 -0000 @@ -13,6 +13,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Kevin Doyle (IBM) - [189150] setSelection(null) added to clear() ********************************************************************************/ package org.eclipse.rse.internal.ui.view.scratchpad; @@ -78,6 +79,7 @@ _scratchPad.removeChild(iterator.next()); } RSECorePlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(_scratchPad, ISystemResourceChangeEvents.EVENT_REFRESH, _scratchPad)); + _view.setSelection(null); //_view.updateActionStates(); } } Index: UI/org/eclipse/rse/internal/ui/view/scratchpad/ClearAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/scratchpad/ClearAction.java,v retrieving revision 1.4 diff -u -r1.4 ClearAction.java --- UI/org/eclipse/rse/internal/ui/view/scratchpad/ClearAction.java 14 May 2007 13:04:58 -0000 1.4 +++ UI/org/eclipse/rse/internal/ui/view/scratchpad/ClearAction.java 5 Jun 2007 13:56:47 -0000 @@ -13,6 +13,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Kevin Doyle (IBM) - [189150] setSelection(null) added to clear() ********************************************************************************/ @@ -54,6 +55,7 @@ { _scratchPad.clearChildren(); RSECorePlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(_scratchPad, ISystemResourceChangeEvents.EVENT_REFRESH, _scratchPad)); + _view.setSelection(null); //_view.updateActionStates(); } } \ No newline at end of file