Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 103171 Details for
Bug 235195
[Wizards] [DataBinding] Non-error statuses not handled correctly by WizardPageSupport class
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch along with a simple unit test
patch_235195.txt (text/plain), 6.29 KB, created by
Ovidio Mallo
on 2008-06-02 14:29:12 EDT
(
hide
)
Description:
Proposed patch along with a simple unit test
Filename:
MIME Type:
Creator:
Ovidio Mallo
Created:
2008-06-02 14:29:12 EDT
Size:
6.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface.databinding >Index: src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java,v >retrieving revision 1.5 >diff -u -r1.5 WizardPageSupport.java >--- src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java 15 May 2008 23:19:43 -0000 1.5 >+++ src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java 2 Jun 2008 18:27:54 -0000 >@@ -188,7 +188,7 @@ > } else if (currentStatus != null > && currentStatus.getSeverity() != IStatus.OK) { > int severity = currentStatus.getSeverity(); >- wizardPage.setPageComplete((severity & IStatus.CANCEL) != 0); >+ wizardPage.setPageComplete((severity & IStatus.CANCEL) == 0); > int type; > switch (severity) { > case IStatus.OK: >#P org.eclipse.jface.tests.databinding >Index: src/org/eclipse/jface/tests/databinding/BindingTestSuite.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java,v >retrieving revision 1.84 >diff -u -r1.84 BindingTestSuite.java >--- src/org/eclipse/jface/tests/databinding/BindingTestSuite.java 25 Apr 2008 23:16:36 -0000 1.84 >+++ src/org/eclipse/jface/tests/databinding/BindingTestSuite.java 2 Jun 2008 18:27:55 -0000 >@@ -132,6 +132,7 @@ > import org.eclipse.jface.tests.databinding.viewers.ObservableSetContentProviderTest; > import org.eclipse.jface.tests.databinding.viewers.ObservableSetTreeContentProviderTest; > import org.eclipse.jface.tests.databinding.viewers.ViewersObservablesTest; >+import org.eclipse.jface.tests.databinding.wizard.WizardPageSupportTest; > import org.eclipse.jface.tests.examples.databinding.mask.internal.EditMaskLexerAndTokenTest; > import org.eclipse.jface.tests.examples.databinding.mask.internal.EditMaskParserTest; > import org.eclipse.jface.tests.internal.databinding.swt.ButtonObservableValueTest; >@@ -333,6 +334,9 @@ > addTestSuite(ObservableSetTreeContentProviderTest.class); > addTestSuite(ViewersObservablesTest.class); > >+ // org.eclipse.jface.tests.databinding.wizard >+ addTestSuite(WizardPageSupportTest.class); >+ > //org.eclipse.jface.tests.example.databinding.mask.internal > addTestSuite(EditMaskLexerAndTokenTest.class); > addTestSuite(EditMaskParserTest.class); >Index: src/org/eclipse/jface/tests/databinding/wizard/WizardPageSupportTest.java >=================================================================== >RCS file: src/org/eclipse/jface/tests/databinding/wizard/WizardPageSupportTest.java >diff -N src/org/eclipse/jface/tests/databinding/wizard/WizardPageSupportTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/tests/databinding/wizard/WizardPageSupportTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,104 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Ovidio Mallo and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Ovidio Mallo - initial API and implementation (bug 235195) >+ ******************************************************************************/ >+ >+package org.eclipse.jface.tests.databinding.wizard; >+ >+import org.eclipse.core.databinding.DataBindingContext; >+import org.eclipse.core.databinding.ValidationStatusProvider; >+import org.eclipse.core.databinding.observable.Observables; >+import org.eclipse.core.databinding.observable.list.IObservableList; >+import org.eclipse.core.databinding.observable.value.IObservableValue; >+import org.eclipse.core.databinding.observable.value.WritableValue; >+import org.eclipse.core.databinding.validation.ValidationStatus; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.jface.databinding.wizard.WizardPageSupport; >+import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; >+import org.eclipse.jface.wizard.IWizardPage; >+import org.eclipse.jface.wizard.Wizard; >+import org.eclipse.jface.wizard.WizardDialog; >+import org.eclipse.jface.wizard.WizardPage; >+import org.eclipse.swt.widgets.Composite; >+ >+/** >+ * @since 1.2 >+ */ >+public class WizardPageSupportTest extends AbstractSWTTestCase { >+ >+ /** >+ * Bug 235195. >+ */ >+ public void testPageComplete() { >+ IWizardPage page = new WizardPage("Page") { >+ public void createControl(Composite parent) { >+ setControl(parent); >+ >+ IObservableValue validation = new WritableValue( >+ ValidationStatus.ok(), IStatus.class); >+ >+ DataBindingContext dbc = new DataBindingContext(); >+ ValidationProvider validationProvider = new ValidationProvider( >+ validation); >+ dbc.addValidationStatusProvider(validationProvider); >+ >+ WizardPageSupport.create(this, dbc); >+ >+ assertTrue(isPageComplete()); >+ >+ validation.setValue(ValidationStatus.info("INFO")); >+ assertTrue(isPageComplete()); >+ >+ validation.setValue(ValidationStatus.warning("WARNING")); >+ assertTrue(isPageComplete()); >+ >+ validation.setValue(ValidationStatus.error("ERROR")); >+ assertFalse(isPageComplete()); >+ >+ validation.setValue(ValidationStatus.cancel("CANCEL")); >+ assertFalse(isPageComplete()); >+ } >+ }; >+ >+ loadWizardPage(page); >+ } >+ >+ private void loadWizardPage(IWizardPage page) { >+ Wizard wizard = new Wizard() { >+ public boolean performFinish() { >+ return true; >+ } >+ }; >+ wizard.addPage(page); >+ >+ WizardDialog dialog = new WizardDialog(getShell(), wizard); >+ dialog.create(); >+ } >+ >+ private class ValidationProvider extends ValidationStatusProvider { >+ >+ private final IObservableValue validation; >+ >+ public ValidationProvider(IObservableValue validation) { >+ this.validation = validation; >+ } >+ >+ public IObservableValue getValidationStatus() { >+ return validation; >+ } >+ >+ public IObservableList getTargets() { >+ return Observables.emptyObservableList(); >+ } >+ >+ public IObservableList getModels() { >+ return Observables.emptyObservableList(); >+ } >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bokowski
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 235195
: 103171