Community
Participate
Working Groups
We would like to request that org.eclipse.ui.internal.registry.WizardsRegistryReader be made API (removed from an internal package) and also that the Class Cast Exception which results whenever you call findWizard(String id) be fixed. WizardsRegistryReader has only one subclass in the base Platform, org.eclipse.ui.internal.registry.NewWizardsRegistryReader, which overrides the findWizard(String id), so it is not susceptible to the Class Cast Exception defect. In our case, we are building a custom Navigator, and would like to provide ways to re-use the Import/Export wizards specified through the standard Eclipse extension points, but add these in a selective way to the context menus. If we could re-use the above class (WizardsRegistryReader), it would provide a clean implementation. We were able to do this with the NewWizardsRegistryReader. The problem we're running across is with the following method: /** * Returns the first wizard with a given id. */ public WorkbenchWizardElement findWizard(String id) { Object [] wizards = getWizardCollectionElements(); for (int nX = 0; nX < wizards.length; nX ++) { WizardCollectionElement collection = (WizardCollectionElement)wizards[nX]; WorkbenchWizardElement element = collection.findWizard(id,true); if (element != null) return element; } return null; } On "WizardCollectionElement collection = (WizardCollectionElement)wizards[nX];", there is a Class Cast Exception because all of the elements in the array are WorkbenchWizardElements. We corrected this in a subclass, by overriding the method as follows: public WorkbenchWizardElement findWizard(String id) { if(id == null || id.length() == 0) return null; Object[] wizards = getWizardCollectionElements(); for (int nX = 0; nX < wizards.length; nX++) { // WizardCollectionElement collection = (WizardCollectionElement) wizards[nX]; // WorkbenchWizardElement element = collection.findWizard(id, true); WorkbenchWizardElement element = (WorkbenchWizardElement)wizards[nX]; if(element != null && element.getID().equals(id)) return element; } return null; } Is there another way we should be reading these extension points? Any guidance would be appreciated. Additionally, we would like to request a standard WizardShortcutAction like the NewWizardShortcutAction. The NewWizardShortcutAction fails because it tries to cast to INewWizard, which does not work (clearly) for Import/Export wizards. Incidentally, changing the creation and cast of the INewWizard variable in the NewWizardShortcutAction.run() to org.eclipse.ui.IWorkbenchWizard works fine, as there are no actual dependencies on the INewWizard interface (given that the interface defines no methods ;).
Which build of 3.0 are you referencing this code against?
Sorry for the oversite. We are currently building on 3.0 M7.
Not for 3.0
Reopening now that 3.0 has shipped
Prakash is now responsible for watching bugs in the [Wizards] component area.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.