mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-29 03:03:10 +02:00
[189150] kevin's patch for clear in the scratchpad view
This commit is contained in:
parent
8ebf4c66c4
commit
6792fa442a
3 changed files with 13 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
|
* Kevin Doyle (IBM) - [189150] setSelection(null) added to clear()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ public class ClearAction extends BrowseAction
|
||||||
{
|
{
|
||||||
_scratchPad.clearChildren();
|
_scratchPad.clearChildren();
|
||||||
RSECorePlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(_scratchPad, ISystemResourceChangeEvents.EVENT_REFRESH, _scratchPad));
|
RSECorePlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(_scratchPad, ISystemResourceChangeEvents.EVENT_REFRESH, _scratchPad));
|
||||||
|
_view.setSelection(null);
|
||||||
//_view.updateActionStates();
|
//_view.updateActionStates();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,6 +13,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* 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;
|
package org.eclipse.rse.internal.ui.view.scratchpad;
|
||||||
|
@ -78,6 +79,7 @@ public class ClearSelectedAction extends BrowseAction
|
||||||
_scratchPad.removeChild(iterator.next());
|
_scratchPad.removeChild(iterator.next());
|
||||||
}
|
}
|
||||||
RSECorePlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(_scratchPad, ISystemResourceChangeEvents.EVENT_REFRESH, _scratchPad));
|
RSECorePlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(_scratchPad, ISystemResourceChangeEvents.EVENT_REFRESH, _scratchPad));
|
||||||
|
_view.setSelection(null);
|
||||||
//_view.updateActionStates();
|
//_view.updateActionStates();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
* Kevin Doyle (IBM) - [192278] Removed handleKeyPressed
|
* Kevin Doyle (IBM) - [192278] Removed handleKeyPressed
|
||||||
|
* Kevin Doyle (IBM) - [189150] _selectionFlagsUpdated reset after clear action performed
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.ui.view.scratchpad;
|
package org.eclipse.rse.internal.ui.view.scratchpad;
|
||||||
|
@ -573,12 +574,17 @@ public class SystemScratchpadView
|
||||||
public void selectionChanged(SelectionChangedEvent event)
|
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();
|
IStructuredSelection sel = (IStructuredSelection)event.getSelection();
|
||||||
Object firstSelection = sel.getFirstElement();
|
Object firstSelection = sel.getFirstElement();
|
||||||
if (firstSelection == null)
|
if (firstSelection == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_selectionFlagsUpdated = false;
|
|
||||||
ISystemViewElementAdapter adapter = getViewAdapter(firstSelection);
|
ISystemViewElementAdapter adapter = getViewAdapter(firstSelection);
|
||||||
if (adapter != null)
|
if (adapter != null)
|
||||||
{
|
{
|
||||||
|
@ -1211,6 +1217,8 @@ public class SystemScratchpadView
|
||||||
*/
|
*/
|
||||||
protected boolean showRefresh()
|
protected boolean showRefresh()
|
||||||
{
|
{
|
||||||
|
if (!_selectionFlagsUpdated)
|
||||||
|
scanSelections();
|
||||||
return _selectionShowRefreshAction;
|
return _selectionShowRefreshAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue