View | Details | Raw Unified | Return to bug 233461 | Differences between
and this patch

Collapse All | Expand All

(-)UI/org/eclipse/rse/internal/ui/view/SystemView.java (-43 / +31 lines)
Lines 57-62 Link Here
57
 * David McKnight  (IBM)         - [233530] Not Prompted on Promptable Filters after using once by double click
57
 * David McKnight  (IBM)         - [233530] Not Prompted on Promptable Filters after using once by double click
58
 * David McKnight  (IBM)         - [233570] ClassCastException when moving filter after "go into" action
58
 * David McKnight  (IBM)         - [233570] ClassCastException when moving filter after "go into" action
59
 * David Dykstal (IBM)           - [233530] Backing out previous change for this bug
59
 * David Dykstal (IBM)           - [233530] Backing out previous change for this bug
60
 * David McKnight   (IBM)        - [223461] [Refresh][api] Refresh expanded folder under filter refreshes Filter
60
 ********************************************************************************/
61
 ********************************************************************************/
61
62
62
package org.eclipse.rse.internal.ui.view;
63
package org.eclipse.rse.internal.ui.view;
Lines 1357-1362 Link Here
1357
		}
1358
		}
1358
	}
1359
	}
1359
1360
1361
	
1360
	/**
1362
	/**
1361
	 * Clear current selection. Ignore widget disposed message.
1363
	 * Clear current selection. Ignore widget disposed message.
1362
	 */
1364
	 */
Lines 1366-1371 Link Here
1366
		} catch (Exception exc) {
1368
		} catch (Exception exc) {
1367
		}
1369
		}
1368
	}
1370
	}
1371
			
1372
1369
1373
1370
	/**
1374
	/**
1371
	 * Returns the implementation of ISystemViewElementAdapter for the given
1375
	 * Returns the implementation of ISystemViewElementAdapter for the given
Lines 2226-2231 Link Here
2226
			case ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE:
2230
			case ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE:
2227
				if (debug) logDebugMsg("SV event: EVENT_REFRESH_REMOTE: src = " + src); //$NON-NLS-1$
2231
				if (debug) logDebugMsg("SV event: EVENT_REFRESH_REMOTE: src = " + src); //$NON-NLS-1$
2228
				
2232
				
2233
				// Fake expanded is set to the item for the src object if the object is in a collapsed state and
2234
				// resides directly under a filter.  The item is artificially expanded in order to allow 
2235
				// refreshRemoteObject() to go through with a query of the item.  After the query is kicked off, 
2236
				// fakeExpanded is contracted in order to retain the original tree expand state.
2237
				TreeItem fakeExpanded = null;
2229
				
2238
				
2230
				ISystemViewElementAdapter adapter = getViewAdapter(src);
2239
				ISystemViewElementAdapter adapter = getViewAdapter(src);
2231
				if (adapter != null)
2240
				if (adapter != null)
Lines 2233-2250 Link Here
2233
					// we need to refresh filters
2242
					// we need to refresh filters
2234
					ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
2243
					ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
2235
					
2244
					
2236
		        	List filterReferences = sr.findFilterReferencesFor(src, adapter.getSubSystem(src), false);
2245
					// if this is a filter reference, we just need to refresh it
2237
		        	// if filters reference this resource we need them refreshed
2246
					if (src instanceof ISystemFilterReference)
2238
		        	for (int f = 0; f < filterReferences.size(); f++)
2247
					{
2239
		        	{
2248
						refresh(src);
2240
		        		ISystemFilterReference ref = (ISystemFilterReference)filterReferences.get(f);
2249
						break;
2241
		        		if (!ref.isStale())
2250
					}
2242
		        		{
2251
					
2243
		        			ref.markStale(true);
2244
		        			smartRefresh(ref, true);
2245
		        		}
2246
		        	}	
2247
		        	
2248
					// first, find out if src is a container or not
2252
					// first, find out if src is a container or not
2249
					// if it's a container, just pass into refreshRemoteObject
2253
					// if it's a container, just pass into refreshRemoteObject
2250
					// if it's NOT a container, pass in it's parent
2254
					// if it's NOT a container, pass in it's parent
Lines 2280-2324 Link Here
2280
									TreeItem[] titems = titem.getItems();
2284
									TreeItem[] titems = titem.getItems();
2281
									if (titems.length >  0 && !titem.getExpanded())
2285
									if (titems.length >  0 && !titem.getExpanded())
2282
									{
2286
									{
2283
										src = adapter.getParent(src);
2287
										// the item is artificially expanded in order to allow the query to go through in
2288
										// refreshRemoteObject()
2289
										titem.setExpanded(true);
2290
											
2291
										// we set this so that after calling refreshRemoteObject(), the item can be re-collapsed
2292
										fakeExpanded = titem;									
2284
									}
2293
									}
2285
								}
2294
								}
2286
									
2287
								/* old code - issue in 196662
2288
								String key = adapter.getAbsoluteName(src);
2289
								if (key != null)
2290
								{
2291
									try
2292
									{
2293
										Object srcParent = adapter.getParent(src); // get parent before we query 
2294
										                                           // because if after query src doesn't exist, 
2295
																			  	   // we can't get parent
2296
										if (srcParent != null)
2297
										{	
2298
											src = ss.getObjectWithAbsoluteName(key);
2299
											hasChildren = adapter.hasChildren((IAdaptable)src);
2300
											if (!hasChildren)
2301
											{
2302
												// make the src the parent of the src
2303
												src = srcParent;
2304
											}
2305
										}
2306
									}
2307
									catch (Exception e)
2308
									{
2309
										e.printStackTrace();
2310
									}
2311
								}
2312
								*/
2313
							}
2295
							}
2314
						}
2296
						}
2315
					}
2297
					}
2316
				}
2298
				}
2317
				
2299
				
2318
				refreshRemoteObject(src, parent, originatedHere);
2300
				refreshRemoteObject(src, parent, originatedHere);
2319
		
2301
				if (fakeExpanded != null){
2320
	        		
2302
					fakeExpanded.setExpanded(false);
2321
	        	
2303
				}
2304
	        			        	
2322
				break;
2305
				break;
2323
			case ISystemResourceChangeEvents.EVENT_SELECT_REMOTE:
2306
			case ISystemResourceChangeEvents.EVENT_SELECT_REMOTE:
2324
				if (debug) logDebugMsg("SV event: EVENT_SELECT_REMOTE: src = " + src); //$NON-NLS-1$
2307
				if (debug) logDebugMsg("SV event: EVENT_SELECT_REMOTE: src = " + src); //$NON-NLS-1$
Lines 6383-6386 Link Here
6383
		}		
6366
		}		
6384
	}
6367
	}
6385
	
6368
	
6369
	/** commented out - this is workaround for performance problem
6370
	protected void handleLabelProviderChanged(LabelProviderChangedEvent event) {
6371
		//System.out.println("handleLableProviderChanged");
6372
	}*/
6373
	
6386
}
6374
}

Return to bug 233461