Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Finding all Dialogs that have a given shell as their parent
Finding all Dialogs that have a given shell as their parent [message #437902] Fri, 11 June 2004 19:54 Go to next message
Henry McEuen is currently offline Henry McEuenFriend
Messages: 6
Registered: July 2009
Junior Member
In working on GUI test tools (Abbot for SWT) I have been trying to
create a hierarchy of widgets that are descendants of the root shell.
The problem is that SWT dialogs are able to contain widgets but are not
actually widgets themselves. From my reading of the SWT API (2.0, but I
think Dialog is similar in 3.0) there appears to be no way to, given a
shell, return all dialogs that have this shell as a parent.

For user-defined classes that subclass Dialog this is not a problem.
According to the javadoc for Eclipse 2.0, user-defined dialogs should
create a new shell and add widgets to this new shell. In this case the
dialog would contain a shell that is accessible through getShells() in
the parent shell and the user-defined dialog and its widgets could be
added to the hierarchy without problem.

The problem case occurs when an application uses one of the SWT Dialog
subclasses such as FileDialog or FontDialog. For example, a tester for
an SWT application that has a file dialog might like to find the file
dialog’s OK button to be able to click on it. While the dialog knows
what shell is its parent, it doesn’t seem possible to use API functions
of the parent shell to find this dialog. Is there something that I am
missing, or would it require modification to the API to be able to start
from a shell and get the dialogs that have this shell as a parent?

Even if this problem were to be resolved, the widgets in this dialog are
not accessible through the API, so the tester would still be unable to
click the button. Are the widgets inaccessible due to the direct use of
native dialogs on certain platforms? There probably isn’t an easy way
for a tester to directly access a button or other widget in one of these
dialogs, but again I could be missing something.

Henry McEuen
Re: Finding all Dialogs that have a given shell as their parent [message #438019 is a reply to message #437902] Mon, 14 June 2004 20:00 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
> Are the widgets inaccessible due to the direct use of native dialogs on
certain platforms?

Yes. There's not much we can do here but the whole automated testing thing
is supposed to get looked at again post 3.0.

"Henry McEuen" <hmceuen@us.ibm.com> wrote in message
news:cad27u$umv$1@eclipse.org...
> In working on GUI test tools (Abbot for SWT) I have been trying to
> create a hierarchy of widgets that are descendants of the root shell.
> The problem is that SWT dialogs are able to contain widgets but are not
> actually widgets themselves. From my reading of the SWT API (2.0, but I
> think Dialog is similar in 3.0) there appears to be no way to, given a
> shell, return all dialogs that have this shell as a parent.
>
> For user-defined classes that subclass Dialog this is not a problem.
> According to the javadoc for Eclipse 2.0, user-defined dialogs should
> create a new shell and add widgets to this new shell. In this case the
> dialog would contain a shell that is accessible through getShells() in
> the parent shell and the user-defined dialog and its widgets could be
> added to the hierarchy without problem.
>
> The problem case occurs when an application uses one of the SWT Dialog
> subclasses such as FileDialog or FontDialog. For example, a tester for
> an SWT application that has a file dialog might like to find the file
> dialog
Re: Finding all Dialogs that have a given shell as their parent [message #438115 is a reply to message #438019] Wed, 16 June 2004 15:00 Go to previous messageGo to next message
Henry McEuen is currently offline Henry McEuenFriend
Messages: 6
Registered: July 2009
Junior Member
Steve Northover wrote:
>>Are the widgets inaccessible due to the direct use of native dialogs on
>
> certain platforms?
>
> Yes. There's not much we can do here but the whole automated testing thing
> is supposed to get looked at again post 3.0.
>
> "Henry McEuen" <hmceuen@us.ibm.com> wrote in message
> news:cad27u$umv$1@eclipse.org...
>
>>In working on GUI test tools (Abbot for SWT) I have been trying to
>>create a hierarchy of widgets that are descendants of the root shell.
>>The problem is that SWT dialogs are able to contain widgets but are not
>>actually widgets themselves. From my reading of the SWT API (2.0, but I
>>think Dialog is similar in 3.0) there appears to be no way to, given a
>>shell, return all dialogs that have this shell as a parent.
>> <snip>

Are there also plans (after 3.0, of course) to address the issue of
getting to dialogs from shells? Currently you can use
Dialog.getParent() to get the dialog's parent shell, but from that shell
there's no way to get back to the dialog.
Re: Finding all Dialogs that have a given shell as their parent [message #438208 is a reply to message #438115] Thu, 17 June 2004 15:34 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Maybe ... Shell.getDialogs()? It seems low priority.

"Henry McEuen" <hmceuen@us.ibm.com> wrote in message
news:capmvf$hdn$1@eclipse.org...
> Steve Northover wrote:
> >>Are the widgets inaccessible due to the direct use of native dialogs on
> >
> > certain platforms?
> >
> > Yes. There's not much we can do here but the whole automated testing
thing
> > is supposed to get looked at again post 3.0.
> >
> > "Henry McEuen" <hmceuen@us.ibm.com> wrote in message
> > news:cad27u$umv$1@eclipse.org...
> >
> >>In working on GUI test tools (Abbot for SWT) I have been trying to
> >>create a hierarchy of widgets that are descendants of the root shell.
> >>The problem is that SWT dialogs are able to contain widgets but are not
> >>actually widgets themselves. From my reading of the SWT API (2.0, but I
> >>think Dialog is similar in 3.0) there appears to be no way to, given a
> >>shell, return all dialogs that have this shell as a parent.
> >> <snip>
>
> Are there also plans (after 3.0, of course) to address the issue of
> getting to dialogs from shells? Currently you can use
> Dialog.getParent() to get the dialog's parent shell, but from that shell
> there's no way to get back to the dialog.
Re: Finding all Dialogs that have a given shell as their parent [message #438243 is a reply to message #438208] Thu, 17 June 2004 19:10 Go to previous message
Timothy Wall is currently offline Timothy WallFriend
Messages: 21
Registered: July 2009
Junior Member
Given that these are native black box components (the subcomponents have
no Java representation,
nor do apparently the dialogs themselves), it makes sense to provide
access to their black box
functionality rather than their subcomponents.

There exists a similar issue when trying to drive java.awt.FileDialog.
Its contents don't exist as far as
Java is concerned, but you don't really need access to the contents. All
that is required is to be able to
perform the major "user API" functions through the GUI tester. The
FileDialog allows you to select a
directory, select a file, and hit cancel or OK (remember, you're not
trying to test these black box
components, you're testing your UI's response to their inputs/outputs).
So your UI driver only needs
to provide methods that simulate the "user API".


Steve Northover wrote:

> Maybe ... Shell.getDialogs()? It seems low priority.

> "Henry McEuen" <hmceuen@us.ibm.com> wrote in message
> news:capmvf$hdn$1@eclipse.org...
> > Steve Northover wrote:
> > >>Are the widgets inaccessible due to the direct use of native dialogs on
> > >
> > > certain platforms?
> > >
> > > Yes. There's not much we can do here but the whole automated testing
> thing
> > > is supposed to get looked at again post 3.0.
> > >
> > > "Henry McEuen" <hmceuen@us.ibm.com> wrote in message
> > > news:cad27u$umv$1@eclipse.org...
> > >
> > >>In working on GUI test tools (Abbot for SWT) I have been trying to
> > >>create a hierarchy of widgets that are descendants of the root shell.
> > >>The problem is that SWT dialogs are able to contain widgets but are not
> > >>actually widgets themselves. From my reading of the SWT API (2.0, but I
> > >>think Dialog is similar in 3.0) there appears to be no way to, given a
> > >>shell, return all dialogs that have this shell as a parent.
> > >> <snip>
> >
> > Are there also plans (after 3.0, of course) to address the issue of
> > getting to dialogs from shells? Currently you can use
> > Dialog.getParent() to get the dialog's parent shell, but from that shell
> > there's no way to get back to the dialog.
Previous Topic:TableViewer doest not show data
Next Topic:How to let the scroll bar scrolls smartly?
Goto Forum:
  


Current Time: Wed Apr 24 22:38:37 GMT 2024

Powered by FUDForum. Page generated in 0.02677 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top