From tchemit@users.nuiton.org Fri Mar 8 20:07:19 2013 From: tchemit@users.nuiton.org To: jaxx-commits@list.nuiton.org Subject: [Jaxx-commits] r2600 - trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor Date: Fri, 08 Mar 2013 20:07:19 +0100 Message-ID: <20130308190719.4A31C15960@nuiton.codelutin.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6912636982164922275==" --===============6912636982164922275== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: tchemit Date: 2013-03-08 20:07:19 +0100 (Fri, 08 Mar 2013) New Revision: 2600 Url: http://nuiton.org/projects/jaxx/repository/revisions/2600 Log: fixes #2578: When invoking fileEditor from a dialog with alwaysOnTopdoes not = display in top Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEditor.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEditorHandl= er.java Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEdit= or.jaxx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEditor.jax= x 2013-03-08 09:50:19 UTC (rev 2599) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEditor.jax= x 2013-03-08 19:07:19 UTC (rev 2600) @@ -23,9 +23,12 @@ --> - java.io.File jaxx.runtime.swing.BaseActionPanel + org.apache.commons.lang3.StringUtils + + javax.swing.JDialog + java.io.File =20 @@ -45,31 +48,35 @@ =20 =20 - */ +/** @author sletellier */ public class FileEditorHandler { =20 public static final String SEPARATOR_REGEX =3D "\\s*,\\s*"; + public static File lastSelectedPath; =20 protected FileEditor view; =20 + /** + * To set the dialog (see http://nuiton.org/issues/2578). + * + * @since 2.5.12 + */ + protected JDialog dialogOwner; + public FileEditorHandler(FileEditor view) { this.view =3D view; if (lastSelectedPath =3D=3D null) { @@ -117,7 +125,15 @@ } =20 // show dialog + // see http://nuiton.org/issues/2578 + boolean hackDialog =3D dialogOwner !=3D null && dialogOwner.isAlways= OnTop(); + if (hackDialog) { + dialogOwner.setAlwaysOnTop(false); + } int returnVal =3D fc.showOpenDialog(view); + if (hackDialog) { + dialogOwner.setAlwaysOnTop(true); + } if (returnVal =3D=3D JFileChooser.APPROVE_OPTION) { =20 // get selected to display in ui @@ -143,6 +159,10 @@ } } =20 + protected void setDialogOwner(JDialog dialogOwner) { + this.dialogOwner =3D dialogOwner; + } + public static class ExtentionFileFiler extends FileFilter { protected String ext; protected String desciption; --===============6912636982164922275==--