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

Collapse All | Expand All

(-)src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java (+19 lines)
Lines 40-45 Link Here
40
 * David McKnight   (IBM)        - [284420] nullprogressmonitor is needed
40
 * David McKnight   (IBM)        - [284420] nullprogressmonitor is needed
41
 * David McKnight   (IBM)        - [310215] SystemEditableRemoteFile.open does not behave as expected
41
 * David McKnight   (IBM)        - [310215] SystemEditableRemoteFile.open does not behave as expected
42
 * David McKnight   (IBM)        - [324519] SystemEditableRemoteFile throws NPE when used in headless mode
42
 * David McKnight   (IBM)        - [324519] SystemEditableRemoteFile throws NPE when used in headless mode
43
 * David McKnight   (IBM)        - [325502] The default editor for a file is not updated when opened in RSE explorer
43
 *******************************************************************************/
44
 *******************************************************************************/
44
45
45
package org.eclipse.rse.files.ui.resources;
46
package org.eclipse.rse.files.ui.resources;
Lines 2013-2016 Link Here
2013
		return remoteFile.isStale();
2014
		return remoteFile.isStale();
2014
	}
2015
	}
2015
2016
2017
	/**
2018
	 * Get the editor descriptor to be associated with the remote file
2019
	 * @return the editor descriptor associated with this remote file
2020
	 * @since 3.3 
2021
	 */
2022
	public IEditorDescriptor getEditorDescriptor(){
2023
		return _editorDescriptor;
2024
	}
2025
	
2026
	/**
2027
	 * Set the editor descriptor to be associated with the remote file
2028
	 * @param descriptor the new editor descriptor
2029
	 * @since 3.3
2030
	 */
2031
	public void setEditorDescriptor(IEditorDescriptor descriptor){
2032
		_editorDescriptor = descriptor;
2033
	}
2034
	
2016
}
2035
}
(-)src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteEditManager.java (-17 / +2 lines)
Lines 874-896 Link Here
874
							// fall through and let the new editable get created
874
							// fall through and let the new editable get created
875
						}
875
						}
876
						else {		
876
						else {		
877
							if (descriptor != null){
877
							if (descriptor != null){ // update the editor descriptor
878
								// using reflection	to change descriptor since there's
878
								editable.setEditorDescriptor(descriptor);
879
								// no API right now
880
								try {
881
						            Class cls = editable.getClass();
882
						            Field[] fields = cls.getDeclaredFields();
883
						            for (int i = 0; i < fields.length; i++){
884
						            	Field fld = fields[i];
885
						            	String name= fld.getName();
886
						            	if (name.equals("_editorDescriptor")){ //$NON-NLS-1$
887
						            		fld.setAccessible(true);
888
						            		fld.set(editable, descriptor);
889
						            	}
890
						            }
891
								}
892
								catch (Exception e){									
893
								}
894
							}
879
							}
895
							return editable;
880
							return editable;
896
						}
881
						}

Return to bug 325502