Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 209703
Collapse All | Expand All

(-)src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java (-1 / +43 lines)
Lines 30-35 Link Here
30
30
31
import org.eclipse.core.resources.IFile;
31
import org.eclipse.core.resources.IFile;
32
import org.eclipse.core.runtime.CoreException;
32
import org.eclipse.core.runtime.CoreException;
33
import org.eclipse.core.runtime.IAdaptable;
33
import org.eclipse.core.runtime.NullProgressMonitor;
34
import org.eclipse.core.runtime.NullProgressMonitor;
34
import org.eclipse.rse.core.RSECorePlugin;
35
import org.eclipse.rse.core.RSECorePlugin;
35
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
36
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
Lines 102-107 Link Here
102
	{
103
	{
103
		super();
104
		super();
104
	}
105
	}
106
	
107
	
105
	/**
108
	/**
106
	 * Create the page's GUI contents.
109
	 * Create the page's GUI contents.
107
	 */
110
	 */
Lines 374-380 Link Here
374
	protected IRemoteFile getRemoteFile()
377
	protected IRemoteFile getRemoteFile()
375
	{
378
	{
376
		Object element = getElement();
379
		Object element = getElement();
377
		return ((IRemoteFile)element);
380
		IRemoteFile file = (IRemoteFile)element;
381
		
382
		return file;
378
	}
383
	}
379
384
380
	/**
385
	/**
Lines 515-520 Link Here
515
           // refresh  
520
           // refresh  
516
           ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); 
521
           ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); 
517
           
522
           
523
           remoteFile.markStale(true);
524
           
518
           // oldCanWrite and updatedValue may not be the same depending on the underlying file service
525
           // oldCanWrite and updatedValue may not be the same depending on the underlying file service
519
           // If the file service updates the underlying object, then there is no need for a remote refresh
526
           // If the file service updates the underlying object, then there is no need for a remote refresh
520
           if (oldCanWrite == updatedValue)
527
           if (oldCanWrite == updatedValue)
Lines 572-582 Link Here
572
				} catch (CoreException e) {
579
				} catch (CoreException e) {
573
				}
580
				}
574
			}
581
			}
582
						
575
		}
583
		}
576
		
584
		
577
		return ok;
585
		return ok;
578
	}
586
	}
579
	
587
	
588
	protected boolean wantDefaultAndApplyButton()
589
	{
590
		return true;
591
	}
592
	
593
	protected void performApply() {
594
		performOk();
595
	}
596
597
	protected void performDefaults() {
598
		doInitializeFields();		
599
	}
600
601
	
580
    /**
602
    /**
581
     * Validate all the widgets on the page
603
     * Validate all the widgets on the page
582
	 * <p>
604
	 * <p>
Lines 597-600 Link Here
597
    	
619
    	
598
    }
620
    }
599
621
622
623
	public void setVisible(boolean visible) {
624
		if (visible){
625
			IRemoteFile file = getRemoteFile();
626
			if (file.isStale()){ // has file changed?
627
				try
628
				{
629
					file = file.getParentRemoteFileSubSystem().getRemoteFileObject(file.getAbsolutePath(), new NullProgressMonitor());
630
				}
631
				catch (Exception e){				
632
				}
633
				setElement((IAdaptable)file);
634
				
635
				// reset according to the changed file
636
				performDefaults();
637
			}			
638
		}
639
		super.setVisible(visible);
640
	}
641
600
}
642
}
(-)src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePermissionsPropertyPage.java (-1 / +38 lines)
Lines 69-75 Link Here
69
	protected IRemoteFile getRemoteFile()
69
	protected IRemoteFile getRemoteFile()
70
	{
70
	{
71
		Object element = getElement();
71
		Object element = getElement();
72
		return ((IRemoteFile)element);
72
		IRemoteFile file = (IRemoteFile)element;
73
74
		
75
		return file;
73
	}
76
	}
74
	
77
	
75
	protected Control createContentArea(Composite parent) {		
78
	protected Control createContentArea(Composite parent) {		
Lines 414-419 Link Here
414
		}
417
		}
415
418
416
		if (changed){
419
		if (changed){
420
			remoteFile.markStale(true);
417
			// notify views of change
421
			// notify views of change
418
			ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
422
			ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
419
			registry.fireEvent(new SystemResourceChangeEvent(remoteFile, ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE, remoteFile));
423
			registry.fireEvent(new SystemResourceChangeEvent(remoteFile, ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE, remoteFile));
Lines 423-426 Link Here
423
		return super.performOk();
427
		return super.performOk();
424
	}
428
	}
425
	
429
	
430
	protected boolean wantDefaultAndApplyButton()
431
	{
432
		return true;
433
	}
434
	
435
	protected void performApply() {
436
		performOk();
437
	}
438
439
	protected void performDefaults() {
440
		IRemoteFile file = getRemoteFile();
441
		IFilePermissionsService service = (IFilePermissionsService)((IAdaptable)file).getAdapter(IFilePermissionsService.class);
442
		initPermissionFields(file, service);		
443
	}
444
	
445
	public void setVisible(boolean visible) {
446
		if (visible){
447
			IRemoteFile file = getRemoteFile();
448
			if (file.isStale()){ // has file changed?
449
				try
450
				{
451
					file = file.getParentRemoteFileSubSystem().getRemoteFileObject(file.getAbsolutePath(), new NullProgressMonitor());
452
				}
453
				catch (Exception e){				
454
				}
455
				setElement((IAdaptable)file);
456
				
457
				// reset according to the changed file
458
				performDefaults();
459
			}			
460
		}
461
		super.setVisible(visible);
462
	}
426
}
463
}

Return to bug 209703