PDA

View Full Version : custom Feature Panel



jadunn
04-21-2003, 04:44 PM
I am trying to create a custom bean that looks similar to the Feature Panel, with a hierarchy of checkboxes.

Does anyone here have experience with this? I am having a bit of trouble getting started with this.

Thanks

samwong
04-21-2003, 06:06 PM
Hi,

Our group needs to customize the feature panel as well. I have some ideas but haven't tried it yet. In the custom wizard bean, you can retrieve the product service using getService(ProductService.NAME). From product service, you can try to use getSoftwareObjectTree() to get the ProductTree object. Using ProductTree, you should be able to traverse the product beans. We are probably going to do a prototype in the next few weeks for our project. Please let me know if you got it working.

Regards,

Samuel Wong
Silicon Valley Lab, IBM.

rblocher
04-27-2003, 12:28 PM
I don't think that would work. The api doc for getSoftwareObjectTree() says:
"The returned product tree is a copy of the information stored in the actual product tree, thus you cannot manipulate the actual product tree directly using the returned object."

I'm trying to get a reference to the real ProductTree (from a wizard bean) for a different reason, but so far haven't figured out how.

Russ Blocher
IBM RTP

samwong
04-28-2003, 01:47 PM
How about extending FeaturePanel itself? FeaturePanel has a getProductTree() method. I hope this works.

Samuel Wong
IBM

William
04-28-2003, 07:23 PM
What is the need for direct interaction with the product tree? Normally, interaction with the product tree should be initiated through the product service methods. For example, changing the active state of a particular feature can cause he change in state for several beans within the tree due to parent-child relationships as well as requirement relationships. Direct interaction with the product tree is not recommended, since there is quite a bit which goes on behind the scenes when modifications to the tree are triggered through product service methods to ensure that the entire tree is up-to-date.

The "getSoftwareObjectTree()" method is used to obtain a copy of the tree and allows the specific properties you are interested in to be set as a parameter to the method. The FeaturePanel, for example, obtains the tree in this manner to determine information about which features are visible and which are active, for example. Any change in active states triggered through the feature panel is sent to the product service as a call to "setProductBeanProperty()", after which the software object tree is refreshed through a call to "getSoftwareObjectTree()" In that manner, the FeaturePanel can (1) modify the product tree and (2) obtain the information necessary to update the UI appropriately to take the overall changes into account.

William
04-28-2003, 07:24 PM
Whoops... wasn't done... =)

What is the paricular use case you are looking at?

Is there a reason why interaction with the product tree in the manner described previously would not fit your needs?

gigistan
11-16-2004, 08:51 AM
In order to encourage you and to complete the Wiliam's post, I should remember that you can have tree components that requires other tree components ... so in the gui when deselecting an selected component required by another selected component you should give a warning to the user (or automatically deselect that component also) and ... remember : these references are also kept into the the product tree as "reference" object so do not forget to update them also.