You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by "Roger L. Whitcomb" <Ro...@ingres.com> on 2011/08/13 02:34:31 UTC

Rough equivalent of Swing JOptionPane.showConfirmDialog

I'm trying to ask a simple "Yes" or "No" question of the user (in
response to trying to close a window), but I need to know the answer
synchronously in order to know whether to close the window or not.  So,
in Windows and Swing there is a synchronous dialog that itself does the
message pump and so it can return when the user clicks the button.  Now,
I don't see anything like that in Pivot, so I'm wondering how one would
implement such a thing?  Thanks.

 

 

 

Roger Whitcomb

Architect, Engineering

Ingres Corporation

roger.whitcomb@ingres.com <ma...@ingres.com> 

 

PHONE +1 650.587.5596

FAX +1 650.587.5550

 

www.ingres.com <http://www.ingres.com/>  

 

This transmission is confidential and intended solely for the use of the
recipient named above. It may contain confidential, proprietary, or
legally privileged information. If you are not the intended recipient,
you are hereby notified that any unauthorized review, use, disclosure or
distribution is strictly prohibited. If you have received this
transmission in error, please contact the sender by reply e-mail and
delete the original transmission and all copies from your system.

 


RE: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Thanks, Chris.  Yes, that's essentially what I was coming to after looking through the window closing stuff.

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com | Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA  +1 650-587-5596 | fax: +1 650-587-5550

-----Original Message-----
From: Chris Bartlett [mailto:cbartlett.x@gmail.com] 
Sent: Friday, August 12, 2011 8:31 PM
To: user@pivot.apache.org
Subject: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

I am not aware of anything like that in Pivot.

What kind of window is being closed to trigger the yes/no dialog?  Are
you talking about a Pivot Window, or maybe a native OS window
(java.awt.Window/java.awt.Frame)?
http://pivot.apache.org/tutorials/windows.html


Here are a couple of old threads that might be useful in the mean time.

Various window listeners
http://apache-pivot-users.399431.n3.nabble.com/Alert-opened-and-the-rest-of-code-keep-going-td2841188.html

Custom Dialog close logic
http://apache-pivot-users.399431.n3.nabble.com/Dialog-Example-td2397810.html#a2399679


It sounds like you probably need to ensure that the window being
closed (which triggers the confirmation dialog) does not get closed
unless a custom flag has been set.  This would be done in some sort of
previewXXX method which would veto the close until the user has
confirmed their intent.
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/WindowStateListener.html#previewWindowClose(org.apache.pivot.wtk.Window)

Then your confirmation might set the flag that *does* permit closing
(assuming that option was selected), and then explicitly request the
shutdown of the primary window, which should now work because the flag
was set.

Chris

On 13 August 2011 07:34, Roger L. Whitcomb <Ro...@ingres.com> wrote:
> I'm trying to ask a simple "Yes" or "No" question of the user (in response
> to trying to close a window), but I need to know the answer synchronously in
> order to know whether to close the window or not.  So, in Windows and Swing
> there is a synchronous dialog that itself does the message pump and so it
> can return when the user clicks the button.  Now, I don't see anything like
> that in Pivot, so I'm wondering how one would implement such a thing?
> Thanks.
>
>
>
>
>
>
>
> Roger Whitcomb
>
> Architect, Engineering
>
> Ingres Corporation
>
> roger.whitcomb@ingres.com
>
>
>
> PHONE +1 650.587.5596
>
> FAX +1 650.587.5550
>
>
>
> www.ingres.com
>
>
>
> This transmission is confidential and intended solely for the use of the
> recipient named above. It may contain confidential, proprietary, or legally
> privileged information. If you are not the intended recipient, you are
> hereby notified that any unauthorized review, use, disclosure or
> distribution is strictly prohibited. If you have received this transmission
> in error, please contact the sender by reply e-mail and delete the original
> transmission and all copies from your system.
>
>

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Chris Bartlett <cb...@gmail.com>.
I am not aware of anything like that in Pivot.

What kind of window is being closed to trigger the yes/no dialog?  Are
you talking about a Pivot Window, or maybe a native OS window
(java.awt.Window/java.awt.Frame)?
http://pivot.apache.org/tutorials/windows.html


Here are a couple of old threads that might be useful in the mean time.

Various window listeners
http://apache-pivot-users.399431.n3.nabble.com/Alert-opened-and-the-rest-of-code-keep-going-td2841188.html

Custom Dialog close logic
http://apache-pivot-users.399431.n3.nabble.com/Dialog-Example-td2397810.html#a2399679


It sounds like you probably need to ensure that the window being
closed (which triggers the confirmation dialog) does not get closed
unless a custom flag has been set.  This would be done in some sort of
previewXXX method which would veto the close until the user has
confirmed their intent.
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/WindowStateListener.html#previewWindowClose(org.apache.pivot.wtk.Window)

Then your confirmation might set the flag that *does* permit closing
(assuming that option was selected), and then explicitly request the
shutdown of the primary window, which should now work because the flag
was set.

Chris

