This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 34924 - Use Component.setName() for all significant UI components
Summary: Use Component.setName() for all significant UI components
Status: VERIFIED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Simonek
URL:
Keywords: T9Y
Depends on:
Blocks:
 
Reported: 2003-07-14 14:34 UTC by Jiri Skrivanek
Modified: 2008-12-22 23:06 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Utility to check if components in .form files have names (23.05 KB, application/octet-stream)
2003-08-22 12:36 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2003-07-14 14:34:00 UTC
For UI testing it would be helpful if all
significant UI components have a unique name. I.e.
method setName() should be called for every
component which can be tested. Typically these are
components that can be accessed by user
(JTextField, JButton, ...) but it could be also a
JLabel which is used for displaying a changing
status information.
Comment 1 Jaroslav Tulach 2003-07-15 09:16:51 UTC
Why not reuse Accessibility descriptions? As all Nb dialogs are
accessible, they should have AccessibleContext.getAccessibleName().
Maybe that could be reused.
Comment 2 Jiri Skrivanek 2003-07-15 09:47:48 UTC
Accessible name is localized. It is better to use name which is unique
on all locales.
Comment 3 Jesse Glick 2003-07-21 14:53:52 UTC
I recall Tim had some thoughts on this too.
Comment 4 Jiri Skrivanek 2003-08-22 12:36:48 UTC
Created attachment 11407 [details]
Utility to check if components in .form files have names
Comment 5 Jiri Skrivanek 2003-08-22 12:40:52 UTC
I've just attached utility to check whether all component have names.
It checks .form files in given directory and its sub directories. It
assumes majority of NetBeans' forms has assocciated .form file. Usage
is simple, e.g.:

java -jar checkForms.jar D:\\cvs\\nb_all\\ant
Comment 6 _ tboudreau 2003-08-23 12:07:34 UTC
Two things:

1. You probably don't want to assume form files exist.  For
example, any GUI forms I've done don't use the form editor.
In general, probably more don't have form files than do, at
least in core/openide, that I've seen.

2. Will it really handle some of the (unreadable by netbeans)
NetBeans 2.0 form files hiding in dark places in the source
base?

Then again, I can't think of any non-complex way to check
for this via the source code.  You could write some kind
of test that logs offending components at runtime, though.

But, yes, this is a great thing to do!  We have too many
tests that do weird, easily broken things to try to find
a component.  Using the name is a natural approach, and
will make it much harder to break tests for silly reasons!
Comment 7 Jiri Skrivanek 2003-08-25 09:54:52 UTC
Yes, you are right. Some of GUI forms will not be checked by this
utility either for reason 1 or 2. For those GUI forms it will be
responsibility of test developer to check whether components have
name. There will exist an utility/test to test it in runtime.
Comment 8 David Simonek 2005-05-05 16:10:23 UTC
It's been so long time, Jirko is it still an issue, should we do this or could I
close this? Shortly what's the status?
Comment 9 Jiri Skrivanek 2005-05-05 18:17:05 UTC
It would be a good practice to use setName() but at the time it is not a big
issue for us. I think it can be closed.
Comment 10 David Simonek 2005-05-06 11:44:49 UTC
OK, thanks, closing as wontfix.
Comment 11 Jiri Skrivanek 2005-05-06 12:24:08 UTC
Verified.