Return-Path: X-Original-To: apmail-incubator-ooo-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 782D1950B for ; Fri, 17 Feb 2012 16:53:20 +0000 (UTC) Received: (qmail 79942 invoked by uid 500); 17 Feb 2012 16:53:20 -0000 Delivered-To: apmail-incubator-ooo-dev-archive@incubator.apache.org Received: (qmail 79881 invoked by uid 500); 17 Feb 2012 16:53:20 -0000 Mailing-List: contact ooo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-dev@incubator.apache.org Received: (qmail 79872 invoked by uid 99); 17 Feb 2012 16:53:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Feb 2012 16:53:20 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [80.67.31.100] (HELO smtprelay05.ispgateway.de) (80.67.31.100) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Feb 2012 16:53:12 +0000 Received: from [212.202.243.194] (helo=[10.1.11.223]) by smtprelay05.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1RyR3A-0001OV-4K for ooo-dev@incubator.apache.org; Fri, 17 Feb 2012 17:52:48 +0100 From: fabian Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: multipart/alternative; boundary="Apple-Mail=_7A4E84CA-F57E-4E48-8D46-E39238DD1F26" Subject: Re: [EXT] image double click Date: Fri, 17 Feb 2012 17:52:47 +0100 In-Reply-To: <0A012321-2353-4E4B-9490-126AD8CE8670@netempire.de> To: ooo-dev@incubator.apache.org References: <20120206131900.GA27303@localhost> <7818335F-1D46-4253-928D-A7262C501FC5@netempire.de> <20120207193230.GA27108@localhost> <20120215012054.GB25758@localhost> <20120216024318.GA32697@localhost> <0A012321-2353-4E4B-9490-126AD8CE8670@netempire.de> Message-Id: <727BF6B3-CDE2-4EEE-8A49-8B5A3CAB8D3F@netempire.de> X-Mailer: Apple Mail (2.1257) X-Df-Sender: Zm1oQG5ldGVtcGlyZS5kZQ== --Apple-Mail=_7A4E84CA-F57E-4E48-8D46-E39238DD1F26 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Ariel, keeping the original dispatch of the graphics dialog causes that = randomly my dispatcher or the original dispatcher is called at an "image = double-click" event. my querydispatch() looks like below, I just call the queryDispatch of = the slaveDispatchProvider and keep the returned Dispatch object in a map = to call it later if needed. Can you see why this is causing that my = dispatch isn't always called by .uno:GraphicDialog and = .uno:InsertGraphic ? When I don't call the original queryDispatch my = dispatch is always called, but calling a slaves queryDispatch = shouldn't do nothing else then returning me a dispatch object or am I = wrong? @Override public XDispatch queryDispatch(URL aURL, String sTargetFrameName, = int iSearchFlags) { if (aURL.Complete.equalsIgnoreCase(".uno:GraphicDialog") || = aURL.Complete.equalsIgnoreCase(".uno:InsertGraphic")) { =20 //originalDispatchMap XDispatch xDispatch =3D = getSlaveDispatchProvider().queryDispatch(aURL, sTargetFrameName, = iSearchFlags); originalDispatchMap.put(aURL.Complete, xDispatch); =20 return this; } return getSlaveDispatchProvider().queryDispatch(aURL, = sTargetFrameName, iSearchFlags); } regards, Fabian On Feb 16, 2012, at 9:41 AM, fabian wrote: > Hi Ariel, >=20 > after trying a little I came to the same solution that using the = dispatch as a "proxy" is how to do it. Another idea which I thought = should work is to to set the requery property of .uno:GraphicDialog to = true in addStatuslistener and request to call querydispatch every time = but I don't know if that even works. At least it failed for me when = trying it out. >=20 > Thank you! >=20 > regards, > Fabian >=20 >=20 > On Feb 16, 2012, at 3:43 AM, Ariel Constenla-Haile wrote: >=20 >>=20 >> Hi Fabian, >>=20 >> On Wed, Feb 15, 2012 at 10:42:26AM +0100, fabian wrote: >>> Hi Ariel, >>>=20 >>> thx, good to know!=20 >>>=20 >>> I just got back to the Dispatchinterceptor since I had to resolve >>> other issues first. As you mentioned I intercepted the events for: >>> ".uno:GraphicDialog" and ".uno:InsertGraphic". >>>=20 >>> Now I want to only intercept the event if an image of interest was >>> double-clicked. Am I right that neither the call of querydipatch nor >>> the actual dispatch call (within my interceptor) gives me the source >>> of the event, so what image was doublecklicked?=20 >>=20 >> you are right >>=20 >>> I guess when query dispatch is called I have to check if one of the >>> two uno commands above was triggered and get the selected image = (using >>> xSelectionSupplier) to check if the image is of interest to me, then >>> I return my own dispatcher. Otherwise I return the slave >>> dispatchPprovider. >>>=20 >>> Is that a proper way to do it? >>=20 >> no, because this won't work in every case. For example, the menu item >> Insert - Picture - =46rom File... In the case you don't have >> the accessibility feature enabled, menu items in the menu bar only = query >> for a dispatch object when the popup menu they belong to gets = activated. >>=20 >> Let's suppose the following scenario: >>=20 >> - you open a Writer document >> - your interceptor registers itself at the XFrame >> - Go to Insert - Picture - =46rom File... >> - your interceptor gets queried for .uno:InsertGraphic=20 >> - because no image is selected, you return the slave dispatcher's >> dispatch >> - this way, the Insert Picture dialog shows up, you select an image, = and >> insert it. The inserted image remains selected after inserting it >> - Go again to Insert - Picture - =46rom file... >> - Problem: the menu implementation caches dispatch objects, so it = won't >> query your interceptor again, instead it has the dispatch object >> provided by your slave: the image is selected, so this menu item will >> end up showing the Picture Properties dialog you want to avoid. >>=20 >> IMO the solution here is to return always your dispatch object when = the >> interceptor gets queried for .uno:GraphicDialog and = .uno:InsertDialog, >> and add to dispatch() all the logic that decides whether to dispatch=20= >> your custom implementation or AOO's one. >>=20 >> In queryDispatch() it may be useful to store also the AOO dispatch, = for >> later user in dispatch() in case you want to use AOO implementation = (the >> Insert Picture dialog, or the Picture Properties dialog). >>=20 >> Resuming: >>=20 >> - in queryDispatch(): if the URL represents one of the commands: = store >> the dispatch object returned by your slave, return your own dispatch >> object >>=20 >> - in dispatch():=20 >> - if the command is .uno:InsertGrapic, check if an image is selected, >> and if that image is of your interest. If so, tell your dispatch to >> dispatch the request; if not, tell your slave's dispatch >> - if the command is .uno:GraphicDialog, then you can be sure an image >> is selected. If you want to intercept every image, dispatch the >> request with your dispatch object. If you are interested in some >> images only, proceed as above. >>=20 >>=20 >> That's all I can imagine right now. Hope that helps. >>=20 >>=20 >> Regards >> --=20 >> Ariel Constenla-Haile >> La Plata, Argentina >=20 --Apple-Mail=_7A4E84CA-F57E-4E48-8D46-E39238DD1F26--