summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-23 21:31:04 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-23 21:31:04 +0000
commit947b8814056ea2fba6bbcfab86591f74bffc0311 (patch)
tree3ca4b2e68dc14c3128b9c781d23f1d0b1f2bee49 /libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
parent49792907376493f0939563eb0219b96a48f1ae3b (diff)
downloadppe42-gcc-947b8814056ea2fba6bbcfab86591f74bffc0311.tar.gz
ppe42-gcc-947b8814056ea2fba6bbcfab86591f74bffc0311.zip
Imported Classpath 0.18.
* sources.am, Makefile.in: Updated. * Makefile.am (nat_source_files): Removed natProxy.cc. * java/lang/reflect/natProxy.cc: Removed. * gnu/classpath/jdwp/VMFrame.java, gnu/classpath/jdwp/VMIdManager.java, gnu/classpath/jdwp/VMVirtualMachine.java, java/lang/reflect/VMProxy.java: New files. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC list. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/net/DefaultContentHandlerFactory.java (getContent): Remove ClasspathToolkit references. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/awt/xlib/XCanvasPeer.java: Add new peer methods. * gnu/awt/xlib/XFramePeer.java: Likewise. * gnu/awt/xlib/XGraphicsConfiguration.java: Likewise. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add classpath/native/jawt/jawt.c. * Makefile.in: Regenerate. * jawt.c: Remove file. * include/Makefile.am (tool_include__HEADERS): Remove jawt.h and jawt_md.h. Add ../classpath/include/jawt.h and ../classpath/include/jawt_md.h. * include/Makefile.in: Regenerate. * include/jawt.h: Regenerate. * include/jawt_md.h: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java')
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java28
1 files changed, 18 insertions, 10 deletions
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
index bd1f0775a92..333407b247f 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
@@ -42,6 +42,7 @@ import java.awt.Dialog;
import java.awt.FileDialog;
import java.awt.Graphics;
import java.awt.Window;
+import java.awt.event.ComponentEvent;
import java.awt.peer.FileDialogPeer;
import java.io.File;
import java.io.FilenameFilter;
@@ -54,7 +55,7 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
private String currentDirectory = null;
private FilenameFilter filter;
- native void create (GtkContainerPeer parent);
+ native void create (GtkContainerPeer parent, int mode);
native void connectSignals ();
native void nativeSetFile (String file);
public native String nativeGetDirectory();
@@ -63,7 +64,8 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
public void create()
{
- create((GtkContainerPeer) awtComponent.getParent().getPeer());
+ create((GtkContainerPeer) awtComponent.getParent().getPeer(),
+ ((FileDialog) awtComponent).getMode());
FileDialog fd = (FileDialog) awtComponent;
@@ -87,10 +89,10 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
{
int[] dims = new int[2];
gtkWidgetGetPreferredDimensions (dims);
- ((GtkFileDialogPeer) this).setBoundsCallback ((Window) awtComponent,
- awtComponent.getX (),
- awtComponent.getY (),
- dims[0], dims[1]);
+
+ if (dims[0] != awtComponent.getWidth()
+ || dims[1] != awtComponent.getHeight())
+ awtComponent.setSize(dims[0], dims[1]);
}
super.setComponentBounds ();
}
@@ -155,6 +157,7 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
GtkFileFilterInfo object and send it to this method, which will
in turn call the filter's accept() method and give back the return
value. */
+ // called back by native side: filename_filter_cb
boolean filenameFilterCallback (String fullname) {
String filename = fullname.substring(fullname.lastIndexOf(FS) + 1);
String dirname = fullname.substring(0, fullname.lastIndexOf(FS));
@@ -167,20 +170,25 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
// GtkFileDialog will repaint by itself
return null;
}
-
+
+ // called back by native side: handle_response_cb
+ // only called from the GTK thread
void gtkHideFileDialog ()
{
+ // hide calls back the peer's setVisible method, so locking is a
+ // problem.
((Dialog) awtComponent).hide();
}
+ // called back by native side: handle_response_cb
void gtkDisposeFileDialog ()
{
((Dialog) awtComponent).dispose();
}
- /* Callback to set the file and directory values when the user is finished
- * with the dialog.
- */
+ // Callback to set the file and directory values when the user is finished
+ // with the dialog.
+ // called back by native side: handle_response_cb
void gtkSetFilename (String fileName)
{
FileDialog fd = (FileDialog) awtWidget;
OpenPOWER on IntegriCloud