On 13 August 2011 07:34, Roger L. Whitcomb <Ro...@ingres.com> wrote:
> I’m trying to ask a simple “Yes” or “No” question of the user (in response
> to trying to close a window), but I need to know the answer synchronously in
> order to know whether to close the window or not.  So, in Windows and Swing
> there is a synchronous dialog that itself does the message pump and so it
> can return when the user clicks the button.  Now, I don’t see anything like
> that in Pivot, so I’m wondering how one would implement such a thing?
> Thanks.
>
>
>
>
>
>
>
> Roger Whitcomb
>
> Architect, Engineering
>
> Ingres Corporation
>
> roger.whitcomb@ingres.com
>
>
>
> PHONE +1 650.587.5596
>
> FAX +1 650.587.5550
>
>
>
> www.ingres.com
>
>
>
> This transmission is confidential and intended solely for the use of the
> recipient named above. It may contain confidential, proprietary, or legally
> privileged information. If you are not the intended recipient, you are
> hereby notified that any unauthorized review, use, disclosure or
> distribution is strictly prohibited. If you have received this transmission
> in error, please contact the sender by reply e-mail and delete the original
> transmission and all copies from your system.
>
>

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Chris Bartlett <cb...@gmail.com>.
(To anyone reading) Please feel free to add feature requests such as
this to the Pivot issue tracking system.
https://issues.apache.org/jira/browse/PIVOT

Issues can be voted on and 'watched', which can help to gauge the
level of interest in a feature, and they are also searchable of
course.
http://confluence.atlassian.com/display/JIRA043/Watching+and+Voting+on+an+Issue

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by guretzki <Th...@tik.info>.
Hi all,

now I've added another part to pivot-contrib - the BXMLBrowser.
It's a tool a colleague and I have written to be able to immediately test
changes in any .bxml file
*or the classes used therein*. The latter is achieved by a special
ClassLoader with the ability
to reload. You can find out more at the new Wiki page: 
http://code.google.com/a/apache-extras.org/p/pivot-contrib/wiki/GuretzkiFeatures
As always, I'm interested in feedback.

There's a small improvement in BlockingDialog, too: the Dialog receives
keyboard focus automatically.

>For the change in pivot-contrib, go forward ... and if you want even to
delete the tag, and re-tag (and re-generate jars, and in this case could be
useful even to add a -version suffix), or if you want a 1.0.1 release ....
as you prefer.
>Tell me, so I can update the home page ...
I've decided to go with the policy recommended by google and have uploaded
another set of jars as release 1.1. I still have to do the tagging, though
:-(

Bye,
Thomas


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3336741.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Sandro Martini <sa...@gmail.com>.
Hi Thomas, 
thanks for all your contributions :-) , and for the ticket too.
I have assigned to me, for the 2.1 release, the attach seem Ok, etc.
So now we have to see what other developers say on this.

>Speaking of Apache Extras: is there a good way to make javadoc available to
the casual visitor? 
>I think it would be great to have links to the javadoc of all main utility
classes.
Yes, you could create a javadoc jar (like what we do for maven-like jars)
... maybe by hand, but probably it's simpler from a build tool like Ant, for
example see Pivot main build file.
Tell me if you need some help ... I'm sorry but I haven't time in these
weeks to fix it (I have some things on Pivot to fix).

>And one other thing: do you consider it appropriate to continue this
release-related discussion in this thread?
Yes, it would be better to move to the developers list (and start a new
thread), but don't worry ...


For the change in pivot-contrib, go forward ... and if you want even to
delete the tag, and re-tag (and re-generate jars, and in this case could be
useful even to add a -version suffix), or if you want a 1.0.1 release ....
as you prefer. 
Tell me, so I can update the home page ...


Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3330225.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by guretzki <Th...@tik.info>.
Hi Sandro,

thanks for the support!

Tagging was no problem. I've also created the JIRA ticket. Couldn't assign
it to you, though. Maybe you can "grab" it yourself: the id is PIVOT-794.

I've also integrated an improvement: the content of the BlockingDialog now
receives keyboard focus upon opening. That's not yet in the Apache Extras
jar, however.

Speaking of Apache Extras: is there a good way to make javadoc available to
the casual visitor? I think it would be great to have links to the javadoc
of all main utility classes.

And one other thing: do you consider it appropriate to continue this
release-related discussion in this thread?

Best regards

Thomas


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3329597.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Sandro Martini <sa...@gmail.com>.
Hi Thomas,
just created a workspace for pivot-contrib, to be aligned with you.

After a quick analysis with FindBugs (really useful/powerful), I have
just committed a small fix to remove two warnings from it (small
things).

I tried to run the Tets application, and all is really blocked until
the dialog box is closed (even the main window), very good.
Just put the "featured" label in the binary download so it will be
visible in Pivot-contrib Home Page.

If you want to try to tag it in svn as pivot-contrib-guretzki-1.0 ...
so we can see if yuou have enough privileges, otherwise tell me and
I'll do it.


And last, can I ask to you (another) thing:
log into our JIRA and create an issue for the 2.1 release (maybe
assigned to me) to ask to make some little changes to Pivot classes to
better integrate pivot-contrib/guretzki , or (if you want, even ask
to) integrate it inside Pivot 2.1 (with related sources in attach
inside a zip, and flag the grant for use in ASF derived work) ... so
we can say what others say ?
You can write that you have already spoken with me, no problem.
I expect that at least for Pivot 2.1 we can make changes to simplify
it ... and JIRA is a way for us to not forget it.
And don't worry, one time created I can change anything if something :-) .


Thank you in the meantime.
Bye

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Sandro Martini <sa...@gmail.com>.
Hi,
what can I say ... great work :-) .

If you want, you can tag the pivot-contrib-guretzki.jar with the "featured"
download, so it will be visible even in the pivot-contrib home page.
Then, the best could be even to add the apache license at the beginning of
any java source file, but it's a small thing ... as a sample you can see any
Pivot source file (even bxml and json files).

After it, we can even tag this as pivot-contrib-guretzki-1.0 in svn ... I
think you should have enough privileges, otherwise tell me and I'll do it.


