[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tm-cvs-commit] dmcknight org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources SystemEditableRemoteFile.java

Update of /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources
In directory dev2:/tmp/cvs-serv3678/src/org/eclipse/rse/files/ui/resources

Modified Files:
      Tag: R3_2_maintenance
	SystemEditableRemoteFile.java 
Log Message:
[376535] RSE does not respect editor overrides


Index: SystemEditableRemoteFile.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java,v
retrieving revision 1.70.2.4
retrieving revision 1.70.2.5
diff -C2 -d -r1.70.2.4 -r1.70.2.5
*** SystemEditableRemoteFile.java	16 Jan 2012 15:59:55 -0000	1.70.2.4
--- SystemEditableRemoteFile.java	19 Apr 2012 13:44:54 -0000	1.70.2.5
***************
*** 44,47 ****
--- 44,48 ----
   * David McKnight   (IBM)        - [359704] SystemEditableRemoteFile does not release reference to editor
   * David McKnight   (IBM)        - [249031] Last used editor should be set to SystemEditableRemoteFile
+  * Rick Sawyer      (IBM)        - [376535] RSE does not respect editor overrides
   *******************************************************************************/
  
***************
*** 132,135 ****
--- 133,137 ----
  	private IFile localFile;
  	private IWorkbenchPage page;
+ 	private boolean _usingDefaultDescriptor = false;
  
  	/**
***************
*** 276,279 ****
--- 278,285 ----
  		try {
  			descriptor = IDE.getEditorDescriptor(localResource);
+ 			
+ 			if (!localResource.exists()){
+ 				_usingDefaultDescriptor = true;
+ 			}
  		} catch (PartInitException e) {	
  		}	
***************
*** 1646,1651 ****
  		// set editor as preferred editor for this file
  		String editorId = null;
! 		if (_editorDescriptor != null)
! 			editorId = _editorDescriptor.getId();
  
  		IDE.setDefaultEditor(file, editorId);
--- 1652,1664 ----
  		// set editor as preferred editor for this file
  		String editorId = null;
! 		if (_editorDescriptor != null){
! 			if (_usingDefaultDescriptor){
! 				_editorDescriptor = IDE.getEditorDescriptor(file);
! 				editorId = _editorDescriptor.getId();
! 			}	
! 			else {
! 				editorId = _editorDescriptor.getId();
! 			}
! 		}
  
  		IDE.setDefaultEditor(file, editorId);
***************
*** 1764,1774 ****
  		if (editor == part){
  			//delete();
! 		      
  			SystemUniversalTempFileListener.getListener().unregisterEditedFile(this);
  
! 			IWorkbenchPage page = SystemBasePlugin.getActiveWorkbenchWindow().getActivePage();
! 
! 			if (page != null)
! 			{
  				page.removePartListener(this);
  				editor = null;
--- 1777,1785 ----
  		if (editor == part){
  			//delete();
! 		       
  			SystemUniversalTempFileListener.getListener().unregisterEditedFile(this);
  
! 			IWorkbenchPage page = SystemBasePlugin.getActiveWorkbenchWindow().getActivePage();			
! 			if (page != null){
  				page.removePartListener(this);
  				editor = null;
***************
*** 2021,2025 ****
  				}
  			}
! 		 }
  	}
  
--- 2032,2036 ----
  				}
  			}
! 		}
  	}