Hello people,

concerning some comments I added to the issues
http://www.openoffice.org/issues/show_bug.cgi?id=86414
http://www.openoffice.org/issues/show_bug.cgi?id=86415
http://www.openoffice.org/issues/show_bug.cgi?id=86416
http://www.openoffice.org/issues/show_bug.cgi?id=86417
http://www.openoffice.org/issues/show_bug.cgi?id=86418

saying that it should be stated in the IDL that the
UnoThrobberControlModel, UnoSimpleAnimationControlModel, and the
FrameControl can not be instantiated at the dialog model's
XMultiServiceManager, but at the global service manager, I take my words
back, what concerns the two first.

Before adding any comment in these issues, I'd like to raise some
questions about some toolkit API inconsistencies - at least from my
point of view of a API client, may be a more qualified opinion can give
a logical explanation to these.

First, what concerns my wrong comments, I was confused by the fact that:

1. I couldn't instantiate at the dialog model the
UnoControlThrobberModel and the UnoControlSimpleAnimationModel

2. the reason was those service names were wrong, BUT they figured ONLY
in the available service names at the global service manager, NOT at
dialog model. So I concluded "logically" that they have to be
instantiated at the global service manager.

Well, now I tested again and these *two* CAN be instantiated at the
dialog model [the other two I've found, FrameControl and
UnoControlContainerModel are a special case]


So for me the following is an inconsistencie and a new issue:
UnoControlDialogModel::getAvailableServiceNames() in
toolkit/source/controls/dialogcontrol.cxx 531-562 returns a Sequence of 21 OUString; this is the one we get via UNO with
::com::sun::star::lang::XMultiServiceFactory::getAvailableServiceNames()
at the dialog model's.

But as I was explained, UnoControlDialogModel::createInstance() in
toolkit/source/controls/dialogcontrol.cxx 449-524 first checks if the
service specifier matches one of those 21 service names, if NOT it tries
to instantiate it at the global service manager, and checks if the
instantiated object supports UnoControlModel.

So, as long as it can be instantiated by its service name, and
supports com.sun.star.awt.UnoControlModel,
UnoControlDialogModel::createInstance() will return this instance.

But XMultiServiceFactory::getAvailableServiceNames()  is supposed to
"Provides the available names of the factory to be used to create
instances", so isn't this an issue? shouldn't *all* available service
names be returned? This includes UnoThrobberControlModel and
UnoSimpleAnimationControlModel [UnoControlContainerModel is a
special/confusing case].


Second, with the com.sun.star.frame.FrameControl I do not understand:

1. why isn't it in the toolkit module css.awt, instead of the css.frame
module? although it is a *frame* control, it is a *control*.

2. also strange to me why the "brand-new" GUI chap. in the Dev's Guide
does not say a word about it; and in fact, in the example
DialogDocument.java it uses the long way of creating a window, a frame,
initializes the frame with the window, loading the document ... This all
can be shorten by using the FrameControl, and simply setting the
"ComponentUrl" and the [undocumented] "LoaderArguments"

3. why the FrameControl has no FrameControlModel? isn't this
inconsistent with the whole design paradigm used in the toolkit? AFAIK
in the AWT module, controls only export interfaces, while models are a
set of properties; following this paradigm, "ComponentUrl" and
"LoaderArguments" seem more logical to be properties of the
FrameControlModel, not of the control.


Third (and last for now): com.sun.star.awt.UnoControlContainer and
com.sun.star.awt.UnoControlContainerModel go beyond my understanding,
although I've been using them so far this way

- instantiate both at the global service manager
- set the model at the control
- add the control to a parent XControlContainer

It turns out that the model can be instantiated at the dialog model's
XMultiServiceManager (obviously just because it supports
UnoControlModel), and then be inserted by name in the dialog model's
XNameContainer.
But when the control model is instantiated this way, there is no control
at all: XControlContainer::getControl() at the UnoControlDialog returns
null.
Also strange that the model instantiated this way has properties it does
not have when instantiated at the global service manager (PositionX,
PosotionY, Width, Height...)

Obviously, the right [or the only one that works] method for using this control is creating it at the global service manager. Isn't this inconsistent with all the rest of the toolkit API?

http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/GUI/Common_Workflow_to_add_Controls


Isn't this how *all* UNO AWT controls should consistently be design to work with?


Regards
Ariel.



--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[EMAIL PROTECTED]

http://www.ArielConstenlaHaile.com.ar/ooo/



"Aus der Kriegsschule des Lebens
                - Was mich nicht umbringt,
        macht mich härter."
                Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to