In your eclipse, have you the FindBugs plugin installed ?
It's very useful ... for example to do some analysis on sources ...
generally speaking.


If you have other things to publish, verify if put under the same guretzki
project, or if make another ... and I'm sure you have others :-) .


If there aren't objections from other developers, next week I could post a
link to this in the News area of Pivot web site.

Good week-end even to you.

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3323107.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by guretzki <Th...@tik.info>.
Hi Sandro,

I've done all that. Take a look at it, if you like.

Have a nice weekend

Thomas


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3322994.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Sandro Martini <sa...@gmail.com>.
Hi Thomas,
after a (very) quick look, the project seem Ok ... but is it Ok for you if
you (or me) to make a change in packages there, to have
pivot_contrib.guretzki (or other, doesn't matter) ?
And add the Apache license on top of any source (as we do in Pivot, even in
json and bxml resources) ?

And last, in root of the guretzki project, add a BUILD (for example saying
how to resolve dependencies) and/or a README file to say what are contents
... and last, add under downloads of pivot-contrib a
pivot-contrib-guretzki.jar (compiled without debug info).

Or I can do it ... tell me what you prefer.

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3322792.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by guretzki <Th...@tik.info>.
Hi all,

as discussed, I have uploaded the classes into Apache Extras, usable under
http://svn.codespot.com/a/apache-extras.org/pivot-contrib/trunk/guretzki
http://svn.codespot.com/a/apache-extras.org/pivot-contrib/trunk/guretzki 
(Contains Eclipse project data, too)

Hope I find the time to let more code follow...

Cheers

Thomas



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3322535.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Sandro Martini <sa...@gmail.com>.
Hi,

>That’s a good suggestion. For the time being, I would like to put it into
Pivot Contrib. Could you add me as commiter there?
Yes, I need only your GMail account name.
If you want, you can send a private mail directly to me.

>Can I then use the same subversion access as for read only? If no, how do I
access it?
On Apache-Extras if you use the http version you are in read-only mode, but
for full access you have to use HTTPS, so for example your url will be:
https://svn.codespot.com/a/apache-extras.org/pivot-contrib/trunk/
and if you want (but I highly recommend it), get even (in read-only) some
code from here:
http://svn.codespot.com/a/apache-extras.org/pivot-common/trunk/
currently there are a (near-empty) project for common code to share on all
our Apache-Extras projects, and a project containing all Pivot dependencies
(with all 2.0 jars, standard, signed and not, javadoc, and even the pack200
version) ... and this will be updated soon with all 2.0.1 resources.
Note that pivot2-dependencies, you can even download it from here:
http://code.google.com/a/apache-extras.org/p/pivot-common/downloads/list
and unzip in your workspace.

Otherwise you could get Pivot dependencies via Maven, it depends on you, but
first way is simpler.

For startup, take a look at the code (some experiments by me) under
pivot-stuff here: 
http://code.google.com/a/apache-extras.org/p/pivot-stuff/source/browse/#svn%2Ftrunk
for project dependencies, package naming, etc ... just as suggestion.



>I would like to publish that as a separate google code project named
something like pivot-miglayout. 
>Any suggestion as to my first steps there?
I think should be enough to go here (
http://code.google.com/a/apache-extras.org/hosting/ ) and create
pivot-miglayout as a new project, but I don't know if it's restricted to
only Apache users ... so it's simple to try and seen what happens :-) .
Then I suggest to use Subversion and the Apache License (requested during
project creation).
After this you should be Ok.
Then, if it's useful you can reuse the pivot2-dependencies from pivot-common
(or at least write somewhere in your pages) that it's needed for your
project to build, or maybe simply copy the zip and use in your workspace.
When you'll have something working tell us, I'll be happy to write a post
even in our web site (I have many other news to write there, but time is
limited).


>Thanks for your feedback, it really encourages me publishing some code.
Good, and I hope to be able to help you even with other Pivot-related things
:-) .


Have a good day.

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3319586.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

AW: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by guretzki <Th...@tik.info>.
Hi Sandro,

Thanks for pointing me to the google code query.

> But in the meantime we could add it in one of our Apache-Extras, to be compatible even with 2.0.x if wanted ...
That's a good suggestion. For the time being, I would like to put it into Pivot Contrib. Could you add me as commiter there?
Can I then use the same subversion access as for read only? If no, how do I access it?
And concerning content: as the project is currently empty: do you have some package structure in mind?

Of my other projects, the MigLayout integration is the most mature. I would like to publish that as a separate google code project
named something like pivot-miglayout. Any suggestion as to my first steps there?

> An important thing to note is even the compatibility of licenses between our code (all under the Apache 2 License) and required dependencies. so as a general rule under Apache-Extras we have a little less restrictions ...
Thanks for that. As MigLayout is published under both GPL and BSD licenses, I think it should even be possible to integrate the BSD variant into Pivot. But that's probably still a long way off.

Thanks for your feedback, it really encourages me publishing some code.

Best regards

Thomas



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3319448.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Sandro Martini <sa...@gmail.com>.
Hi Thomas,

>This is one of many pieces of code I have written that would IMHO be useful
as an integral part of pivot.
I'm sure many of us have useful code, and this is a right spirit for Open
Source development (and not only open source debug as many times I see
anywhere), I'm very happy for this :-) .

>to integrate this one would be the DesktopApplicationContext class, I think
(that way, we could avoid duplicating the code for DesktopDisplayHost and
HostDialog)
For me there aren't problems to integrate inside DesktopApplicationContext
(duplicating code is never good), but we have to see what others (Greg for
example) say on this.

>Best to wait after the 2.0.1 release, isn’t it
Yes, it will be safer.
But in the meantime we could add it in one of our Apache-Extras, to be
compatible even with 2.0.x if wanted ...


>Apart from all that, I have also some code exceeding the (as I understand
it) intended scope of Pivot. Mainly, this is about integrations with
MigLayout,  the spring framework and JPA. 
Yes, this is interesting, surely.
An important thing to note is even the compatibility of licenses between our
code (all under the Apache 2 License) and required dependencies. so as a
general rule under Apache-Extras we have a little less restrictions ...
For big dependencies I prefer to use Maven but it's only a personal taste (a
standard project is Ok the same) ... what do you think ?

