View | Details | Raw Unified | Return to bug 192716
Collapse All | Expand All

(-)UI/org/eclipse/rse/internal/ui/view/SystemTableViewPart.java (-6 / +52 lines)
Lines 18-23 Link Here
18
 * Kevin Doyle (IBM) - [189005] Changed setFocus() to setInput to SystemRegistryUI
18
 * Kevin Doyle (IBM) - [189005] Changed setFocus() to setInput to SystemRegistryUI
19
 * Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core
19
 * Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core
20
 * David McKnight (IBM) - [191288] Up To Action doesn't go all the way back to the connections
20
 * David McKnight (IBM) - [191288] Up To Action doesn't go all the way back to the connections
21
 * Xuan Chen        (IBM)        - [192716] Refresh Error in Table View after Renaming folder shown in table
21
 ********************************************************************************/
22
 ********************************************************************************/
22
23
23
package org.eclipse.rse.internal.ui.view;
24
package org.eclipse.rse.internal.ui.view;
Lines 1166-1171 Link Here
1166
1167
1167
	public void createPartControl(Composite parent)
1168
	public void createPartControl(Composite parent)
1168
	{
1169
	{
1170
		//Want to register SystemTableViewPart as resouce change listener first, since it may update the _inputObject
1171
		//of the SystemTableView, which will affect the behaviour of the resource change event handling of SystemTableView.
1172
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
1173
		registry.addSystemResourceChangeListener(this);
1174
		registry.addSystemRemoteChangeListener(this);
1175
		
1169
		Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
1176
		Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
1170
		_viewer = new SystemTableView(table, this);
1177
		_viewer = new SystemTableView(table, this);
1171
1178
Lines 1191-1197 Link Here
1191
		_browsePosition = 0;
1198
		_browsePosition = 0;
1192
1199
1193
		// register global edit actions 		
1200
		// register global edit actions 		
1194
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
1195
		Clipboard clipboard = RSEUIPlugin.getTheSystemRegistryUI().getSystemClipboard();
1201
		Clipboard clipboard = RSEUIPlugin.getTheSystemRegistryUI().getSystemClipboard();
1196
1202
1197
		CellEditorActionHandler editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
1203
		CellEditorActionHandler editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
Lines 1208-1216 Link Here
1208
		
1214
		
1209
		// register rename action as a global handler
1215
		// register rename action as a global handler
1210
		getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.RENAME.getId(), _renameAction);
1216
		getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.RENAME.getId(), _renameAction);
1211
1217
		
1212
		registry.addSystemResourceChangeListener(this);
1213
		registry.addSystemRemoteChangeListener(this);
1214
1218
1215
		SystemWidgetHelpers.setHelp(_viewer.getControl(), RSEUIPlugin.HELPPREFIX + "sysd0000"); //$NON-NLS-1$
1219
		SystemWidgetHelpers.setHelp(_viewer.getControl(), RSEUIPlugin.HELPPREFIX + "sysd0000"); //$NON-NLS-1$
1216
		
1220
		
Lines 1604-1610 Link Here
1604
	{
1608
	{
1605
		int eventType = event.getEventType();
1609
		int eventType = event.getEventType();
1606
		Object remoteResource = event.getResource();
1610
		Object remoteResource = event.getResource();
1607
	
1611
		String inputAbsoluteNameWithSubSystemId = null;
1608
		Vector remoteResourceNames = null;
1612
		Vector remoteResourceNames = null;
1609
		if (remoteResource instanceof Vector)
1613
		if (remoteResource instanceof Vector)
1610
		{
1614
		{
Lines 1616-1623 Link Here
1616
		
1620
		
1617
		
1621
		
1618
		Object input = _viewer.getInput();
1622
		Object input = _viewer.getInput();
1619
		if (input == child || child instanceof Vector)
1623
		
1624
		//Simply doing comparason of if two object is equal is not enough
1625
		//If two different objects, but if their absoluate path (with subsystem id)
1626
		//are the same, they refer to the same remote object.
1627
		
1628
		if(input instanceof IAdaptable) 
1629
		{
1630
      	  	ISystemViewElementAdapter adapter =
1631
      		  (ISystemViewElementAdapter)
1632
      		  ((IAdaptable)input).getAdapter(ISystemViewElementAdapter.class);
1633
      	
1634
      	  	if (adapter != null ) {
1635
      		  // first need to check subsystems
1636
      		  ISubSystem subSystem = adapter.getSubSystem(input);
1637
      		  String subSystemId = RSECorePlugin.getTheSystemRegistry().getAbsoluteNameForSubSystem(subSystem);
1638
      		  String absolutePath = adapter.getAbsoluteName(input);
1639
      		  inputAbsoluteNameWithSubSystemId = subSystemId + ":" + absolutePath;  //$NON-NLS-1$
1640
      			 
1641
	      }
1642
        }
1643
		
1644
		String remoteResourceAbsoluteNameWithSubSystemId = null;
1645
		if(child instanceof IAdaptable) 
1646
		{
1647
      	  	ISystemViewElementAdapter adapter =
1648
      		  (ISystemViewElementAdapter)
1649
      		  ((IAdaptable)child).getAdapter(ISystemViewElementAdapter.class);
1650
      	
1651
      	  	if (adapter != null ) {
1652
      		  // first need to check subsystems
1653
      		  ISubSystem subSystem = adapter.getSubSystem(child);
1654
      		  String subSystemId = RSECorePlugin.getTheSystemRegistry().getAbsoluteNameForSubSystem(subSystem);
1655
      		remoteResourceAbsoluteNameWithSubSystemId = subSystemId + ":" + event.getOldName();  //$NON-NLS-1$
1656
      			 
1657
	      }
1658
        }
1659
		
1660
		boolean referToSameObject = false;
1661
		if (inputAbsoluteNameWithSubSystemId != null && inputAbsoluteNameWithSubSystemId.equals(remoteResourceAbsoluteNameWithSubSystemId))
1620
		{
1662
		{
1663
			referToSameObject = true;
1664
		}
1665
		if (input == child || child instanceof Vector || referToSameObject)
1666
		{ 
1621
			switch (eventType)
1667
			switch (eventType)
1622
			{
1668
			{
1623
				// --------------------------
1669
				// --------------------------

Return to bug 192716