# HG changeset patch # User bagiras # Date 1380804716 -14400 # Node ID 6e4dba8825460043694f333fcecb04b0c45a4009 # Parent 4cedf4e1560acbf85b037c80b607dad092eac991 8013553: [macosx] java.awt.FileDialog removes file extensions Reviewed-by: leonidr, serb diff -r 4cedf4e1560a -r 6e4dba882546 jdk/src/macosx/native/sun/awt/CFileDialog.m --- a/jdk/src/macosx/native/sun/awt/CFileDialog.m Wed Oct 02 11:28:07 2013 -0700 +++ b/jdk/src/macosx/native/sun/awt/CFileDialog.m Thu Oct 03 16:51:56 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,6 +93,14 @@ - (void)safeSaveOrLoad { NSSavePanel *thePanel = nil; + /* + * 8013553: turns off extension hiding for the native file dialog. + * This way is used because setExtensionHidden(NO) doesn't work + * as expected. + */ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setBool:NO forKey:@"NSNavLastUserSetHideExtensionButtonState"]; + if (fMode == java_awt_FileDialog_SAVE) { thePanel = [NSSavePanel savePanel]; [thePanel setAllowsOtherFileTypes:YES];