Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod2008-01-10 19:52:08 +0000
committerCarolyn MacLeod2008-01-10 19:52:08 +0000
commit230c878d65efde864dc47f556220f07201b137c6 (patch)
tree66b89eea24222ea2468481b02433395c1ef1478a /bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FileDialog.java
parentb4da829bcb6bc3eaf9f91d5d9cfd584567880196 (diff)
downloadeclipse.platform.swt-230c878d65efde864dc47f556220f07201b137c6.tar.gz
eclipse.platform.swt-230c878d65efde864dc47f556220f07201b137c6.tar.xz
eclipse.platform.swt-230c878d65efde864dc47f556220f07201b137c6.zip
Allow filterIndex to be set even if platform does not implement feature
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FileDialog.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FileDialog.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FileDialog.java
index 522f14d9ae..94001be631 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FileDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FileDialog.java
@@ -40,6 +40,7 @@ public class FileDialog extends Dialog {
String fileName = ""; //$NON-NLS-1$
String filterPath = ""; //$NON-NLS-1$
String fullPath;
+ int filterIndex = -1;
static final String FILTER = "*"; //$NON-NLS-1$
static final char SEPARATOR = System.getProperty ("file.separator").charAt (0); //$NON-NLS-1$
@@ -137,9 +138,11 @@ public String [] getFilterExtensions () {
*
* @see #getFilterExtensions
* @see #getFilterNames
+ *
+ * @since 3.4
*/
public int getFilterIndex () {
- return filterExtensions == null || filterExtensions.length == 0 ? -1 : 0;
+ return filterIndex;
}
/**
@@ -236,6 +239,7 @@ int okPressed (int widget, int client, int call) {
}
OS.XmStringFree (xmString1);
+ filterIndex = filterExtensions == null || filterExtensions.length == 0 ? -1 : 0;
if ((style & SWT.MULTI) != 0) {
int fileList = OS.XmFileSelectionBoxGetChild (dialog, OS.XmDIALOG_LIST);
if (fileList == 0) return 0;
@@ -560,8 +564,11 @@ public void setFilterExtensions (String [] extensions) {
*
* @see #setFilterExtensions
* @see #setFilterNames
+ *
+ * @since 3.4
*/
public void setFilterIndex (int index) {
+ filterIndex = index;
}
/**

Back to the top