### Eclipse Workspace Patch 1.0 #P org.jboss.tools.deltacloud.ui Index: src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java =================================================================== --- src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java (revision 28346) +++ src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java (working copy) @@ -79,6 +79,7 @@ private final static String CONFIRM_KEY_DELETE_MSG = "ConfirmKeyDelete.msg"; //$NON-NLS-1$ private ManageKeysPageModel model; + private DataBindingContext dbc; private class Key2IdConverter extends Converter { @@ -124,7 +125,7 @@ @Override public void createControl(Composite parent) { - DataBindingContext dbc = new DataBindingContext(); + this.dbc = new DataBindingContext(); // WizardPageSupport.create(this, dbc); bindWizardComplete(dbc); @@ -186,6 +187,11 @@ new UpdateValueStrategy().setConverter(new ObjectNotNullToBoolean())); } + @Override + public void setPageComplete(boolean complete) { + super.setPageComplete(complete); + } + private List createKeyList(DataBindingContext dbc, Composite container) { final List keyList = new List(container, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL); // bind items @@ -254,7 +260,7 @@ } }; try { - WizardUtils.runInWizard(job, getContainer()); + WizardUtils.runInWizard(job, getContainer(), dbc); } catch (Exception e) { // ignore since the job will report its failure } @@ -396,7 +402,7 @@ } } }; - WizardUtils.runInWizard(job, getContainer()); + WizardUtils.runInWizard(job, getContainer(), dbc); } catch (Exception e) { // ignore } @@ -447,7 +453,9 @@ } } }; - WizardUtils.runInWizard(job, getContainer()); + WizardUtils.runInWizard(job, getContainer(), dbc); +// // WORKAROUND (wizard runnable service always reenables OK-button) +// setPageComplete(isPageComplete()); } catch (Exception e) { // ignore } Index: src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java =================================================================== --- src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java (revision 28342) +++ src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java (working copy) @@ -13,6 +13,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.concurrent.CountDownLatch; +import org.eclipse.core.databinding.DataBindingContext; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.Job; @@ -43,6 +44,9 @@ * the interrupted exception * * @author André Dietisheim + * + * @see IWizardContainer#run(boolean, boolean, IRunnableWithProgress) + * @see Job */ public static void runInWizard(final Job job, IWizardContainer container) throws InvocationTargetException, InterruptedException { @@ -66,6 +70,36 @@ } /** + * Runs the given job in the given wizard container. + *
+ * Furhtermore it updates the models and targets of the given data binding + * context. This might be necessary if the given job will change widget + * enablements in the calling wizard page. The reason for this being needed + * is that the runner saves the widget enablement state when before it + * executes the given runnable. It the restores those states of all widgets + * in the calling page once he finished the given runnable. It may therefore + * restore incorrect states since the job changed those enablements while + * the runner was executing the job. + * + * @param job + * the job + * @param container + * the container + * @param dbc + * the dbc + * @throws InvocationTargetException + * the invocation target exception + * @throws InterruptedException + * the interrupted exception + */ + public static void runInWizard(final Job job, IWizardContainer container, final DataBindingContext dbc) + throws InvocationTargetException, InterruptedException { + runInWizard(job, container); + dbc.updateTargets(); + dbc.updateModels(); + } + + /** * Flips to the next wizard page or finishes the current wizard. * * @param wizardPage