问题
When the user presses the 'next' button in my jface wizard, it will be communicating with my server asynchronouly. However this operation cannnot be cancelled, so I want to basically disable the 'Cancel' button temporarily in my jface wizard and also if possible the 'close' button in the title bar.
Is this possible?
回答1:
How are you communicating with the server? Are you running it inside IWizardContainer.run()? you can pass cancellable = false.
回答2:
pass your long-running code wrapped by IRunnableWithProgress
into wizard.getContainer().run(true, false, rwp)
. Inside your code you will have access to IProgressMonitor
, which basically controls the visual progress bar.
来源:https://stackoverflow.com/questions/5827595/can-you-disable-the-cancel-button-in-a-jface-wizard