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.
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.
Please explain why we could not just use: type.isAssignableFrom(component.getClass()) where type is the type intended for the categorization node.
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.
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.
Close this as won't fix for now. Please reopen if there is actual such use case on WSDL model.
Closing as verified, as it has not been reopened.