Return-Path: X-Original-To: apmail-pivot-user-archive@www.apache.org Delivered-To: apmail-pivot-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D007D9AF3 for ; Fri, 2 Dec 2011 23:27:14 +0000 (UTC) Received: (qmail 12899 invoked by uid 500); 2 Dec 2011 23:27:14 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 12871 invoked by uid 500); 2 Dec 2011 23:27:14 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 12863 invoked by uid 99); 2 Dec 2011 23:27:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2011 23:27:14 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Roger.Whitcomb@actian.com designates 69.18.216.40 as permitted sender) Received: from [69.18.216.40] (HELO mail.actian.com) (69.18.216.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2011 23:27:09 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CCB149.B8D36CBE" Subject: RE: Question about "previewSheetClose" Date: Fri, 2 Dec 2011 18:25:47 -0500 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Question about "previewSheetClose" Thread-Index: AcyxNbUCgX2nj2ZfTTWsn31bhK8kSQAA7HzQAAPPW4A= References: <789F9E6E-9CD1-4547-A71B-2F6F88AB5C62@verizon.net> <076A302F-F5A2-4750-BBED-DABA375D0D41@verizon.net> From: "Roger L. Whitcomb" To: This is a multi-part message in MIME format. ------_=_NextPart_001_01CCB149.B8D36CBE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The main problem now appears to be that in my listener the FileBrowserSheet.getSelectedFile isn't correct when my SheetStateListener gets called. Because the selected file isn't set until AFTER the "previewSheetClose" Is called for all listeners. So, I can't correctly do the "okay to overwrite" check because the correct file isn't available. See the code in TerraFileBrowserSheetSkin.java at line 261 and following. So, the skin calls "previewSheetClose" and only if the Vote is APPROVE will it set the selected file in the embedded FileBrowserSheet object. And it looks like there isn't an easy way to determine what the selected file is (based on the logic I just added to the SAVE_AS case at line 287 and following. =20 So, I'm wondering if I can't rearrange the logic in "previewSheetClose" in TerraFileBrowserSkin to set the selection if the okButton is enabled and then call the "super.previewSheetClose" method, at which time I will be able to accurately tell whether I want to DENY or not and everything should work. It just seems wrong to expect that all the "previewSheetClose" listeners could make an accurate determination if the selected file isn't even set yet. =20 What do you think? =20 Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@actian.com| Actian Corp. | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA | = +1 650-587-5596 | fax: +1 650-587-5550 =20 From: Roger L. Whitcomb [mailto:Roger.Whitcomb@actian.com]=20 Sent: Friday, December 02, 2011 1:31 PM To: user@pivot.apache.org Subject: RE: Question about "previewSheetClose" =20 Hmm, interesting. When I return DENY, the first time it starts the rollup and then brings it back down and the prompt shows up. If I answer "No" to the overwrite prompt and click OK again, then the second time and following times the rollup doesn't happen. So, let me try to debug that. At any rate, it works better with DENY than with DEFER so we're on the right track here. Thanks. =20 Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@actian.com| Actian Corp. | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA | = +1 650-587-5596 | fax: +1 650-587-5550 =20 From: Greg Brown [mailto:gk_brown@verizon.net]=20 Sent: Friday, December 02, 2011 1:03 PM To: user@pivot.apache.org Subject: Re: Question about "previewSheetClose" =20 I think the right thing to do is return DENY. If the sheet still rolls up in that case, it is probably a bug in TerraSheetSkin. =20 On Dec 2, 2011, at 3:41 PM, Roger L. Whitcomb wrote: =20 No, I was returning DEFER. But, as I recall, even if I returned DENY the rollup still happened. So, TerraFileBrowserSheetSkin registers itself with a SheetStateListener, then my use of this class also registers a SheetStateListener. So, when "close" is called, both listeners get called. TerraFileBrowserSheetSkin gets called first, which calls TerraSheetSkin via "super.previewSheetClose" (line 268), which will start the close transition and return Vote.DEFER. Then my listener gets called and will return DEFER (or DENY). Once the votes are tallied, the non-APPROVE final vote cancels the close transition (which has already started running) and then brings up my prompt.=20 =20 Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@actian.com| Actian Corp. | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA | = +1 650-587-5596 | fax: +1 650-587-5550 =20 From: Greg Brown [mailto:gk_brown@verizon.net]=20 Sent: Friday, December 02, 2011 12:17 PM To: user@pivot.apache.org Subject: Re: Question about "previewSheetClose" =20 In your listener, are you vetoing the close event? =20 On Dec 2, 2011, at 1:15 PM, Roger L. Whitcomb wrote: I need to implement a prompt in my Save As dialogs to confirm if you want to overwrite an existing file. So, I try to add a SheetStateListener and begin the prompt in there. That all works, except that the FileBrowserSheet "rolls up" and then rolls back down with the prompt showing on top of it. The reason it does that is that my listener is now third in line. First is the FileBrowserSheet listener which calls "super" (which is Sheet itself) which starts the close transition and then it sets the selected file. So, my listener actually gets called twice: once with the previous selected file (or null) set and once with the correct file.=20 So, there are two ugly things: 1) Visually it doesn't look good to have the sheet go away and come back with the overwrite prompt on it. 2) It is hard to code the logic in my listener to deal with being called twice. =20 What I'm casting around for is a way to make my listener be the "first in line" or have mine take precedence somehow without (necessarily) having a lot of knowledge of Pivot internals since they may change over time. I mean that I *could* remove any existing listeners from the list and make mine the only one and have mine call the other ones if appropriate, but that seems like a really bad practice, in general. So, any thoughts as to what's the "right" way to handle this? I think similar problems could potentially arise with other close/state listeners as well, although the visual aspects are most clearly seen with Sheet since it starts the rollaway transition in "previewSheetClose". =20 Or am I missing something fundamental here? Thanks. =20 =20 Roger Whitcomb Architect, Engineering Actian Corporation roger.whitcomb@actian.com =20 =20 PHONE +1 650.587.5596 FAX +1 650.587.5550 www.actian.com =20 =20 =20 =20 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. =20 =20 =20 ------_=_NextPart_001_01CCB149.B8D36CBE Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

The main problem now appears to be that in my listener the = FileBrowserSheet.getSelectedFile isn’t correct when my = SheetStateListener gets called.  Because the selected file = isn’t set until AFTER the “previewSheetClose” Is = called for all listeners.  So, I can’t correctly do the = “okay to overwrite” check because the correct file = isn’t available.  See the code in = TerraFileBrowserSheetSkin.java at line 261 and following.  So, the = skin calls “previewSheetClose” and only if the Vote is = APPROVE will it set the selected file in the embedded FileBrowserSheet = object.  And it looks like there isn’t an easy way to = determine what the selected file is (based on the logic I just added to = the SAVE_AS case at line 287 and following.

 

So, I’m wondering if I can’t rearrange the logic in = “previewSheetClose” in TerraFileBrowserSkin to set the = selection if the okButton is enabled and then call the = “super.previewSheetClose” method, at which time I will be = able to accurately tell whether I want to DENY or not and everything = should work.  It just seems wrong to expect that all the = “previewSheetClose” listeners could make an accurate = determination if the selected file isn’t even set = yet.

 

What do you think?

 

Rog= er Whitcomb | Architect, Engineering | Roger.Whitcomb@actian.com| = Actian Corp. | = 500 Arguello Street | = Suite 200 | Redwood City | CA | 94063 | USA &nb= sp;| +1 650-587-5596 | fax: +1 650-587-5550

 

From:= = Roger L. Whitcomb [mailto:Roger.Whitcomb@actian.com]
Sent: = Friday, December 02, 2011 1:31 PM
To: = user@pivot.apache.org
Subject: RE: Question about = "previewSheetClose"

 

Hmm, interesting.  When I return DENY, the first time it starts = the rollup and then brings it back down and the prompt shows up.  = If I answer “No” to the overwrite prompt and click OK again, = then the second time and following times the rollup doesn’t = happen.  So, let me try to debug that.  At any rate, it works = better with DENY than with DEFER so we’re on the right track = here.  Thanks.

 

Rog= er Whitcomb | Architect, Engineering | Roger.Whitcomb@actian.com| = Actian Corp. | = 500 Arguello Street | = Suite 200 | Redwood City | CA | 94063 | USA &nb= sp;| +1 650-587-5596 | fax: +1 650-587-5550

 

From:= = Greg Brown [mailto:gk_brown@verizon.net]
Sent: Friday, = December 02, 2011 1:03 PM
To: = user@pivot.apache.org
Subject: Re: Question about = "previewSheetClose"

 

I think the = right thing to do is return DENY. If the sheet still rolls up in that = case, it is probably a bug in TerraSheetSkin.

 

On = Dec 2, 2011, at 3:41 PM, Roger L. Whitcomb wrote:

 

No, I was returning DEFER.  But, as I recall, even if I returned = DENY the rollup still happened.  So, TerraFileBrowserSheetSkin = registers itself with a SheetStateListener, then my use of this class = also registers a SheetStateListener.  So, when “close” = is called, both listeners get called.  TerraFileBrowserSheetSkin = gets called first, which calls TerraSheetSkin via = “super.previewSheetClose” (line 268), which will start the = close transition and return Vote.DEFER.  Then my listener gets = called and will return DEFER (or DENY).  Once the votes are = tallied, the non-APPROVE final vote cancels the close transition (which = has already started running) and then brings up my = prompt. 

 

Rog= er Whitcomb | Architect, Engineering | Roger.Whitcomb@actian.com|<= span class=3Dapple-converted-space> Actian Corp. | = 500 Arguello Street | = Suite 200 | Redwood City | CA | 94063 | USA &nb= sp;| +1 650-587-5596 | fax: +1 = 650-587-5550

 

From:=  Greg Brown = [mailto:gk_brown@verizon.net] 
Sent: Friday, December 02, 2011 = 12:17 PM
To: user@pivot.apache.org
Sub= ject: Re: Question = about = "previewSheetClose"

 

In your listener, are you vetoing the close = event?

 

On Dec 2, 2011, at 1:15 PM, Roger L. Whitcomb = wrote:



I need to = implement a prompt in my Save As dialogs to confirm if you want to = overwrite an existing file.  So, I try to add a SheetStateListener = and begin the prompt in there.  That all works, except that the = FileBrowserSheet “rolls up” and then rolls back down with = the prompt showing on top of it.  The reason it does that is that = my listener is now third in line.  First is the FileBrowserSheet = listener which calls “super” (which is Sheet itself) which = starts the close transition and then it sets the selected file.  = So, my listener actually gets called twice:  once with the previous = selected file (or null) set and once with the correct = file. 


So, = there are two ugly things:

1) = Visually it doesn’t look good to have the sheet go away and come = back with the overwrite prompt on = it.

2) It is = hard to code the logic in my listener to deal with being called = twice.

 

What = I’m casting around for is a way to make my listener be the = “first in line” or have mine take precedence somehow without = (necessarily) having a lot of knowledge of Pivot internals since they = may change over time.  I mean that I *could* remove any = existing listeners from the list and make mine the only one and have = mine call the other ones if appropriate, but that seems like a really = bad practice, in general.  So, any thoughts as to what’s the = “right” way to handle this?  I think similar problems = could potentially arise with other close/state listeners as well, = although the visual aspects are most clearly seen with Sheet since it = starts the rollaway transition in = “previewSheetClose”.

 

Or am I = missing something fundamental here?  = Thanks.

 

 

R= oger Whitcomb

= Architect, Engineering

= Actian Corporation

 

= PHONE&= nbsp;+1 650.587.5596

= FAX&= nbsp;+1 650.587.5550

 

&n= bsp;

Th= is 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.

 

 

 

------_=_NextPart_001_01CCB149.B8D36CBE--