Re: PrintProvider implementation in the Lookup of a MultiviewElement TopComponent not used!

Boris Heithecker <[email protected]> Tue, 9 May 2017 21:34:52 +0200
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAL465REE5e9pkXahCrnG_48N42O=OAUxxv_yCXrB1ed8Y++wKg@mail.gmail.com>
I've had a very quick look at the sources of PrintAction. The action first
searches for components with the PrintManager.PRINT_PRINTABLE property set
to TRUE among all child components of the activated TopComponent.
If this happens to be the case, i.e. any component found, the lookup is not
queried anymore. (The javadoc seems to be incorrect at PrintManger, but I
may also be wrong.)
Hope this helps,
Boris

2017-05-09 20:16 GMT+02:00 Oliver Rettig <[email protected]>:

> Hi Boris,
> > Is the File/Print action enabled when your TopComponent is activated?
> yes, the actions are active, printpreview and pagesetup work fine with the
> default behavoir which should be active without explicit adding a
> PrintProvider in the lookup.
>
> For this default behavoir the following properties are set:
>
>  putClientProperty(PrintManager.PRINT_PRINTABLE, Boolean.TRUE);
>  putClientProperty(PrintManager.PRINT_NAME, ...);
>
> The strange thing is that the print actions are still available even if I
> comment out the put with the PRINT_PRINTABLE property.
>
> best regards
> Oliver
>
> >
> > 2017-05-09 19:33 GMT+02:00 Neil C Smith <[email protected]>:
> > > Hi,
> > >
> > > On Tue, May 9, 2017 at 6:23 PM Oliver Rettig <[email protected]>
> > >
> > > wrote:
> > >> I throw RuntimeExceptions to be sure:-)
> > >>
> > >> But it is not invoked, no exceptions are thrown.
> > >>
> > >> any further ideas?
> > >
> > > Unfortunately not from me - not made use of PrintProvider yet.  Just
> > > checking you weren't only using System.out as a check given it's
> usually
> > > not visible - painful memories of early days with the platform there!
> ;-)
> > >
> > > Good luck with it.
> > >
> > > Best wishes,
> > >
> > > Neil
> > > --
> > > Neil C Smith
> > > Artist & Technologist
> > > www.neilcsmith.net
> > >
> > > Praxis LIVE - hybrid visual IDE for creative coding -
> www.praxislive.org
>
>
>


-- 
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34