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 2D59590A5 for ; Tue, 7 Feb 2012 17:57:43 +0000 (UTC) Received: (qmail 56337 invoked by uid 500); 7 Feb 2012 17:57:42 -0000 Delivered-To: apmail-incubator-ooo-dev-archive@incubator.apache.org Received: (qmail 56230 invoked by uid 500); 7 Feb 2012 17:57:42 -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 56222 invoked by uid 99); 7 Feb 2012 17:57:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 17:57:41 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [80.67.18.43] (HELO smtprelay01.ispgateway.de) (80.67.18.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 17:57:32 +0000 Received: from [212.202.243.194] (helo=[10.1.11.223]) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1RupHy-0006Xf-U4 for ooo-dev@incubator.apache.org; Tue, 07 Feb 2012 18:57:10 +0100 From: fabian Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: multipart/alternative; boundary="Apple-Mail=_86C28C96-4E7D-441D-89B6-81F83B1B69B0" Subject: Re: [EXT] image double click Date: Tue, 7 Feb 2012 18:57:10 +0100 In-Reply-To: <20120206131900.GA27303@localhost> To: ooo-dev@incubator.apache.org References: <20120206131900.GA27303@localhost> Message-Id: <7818335F-1D46-4253-928D-A7262C501FC5@netempire.de> X-Mailer: Apple Mail (2.1257) X-Df-Sender: Zm1oQG5ldGVtcGlyZS5kZQ== X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_86C28C96-4E7D-441D-89B6-81F83B1B69B0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Ariel, thx for telling me about the dispatchProviderInterceptors. I read = through the DevGuide and some examples and implmented the interceptor = and a Xjob. Unfortunately so far I wasn't able to trigger my Job and the provided examples didn't help.=20= Following I wrote down what I did.=20 Thx for your help so far, I understand if you can't spare the time going = through it I startet out with my netbeans project (generate by the OOo-integration) = which contains, the CentralRegistration.class and my generated starter = dispatch class=20 called addonStarter.class which handles all my Dispatches and is = referenced as protocollhandler in the protocolhandler.xcu.=20 I created:=20 - a Interceptor class implementing XDispatchProviderInterceptor and = XDispatch. - a job class implementing com.sun.star.task.XJob and implements the = execute method which shall trigger my interceptor. I wrote a configuration for my XJob (Jobs.xcu) and saved it along with = addons.xcu and my protocollHandler.xcu --------------------------------------- myaddon.test.InterceptorJob val_1 --------------------------------------- Then I added my jobs.xcu to my uno-extension-manifest.xml with: --------------------------------------- --------------------------------------- This is were I stumble and my Job class wasn't triggered so far. I know = that my job shall be registered by __getServiceFactory and = __writeRegistryServiceInfo by the set implementatiton name: "myaddon.test.InterceptorJob", but I = couldn't figure out what is necessary that those methods are called by = openoffice. I've seen examples where the XJob implementation is set in the jar = manifest as "RegistrationClassName" and I guess therefor its = __getServiceFactory is called. In my generated manifest my addonStarter = class is set as RegistrationClass. Can you tell me about anything obvious I'm missing to fully register my = job class? Thank you! regards, Fabian On Feb 6, 2012, at 2:19 PM, Ariel Constenla-Haile wrote: > Hi Fabian, >=20 > On Mon, Feb 06, 2012 at 11:58:33AM +0100, fabian wrote: >> Hi, >>=20 >> I am trying to find out if one can override the event when >> double-clicking on an embedded image within a writer document. For = my >> extension I would like to embed an image and when double-clicking it >> I would like to trigger my own action instead of the default "image >> dialog" which pops up.=20 >=20 > not that this dialog is shown not only on double-clicking an image: >=20 > - if the image is selected, the "Insert" - "Picture" - "=46rom = file..." > menu item does not insert a picture but shows the picture properties > dialog > - the same happens with the icon in the "Picture" toolbar > - if the image is selected, the context menu has a "Picture..." item > that triggers the Picture dialog > - that dialog can be executed using the keyboard instead of the mouse > - ... >=20 >=20 >>=20 >> I tried to use com.sun.star.document.XEventListener and >> com.sun.star.view.XSelectionChangeListener to catch the click event. >> But so far without success. >>=20 >> Is catching this event even possible via the api? >=20 > IMO it would work better to intercept the commands, with an > XDispatchProviderInterceptor: > = http://www.openoffice.org/api/docs/common/ref/com/sun/star/frame/XDispatch= ProviderInterceptor.html > Just intercept=20 > - ".uno:GraphicDialog" > - ".uno:InsertGraphic" > and when an image is selected, return your dispatch object in > queryDispatch(). >=20 > This adds an extra level of complexity to your extension, you will = have > to implement an css.task.Job to register your dispatch interceptor. > = http://www.openoffice.org/api/docs/common/ref/com/sun/star/task/Job.html > = http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO= /Jobs/Implementation >=20 > IIRC there are examples in the SDK. >=20 >=20 > Regards > --=20 > Ariel Constenla-Haile > La Plata, Argentina --Apple-Mail=_86C28C96-4E7D-441D-89B6-81F83B1B69B0--