/[classpath]/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17.2.5 by gnu_andrew, Tue Aug 2 20:12:09 2005 UTC revision 1.17.2.6 by gnu_andrew, Sat Sep 10 15:31:37 2005 UTC
# Line 42  import java.awt.Dialog; Line 42  import java.awt.Dialog;
42  import java.awt.FileDialog;  import java.awt.FileDialog;
43  import java.awt.Graphics;  import java.awt.Graphics;
44  import java.awt.Window;  import java.awt.Window;
45    import java.awt.event.ComponentEvent;
46  import java.awt.peer.FileDialogPeer;  import java.awt.peer.FileDialogPeer;
47  import java.io.File;  import java.io.File;
48  import java.io.FilenameFilter;  import java.io.FilenameFilter;
# Line 54  public class GtkFileDialogPeer extends G Line 55  public class GtkFileDialogPeer extends G
55    private String currentDirectory = null;    private String currentDirectory = null;
56    private FilenameFilter filter;    private FilenameFilter filter;
57    
58    native void create (GtkContainerPeer parent);    native void create (GtkContainerPeer parent, int mode);
59    native void connectSignals ();    native void connectSignals ();
60    native void nativeSetFile (String file);    native void nativeSetFile (String file);
61    public native String nativeGetDirectory();    public native String nativeGetDirectory();
# Line 63  public class GtkFileDialogPeer extends G Line 64  public class GtkFileDialogPeer extends G
64    
65    public void create()    public void create()
66    {    {
67      create((GtkContainerPeer) awtComponent.getParent().getPeer());      create((GtkContainerPeer) awtComponent.getParent().getPeer(),
68               ((FileDialog) awtComponent).getMode());
69    
70      FileDialog fd = (FileDialog) awtComponent;      FileDialog fd = (FileDialog) awtComponent;
71    
# Line 87  public class GtkFileDialogPeer extends G Line 89  public class GtkFileDialogPeer extends G
89        {        {
90          int[] dims = new int[2];          int[] dims = new int[2];
91          gtkWidgetGetPreferredDimensions (dims);          gtkWidgetGetPreferredDimensions (dims);
92          ((GtkFileDialogPeer) this).setBoundsCallback ((Window) awtComponent,  
93                                                        awtComponent.getX (),          if (dims[0] != awtComponent.getWidth()
94                                                        awtComponent.getY (),              || dims[1] != awtComponent.getHeight())
95                                                        dims[0], dims[1]);            awtComponent.setSize(dims[0], dims[1]);
96        }        }
97      super.setComponentBounds ();      super.setComponentBounds ();
98    }    }
# Line 155  public class GtkFileDialogPeer extends G Line 157  public class GtkFileDialogPeer extends G
157       GtkFileFilterInfo object and send it to this method, which will       GtkFileFilterInfo object and send it to this method, which will
158       in turn call the filter's accept() method and give back the return       in turn call the filter's accept() method and give back the return
159       value. */       value. */
160      // called back by native side: filename_filter_cb
161    boolean filenameFilterCallback (String fullname) {    boolean filenameFilterCallback (String fullname) {
162      String filename = fullname.substring(fullname.lastIndexOf(FS) + 1);      String filename = fullname.substring(fullname.lastIndexOf(FS) + 1);
163      String dirname = fullname.substring(0, fullname.lastIndexOf(FS));      String dirname = fullname.substring(0, fullname.lastIndexOf(FS));
# Line 167  public class GtkFileDialogPeer extends G Line 170  public class GtkFileDialogPeer extends G
170      // GtkFileDialog will repaint by itself      // GtkFileDialog will repaint by itself
171      return null;      return null;
172    }    }
173      
174      // called back by native side: handle_response_cb
175      // only called from the GTK thread
176    void gtkHideFileDialog ()    void gtkHideFileDialog ()
177    {    {
178        // hide calls back the peer's setVisible method, so locking is a
179        // problem.
180      ((Dialog) awtComponent).hide();      ((Dialog) awtComponent).hide();
181    }    }
182        
183      // called back by native side: handle_response_cb
184    void gtkDisposeFileDialog ()    void gtkDisposeFileDialog ()
185    {    {
186      ((Dialog) awtComponent).dispose();      ((Dialog) awtComponent).dispose();
187    }    }
188    
189    /* Callback to set the file and directory values when the user is finished    // Callback to set the file and directory values when the user is finished
190     * with the dialog.    // with the dialog.
191     */    // called back by native side: handle_response_cb
192    void gtkSetFilename (String fileName)    void gtkSetFilename (String fileName)
193    {    {
194      FileDialog fd = (FileDialog) awtWidget;      FileDialog fd = (FileDialog) awtWidget;

Legend:
Removed from v.1.17.2.5  
changed lines
  Added in v.1.17.2.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26