Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2019-06-19 06:38:37 -0400
committerLakshmi Shanmugam2019-06-21 04:02:09 -0400
commita4d824f51a06535bde5014bd6d0f86bdd7da903a (patch)
tree567279c14274a4ba43504558955388260498d334 /bundles/org.eclipse.swt/Eclipse SWT PI
parent16b819334eff1e3f82dcb60bfa8ca7c5d8b144dd (diff)
downloadeclipse.platform.swt-a4d824f51a06535bde5014bd6d0f86bdd7da903a.tar.gz
eclipse.platform.swt-a4d824f51a06535bde5014bd6d0f86bdd7da903a.tar.xz
eclipse.platform.swt-a4d824f51a06535bde5014bd6d0f86bdd7da903a.zip
Bug 443089: Save Dialog doesn't handle files with multipart extensions
Reverted code changes made for Bug 347430. Don't use setAllowedFileType to set the filter extensions to the NSSavePanel as it doesn't support multi-part extensions such as tar.gz. Used delegate method panel:userEnteredFilename:confirmed: to handle the overwrite case when name field has filename without extension. Cocoa APIs in general don't support multi-part extensions. However, SWT FileDialog needs to support them. Hence, add the required extensions manually on save and selection change. Change-Id: I221f75476f1c1d263f64da239845c325b436bfca
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java2
4 files changed, 18 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
index 7b9dae576e..47078eb055 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
@@ -2809,6 +2809,9 @@
<method selector="filename" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
+ <method selector="nameFieldStringValue" swt_gen="true">
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="runModal" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
@@ -5317,6 +5320,12 @@
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
+ <method selector="panel:userEnteredFilename:confirmed:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
</informal_protocol>
<informal_protocol name="NSOutlineViewDataSource" swt_gen="mixed">
<method selector="outlineView:acceptDrop:item:childIndex:" swt_gen="true">
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java
index f7afd38ea4..8df3efdbd9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java
@@ -32,6 +32,11 @@ public NSString filename() {
return result != 0 ? new NSString(result) : null;
}
+public NSString nameFieldStringValue() {
+ long result = OS.objc_msgSend(this.id, OS.sel_nameFieldStringValue);
+ return result != 0 ? new NSString(result) : null;
+}
+
public long runModal() {
return OS.objc_msgSend(this.id, OS.sel_runModal);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 65ecd5c95e..2e5314cd3d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -1641,6 +1641,7 @@ public static final long sel_moveUp_ = Selector.sel_moveUp_.value;
public static final long sel_mutableCopy = Selector.sel_mutableCopy.value;
public static final long sel_mutableString = Selector.sel_mutableString.value;
public static final long sel_name = Selector.sel_name.value;
+public static final long sel_nameFieldStringValue = Selector.sel_nameFieldStringValue.value;
public static final long sel_needsPanelToBecomeKey = Selector.sel_needsPanelToBecomeKey.value;
public static final long sel_nextEventMatchingMask_untilDate_inMode_dequeue_ = Selector.sel_nextEventMatchingMask_untilDate_inMode_dequeue_.value;
public static final long sel_nextObject = Selector.sel_nextObject.value;
@@ -1714,6 +1715,7 @@ public static final long sel_pageDown_ = Selector.sel_pageDown_.value;
public static final long sel_pageTitle = Selector.sel_pageTitle.value;
public static final long sel_pageUp_ = Selector.sel_pageUp_.value;
public static final long sel_panel_shouldEnableURL_ = Selector.sel_panel_shouldEnableURL_.value;
+public static final long sel_panel_userEnteredFilename_confirmed_ = Selector.sel_panel_userEnteredFilename_confirmed_.value;
public static final long sel_panelConvertFont_ = Selector.sel_panelConvertFont_.value;
public static final long sel_paperSize = Selector.sel_paperSize.value;
public static final long sel_paragraphs = Selector.sel_paragraphs.value;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
index f4ab9558ca..058b4cf9fe 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
@@ -752,6 +752,7 @@ public enum Selector {
, sel_mutableCopy("mutableCopy")
, sel_mutableString("mutableString")
, sel_name("name")
+ , sel_nameFieldStringValue("nameFieldStringValue")
, sel_needsPanelToBecomeKey("needsPanelToBecomeKey")
, sel_nextEventMatchingMask_untilDate_inMode_dequeue_("nextEventMatchingMask:untilDate:inMode:dequeue:")
, sel_nextObject("nextObject")
@@ -825,6 +826,7 @@ public enum Selector {
, sel_pageTitle("pageTitle")
, sel_pageUp_("pageUp:")
, sel_panel_shouldEnableURL_("panel:shouldEnableURL:")
+ , sel_panel_userEnteredFilename_confirmed_("panel:userEnteredFilename:confirmed:")
, sel_panelConvertFont_("panelConvertFont:")
, sel_paperSize("paperSize")
, sel_paragraphs("paragraphs")

Back to the top