>I could imagine sharing that, too, probably best as part of the Apache
Extras projects. 
Good I have some code that has not been included in Pivot, if only I could
have enough time ... but I have to put it somewhere under Apache-Extras too.

>Is there some overview of those projects somewhere?
No, I have created them mainly for "Usage", you can find all them with this
query:
http://code.google.com/a/apache-extras.org/hosting/search?q=label%3aPivot
there are some comments, but at the moment no wiki docs etc (no time for it
until now).
Choose what you like and tell me ... I think that pivot-contrib and
pivot-extras could be enough for the beginning, and maybe pivot-common if
there are some features useful to all pivot-related projects here.

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3319266.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

AW: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by guretzki <Th...@tik.info>.
Hi Sandro,

thanks for your quick comment. This is one of many pieces of code I have written that would IMHO be useful as an integral part of pivot.
Best place to integrate this one would be the DesktopApplicationContext class, I think (that way, we could avoid duplicating the code
for DesktopDisplayHost and HostDialog). If you think otherwise, then I would indeed like to have access to those both classes from
outside of DesktopApplicationContext, e. g. by making them protected (not ideal) or package access. Or by taking them out of
DesktopApplicationContext altogether.
Let's agree on a strategy here, then I can implement it against trunk and send you a patch together with the grant for usage in ASF derived work. Best to wait after the 2.0.1 release, isn't it?

Apart from all that, I have also some code exceeding the (as I understand it) intended scope of Pivot. Mainly, this is about integrations with MigLayout,  the spring framework and JPA. I could imagine sharing that, too, probably best as part of the Apache Extras projects. Is there some overview of those projects somewhere?

Best regards

Thomas


------------------------------------------------------------
Thomas Guretzki
Telefon +49 511 7631 334; Fax +49 511 7631 718
T.I.K. GmbH - Datenbankadministration & Softwareentwicklung
Königsworther Platz 6    30167 Hannover     Germany
Steuer-Nr. 2520601056
Geschäftsführer: Dr. Rainer Koch, Sitz: Hannover
Registereintrag: HRB 58144, Amtsgericht Hannover


________________________________
Von: Sandro Martini [via Apache Pivot - Users] [mailto:ml-node+3319073-526669658-236352@n3.nabble.com]
Gesendet: Donnerstag, 8. September 2011 10:57
An: Thomas Guretzki
Betreff: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Hi all,
many thanks to Thomas for the contribution here ...

>@developers: would you consider making the internal classes of DesktopApplicationContext public or at least protected?
Yes, to me seem that put required stuff protected is Ok, if there aren't objections from others I'll do it.
Please, can you tell me exactly what you need (or is it enough to try to build your code) ?

Note that we are freezing the 2.0.1 release, so this change will be visible for 2.1 release (I can commit all changes in trunk, but just after the final freeze of 2.0.1), I hope this is not a problem for you.

