Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 204837 - [CommonNavigator] commonWizard with no pages displays empty dialog
Summary: [CommonNavigator] commonWizard with no pages displays empty dialog
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Francis Upton IV CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-27 13:25 EDT by Chris Torrence CLA
Modified: 2009-06-03 13:05 EDT (History)
1 user (show)

See Also:


Attachments
Contains a fix for this issue (1.34 KB, patch)
2008-09-10 02:28 EDT, Murat Eken CLA
emoffatt: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Torrence CLA 2007-09-27 13:25:53 EDT
Build ID: I20070625-1500

Steps To Reproduce:
Create a Navigator context menu item for New->Untitled Text File, by adding the following to your plugin.xml:
<extension point="org.eclipse.ui.navigator.navigatorContent">
 <commonWizard type="new"
   wizardId="org.eclipse.ui.editors.wizards.UntitledTextFileWizard">
    <enablement>
      <adapt type="org.eclipse.core.resources.IResource" /> 
    </enablement>
 </commonWizard>
</extension>

This wizard does not have any pages. However, when you select it from the Navigator context menu, you will get an empty dialog with just Finish and Cancel buttons. This wizard works fine (the dialog is not displayed) when used from the main File->New menu.

This is similar to bug 177468, which was the same problem but with wizards within Cheat Sheets.

Here, the problem is within org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction. In the run() method, just after the call to wizard.init(), but before the window.getShell(), we need to have:

if (descriptor.canFinishEarly() && !descriptor.hasPages()) {
    wizard.performFinish();
    return;
}

I have tested the above fix against the 3.3 (I20070625-1500) build and it works correctly.
Comment 1 Chris Torrence CLA 2007-12-27 16:49:05 EST
Any possibility of getting this fixed for Eclipse 3.4? I am currently shipping a hacked version of org.eclipse.ui.navigator with my RCP app, just to get around this problem. I would like to avoid having to put the same hack into Eclipse 3.4 once I upgrade my RCP app.
Comment 2 Michael D. Elder CLA 2008-01-01 21:12:48 EST
We'll take a look for inclusion in the next milestone.
Comment 3 Chris Torrence CLA 2008-04-04 11:33:08 EDT
Just wanted to find out if this could be fixed in time for 3.4M7? I don't want to ship a hacked version of org.eclipse.ui.navigator, like we had to do for Eclipse 3.3... This is the only bug that is holding our product up from switching to 3.4.

Here is the fix:

In org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction. In the run()
method, just after the call to wizard.init(), but before the window.getShell(),
we need to have:

if (descriptor.canFinishEarly() && !descriptor.hasPages()) {
    wizard.performFinish();
    return;
}

I just tried this against 3.4M6 and it fixes the problem.
Comment 4 Chris Torrence CLA 2008-07-29 17:34:06 EDT
Any chance of getting this into Eclipse 3.4.1? It sure would be nice if our product did not have to ship a hacked (and hence digitally unsigned) version of org.eclipse.ui.navigator.
Comment 5 Murat Eken CLA 2008-09-10 02:28:29 EDT
Created attachment 112164 [details]
Contains a fix for this issue

Attached the proposed solution as a patch, all you need to do is apply and test; it would be great if this made it for the next release.
Comment 6 Francis Upton IV CLA 2008-09-16 11:46:31 EDT
Chris, this came to my attention too late for 3.4.1 (there were many other CNF fixes that did get into 3.4.1, but somehow I missed this one).

Sorry I did not get the time to do this for 3.5M2, hopefully it will be in soon and then you can take an I build with the fix.
Comment 7 Francis Upton IV CLA 2009-01-15 03:41:29 EST
Released to HEAD 3.5M5