Bug 255076 [EditorMgmt] File icon not updated when file changed (content change or move/rename)
M20081008-0800 File icons are not updated when a file is changed (content change or move/rename the file). Steps: - create file a.xml - paste this into the opened text editor: <?xml version="1.0" encoding="UTF-8"?> <project name="project" default="default"> <target name="default"> </target> </project> - save => expected: file icon should turn into Ant file => was: nothing happens (in Package Explorer and Navigator) - File > Refresh refreshes the icon - rename file to a.xml2 => expected: File icon should turn into plain text file => was: Ant icon stays, even if I try to refresh - move file to another folder => was: Ant icon stays, even if I try to refresh - copy file and paste into same folder, use suggested name => was: copy uses plain text icon (good)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/ContentTypeDecorator.java
public void decorate(Object element, IDecoration decoration) {
		if (element instanceof IFile == false) {
			return;
		}
		IFile file = (IFile) element;
		IContentDescription contentDescription = null;
		try {
			contentDescription = file.getContentDescription();
		} catch (CoreException e) {
			
			
		}
		if (contentDescription != null) {
			IContentType contentType = contentDescription.getContentType();
			if (contentType != null) {
				IWorkbench workbench = PlatformUI.getWorkbench();