mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 15:25:49 +02:00
[367357] system table-tree view not showing refresh action
This commit is contained in:
parent
0d59141d99
commit
a090799028
1 changed files with 41 additions and 29 deletions
|
@ -20,6 +20,7 @@
|
||||||
* David McKnight (IBM) - [296877] Allow user to choose the attributes for remote search result
|
* David McKnight (IBM) - [296877] Allow user to choose the attributes for remote search result
|
||||||
* David McKnight (IBM) - [357587] Custom sorter is changed to SystemTableViewSorter
|
* David McKnight (IBM) - [357587] Custom sorter is changed to SystemTableViewSorter
|
||||||
* David McKnight (IBM) - [363392] system table views shows open view actions when they shouldn't
|
* David McKnight (IBM) - [363392] system table views shows open view actions when they shouldn't
|
||||||
|
* David McKnight (IBM) - [367357] system table-tree view not showing refresh action
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.ui.view;
|
package org.eclipse.rse.internal.ui.view;
|
||||||
|
@ -967,48 +968,45 @@ public class SystemTableTreeView
|
||||||
// --------------------------
|
// --------------------------
|
||||||
case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
|
case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
|
||||||
{
|
{
|
||||||
|
Object dchild = remoteResource;
|
||||||
|
|
||||||
|
ISystemViewElementAdapter dadapt = getViewAdapter(dchild);
|
||||||
|
if (dadapt != null)
|
||||||
{
|
{
|
||||||
Object dchild = remoteResource;
|
ISubSystem dSubSystem = dadapt.getSubSystem(dchild);
|
||||||
|
String dkey = dadapt.getAbsoluteName(dchild);
|
||||||
|
|
||||||
ISystemViewElementAdapter dadapt = getViewAdapter(dchild);
|
if (provider != null)
|
||||||
if (dadapt != null)
|
|
||||||
{
|
{
|
||||||
ISubSystem dSubSystem = dadapt.getSubSystem(dchild);
|
Object[] children = provider.getChildren(_objectInput);
|
||||||
String dkey = dadapt.getAbsoluteName(dchild);
|
for (int i = 0; i < children.length; i++)
|
||||||
|
|
||||||
if (provider != null)
|
|
||||||
{
|
{
|
||||||
Object[] children = provider.getChildren(_objectInput);
|
Object existingChild = children[i];
|
||||||
for (int i = 0; i < children.length; i++)
|
if (existingChild != null)
|
||||||
{
|
{
|
||||||
Object existingChild = children[i];
|
ISystemViewElementAdapter eadapt = getViewAdapter(existingChild);
|
||||||
if (existingChild != null)
|
ISubSystem eSubSystem = eadapt.getSubSystem(existingChild);
|
||||||
|
|
||||||
|
if (dSubSystem == eSubSystem)
|
||||||
{
|
{
|
||||||
ISystemViewElementAdapter eadapt = getViewAdapter(existingChild);
|
String ekey = eadapt.getAbsoluteName(existingChild);
|
||||||
ISubSystem eSubSystem = eadapt.getSubSystem(existingChild);
|
if (ekey.equals(dkey))
|
||||||
|
|
||||||
if (dSubSystem == eSubSystem)
|
|
||||||
{
|
{
|
||||||
String ekey = eadapt.getAbsoluteName(existingChild);
|
if (!madeChange)
|
||||||
if (ekey.equals(dkey))
|
|
||||||
{
|
{
|
||||||
if (!madeChange)
|
provider.flushCache();
|
||||||
{
|
madeChange = true;
|
||||||
provider.flushCache();
|
|
||||||
madeChange = true;
|
|
||||||
|
|
||||||
// do a full refresh
|
// do a full refresh
|
||||||
refresh();
|
refresh();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1361,6 +1359,16 @@ public class SystemTableTreeView
|
||||||
scanSelections();
|
scanSelections();
|
||||||
return _selectionShowRenameAction;
|
return _selectionShowRenameAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decides whether to even show the refresh menu item.
|
||||||
|
* Assumes scanSelections() has already been called
|
||||||
|
*/
|
||||||
|
protected boolean showRefresh() {
|
||||||
|
if (!_selectionFlagsUpdated)
|
||||||
|
scanSelections();
|
||||||
|
return _selectionShowRefreshAction;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Required method from ISystemRenameTarget
|
* Required method from ISystemRenameTarget
|
||||||
* Decides whether to enable the rename menu item.
|
* Decides whether to enable the rename menu item.
|
||||||
|
@ -1580,6 +1588,9 @@ public class SystemTableTreeView
|
||||||
SystemView.createStandardGroups(menu);
|
SystemView.createStandardGroups(menu);
|
||||||
|
|
||||||
// ADD COMMON ACTIONS...
|
// ADD COMMON ACTIONS...
|
||||||
|
if (showRefresh()) {
|
||||||
|
menu.appendToGroup(ISystemContextMenuConstants.GROUP_BUILD, getRefreshAction());
|
||||||
|
}
|
||||||
|
|
||||||
// COMMON RENAME ACTION...
|
// COMMON RENAME ACTION...
|
||||||
if (canRename())
|
if (canRename())
|
||||||
|
@ -1597,6 +1608,9 @@ public class SystemTableTreeView
|
||||||
{
|
{
|
||||||
Object element = elements.next();
|
Object element = elements.next();
|
||||||
ISystemViewElementAdapter adapter = getViewAdapter(element);
|
ISystemViewElementAdapter adapter = getViewAdapter(element);
|
||||||
|
if (adapter == null){
|
||||||
|
System.out.println("no adapter for "+element);
|
||||||
|
}
|
||||||
adapters.put(adapter, element); // want only unique adapters
|
adapters.put(adapter, element); // want only unique adapters
|
||||||
}
|
}
|
||||||
Enumeration uniqueAdapters = adapters.keys();
|
Enumeration uniqueAdapters = adapters.keys();
|
||||||
|
@ -1670,8 +1684,6 @@ public class SystemTableTreeView
|
||||||
menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, showInTableAction);
|
menu.appendToGroup(ISystemContextMenuConstants.GROUP_OPEN, showInTableAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue