fix combo box behaviour when selecting content type override
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 14 Jun 2008 11:55:19 +0000 (13:55 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 14 Jun 2008 11:55:19 +0000 (13:55 +0200)
src/net/pterodactylus/jsite/gui/FileManager.java

index 996d609..766677f 100644 (file)
@@ -399,7 +399,11 @@ public class FileManager extends JDialog implements I18nable, TreeSelectionListe
                                                fileOverride = new FileOverride();
                                                project.addFileOverride(projectFile, fileOverride);
                                        }
-                                       fileOverride.setContentType(MimeTypes.getMimeType(getFileExtension(projectFile.getName())));
+                                       String projectFileName = projectFile.getName();
+                                       String mimeType = MimeTypes.getMimeType(getFileExtension(projectFileName));
+                                       fileOverride.setContentType(mimeType);
+                                       fillComboBox(projectFileName);
+                                       contentTypeOverrideComboBox.setSelectedItem(mimeType);
                                } else {
                                        fileOverride.setContentType(null);
                                        if (fileOverride.isEmpty()) {