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

(-)src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java (-3 / +11 lines)
Lines 19-24 Link Here
19
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
19
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
20
 * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
20
 * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
21
 * David McKnight   (IBM)        - [187130] New Folder/File, Move and Rename should be available for read-only folders
21
 * David McKnight   (IBM)        - [187130] New Folder/File, Move and Rename should be available for read-only folders
22
 * Kevin Doyle      (IBM) 		 - [197976] Changing a file to read-only when it is open doesn't update local copy
22
 ********************************************************************************/
23
 ********************************************************************************/
23
24
24
package org.eclipse.rse.files.ui.resources;
25
package org.eclipse.rse.files.ui.resources;
Lines 439-447 Link Here
439
		{
440
		{
440
			setEditorAsReadOnly();
441
			setEditorAsReadOnly();
441
		}
442
		}
442
		else if (editor instanceof ISystemTextEditor)
443
		else
443
		{
444
		{
444
			((ISystemTextEditor) editor).setReadOnly(false);
445
			if (editor instanceof ISystemTextEditor) {
446
				((ISystemTextEditor) editor).setReadOnly(false);
447
			}
448
			IFile file = getLocalResource();
449
			setReadOnly(file, false);
450
			SystemIFileProperties properties = new SystemIFileProperties(file);
451
			properties.setReadOnly(true);
445
		}
452
		}
446
	}
453
	}
447
454
Lines 1589-1595 Link Here
1589
			((ISystemTextEditor) editor).setReadOnly(true);
1596
			((ISystemTextEditor) editor).setReadOnly(true);
1590
		}
1597
		}
1591
		IFile file = getLocalResource();
1598
		IFile file = getLocalResource();
1592
1599
		setReadOnly(file, true);
1600
		
1593
		SystemIFileProperties properties = new SystemIFileProperties(file);
1601
		SystemIFileProperties properties = new SystemIFileProperties(file);
1594
		properties.setReadOnly(true);
1602
		properties.setReadOnly(true);
1595
	}
1603
	}
(-)src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java (-2 / +11 lines)
Lines 17-22 Link Here
17
 * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() 
17
 * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() 
18
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
18
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
19
 * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
19
 * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
20
 * Kevin Doyle (IBM) - [197976] Synch up Read-Only attribute when performing save based on local copy
20
 ********************************************************************************/
21
 ********************************************************************************/
21
22
22
package org.eclipse.rse.files.ui.resources;
23
package org.eclipse.rse.files.ui.resources;
Lines 24-29 Link Here
24
25
25
import org.eclipse.core.resources.IFile;
26
import org.eclipse.core.resources.IFile;
26
import org.eclipse.core.runtime.IProgressMonitor;
27
import org.eclipse.core.runtime.IProgressMonitor;
28
import org.eclipse.core.runtime.NullProgressMonitor;
27
import org.eclipse.rse.core.RSECorePlugin;
29
import org.eclipse.rse.core.RSECorePlugin;
28
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
30
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
29
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
31
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
Lines 119-125 Link Here
119
	* @param monitor progress monitor
121
	* @param monitor progress monitor
120
	*/
122
	*/
121
	protected void doResourceSynchronization(ISubSystem subsystem, IFile tempFile, String resourceId, IProgressMonitor monitor)
123
	protected void doResourceSynchronization(ISubSystem subsystem, IFile tempFile, String resourceId, IProgressMonitor monitor)
