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 43492 - Cannot internationalize forms
Summary: Cannot internationalize forms
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: I18N (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2004-05-19 02:21 UTC by Jesse Glick
Modified: 2004-08-13 12:11 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-05-19 02:21:48 UTC
May 18 refactoring build (if it matters). JDK
1.5.0b51. Selected a form file - I18nPanel.java in
fact - and Tools -> Internationalization submenu
items are all disabled. multiview problem?
Comment 1 Tomas Pavek 2004-05-24 18:39:17 UTC
This actually works for me in today dev build (200405231800).

However - by fixing issue 43575 (related to issue 43683) this appears
again. The problem now is that NodeAction gets 2 nodes as activated
(in fact one node twice) - I guess this happens due to setting the
node as activated once on the java editor TopComponent and then
immediately on the multiview TopComponent. While this makes
TopComponent.Registry to fire activated nodes properly (and so Toggle
Breakpoint action works), it somehow duplicates the change in the
actions lookup (so I18n action does not work). Any idea what could be
done with this?
Comment 2 Milos Kleint 2004-05-25 06:47:01 UTC
i guess I will have to filter out the duplicate items in the lookup.
for this case a simple == check should be enough, however in general
it could be hard to achieve a really consistent lookup with 
MVElements that are topcomponents.
Comment 3 Milos Kleint 2004-05-25 10:06:14 UTC
ok, seems to be more complicated than anticipated.
The default lookup in topcomponent will get activated node, add it to
lookup and expand all it's lookup item to the tc's lookup as well. No
idea why, but all these items will now appear twice in the
MultiViewTC's lookup. (in case the currently selected Element is a
TopComponent by chance)
Comment 4 Jesse Glick 2004-05-25 11:46:55 UTC
Milos - the algorithm you mention is Yarda's. Impl in
DefaultTopComponentLookup I think.
Comment 5 Milos Kleint 2004-05-25 12:04:21 UTC
yup. the problem is however that I got 2 instances of
DefaultTopComponentLookup that I need to merge.. maybe with another
one? However I don't understand the code well enough, plus it's not
public so I'd rather not copy the code over to multiview module.

Comment 6 Jaroslav Tulach 2004-05-25 12:48:21 UTC
This is a piece of functionality that must work correctly. There is a
TopComponentGetLookupTest that cointains all the painful experience I
had to go thru when fixing bugs reported against the lookup<->nodes
interaction.

The same code has already been copied to implement
ExplorerUtils.createLookup (ExplorerManager) so copying it once more
does not form any big obsticle, if..

You should create MultiViewGetLookupTest in your module and extend the
TopComponentGetLookupTest and override the creational methods (exactly
as done in ExplorerManager...Test). That way we can ensure that your
implementation is correct (behaves the same). Moreover whenever
somebody fixes a bug it should add new test into
TopComponentGetLookupTest and we will immediatelly be notified about
failure in all other places.


Comment 7 Milos Kleint 2004-05-27 09:39:51 UTC
I've managed to make the test working from multiviews for the usecase
where nodes are activated on the inner element and checks are done
against the outer (multiview) component lookup.


However the I18N actions atill don't work. :)
I've figured the problem is that the i18n.wizards.Util class checks
for EditorCookie on the nodes, however the FormNode instances don't
have it.
that change in util class was done by pkuzel in version 1.5. before
this change at least the I18NWizardAction.java (in version 1.11)
didn't check for editor cookie in the activated nodes.
Comment 8 Milos Kleint 2004-05-31 12:34:38 UTC
commited the changes in multiview to trunk. for the remaining problems
with i18n actions, reassigning to i18n.
Comment 9 Tomas Pavek 2004-05-31 14:30:56 UTC
Fixed also the remaining problems.

/cvs/i18n/src/org/netbeans/modules/i18n/I18nAction.java
new revision: 1.17; previous revision: 1.16

/cvs/i18n/src/org/netbeans/modules/i18n/wizard/Util.java
new revision: 1.11; previous revision: 1.10