And last, are you interested to share your code with us ?
We could put it in Pivot, but in this case (and if there aren't objections from others of course) you should put all the stuff in a zip, and attach in a new JIRA ticket (and important, grant for usage in ASF derived work), otherwise we can't use it.
Or as an alternative solution, I could add you as committer in one of our Apache-Extras projects (for example this http://code.google.com/a/apache-extras.org/p/pivot-contrib/ , but we have others ...) so you can directly create a subproject and put/publish there ... but in this case this will not be included in core Pivot.

Comments ?

Bye,
Sandro

________________________________
If you reply to this email, your message will be added to the discussion below:
http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3319073.html
To unsubscribe from Rough equivalent of Swing JOptionPane.showConfirmDialog, click here<http://apache-pivot-users.399431.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3250719&code=VGhvbWFzLkd1cmV0emtpQHRpay5pbmZvfDMyNTA3MTl8LTk2Nzg4MjMzMQ==>.


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3319225.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Sandro Martini <sa...@gmail.com>.
Hi all,
many thanks to Thomas for the contribution here ...

>@developers: would you consider making the internal classes of
DesktopApplicationContext public or at least protected?
Yes, to me seem that put required stuff protected is Ok, if there aren't
objections from others I'll do it.
Please, can you tell me exactly what you need (or is it enough to try to
build your code) ?

Note that we are freezing the 2.0.1 release, so this change will be visible
for 2.1 release (I can commit all changes in trunk, but just after the final
freeze of 2.0.1), I hope this is not a problem for you.

And last, are you interested to share your code with us ?
We could put it in Pivot, but in this case (and if there aren't objections
from others of course) you should put all the stuff in a zip, and attach in
a new JIRA ticket (and important, grant for usage in ASF derived work),
otherwise we can't use it.
Or as an alternative solution, I could add you as committer in one of our
Apache-Extras projects (for example this
http://code.google.com/a/apache-extras.org/p/pivot-contrib/ , but we have
others ...) so you can directly create a subproject and put/publish there
... but in this case this will not be included in core Pivot.

Comments ?

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3319073.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Clint Gilbert <cl...@hms.harvard.edu>.
Awesome, I can't wait to try it out!

On 09/07/2011 04:56 AM, guretzki wrote:
> Hi all,
> I've hammered together something that does the trick for me; see attached
> files.
> Swing is NOT referenced.
> If you find it useful or would like to have something changed or need
> directions,
> please let me know.
> @developers: would you consider making the internal classes of
> DesktopApplicationContext public or at least protected?
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/BlockingDialog.java
> BlockingDialog.java 
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/DesktopDisplayHost.java
> DesktopDisplayHost.java 
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/HostDialog.java
> HostDialog.java 
> As an example:
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/BlockingDialogTest.java
> BlockingDialogTest.java 
>
> Regards
>
> Thomas
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3316061.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Clint Gilbert <cl...@hms.harvard.edu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I just tested out your code and can confirm that it works.  Thanks very
much, it's a huge help!

On 09/07/2011 04:56 AM, guretzki wrote:
> Hi all,
> I've hammered together something that does the trick for me; see attached
> files.
> Swing is NOT referenced.
> If you find it useful or would like to have something changed or need
> directions,
> please let me know.
> @developers: would you consider making the internal classes of
> DesktopApplicationContext public or at least protected?
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/BlockingDialog.java
> BlockingDialog.java 
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/DesktopDisplayHost.java
> DesktopDisplayHost.java 
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/HostDialog.java
> HostDialog.java 
> As an example:
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/BlockingDialogTest.java
> BlockingDialogTest.java 
> 
> Regards
> 
> Thomas
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3316061.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk5oDTwACgkQ0GFaTS4nYxu66ACgj0kz6AmU4lNWoXPJmwg8FgjJ
Oc8AoLxe0FYByAYSewabY55s3Vo4Vf2w
=A/Iv
-----END PGP SIGNATURE-----

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by guretzki <Th...@tik.info>.
Hi all,
I've hammered together something that does the trick for me; see attached
files.
Swing is NOT referenced.
If you find it useful or would like to have something changed or need
directions,
please let me know.
@developers: would you consider making the internal classes of
DesktopApplicationContext public or at least protected?
http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/BlockingDialog.java
BlockingDialog.java 
http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/DesktopDisplayHost.java
DesktopDisplayHost.java 
http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/HostDialog.java
HostDialog.java 
As an example:
http://apache-pivot-users.399431.n3.nabble.com/file/n3316061/BlockingDialogTest.java
BlockingDialogTest.java 

Regards

Thomas

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Rough-equivalent-of-Swing-JOptionPane-showConfirmDialog-tp3250719p3316061.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Greg Brown <gk...@verizon.net>.
Yes. You might be able to do something along the lines of DesktopApplicationContext#createDisplay().

On Aug 16, 2011, at 3:38 PM, Roger L. Whitcomb wrote:

> Is it possible to piggy back on top of JDialog and just put Pivot
> widgets on an otherwise blank pane?
> 
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
> 
> -----Original Message-----
> From: Greg Brown [mailto:gk_brown@verizon.net] 
> Sent: Tuesday, August 16, 2011 12:31 PM
> To: user@pivot.apache.org
> Subject: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog
> 
>> Sorry, my use of "blocking" was not intended to be technically
> accurate.
>> Of course, it has to keep pumping the event loop, which is what makes
> it
>> so tricky.  Actually, the tricky code seems to be in java.awt.Dialog
>> where the modal event loop lives.
> 
> Right, that's what I would have guessed.
> 
> But in any case, this sort of behavior would require access to the
> native event queue, which AWT does not provide (and I'm not sure should
> be exposed anyway).
> 
> G
> 


Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Clint Gilbert <cl...@hms.harvard.edu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roger, if you get this working, please post about it here.  I'd love to
hear about how you did it, and perhaps others will too.

On 08/16/2011 03:38 PM, Roger L. Whitcomb wrote:
> Is it possible to piggy back on top of JDialog and just put Pivot
> widgets on an otherwise blank pane?
> 
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
> 
> -----Original Message-----
> From: Greg Brown [mailto:gk_brown@verizon.net] 
> Sent: Tuesday, August 16, 2011 12:31 PM
> To: user@pivot.apache.org
> Subject: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog
> 
>> Sorry, my use of "blocking" was not intended to be technically
> accurate.
>> Of course, it has to keep pumping the event loop, which is what makes
> it
>> so tricky.  Actually, the tricky code seems to be in java.awt.Dialog
>> where the modal event loop lives.
> 
> Right, that's what I would have guessed.
> 
> But in any case, this sort of behavior would require access to the
> native event queue, which AWT does not provide (and I'm not sure should
> be exposed anyway).
> 
> G
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5MEkEACgkQ5IyIbnMUeTuBwQCeJGc9ATaPrdnzp3V21OXwrErX
B/cAnRYNtKVZ1IomB6HVLH1eg887iAFm
=Q1Ap
-----END PGP SIGNATURE-----

RE: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Is it possible to piggy back on top of JDialog and just put Pivot
widgets on an otherwise blank pane?

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA  +1 650-587-5596 | fax: +1 650-587-5550

-----Original Message-----
From: Greg Brown [mailto:gk_brown@verizon.net] 
Sent: Tuesday, August 16, 2011 12:31 PM
To: user@pivot.apache.org
Subject: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

> Sorry, my use of "blocking" was not intended to be technically
accurate.
> Of course, it has to keep pumping the event loop, which is what makes
it
> so tricky.  Actually, the tricky code seems to be in java.awt.Dialog
> where the modal event loop lives.

Right, that's what I would have guessed.

But in any case, this sort of behavior would require access to the
native event queue, which AWT does not provide (and I'm not sure should
be exposed anyway).

G


Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Greg Brown <gk...@verizon.net>.
> Sorry, my use of "blocking" was not intended to be technically accurate.
> Of course, it has to keep pumping the event loop, which is what makes it
> so tricky.  Actually, the tricky code seems to be in java.awt.Dialog
> where the modal event loop lives.

Right, that's what I would have guessed.

But in any case, this sort of behavior would require access to the native event queue, which AWT does not provide (and I'm not sure should be exposed anyway).

G


RE: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Sorry, my use of "blocking" was not intended to be technically accurate.
Of course, it has to keep pumping the event loop, which is what makes it
so tricky.  Actually, the tricky code seems to be in java.awt.Dialog
where the modal event loop lives.

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA  +1 650-587-5596 | fax: +1 650-587-5550

-----Original Message-----
From: Greg Brown [mailto:gk_brown@verizon.net] 
Sent: Tuesday, August 16, 2011 11:18 AM
To: user@pivot.apache.org
Subject: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

OptionPane isn't the problem - this has to do with how low-level
windowing toolkit events are processed. These calls don't actually
"block" - they keep running, but they transfer execution to another
event polling loop that is run by the dialog. Without a "pull" model
like SWT or direct access to the native OS event queue, you just can't
get this type of behavior.

On Aug 16, 2011, at 2:07 PM, Roger L. Whitcomb wrote:

> I would say a blocking version of Alert.alert or Prompt.prompt would
be
> perfect for what I need.  And looking through the source of
JOptionPane,
> I would say this would be quite a mess to implement.
> 
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
> 
> -----Original Message-----
> From: Clint Gilbert [mailto:clint_gilbert@hms.harvard.edu] 
> Sent: Tuesday, August 16, 2011 10:58 AM
> To: user@pivot.apache.org
> Subject: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 08/16/2011 01:53 PM, Clint Gilbert wrote:
>> Yes, that's exactly what I was looking for.  Basically like
> Javascript's
>> alert(), but more general: I wanted to block while asking the user
for
>> more than just a boolean.
> 
> To be more clear, the more-general prompting was something I was
> planning on building myself, if I could make a blocking dialog
somehow;
> I wasn't necessarily looking for that from Pivot.
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk5Kr5UACgkQ5IyIbnMUeTv4lQCffz372vhR1Hgjhg3/LmWy9MfC
> VEIAn360190nU4MJv9PSunEQusOnbiag
> =DK/E
> -----END PGP SIGNATURE-----


Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Greg Brown <gk...@verizon.net>.
OptionPane isn't the problem - this has to do with how low-level windowing toolkit events are processed. These calls don't actually "block" - they keep running, but they transfer execution to another event polling loop that is run by the dialog. Without a "pull" model like SWT or direct access to the native OS event queue, you just can't get this type of behavior.

On Aug 16, 2011, at 2:07 PM, Roger L. Whitcomb wrote:

> I would say a blocking version of Alert.alert or Prompt.prompt would be
> perfect for what I need.  And looking through the source of JOptionPane,
> I would say this would be quite a mess to implement.
> 
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
> 
> -----Original Message-----
> From: Clint Gilbert [mailto:clint_gilbert@hms.harvard.edu] 
> Sent: Tuesday, August 16, 2011 10:58 AM
> To: user@pivot.apache.org
> Subject: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 08/16/2011 01:53 PM, Clint Gilbert wrote:
>> Yes, that's exactly what I was looking for.  Basically like
> Javascript's
>> alert(), but more general: I wanted to block while asking the user for
>> more than just a boolean.
> 
> To be more clear, the more-general prompting was something I was
> planning on building myself, if I could make a blocking dialog somehow;
> I wasn't necessarily looking for that from Pivot.
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk5Kr5UACgkQ5IyIbnMUeTv4lQCffz372vhR1Hgjhg3/LmWy9MfC
> VEIAn360190nU4MJv9PSunEQusOnbiag
> =DK/E
> -----END PGP SIGNATURE-----


RE: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
I would say a blocking version of Alert.alert or Prompt.prompt would be
perfect for what I need.  And looking through the source of JOptionPane,
I would say this would be quite a mess to implement.

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA  +1 650-587-5596 | fax: +1 650-587-5550

-----Original Message-----
From: Clint Gilbert [mailto:clint_gilbert@hms.harvard.edu] 
Sent: Tuesday, August 16, 2011 10:58 AM
To: user@pivot.apache.org
Subject: Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/16/2011 01:53 PM, Clint Gilbert wrote:
> Yes, that's exactly what I was looking for.  Basically like
Javascript's
> alert(), but more general: I wanted to block while asking the user for
> more than just a boolean.

To be more clear, the more-general prompting was something I was
planning on building myself, if I could make a blocking dialog somehow;
I wasn't necessarily looking for that from Pivot.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5Kr5UACgkQ5IyIbnMUeTv4lQCffz372vhR1Hgjhg3/LmWy9MfC
VEIAn360190nU4MJv9PSunEQusOnbiag
=DK/E
-----END PGP SIGNATURE-----

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Clint Gilbert <cl...@hms.harvard.edu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/16/2011 01:53 PM, Clint Gilbert wrote:
> Yes, that's exactly what I was looking for.  Basically like Javascript's
> alert(), but more general: I wanted to block while asking the user for
> more than just a boolean.

To be more clear, the more-general prompting was something I was
planning on building myself, if I could make a blocking dialog somehow;
I wasn't necessarily looking for that from Pivot.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5Kr5UACgkQ5IyIbnMUeTv4lQCffz372vhR1Hgjhg3/LmWy9MfC
VEIAn360190nU4MJv9PSunEQusOnbiag
=DK/E
-----END PGP SIGNATURE-----

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Clint Gilbert <cl...@hms.harvard.edu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/16/2011 02:26 AM, Chris Bartlett wrote:
> To clarify (although I'm not sure how relevant it might be), are you
> describing scenarios that always involve blocking/waiting for user
> input via some sort of Dialog/Window

Yes, that's exactly what I was looking for.  Basically like Javascript's
alert(), but more general: I wanted to block while asking the user for
more than just a boolean.

I was able to do this with SWT, but that API is about 1000 times uglier
and more verbose than Pivot.

Pivot's been fantastic for lots of other reasons, but my app has some
use cases where prompting synchronously would make things more
straightforward.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5KrqkACgkQ5IyIbnMUeTuasACfXly1xRlCX3fM0OwrTPap8S3g
+9MAn3XjiirsB/iM0soevlnWz4Uzcc7h
=gAXe
-----END PGP SIGNATURE-----

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Chris Bartlett <cb...@gmail.com>.
To clarify (although I'm not sure how relevant it might be), are you
describing scenarios that always involve blocking/waiting for user
input via some sort of Dialog/Window, or a more generic flow like
1) do something
2) block until *something else* happens (not just a choice of options
from a Dialog)
3) continue, most likely branching based on the 'result' from 2

On 16 August 2011 13:11, Clint Gilbert <cl...@hms.harvard.edu> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I don't have any terribly bright ideas, I'm afraid.  I wanted something
> like:
>
> user initiates some process
> some stuff happens, including:
> ask user a yes/no question
> if(answer == yes)
>  do one thing
> otherwise
>  do some other thing
>
> - - basically like Javascript alert()s, but this isn't possible.

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Clint Gilbert <cl...@hms.harvard.edu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't have any terribly bright ideas, I'm afraid.  I wanted something
like:

user initiates some process
some stuff happens, including:
ask user a yes/no question
if(answer == yes)
  do one thing
otherwise
  do some other thing

- - basically like Javascript alert()s, but this isn't possible.

So I went with callbacks all over.  In the above example, I'd use two
callbacks for each branch of the conditional.  My app is mostly written
in Scala, and I was able to use some of Scala's features to make the
syntactic burden of callbacks for flow control less onerous.  I'm no
guru, but I made some progress in this regard.

I did run into a bunch of situations where sibling widgets needed to
"communicate" with each other, but I didn't want them to have to know
about each other.  In these cases, an event bus (a pub/sub pattern,
basically) was helpful.  This nicely decoupled important parts of the
app, but this was not without cost:  Chaining callbacks to allow
operations to happen in sequence made the app's logic harder to reason
about, but using the event bus made this even more difficult, as it
required holding a lot more state in my head about what was emitting
what events and what was listening for them.

There are clever techniques like Functional Reactive Programming (
http://lamp.epfl.ch/~imaier/pub/DeprecatingObserversTR2010.pdf ) that
are potentially appealing, but I don't understand them well enough to
implement them yet.


On 08/16/2011 01:24 AM, Chris Bartlett wrote:
> Clint,
> 
> Would you mind sharing how you worked around the lack of a blocking
> Dialog?  Perhaps *something* could be included in Pivot to make it
> easier to work this way given there are equivalents in Swing & SWT,
> and the issue has come up on the mailing lists a few times.
> 
> This might be a use for a Glass Pane type Component within Pivot
> (which came up on the mailing list recently IIRC)
> http://download.oracle.com/javase/tutorial/uiswing/components/rootpane.html#glasspane
> 
> Combined with some host frame, window & focus management and a
> simplified/streamlined/hidden way of creating the listeners, this
> might not be particularly difficult to implement.  I have code that
> does a similar thing in a Pivot app with multiple host frames to show
> an ' app-wide modal' Dialog.
> 
> Chris
> 
> On 16 August 2011 07:21, Clint Gilbert <cl...@hms.harvard.edu> wrote:
> I asked more or less this question a ways back:
> 
> https://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> 
> The answer, sadly, is no.
> 
> My app - a game with a well-defined workflow - would have been much
> simpler to implement with blocking, synchronous dialogs, but I get the
> feeling apps like that are the minority.
> 
> On 08/12/2011 08:34 PM, Roger L. Whitcomb wrote:
>>>> Im trying to ask a simple Yes or No question of the user (in
>>>> response to trying to close a window), but I need to know the answer
>>>> synchronously in order to know whether to close the window or not.  So,
>>>> in Windows and Swing there is a synchronous dialog that itself does the
>>>> message pump and so it can return when the user clicks the button.  Now,
>>>> I dont see anything like that in Pivot, so Im wondering how one would
>>>> implement such a thing?  Thanks.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *Roger Whitcomb*
>>>>
>>>> Architect, Engineering
>>>>
>>>> *Ingres Corporation***
>>>>
>>>> roger.whitcomb@ingres.com <ma...@ingres.com>
>>>>
>>>>
>>>>
>>>> *PHONE*+1 650.587.5596
>>>>
>>>> *FAX*+1 650.587.5550
>>>>
>>>>
>>>>
>>>> *www.ingres.com* <http://www.ingres.com/>
>>>>
>>>>
>>>>
>>>> This transmission is confidential and intended solely for the use of the
>>>> recipient named above. It may contain confidential, proprietary, or
>>>> legally privileged information. If you are not the intended recipient,
>>>> you are hereby notified that any unauthorized review, use, disclosure or
>>>> distribution is strictly prohibited. If you have received this
>>>> transmission in error, please contact the sender by reply e-mail and
>>>> delete the original transmission and all copies from your system.
>>>>
>>>>
>>>>
> 
>>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk5KChAACgkQ0GFaTS4nYxudZgCgpUZy134A9FTlX9itWjap08gC
b9IAnjd5CymAxhSXLHtC+Cp9wrNGUM/k
=tzuo
-----END PGP SIGNATURE-----

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Chris Bartlett <cb...@gmail.com>.
Clint,

Would you mind sharing how you worked around the lack of a blocking
Dialog?  Perhaps *something* could be included in Pivot to make it
easier to work this way given there are equivalents in Swing & SWT,
and the issue has come up on the mailing lists a few times.

This might be a use for a Glass Pane type Component within Pivot
(which came up on the mailing list recently IIRC)
http://download.oracle.com/javase/tutorial/uiswing/components/rootpane.html#glasspane

Combined with some host frame, window & focus management and a
simplified/streamlined/hidden way of creating the listeners, this
might not be particularly difficult to implement.  I have code that
does a similar thing in a Pivot app with multiple host frames to show
an ' app-wide modal' Dialog.

Chris

On 16 August 2011 07:21, Clint Gilbert <cl...@hms.harvard.edu> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I asked more or less this question a ways back:
>
> https://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
>
> The answer, sadly, is no.
>
> My app - a game with a well-defined workflow - would have been much
> simpler to implement with blocking, synchronous dialogs, but I get the
> feeling apps like that are the minority.
>
> On 08/12/2011 08:34 PM, Roger L. Whitcomb wrote:
>> I’m trying to ask a simple “Yes” or “No” question of the user (in
>> response to trying to close a window), but I need to know the answer
>> synchronously in order to know whether to close the window or not.  So,
>> in Windows and Swing there is a synchronous dialog that itself does the
>> message pump and so it can return when the user clicks the button.  Now,
>> I don’t see anything like that in Pivot, so I’m wondering how one would
>> implement such a thing?  Thanks.
>>
>>
>>
>>
>>
>>
>>
>> *Roger Whitcomb*
>>
>> Architect, Engineering
>>
>> *Ingres Corporation***
>>
>> roger.whitcomb@ingres.com <ma...@ingres.com>
>>
>>
>>
>> *PHONE*+1 650.587.5596
>>
>> *FAX*+1 650.587.5550
>>
>>
>>
>> *www.ingres.com* <http://www.ingres.com/>
>>
>>
>>
>> This transmission is confidential and intended solely for the use of the
>> recipient named above. It may contain confidential, proprietary, or
>> legally privileged information. If you are not the intended recipient,
>> you are hereby notified that any unauthorized review, use, disclosure or
>> distribution is strictly prohibited. If you have received this
>> transmission in error, please contact the sender by reply e-mail and
>> delete the original transmission and all copies from your system.
>>
>>
>>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk5JuB8ACgkQ5IyIbnMUeTs3dACfWl9a8TxXWNGKgoY0PrtK6nLw
> lEYAnRe+ye7wo3iQZtDf3Kjq9OPfwkmR
> =Q8mQ
> -----END PGP SIGNATURE-----
>

Re: Rough equivalent of Swing JOptionPane.showConfirmDialog

Posted by Clint Gilbert <cl...@hms.harvard.edu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I asked more or less this question a ways back:

https://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E

The answer, sadly, is no.

My app - a game with a well-defined workflow - would have been much
simpler to implement with blocking, synchronous dialogs, but I get the
feeling apps like that are the minority.

On 08/12/2011 08:34 PM, Roger L. Whitcomb wrote:
> I’m trying to ask a simple “Yes” or “No” question of the user (in
> response to trying to close a window), but I need to know the answer
> synchronously in order to know whether to close the window or not.  So,
> in Windows and Swing there is a synchronous dialog that itself does the
> message pump and so it can return when the user clicks the button.  Now,
> I don’t see anything like that in Pivot, so I’m wondering how one would
> implement such a thing?  Thanks.
> 
>  
> 
>  
> 
>  
> 
> *Roger Whitcomb*
> 
> Architect, Engineering
> 
> *Ingres Corporation***
> 
> roger.whitcomb@ingres.com <ma...@ingres.com>
> 
>  
> 
> *PHONE*+1 650.587.5596
> 
> *FAX*+1 650.587.5550
> 
>  
> 
> *www.ingres.com* <http://www.ingres.com/>
> 
>  
> 
> This transmission is confidential and intended solely for the use of the
> recipient named above. It may contain confidential, proprietary, or
> legally privileged information. If you are not the intended recipient,
> you are hereby notified that any unauthorized review, use, disclosure or
> distribution is strictly prohibited. If you have received this
> transmission in error, please contact the sender by reply e-mail and
> delete the original transmission and all copies from your system.
> 
>  
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5JuB8ACgkQ5IyIbnMUeTs3dACfWl9a8TxXWNGKgoY0PrtK6nLw
lEYAnRe+ye7wo3iQZtDf3Kjq9OPfwkmR
=Q8mQ
-----END PGP SIGNATURE-----