122
	{
124
	{		
123
		if (subsystem instanceof IRemoteFileSubSystem)
125
		if (subsystem instanceof IRemoteFileSubSystem)
124
		{
126
		{
125
			IRemoteFileSubSystem fs = (IRemoteFileSubSystem) subsystem;
127
			IRemoteFileSubSystem fs = (IRemoteFileSubSystem) subsystem;
Lines 174-179 Link Here
174
					// get modification stamp and dirty state         
176
					// get modification stamp and dirty state         
175
					long storedModifiedStamp = properties.getRemoteFileTimeStamp();
177
					long storedModifiedStamp = properties.getRemoteFileTimeStamp();
176
178
179
					// If remote file is read-only make it writable as the local
180
					// copy has changed to be writable
181
					if (remoteFile.exists() && !remoteFile.canWrite() && !tempFile.isReadOnly()) {
182
						remoteFile.getParentRemoteFileSubSystem().setReadOnly(
183
								remoteFile, false, new NullProgressMonitor());
184
					}				
185
					
177
					// get associated editable
186
					// get associated editable
178
					SystemEditableRemoteFile editable = getEditedFile(remoteFile);
187
					SystemEditableRemoteFile editable = getEditedFile(remoteFile);
179
					if (editable != null && storedModifiedStamp == 0)
188
					if (editable != null && storedModifiedStamp == 0)
Lines 192-198 Link Here
192
						{
201
						{
193
							editable = new SystemEditableRemoteFile(remoteFile);
202
							editable = new SystemEditableRemoteFile(remoteFile);
194
						}
203
						}
195
204
					
196
						// defect - we get a save event when saving during a close
205
						// defect - we get a save event when saving during a close
197
						// in that case, we shouldn't reopen the editor
206
						// in that case, we shouldn't reopen the editor
198
						// I think this was originally here so that, if a save is done on
207
						// I think this was originally here so that, if a save is done on
(-)src/org/eclipse/rse/internal/files/ui/propertypages/SystemFilePropertyPage.java (+10 lines)
Lines 17-22 Link Here
17
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
17
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
18
 * David Dykstal (IBM) - [160776] format file size according to client system conventions and locale
18
 * David Dykstal (IBM) - [160776] format file size according to client system conventions and locale
19
 * David McKnight (IBM) - [173518] [refresh] Read only changes are not shown in RSE until the parent folder is refreshed
19
 * David McKnight (IBM) - [173518] [refresh] Read only changes are not shown in RSE until the parent folder is refreshed
20
 * Kevin Doyle (IBM) - [197976] Changing a file to read-only when it is open doesn't update local copy
20
 ********************************************************************************/
21
 ********************************************************************************/
21
22
22
package org.eclipse.rse.internal.files.ui.propertypages;
23
package org.eclipse.rse.internal.files.ui.propertypages;
Lines 30-35 Link Here
30
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
31
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
31
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
32
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
32
import org.eclipse.rse.core.model.ISystemRegistry;
33
import org.eclipse.rse.core.model.ISystemRegistry;
34
import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile;
33
import org.eclipse.rse.internal.files.ui.FileResources;
35
import org.eclipse.rse.internal.files.ui.FileResources;
34
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
36
import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources;
35
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
37
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
Lines 42-47 Link Here
42
import org.eclipse.rse.ui.RSEUIPlugin;
44
import org.eclipse.rse.ui.RSEUIPlugin;
43
import org.eclipse.rse.ui.SystemWidgetHelpers;
45
import org.eclipse.rse.ui.SystemWidgetHelpers;
44
import org.eclipse.rse.ui.propertypages.SystemBasePropertyPage;
46
import org.eclipse.rse.ui.propertypages.SystemBasePropertyPage;
47
import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
45
import org.eclipse.swt.SWT;
48
import org.eclipse.swt.SWT;
46
import org.eclipse.swt.events.KeyAdapter;
49
import org.eclipse.swt.events.KeyAdapter;
47
import org.eclipse.swt.events.KeyEvent;
50
import org.eclipse.swt.events.KeyEvent;
Lines 491-496 Link Here
491
           // get the new can write attribute
494
           // get the new can write attribute
492
           boolean updatedValue = remoteFile.canWrite();
495
           boolean updatedValue = remoteFile.canWrite();
493
496
497
           // check if the file is open in an editor
498
           SystemEditableRemoteFile editable = new SystemEditableRemoteFile(remoteFile);
499
           if (editable.checkOpenInEditor() != ISystemEditableRemoteObject.NOT_OPEN) {
500
        	   // Need to keep local copy and remote copies up to date
501
        	   editable.setReadOnly(readOnlySelected);
502
           }
503
                     
494
           // if the values haven't changed, then we need to     
504
           // if the values haven't changed, then we need to     
495
           // refresh  
505
           // refresh  
496
           ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); 
506
           ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); 

Return to bug 197976