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 83243 - Need getComponentType() method on WSDLComponent
Summary: Need getComponentType() method on WSDLComponent
Status: VERIFIED WONTFIX
Alias: None
Product: xml
Classification: Unclassified
Component: WSDL Model (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-23 02:32 UTC by Nathan Fiedler
Modified: 2007-11-05 11:20 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Fiedler 2006-08-23 02:32:07 UTC
The schema model provides a method called getComponentType() on the
SchemaComponent interface which returns a Class indicating the type of the
component (e.g. GlobalElement). This is necessary for the WSDL tools to
implement the paste action appropriately on the category nodes, which may only
contain components of a specific type, such that paste should be disabled for
components of the wrong type. Without something like getComponentType(), this
cannot be done.
Comment 1 Nam Nguyen 2006-08-23 20:06:39 UTC
Please explain why we could not just use:
  type.isAssignableFrom(component.getClass()) 
where type is the type intended for the categorization node.
Comment 2 Nathan Fiedler 2006-08-23 21:20:41 UTC
I do not have a specific example for the WSDL model, but this was an issue for
the Schema model. The reason is that the concrete implementations of the schema
components do not necessarily 'implement' the interface they are implementing (I
don't have an example handy, but Chris knows exactly what I'm talking about).
Thus, using instanceof or similar operations was ineffective. We needed a way to
ask the implementation what type of element it was representing. Chris said he
could try to redesign the impl classes, but it was easier to add the
getComponentType() method instead.
Comment 3 Nathan Fiedler 2006-08-23 21:53:12 UTC
I am going to attempt to use the solution suggested by Nam, so this issue can be
marked as wontfix. However, it may eventually turn out that this will fail as I
have described, so this issue may be re-opened at a later time.
Comment 4 Nam Nguyen 2007-01-11 03:50:19 UTC
Close this as won't fix for now.  Please reopen if there is actual such use case
on WSDL model.
Comment 5 jlautz 2007-11-05 11:20:35 UTC
Closing as verified, as it has not been reopened.