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 20472 - Method component(De)Activated is not called thorough whole component tree.
Summary: Method component(De)Activated is not called thorough whole component tree.
Status: CLOSED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: David Simonek
URL:
Keywords:
Depends on:
Blocks: 20316
  Show dependency tree
 
Reported: 2002-02-12 17:44 UTC by _ lkramolis
Modified: 2008-12-22 19:56 UTC (History)
2 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 _ lkramolis 2002-02-12 17:44:00 UTC
[Source: XML module -
xml/tree-edit/src/org/netbeans/modules/xml/tree/editor/TreeEditorComponent.java]

TreeEditorComponent extends CloneableTopComponent. It adds ExplorerPanel into
itself. When TreeEditorComponent is activated|deactivated (method call
componentActivated() | componentDeactivated()), this should be applied on whole
component tree. So, this should be called also on explorerPanel instance, but it
is not.

ExplorerPanel enable | disable component actions in component(De)Activated
methods, so I have to call such methods by reflection to have correctly enabled
Cut, Copy, ... actions.

I would like to suggest to implement methods component(De)Activated in
TopComponent to go thorough component tree and call this method on all
TopComponent subclasses.
Comment 1 David Simonek 2002-02-12 17:51:20 UTC
This sounds more like enhancements to me, nesting of top components is
generally not supported.

Cc'ing Petr N. - could it mean some significant performance penalty? I
don't think so, we can hopefully cache relations somehow.
Comment 2 _ lkramolis 2002-02-12 17:57:08 UTC
It really looks like enhancement, but it is not. I do not really
think, it is enhancement, when I must use reflection to gain common
behaviour.
Comment 3 David Simonek 2002-02-12 18:04:17 UTC
Nobody ever wanted it before, so I doubt if it is common behaviour.
Still it looks like enh to me, I repeat that nesting of tcs is not
supported. I can't understand your approach - subclass ExplorerPanel
and install needed relationship yourself, no need for reflection....?
Comment 4 _ lkramolis 2002-02-12 18:52:28 UTC
Nobody before used TC so complex, but it does not mean that it is not bug.

I need to have CloneableTopComponent and use ExplorerPanel, simple use
case. If ExplorerPanel extends CloneableTopComponent, I will be happy.

I do not understand, why is not nesting of tcs supported? Is it some
where described?

--
It is changed back to DEFECT, because I still have to use reflection.
Comment 5 David Simonek 2002-02-13 19:18:34 UTC
Reflection usage can be workarounded using following approach (hopefully)
- create your own subclass MyLittleExplorerPanel extends
ExplorerPanel, possibly as inner class of your MyBigTopComponent
extends CloneableTopComponent. Then simply delegate from
MyBigTopComponent.componentActivated to
MyLittleExplorerPanel.componentActivated.

Side question for David Strupl - why explorer panel doesn't support
cloning (extends CloneableTC), do you know?
Comment 6 David Strupl 2002-02-14 07:42:02 UTC
I have no idea.
Comment 7 _ lkramolis 2002-02-14 09:26:55 UTC
Workaround applied, thanks.

Closed as WONTFIX.
Comment 8 Quality Engineering 2003-07-01 15:52:33 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified
Comment 9 Quality Engineering 2003-07-01 16:09:47 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.