<p>I'm writing a wizard for an Eclipse RCP application.  After doing some processing on a file and taking some user input, I don't want to let the user go back to make changes.  At this point they must either accept or reject the changes they are about to make to the system.</p>

<p>What I can't seem to find is a method call that lets me override the buttons that display or the user's ability to hit the back button.  I'd prefer that it not be there or at least be disabled.</p>

<p>Has anyone found a way to do this using the <a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/wizard/package-summary.html" rel="noreferrer">JFace Wizard</a> and <a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/wizard/package-summary.html" rel="noreferrer">WizardPage</a>?</p>

<p>Usability-wise, am I breaking wizard conventions?  Should I consider a different approach to the problem?</p>

[{'answer_id': 45870, 'author': 'jodonnell', 'author_id': 4223, 'author_profile': 'https://Stackoverflow.com/users/4223', 'pm_score': 5, 'selected': True, 'text': '<p>You can return null from the getPreviousPage() method in your wizard page implementation.</p>\n'}, {'answer_id': 45877, 'author': 'Chris Upchurch', 'author_id': 2600, 'author_profile': 'https://Stackoverflow.com/users/2600', 'pm_score': 2, 'selected': False, 'text': "<p>From a UI perspective this seems rather bad.  Your users are going to get frustrated if they make a mistake and want to go back and correct it and you don't let them.  I think it would be much better to change the application to allow going back rather than looking for ways to prevent it.</p>\n"}, {'answer_id': 92383, 'author': 'Heath Borders', 'author_id': 9636, 'author_profile': 'https://Stackoverflow.com/users/9636', 'pm_score': 0, 'selected': False, 'text': '<p>There is no way to do this using standard JFace wizard APIs.  My team accomplished this by writing a custom WizardDialog.  We did this on an Eclipse RCP application and not on an eclipse plugin.  Disabling the back button is breaking convention, but our business analysts really wanted the functionality.</p>\n'}, {'answer_id': 6780595, 'author': 'Nick Sawadsky', 'author_id': 856583, 'author_profile': 'https://Stackoverflow.com/users/856583', 'pm_score': 3, 'selected': False, 'text': '<p>Expanding on jodonell\'s answer:</p>\n\n<p>Disabling the back button is harder than it should be, due to non-intuitive behavior in the default implementation of WizardPage.getPreviousPage().  You can call setPreviousPage( null ), and getPreviousPage() still returns the previous page.  You need to override the implementation of getPreviousPage() in order to disable the back button:</p>\n\n<pre><code>public abstract class MyWizardPage extends WizardPage {\n    private boolean backButtonEnabled = true;\n\n    public void setBackButtonEnabled(boolean enabled) {\n        backButtonEnabled = enabled;\n        getContainer().updateButtons();\n    }\n\n    @Override\n    public IWizardPage getPreviousPage() {\n        if (!backButtonEnabled) {\n            return null;\n        }\n        return super.getPreviousPage();\n    }\n}\n</code></pre>\n\n<p>See my blog post for a few more JFace wizard tips and tricks:</p>\n\n<p><a href="http://nsawadsky.blogspot.com/2011/07/jface-wizard-tips-and-tricks.html" rel="noreferrer">http://nsawadsky.blogspot.com/2011/07/jface-wizard-tips-and-tricks.html</a></p>\n'}]
['https://Stackoverflow.com/questions/45865', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4513/']