This commit was manufactured by cvs2svn to create tag 'I20070327-0010'.
Sprout from master 2007-03-26 18:51:44 UTC Tod Creasey <tod> 'Fix for Bug 178654 Add test suites for DecoratingLabelProvider'
Cherrypick from master 2007-03-26 19:54:54 UTC Eric Moffatt <emoffatt> '*** empty log message ***':
bundles/org.eclipse.ui/buildnotes_workbench.html
Delete:
bundles/org.eclipse.core.commands/.classpath
bundles/org.eclipse.core.commands/.cvsignore
bundles/org.eclipse.core.commands/.project
bundles/org.eclipse.core.commands/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.core.commands/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.core.commands/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.core.commands/META-INF/MANIFEST.MF
bundles/org.eclipse.core.commands/about.html
bundles/org.eclipse.core.commands/build.properties
bundles/org.eclipse.core.commands/component.xml
bundles/org.eclipse.core.commands/plugin.properties
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/AbstractHandler.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/AbstractHandlerWithState.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/AbstractParameterValueConverter.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/Category.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/CategoryEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/Command.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/CommandEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/CommandManager.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/CommandManagerEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ExecutionEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ExecutionException.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/HandlerEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ICategoryListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ICommandListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ICommandManagerListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IExecutionListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IExecutionListenerWithChecks.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IHandler.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IHandlerAttributes.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IHandlerListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/INamedHandleStateIds.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IObjectWithState.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IParameter.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IParameterTypeListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IParameterValues.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/IStateListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ITypedParameter.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/NamedHandleObjectWithState.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/NotEnabledException.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/NotHandledException.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterType.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterTypeEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterValueConversionException.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterValuesException.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/Parameterization.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/ParameterizedCommand.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/SerializationException.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/State.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/AbstractBitSetEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/AbstractHandleObjectEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/AbstractNamedHandleEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/CommandException.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/EventManager.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/HandleObject.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/HandleObjectManager.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/IIdentifiable.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/NamedHandleObject.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/NamedHandleObjectComparator.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/NotDefinedException.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/common/package.html
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/contexts/Context.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/contexts/ContextEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/contexts/ContextManager.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/contexts/ContextManagerEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/contexts/IContextListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/contexts/IContextManagerListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/contexts/package.html
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/AbstractOperation.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/DefaultOperationHistory.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IAdvancedUndoableOperation.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IAdvancedUndoableOperation2.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/ICompositeOperation.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IContextReplacingOperation.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IOperationApprover.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IOperationApprover2.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IOperationHistory.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IOperationHistoryListener.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IUndoContext.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IUndoableOperation.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/LinearUndoEnforcer.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/LinearUndoViolationDetector.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/ObjectUndoContext.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/OperationHistoryEvent.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/OperationHistoryFactory.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/OperationStatus.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/TriggeredOperations.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/UndoContext.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/package.html
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/package.html
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/util/Tracing.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/internal/commands/operations/GlobalUndoContext.java
bundles/org.eclipse.core.commands/src/org/eclipse/core/internal/commands/util/Util.java
bundles/org.eclipse.core.databinding.beans/.classpath
bundles/org.eclipse.core.databinding.beans/.cvsignore
bundles/org.eclipse.core.databinding.beans/.project
bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF
bundles/org.eclipse.core.databinding.beans/about.html
bundles/org.eclipse.core.databinding.beans/build.properties
bundles/org.eclipse.core.databinding.beans/plugin.properties
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/BeansObservables.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/IBeanObservable.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/package.html
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableListDecorator.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableSetDecorator.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableValueDecorator.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/IdentityWrapper.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableList.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableMap.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableSet.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableValue.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/ListenerSupport.java
bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/package.html
bundles/org.eclipse.jface.databinding/.classpath
bundles/org.eclipse.jface.databinding/.cvsignore
bundles/org.eclipse.jface.databinding/.project
bundles/org.eclipse.jface.databinding/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.jface.databinding/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.jface.databinding/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.jface.databinding/META-INF/MANIFEST.MF
bundles/org.eclipse.jface.databinding/about.html
bundles/org.eclipse.jface.databinding/build.properties
bundles/org.eclipse.jface.databinding/plugin.properties
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/ISWTObservable.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/ISWTObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/SWTObservables.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/package.html
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ListeningLabelProvider.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableListContentProvider.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableMapLabelProvider.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableSetContentProvider.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ViewersObservables.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/package.html
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ButtonObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableList.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CLabelObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableList.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ControlObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/LabelObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableList.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SWTObservableList.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SWTProperties.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ScaleObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SpinnerObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TableObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextEditableObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/IPrefetchingTree.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/LeafNodesSet.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/OrderedTreeContentProvider.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/OrderedTreeNode.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/PrefetchingTree.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/UnorderedTreeContentProvider.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/UnorderedTreeNode.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTObservableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTVetoableValue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/CompositeUpdater.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/ControlUpdater.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/MenuUpdater.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/SWTUtil.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/TableUpdater.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/WorkQueue.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/ViewerLabelProvider.java
bundles/org.eclipse.ui.browser/.classpath
bundles/org.eclipse.ui.browser/.cvsignore
bundles/org.eclipse.ui.browser/.options
bundles/org.eclipse.ui.browser/.project
bundles/org.eclipse.ui.browser/.settings/org.eclipse.core.resources.prefs
bundles/org.eclipse.ui.browser/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.browser/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.browser/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.browser/about.html
bundles/org.eclipse.ui.browser/build.properties
bundles/org.eclipse.ui.browser/component.xml
bundles/org.eclipse.ui.browser/icons/clcl16/nav_backward.gif
bundles/org.eclipse.ui.browser/icons/clcl16/nav_forward.gif
bundles/org.eclipse.ui.browser/icons/clcl16/nav_go.gif
bundles/org.eclipse.ui.browser/icons/clcl16/nav_home.gif
bundles/org.eclipse.ui.browser/icons/clcl16/nav_print.gif
bundles/org.eclipse.ui.browser/icons/clcl16/nav_refresh.gif
bundles/org.eclipse.ui.browser/icons/clcl16/nav_stop.gif
bundles/org.eclipse.ui.browser/icons/dlcl16/nav_backward.gif
bundles/org.eclipse.ui.browser/icons/dlcl16/nav_forward.gif
bundles/org.eclipse.ui.browser/icons/dlcl16/nav_go.gif
bundles/org.eclipse.ui.browser/icons/dlcl16/nav_home.gif
bundles/org.eclipse.ui.browser/icons/dlcl16/nav_print.gif
bundles/org.eclipse.ui.browser/icons/dlcl16/nav_refresh.gif
bundles/org.eclipse.ui.browser/icons/dlcl16/nav_stop.gif
bundles/org.eclipse.ui.browser/icons/dlcl16/synced.gif
bundles/org.eclipse.ui.browser/icons/elcl16/nav_backward.gif
bundles/org.eclipse.ui.browser/icons/elcl16/nav_forward.gif
bundles/org.eclipse.ui.browser/icons/elcl16/nav_go.gif
bundles/org.eclipse.ui.browser/icons/elcl16/nav_home.gif
bundles/org.eclipse.ui.browser/icons/elcl16/nav_print.gif
bundles/org.eclipse.ui.browser/icons/elcl16/nav_refresh.gif
bundles/org.eclipse.ui.browser/icons/elcl16/nav_stop.gif
bundles/org.eclipse.ui.browser/icons/elcl16/synced.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/1.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/10.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/11.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/12.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/13.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/2.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/3.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/4.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/5.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/6.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/7.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/8.gif
bundles/org.eclipse.ui.browser/icons/obj16/busy/9.gif
bundles/org.eclipse.ui.browser/icons/obj16/external_browser.gif
bundles/org.eclipse.ui.browser/icons/obj16/internal_browser.gif
bundles/org.eclipse.ui.browser/plugin.properties
bundles/org.eclipse.ui.browser/plugin.xml
bundles/org.eclipse.ui.browser/schema/browsers.exsd
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/browser/BrowserFactory.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserDescriptor.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserDescriptorDialog.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserDescriptorWorkingCopy.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserExt.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserLauncher.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserManager.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserText.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserViewer.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BusyIndicator.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ContextIds.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/DefaultBrowserSupport.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ExternalBrowserInstance.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/FallbackScrolledComposite.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/IBrowserDescriptor.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/IBrowserDescriptorWorkingCopy.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/IBrowserExt.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/IBrowserViewerContainer.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ImageResource.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/InternalBrowserEditorInstance.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/InternalBrowserInstance.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/InternalBrowserViewInstance.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/Messages.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/Messages.properties
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/OpenBrowserHandler.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/OpenBrowserWorkbenchAction.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/SWTUtil.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/SystemBrowserDescriptor.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/SystemBrowserInstance.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/TextAction.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ToolbarLayout.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/Trace.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditor.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorActionBarContributor.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreference.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserPreferencePage.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserView.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserViewDropAdapter.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/BrowserLog.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/DefaultBrowser.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/DefaultBrowserFactory.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/MozillaBrowser.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/MozillaFactory.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/NullBrowser.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/browsers/StreamConsumer.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/macosx/DefaultBrowser.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/macosx/DefaultBrowserFactory.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/macosx/SafariBrowser.java
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/macosx/SafariBrowserFactory.java
bundles/org.eclipse.ui.carbon/.classpath
bundles/org.eclipse.ui.carbon/.cvsignore
bundles/org.eclipse.ui.carbon/.project
bundles/org.eclipse.ui.carbon/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.carbon/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.carbon/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.carbon/.template
bundles/org.eclipse.ui.carbon/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.carbon/about.html
bundles/org.eclipse.ui.carbon/build.properties
bundles/org.eclipse.ui.carbon/fragment-carbon.properties
bundles/org.eclipse.ui.carbon/fragment.xml
bundles/org.eclipse.ui.carbon/scripts/exportplugin.xml
bundles/org.eclipse.ui.carbon/src/org/eclipse/ui/carbon/CarbonUIEnhancer.java
bundles/org.eclipse.ui.carbon/src/org/eclipse/ui/carbon/Messages.properties
bundles/org.eclipse.ui.forms/.classpath
bundles/org.eclipse.ui.forms/.cvsignore
bundles/org.eclipse.ui.forms/.options
bundles/org.eclipse.ui.forms/.project
bundles/org.eclipse.ui.forms/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.forms/about.html
bundles/org.eclipse.ui.forms/build.properties
bundles/org.eclipse.ui.forms/component.xml
bundles/org.eclipse.ui.forms/plugin.properties
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/AbstractFormPart.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/DetailsPart.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormColors.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormDialog.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/HyperlinkGroup.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/HyperlinkSettings.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IDetailsPage.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IDetailsPageProvider.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IFormColors.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IFormPart.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IManagedForm.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IMessage.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IMessageManager.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IMessagePrefixProvider.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/IPartSelectionListener.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/ManagedForm.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/MasterDetailsBlock.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/SectionPart.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/editor/FormEditor.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/editor/FormPage.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/editor/IFormPage.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/editor/SharedHeaderFormEditor.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/editor/package.html
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/events/ExpansionAdapter.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/events/ExpansionEvent.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/events/HyperlinkAdapter.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/events/HyperlinkEvent.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/events/IExpansionListener.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/events/IHyperlinkListener.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/events/package.html
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/package.html
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/AbstractHyperlink.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ColumnLayout.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ColumnLayoutData.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Form.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormText.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormToolkit.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Hyperlink.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ILayoutExtension.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ImageHyperlink.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/LayoutCache.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/LayoutComposite.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ScrolledForm.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ScrolledFormText.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ScrolledPageBook.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Section.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/SharedScrolledComposite.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/SizeCache.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/TableWrapData.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/TableWrapLayout.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ToggleHyperlink.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/TreeNode.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Twistie.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/package.html
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/IMessageToolTipManager.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/MessageManager.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/Messages.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/Messages.properties
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/AggregateHyperlinkSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BreakSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BulletParagraph.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/ControlSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/FormHeading.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/FormTextModel.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/FormUtil.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/FormsResources.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/IFocusSelectable.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/IHyperlinkSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/ImageHyperlinkSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/ImageSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/Locator.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/ObjectSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/Paragraph.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/ParagraphSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/PixelConverter.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/SWTUtil.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/SelectionData.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TextHyperlinkSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TextSegment.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TitleRegion.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/WrappedPageBook.java
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/progress.gif
bundles/org.eclipse.ui.ide.application/.classpath
bundles/org.eclipse.ui.ide.application/.project
bundles/org.eclipse.ui.ide.application/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.ide.application/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.ide.application/about.html
bundles/org.eclipse.ui.ide.application/build.properties
bundles/org.eclipse.ui.ide.application/icons/full/eview16/resource_persp.gif
bundles/org.eclipse.ui.ide.application/plugin.properties
bundles/org.eclipse.ui.ide.application/plugin.xml
bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java
bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEIdleHelper.java
bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEWorkbenchAdvisor.java
bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEWorkbenchWindowAdvisor.java
bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/ResourcePerspective.java
bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/dialogs/IDEStartupPreferencePage.java
bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/package.html
bundles/org.eclipse.ui.navigator.resources/.classpath
bundles/org.eclipse.ui.navigator.resources/.cvsignore
bundles/org.eclipse.ui.navigator.resources/.project
bundles/org.eclipse.ui.navigator.resources/.settings/org.eclipse.core.resources.prefs
bundles/org.eclipse.ui.navigator.resources/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.navigator.resources/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.navigator.resources/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.navigator.resources/about.html
bundles/org.eclipse.ui.navigator.resources/build.properties
bundles/org.eclipse.ui.navigator.resources/icons/full/clcl16/collapseall.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/clcl16/synced.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/cview16/filenav_nav.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/elcl16/collapseall.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/elcl16/filter_ps.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/elcl16/synced.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/eview16/resource_persp.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/obj16/workingsets.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/ovr16/error_co.gif
bundles/org.eclipse.ui.navigator.resources/icons/full/ovr16/warning_co.gif
bundles/org.eclipse.ui.navigator.resources/plugin.properties
bundles/org.eclipse.ui.navigator.resources/plugin.xml
bundles/org.eclipse.ui.navigator.resources/prepareforpii.xml
bundles/org.eclipse.ui.navigator.resources/scripts/src.jardesc
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/CopyAction.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/EditActionGroup.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/EditActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/NewActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/OpenActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/PasteAction.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/PortingActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/PropertiesActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/QuickMenuAction.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/RefactorActionGroup.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/RefactorActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/ResourceMgmtActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/ResourceSelectionUtil.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/TextActionHandler.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/WorkManagementActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/WorkingSetActionProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/WorkingSetRootModeActionGroup.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/plugin/NavigatorUIPluginImages.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/plugin/WorkbenchNavigatorMessages.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/plugin/WorkbenchNavigatorPlugin.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/plugin/messages.properties
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceComparator.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionContentProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionLabelProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionSorter.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceLinkHelper.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/TabbedPropertySheetAdapterFactory.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/TabbedPropertySheetProjectExplorerContributor.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/TabbedPropertySheetTitleProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/workingsets/WorkingSetSorter.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/workingsets/WorkingSetsContentProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/workingsets/WorkingSetsLabelProvider.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/ResourceDragAdapterAssistant.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/ResourceDropAdapterAssistant.java
bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/navigator/resources/package.html
bundles/org.eclipse.ui.navigator.resources/test.txt
bundles/org.eclipse.ui.navigator/.classpath
bundles/org.eclipse.ui.navigator/.cvsignore
bundles/org.eclipse.ui.navigator/.project
bundles/org.eclipse.ui.navigator/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.navigator/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.navigator/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.navigator/about.html
bundles/org.eclipse.ui.navigator/build.properties
bundles/org.eclipse.ui.navigator/component.xml
bundles/org.eclipse.ui.navigator/icons/full/clcl16/collapseall.gif
bundles/org.eclipse.ui.navigator/icons/full/clcl16/elipses.gif
bundles/org.eclipse.ui.navigator/icons/full/clcl16/pause.gif
bundles/org.eclipse.ui.navigator/icons/full/clcl16/synced.gif
bundles/org.eclipse.ui.navigator/icons/full/elcl16/collapseall.gif
bundles/org.eclipse.ui.navigator/icons/full/elcl16/filter_ps.gif
bundles/org.eclipse.ui.navigator/icons/full/elcl16/synced.gif
bundles/org.eclipse.ui.navigator/javadoc-images/framework-overview.jpg
bundles/org.eclipse.ui.navigator/javadoc-images/navigator_logical_extension.jpg
bundles/org.eclipse.ui.navigator/jdt-patch/org.eclipse.jdt.ui_patch.txt
bundles/org.eclipse.ui.navigator/models/CommonNavigator.emx
bundles/org.eclipse.ui.navigator/plugin.properties
bundles/org.eclipse.ui.navigator/plugin.xml
bundles/org.eclipse.ui.navigator/schema/linkHelper.exsd
bundles/org.eclipse.ui.navigator/schema/navigatorContent.exsd
bundles/org.eclipse.ui.navigator/schema/viewer.exsd
bundles/org.eclipse.ui.navigator/scripts/src.jardesc
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/AdaptabilityUtility.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CommonNavigatorActionGroup.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CommonNavigatorManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CommonNavigatorMessages.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CommonViewerSiteDelegate.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CommonViewerSiteIEditorPartSiteDelegate.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CommonViewerSiteIPageSiteDelegate.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CommonViewerSiteIViewSiteDelegate.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/ContributorTrackingSet.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/CustomAndExpression.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/INavigatorHelpContextIds.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorActivationService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceContentProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceDescriptionProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorContentServiceLabelProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorFilterService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorImages.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorPipelineService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorPlugin.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorSaveablesService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorSiteEditor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/ReusableViewerLabel.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/StringMatcher.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/TextActionHandler.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/VisibilityAssistant.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/CollapseAllAction.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/CommonActionDescriptorManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/CommonActionProviderDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/LinkEditorAction.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/dnd/CommonDropAdapterDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/dnd/CommonDropDescriptorManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/dnd/NavigatorContentServiceTransfer.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/dnd/NavigatorDnDService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/dnd/NavigatorPluginDropAction.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/dnd/SkeletonCommonDropAssistant.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/Binding.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/CommonActionExtensionSite.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/CommonContentExtensionSite.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/CommonDragAssistantDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/CommonExtensionSite.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/EvalutationReference.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/ExtensionPriorityComparator.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/ExtensionStateModel.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/ILinkHelperExtPtConstants.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/INavigatorContentExtPtConstants.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/INavigatorSiteEditor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/IViewerExtPtConstants.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/LinkHelperDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/LinkHelperManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/LinkHelperService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/NavigatorContentDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/NavigatorContentDescriptorManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/NavigatorContentExtension.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/NavigatorContentRegistryReader.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/NavigatorViewerDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/NavigatorViewerDescriptorManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/OverridePolicy.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/RegistryReader.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SafeDelegateCommonLabelProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SafeDelegateTreeContentProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SkeletonActionProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SkeletonCommonDragAssistant.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SkeletonLabelProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SkeletonLinkHelper.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/SkeletonTreeContentProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/extensions/StructuredViewerManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/CommonFilterContentProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/CommonFilterDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/CommonFilterDescriptorManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/CommonFilterLabelProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/CommonFilterSelectionDialog.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/CommonFiltersTab.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/ContentDescriptorContentProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/ContentExtensionsTab.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/CoreExpressionFilter.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/CustomizationTab.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/FilterActionGroup.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/FilterDialogSelectionListener.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/SelectFiltersAction.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/SkeletonViewerFilter.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/ToggleFilterAction.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/UpdateActiveExtensionsOperation.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/filters/UpdateActiveFiltersOperation.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/messages.properties
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/sorters/CommonSorterDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/sorters/CommonSorterDescriptorManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/sorters/NavigatorSorterService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/sorters/SkeletonViewerSorter.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/wizards/CommonWizardDescriptorManager.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/wizards/WizardShortcutAction.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonActionProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonDragAdapter.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonDragAdapterAssistant.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonDropAdapter.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonDropAdapterAssistant.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewer.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewerSiteFactory.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewerSorter.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonActionConstants.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonActionExtensionSite.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonContentExtensionSite.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonContentProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonFilterDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonLabelProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonMenuConstants.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonViewerSite.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ICommonViewerWorkbenchSite.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/IDescriptionProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/IExtensionActivationListener.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/IExtensionStateModel.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/ILinkHelper.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/IMementoAware.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorActivationService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorContentDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorContentExtension.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorContentService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorContentServiceListener.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorDnDService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorFilterService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorPipelineService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorSaveablesService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorSorterService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/INavigatorViewerDescriptor.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/IPipelinedTreeContentProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/MenuInsertionPoint.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/NavigatorActionService.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/NavigatorContentServiceFactory.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/PipelinedShapeModification.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/PipelinedViewerUpdate.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/Priority.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/SaveablesProvider.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/WizardActionGroup.java
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/package.html
bundles/org.eclipse.ui.presentations.r21/.classpath
bundles/org.eclipse.ui.presentations.r21/.cvsignore
bundles/org.eclipse.ui.presentations.r21/.project
bundles/org.eclipse.ui.presentations.r21/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.presentations.r21/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.presentations.r21/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.presentations.r21/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.presentations.r21/README.TXT
bundles/org.eclipse.ui.presentations.r21/about.html
bundles/org.eclipse.ui.presentations.r21/build.properties
bundles/org.eclipse.ui.presentations.r21/component.xml
bundles/org.eclipse.ui.presentations.r21/plugin.properties
bundles/org.eclipse.ui.presentations.r21/plugin.xml
bundles/org.eclipse.ui.presentations.r21/r21presentation.ini
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/R21BasicStackPresentation.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/R21EditorStackPresentation.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/R21PresentationFactory.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/R21ViewStackPresentation.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/R21Colors.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/R21PresentationMessages.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/R21PresentationPlugin.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/messages.properties
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/widgets/CTabFolder.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/widgets/CTabFolderEvent.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/widgets/CTabFolderListener.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/widgets/CTabItem.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/widgets/R21PaneFolder.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/widgets/R21PaneFolderButtonListener.java
bundles/org.eclipse.ui.presentations.r21/src/org/eclipse/ui/internal/presentations/r21/widgets/ViewForm.java
bundles/org.eclipse.ui.tutorials.rcp.part1/.classpath
bundles/org.eclipse.ui.tutorials.rcp.part1/.cvsignore
bundles/org.eclipse.ui.tutorials.rcp.part1/.project
bundles/org.eclipse.ui.tutorials.rcp.part1/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.tutorials.rcp.part1/build.properties
bundles/org.eclipse.ui.tutorials.rcp.part1/part1.product
bundles/org.eclipse.ui.tutorials.rcp.part1/plugin.xml
bundles/org.eclipse.ui.tutorials.rcp.part1/src/org/eclipse/ui/tutorials/rcp/part1/Application.java
bundles/org.eclipse.ui.tutorials.rcp.part1/src/org/eclipse/ui/tutorials/rcp/part1/ApplicationActionBarAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part1/src/org/eclipse/ui/tutorials/rcp/part1/ApplicationWorkbenchAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part1/src/org/eclipse/ui/tutorials/rcp/part1/ApplicationWorkbenchWindowAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part1/src/org/eclipse/ui/tutorials/rcp/part1/Part1Plugin.java
bundles/org.eclipse.ui.tutorials.rcp.part1/src/org/eclipse/ui/tutorials/rcp/part1/Perspective.java
bundles/org.eclipse.ui.tutorials.rcp.part2/.classpath
bundles/org.eclipse.ui.tutorials.rcp.part2/.cvsignore
bundles/org.eclipse.ui.tutorials.rcp.part2/.project
bundles/org.eclipse.ui.tutorials.rcp.part2/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.tutorials.rcp.part2/build.properties
bundles/org.eclipse.ui.tutorials.rcp.part2/part2.product
bundles/org.eclipse.ui.tutorials.rcp.part2/plugin.xml
bundles/org.eclipse.ui.tutorials.rcp.part2/src/org/eclipse/ui/tutorials/rcp/part2/Application.java
bundles/org.eclipse.ui.tutorials.rcp.part2/src/org/eclipse/ui/tutorials/rcp/part2/ApplicationActionBarAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part2/src/org/eclipse/ui/tutorials/rcp/part2/ApplicationWorkbenchAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part2/src/org/eclipse/ui/tutorials/rcp/part2/ApplicationWorkbenchWindowAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part2/src/org/eclipse/ui/tutorials/rcp/part2/Part2Plugin.java
bundles/org.eclipse.ui.tutorials.rcp.part2/src/org/eclipse/ui/tutorials/rcp/part2/Perspective.java
bundles/org.eclipse.ui.tutorials.rcp.part3/.classpath
bundles/org.eclipse.ui.tutorials.rcp.part3/.cvsignore
bundles/org.eclipse.ui.tutorials.rcp.part3/.project
bundles/org.eclipse.ui.tutorials.rcp.part3/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.tutorials.rcp.part3/build.properties
bundles/org.eclipse.ui.tutorials.rcp.part3/icons/sample.gif
bundles/org.eclipse.ui.tutorials.rcp.part3/icons/sample.icns
bundles/org.eclipse.ui.tutorials.rcp.part3/icons/sample2.gif
bundles/org.eclipse.ui.tutorials.rcp.part3/icons/sample3.gif
bundles/org.eclipse.ui.tutorials.rcp.part3/part3.product
bundles/org.eclipse.ui.tutorials.rcp.part3/plugin.properties
bundles/org.eclipse.ui.tutorials.rcp.part3/plugin.xml
bundles/org.eclipse.ui.tutorials.rcp.part3/product_lg.gif
bundles/org.eclipse.ui.tutorials.rcp.part3/splash.bmp
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/Application.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/ApplicationActionBarAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/ApplicationWorkbenchAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/ApplicationWorkbenchWindowAdvisor.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/ICommandIds.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/MessagePopupAction.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/NavigationView.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/OpenViewAction.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/Part3Plugin.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/Perspective.java
bundles/org.eclipse.ui.tutorials.rcp.part3/src/org/eclipse/ui/tutorials/rcp/part3/View.java
bundles/org.eclipse.ui.views.properties.tabbed/.classpath
bundles/org.eclipse.ui.views.properties.tabbed/.cvsignore
bundles/org.eclipse.ui.views.properties.tabbed/.project
bundles/org.eclipse.ui.views.properties.tabbed/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.views.properties.tabbed/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.views.properties.tabbed/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.views.properties.tabbed/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.views.properties.tabbed/about.html
bundles/org.eclipse.ui.views.properties.tabbed/build.properties
bundles/org.eclipse.ui.views.properties.tabbed/plugin.properties
bundles/org.eclipse.ui.views.properties.tabbed/plugin.xml
bundles/org.eclipse.ui.views.properties.tabbed/schema/propertyContributor.exsd
bundles/org.eclipse.ui.views.properties.tabbed/schema/propertySections.exsd
bundles/org.eclipse.ui.views.properties.tabbed/schema/propertyTabs.exsd
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/TabbedPropertyViewPlugin.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/TabbedPropertyViewStatusCodes.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/l10n/TabbedPropertyMessages.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/l10n/TabbedPropertyMessages.properties
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/SectionDescriptor.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/Tab.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabDescriptor.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabListContentProvider.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyComposite.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyRegistry.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyRegistryClassSectionFilter.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyRegistryFactory.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyTitle.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyViewer.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/AbstractPropertySection.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/AbstractTypeMapper.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/AdvancedPropertySection.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/IActionProvider.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ISection.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ISectionDescriptor.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ISectionDescriptorProvider.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ITabItem.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ITabSelectionListener.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ITabbedPropertyConstants.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ITabbedPropertySheetPageContributor.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ITypeMapper.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/TabbedPropertySheetPage.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/TabbedPropertySheetWidgetFactory.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/package.html
bundles/org.eclipse.ui.views/.classpath
bundles/org.eclipse.ui.views/.cvsignore
bundles/org.eclipse.ui.views/.project
bundles/org.eclipse.ui.views/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.views/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.views/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.views/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.views/about.html
bundles/org.eclipse.ui.views/build.properties
bundles/org.eclipse.ui.views/component.xml
bundles/org.eclipse.ui.views/icons/full/dlcl16/defaults_ps.gif
bundles/org.eclipse.ui.views/icons/full/dlcl16/filter_ps.gif
bundles/org.eclipse.ui.views/icons/full/dlcl16/tree_mode.gif
bundles/org.eclipse.ui.views/icons/full/elcl16/defaults_ps.gif
bundles/org.eclipse.ui.views/icons/full/elcl16/filter_ps.gif
bundles/org.eclipse.ui.views/icons/full/elcl16/tree_mode.gif
bundles/org.eclipse.ui.views/icons/full/eview16/outline_co.gif
bundles/org.eclipse.ui.views/icons/full/eview16/prop_ps.gif
bundles/org.eclipse.ui.views/plugin.properties
bundles/org.eclipse.ui.views/plugin.xml
bundles/org.eclipse.ui.views/scripts/exportplugin.xml
bundles/org.eclipse.ui.views/src/org/eclipse/ui/internal/views/ViewsPlugin.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/internal/views/contentoutline/ContentOutlineMessages.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/internal/views/contentoutline/messages.properties
bundles/org.eclipse.ui.views/src/org/eclipse/ui/internal/views/contentoutline/package.html
bundles/org.eclipse.ui.views/src/org/eclipse/ui/internal/views/properties/PropertiesMessages.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/internal/views/properties/messages.properties
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/contentoutline/ContentOutline.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/contentoutline/ContentOutlinePage.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/contentoutline/IContentOutlinePage.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/contentoutline/package.html
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/CategoriesAction.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/ColorPropertyDescriptor.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/ComboBoxLabelProvider.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/ComboBoxPropertyDescriptor.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/CopyPropertyAction.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/DefaultsAction.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/FilterAction.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/ICellEditorActivationListener.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertiesHelpContextIds.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertyDescriptor.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertySheetEntry.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertySheetEntryListener.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertySheetPage.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertySource.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertySource2.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertySourceProvider.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertyDescriptor.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetAction.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetCategory.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetEntry.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetPage.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetSorter.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetViewer.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/TextPropertyDescriptor.java
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/package.html
bundles/org.eclipse.ui.win32/.classpath
bundles/org.eclipse.ui.win32/.cvsignore
bundles/org.eclipse.ui.win32/.project
bundles/org.eclipse.ui.win32/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.win32/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.win32/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.win32/about.html
bundles/org.eclipse.ui.win32/build.properties
bundles/org.eclipse.ui.win32/fragment-win32.properties
bundles/org.eclipse.ui.win32/src/org/eclipse/ui/internal/editorsupport/win32/OleEditor.java
bundles/org.eclipse.ui.win32/src/org/eclipse/ui/internal/editorsupport/win32/OleMessages.java
bundles/org.eclipse.ui.win32/src/org/eclipse/ui/internal/editorsupport/win32/messages.properties
bundles/org.eclipse.ui.workbench.compatibility/.classpath
bundles/org.eclipse.ui.workbench.compatibility/.cvsignore
bundles/org.eclipse.ui.workbench.compatibility/.project
bundles/org.eclipse.ui.workbench.compatibility/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.workbench.compatibility/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.workbench.compatibility/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.workbench.compatibility/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.workbench.compatibility/about.html
bundles/org.eclipse.ui.workbench.compatibility/build.properties
bundles/org.eclipse.ui.workbench.compatibility/fragment-compatibility.properties
bundles/org.eclipse.ui.workbench.compatibility/src/org/eclipse/ui/internal/CompatibleWorkbenchPage.java
bundles/org.eclipse.ui.workbench.compatibility/src/org/eclipse/ui/internal/ICompatibleWorkbenchPage.java
examples/org.eclipse.jface.examples.databinding/.classpath
examples/org.eclipse.jface.examples.databinding/.cvsignore
examples/org.eclipse.jface.examples.databinding/.project
examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.pde.prefs
examples/org.eclipse.jface.examples.databinding/META-INF/MANIFEST.MF
examples/org.eclipse.jface.examples.databinding/about.html
examples/org.eclipse.jface.examples.databinding/build.properties
examples/org.eclipse.jface.examples.databinding/plugin.properties
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ModelObject.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/AsynchronousTestSet.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/LabelProviderTest.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/LabelProviderTest2.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/RenamableItem.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/SimpleNode.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/SomeMathFunction.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/StructuredContentProviderTest.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/TreeContentProviderTest.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/DuckType.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/ReflectedMethod.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/ReflectedProperty.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/RelaxedDuckType.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMask.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMaskParseException.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMaskTest.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/EditMaskLexerAndToken.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/EditMaskParser.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/SWTUtil.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/WorkQueue.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Account.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Adventure.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/AdventureFactory.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/AggregateObservableValue.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Cart.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Catalog.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Category.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Lodging.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/PriceModelObject.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SampleData.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Signon.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimpleModel.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimpleOrder.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimplePerson.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Transportation.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/nestedselection/TestMasterDetail.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/radioGroup/RadioGroup.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/radioGroup/VetoableSelectionListener.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet000HelloWorld.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet001NestedSelectionWithCombo.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet002UpdateComboRetainSelection.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet003UpdateComboBindUsingViewer.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet004DataBindingContextErrorLabel.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet005MenuUpdater.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet006Spreadsheet.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet007ColorLabelProvider.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet008ComputedValue.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet009TableViewer.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet010MasterDetail.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet011ValidateMultipleBindingsSnippet.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet012CompositeUpdater.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet0xffffffff.java
examples/org.eclipse.jface.snippets/.classpath
examples/org.eclipse.jface.snippets/.project
examples/org.eclipse.jface.snippets/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet012DialogWithImageButtons.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/cancel.png
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/filesave.png
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/layout/Snippet013GridLayoutFactory.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/layout/Snippet016TableLayout.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/layout/Snippet027TreeLayout.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/AbstractCellCursor.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/CursorCellHighlighter.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet001TableViewer.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet002TreeViewer.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet003TableLabelProvider.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet004HideSelection.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet005TreeCustomMenu.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet006TableMultiLineCells.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet007FullSelection.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet008RevealElement.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet009CellEditors.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet010OwnerDraw.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet011CustomTooltips.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet013TableViewerNoMandatoryLabelProvider.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet014TreeViewerNoMandatoryLabelProvider.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet015CustomTooltipsForTree.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet017TableViewerHideShowColumns.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet018TableViewerAddRemoveColumnsWithEditing.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet019TableViewerAddRemoveColumnsWithEditingNewAPI.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet021CellEditorsOnDoubleClick.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet022TableViewerRefreshNoScroll.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet024TableViewerExploreNewAPI.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet025TabEditing.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet026TreeViewerTabEditing.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet027ComboBoxCellEditors.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet029VirtualTableViewer.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet030VirtualLazyTableViewer.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet032TableTreeViewer.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet033CellEditorPerRowPre33.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet034CellEditorPerRowNewAPI.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet035TableCursorCellHighlighter.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/TableCursor.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/Snippet020CustomizedControlTooltips.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/Snippet023TreeViewerCustomTooltips.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/Snippet031TableStaticTooltip.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/linkto_help.gif
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/showerr_tsk.gif
examples/org.eclipse.jface.snippets/META-INF/MANIFEST.MF
examples/org.eclipse.jface.snippets/build.properties
examples/org.eclipse.ui.examples.contributions/.project
examples/org.eclipse.ui.examples.fieldassist/.classpath
examples/org.eclipse.ui.examples.fieldassist/.cvsignore
examples/org.eclipse.ui.examples.fieldassist/.project
examples/org.eclipse.ui.examples.fieldassist/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.fieldassist/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.fieldassist/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/FieldAssistPlugin.java
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/FieldAssistTestDialog.java
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/TaskAssistExampleMessages.java
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/actions/TestDialogAction.java
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/messages.properties
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/preferences/ContentAssistPreferencePage.java
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/preferences/FieldAssistPreferencePage.java
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/preferences/PreferenceConstants.java
examples/org.eclipse.ui.examples.fieldassist/Eclipse UI Examples Field Assist/org/eclipse/ui/examples/fieldassist/preferences/PreferenceInitializer.java
examples/org.eclipse.ui.examples.fieldassist/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.fieldassist/about.html
examples/org.eclipse.ui.examples.fieldassist/build.properties
examples/org.eclipse.ui.examples.fieldassist/doc-html/hglegal.htm
examples/org.eclipse.ui.examples.fieldassist/doc-html/ui_fieldassist_ex.html
examples/org.eclipse.ui.examples.fieldassist/icons/sample.gif
examples/org.eclipse.ui.examples.fieldassist/plugin.properties
examples/org.eclipse.ui.examples.fieldassist/plugin.xml
examples/org.eclipse.ui.examples.job/.classpath
examples/org.eclipse.ui.examples.job/.cvsignore
examples/org.eclipse.ui.examples.job/.project
examples/org.eclipse.ui.examples.job/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.job/README.TXT
examples/org.eclipse.ui.examples.job/about.html
examples/org.eclipse.ui.examples.job/build.properties
examples/org.eclipse.ui.examples.job/doc/Responsive UIs.ppt
examples/org.eclipse.ui.examples.job/doc/eclipse-con-talk_2.doc
examples/org.eclipse.ui.examples.job/doc/responsive_ui.html
examples/org.eclipse.ui.examples.job/doc/usecases.txt
examples/org.eclipse.ui.examples.job/doc/workspace-lock.html
examples/org.eclipse.ui.examples.job/icons/job_view.gif
examples/org.eclipse.ui.examples.job/icons/sample.gif
examples/org.eclipse.ui.examples.job/icons/suspend.gif
examples/org.eclipse.ui.examples.job/icons/tree_view.gif
examples/org.eclipse.ui.examples.job/plugin.xml
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/BusyShowWhileDialog.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/ProgressExamplesPlugin.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/TestJob.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/TestJobRule.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/UITestJob.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/actions/CreateJobsAction.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/actions/DebugJobManagerAction.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/actions/ForegroundAction.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/actions/JobAction.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/actions/SuspendJobManagerAction.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/views/DeferredContentProvider.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/views/JobsView.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/views/LazyTreeView.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/views/ProgressExampleAdapterFactory.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/views/SlowElement.java
examples/org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/views/SlowElementAdapter.java
examples/org.eclipse.ui.examples.multipageeditor/.classpath
examples/org.eclipse.ui.examples.multipageeditor/.cvsignore
examples/org.eclipse.ui.examples.multipageeditor/.project
examples/org.eclipse.ui.examples.multipageeditor/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.multipageeditor/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.multipageeditor/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MessageUtil.java
examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageContributor.java
examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/MultiPageEditorExample.java
examples/org.eclipse.ui.examples.multipageeditor/Eclipse UI Examples MultiPageEditor/org/eclipse/ui/examples/multipageeditor/messages.properties
examples/org.eclipse.ui.examples.multipageeditor/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.multipageeditor/about.html
examples/org.eclipse.ui.examples.multipageeditor/build.properties
examples/org.eclipse.ui.examples.multipageeditor/doc-html/hglegal.htm
examples/org.eclipse.ui.examples.multipageeditor/doc-html/ui_multipageeditor_ex.html
examples/org.eclipse.ui.examples.multipageeditor/icons/copy.gif
examples/org.eclipse.ui.examples.multipageeditor/plugin.properties
examples/org.eclipse.ui.examples.multipageeditor/plugin.xml
examples/org.eclipse.ui.examples.navigator/.classpath
examples/org.eclipse.ui.examples.navigator/.project
examples/org.eclipse.ui.examples.navigator/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.navigator/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.navigator/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.navigator/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.navigator/about.html
examples/org.eclipse.ui.examples.navigator/build.properties
examples/org.eclipse.ui.examples.navigator/icons/delete_obj.gif
examples/org.eclipse.ui.examples.navigator/icons/filenav_nav.gif
examples/org.eclipse.ui.examples.navigator/icons/prop_ps.gif
examples/org.eclipse.ui.examples.navigator/plugin.properties
examples/org.eclipse.ui.examples.navigator/plugin.xml
examples/org.eclipse.ui.examples.navigator/src/org/eclipse/ui/examples/navigator/PropertiesContentProvider.java
examples/org.eclipse.ui.examples.navigator/src/org/eclipse/ui/examples/navigator/PropertiesLabelProvider.java
examples/org.eclipse.ui.examples.navigator/src/org/eclipse/ui/examples/navigator/PropertiesTreeData.java
examples/org.eclipse.ui.examples.navigator/src/org/eclipse/ui/examples/navigator/actions/DeletePropertyAction.java
examples/org.eclipse.ui.examples.navigator/src/org/eclipse/ui/examples/navigator/actions/OpenPropertyAction.java
examples/org.eclipse.ui.examples.navigator/src/org/eclipse/ui/examples/navigator/actions/PropertyActionProvider.java
examples/org.eclipse.ui.examples.navigator/src/org/eclipse/ui/internal/examples/navigator/Activator.java
examples/org.eclipse.ui.examples.presentation/.classpath
examples/org.eclipse.ui.examples.presentation/.cvsignore
examples/org.eclipse.ui.examples.presentation/.project
examples/org.eclipse.ui.examples.presentation/BareBonesPresentation.ini
examples/org.eclipse.ui.examples.presentation/WrappedTabsPresentation.ini
examples/org.eclipse.ui.examples.presentation/about.html
examples/org.eclipse.ui.examples.presentation/build.properties
examples/org.eclipse.ui.examples.presentation/eclipsecon2005-presentationsAPI.ppt
examples/org.eclipse.ui.examples.presentation/icons/close_view.gif
examples/org.eclipse.ui.examples.presentation/icons/hide_toolbar.GIF
examples/org.eclipse.ui.examples.presentation/icons/max_view.gif
examples/org.eclipse.ui.examples.presentation/icons/min_view.gif
examples/org.eclipse.ui.examples.presentation/icons/restore_view.GIF
examples/org.eclipse.ui.examples.presentation/icons/show_toolbar.GIF
examples/org.eclipse.ui.examples.presentation/icons/view_menu.GIF
examples/org.eclipse.ui.examples.presentation/plugin.xml
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/PresentationExamplesPlugin.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/PresentationImages.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/PresentationPlugin.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/barebones/BareBonesPartPresentation.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/barebones/BareBonesPresentationFactory.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/baretittle/BareTitlePresentationFactory.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/baretittle/BareTitleStackPresentation.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/sidewinder/ClosePartContributionItem.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/sidewinder/PartItem.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/sidewinder/SideWinderItemViewPresentation.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/sidewinder/SideWinderPresentationFactory.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/ChangeStackStateContributionItem.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/CloseAllContributionItem.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/CloseContributionItem.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/CloseOthersContributionItem.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/PartListContributionItem.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/ProxyControl.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/ShowToolbarContributionItem.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/WrappedTabsPartPresentation.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/WrappedTabsPresentationFactory.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/WrappedTabsThemeConstants.java
examples/org.eclipse.ui.examples.presentation/src/org/eclipse/ui/examples/presentation/wrappedtabs/WrappedTabsUtil.java
examples/org.eclipse.ui.examples.propertysheet/.classpath
examples/org.eclipse.ui.examples.propertysheet/.cvsignore
examples/org.eclipse.ui.examples.propertysheet/.project
examples/org.eclipse.ui.examples.propertysheet/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.propertysheet/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.propertysheet/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Address.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Birthday.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddress.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/EmailAddressValidator.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/GroupElement.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/IUserConstants.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/MessageUtil.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/Name.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/OrganizationElement.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PopupMenuActionDelegate.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetContentOutlinePage.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/PropertySheetPlugin.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/StreetAddress.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserEditor.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserElement.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/UserFileParser.java
examples/org.eclipse.ui.examples.propertysheet/Eclipse UI Examples PropertySheet/org/eclipse/ui/examples/propertysheet/messages.properties
examples/org.eclipse.ui.examples.propertysheet/HelpContexts.xml
examples/org.eclipse.ui.examples.propertysheet/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.propertysheet/about.html
examples/org.eclipse.ui.examples.propertysheet/build.properties
examples/org.eclipse.ui.examples.propertysheet/doc-html/hglegal.htm
examples/org.eclipse.ui.examples.propertysheet/doc-html/ui_propertysheet_ex.html
examples/org.eclipse.ui.examples.propertysheet/doc.zip
examples/org.eclipse.ui.examples.propertysheet/icons/obj16/usereditor.gif
examples/org.eclipse.ui.examples.propertysheet/plugin.properties
examples/org.eclipse.ui.examples.propertysheet/plugin.xml
examples/org.eclipse.ui.examples.rcp.browser/.classpath
examples/org.eclipse.ui.examples.rcp.browser/.cvsignore
examples/org.eclipse.ui.examples.rcp.browser/.project
examples/org.eclipse.ui.examples.rcp.browser/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.rcp.browser/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.rcp.browser/Browser.product
examples/org.eclipse.ui.examples.rcp.browser/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.rcp.browser/about.html
examples/org.eclipse.ui.examples.rcp.browser/build.properties
examples/org.eclipse.ui.examples.rcp.browser/icons/alt16.gif
examples/org.eclipse.ui.examples.rcp.browser/icons/alt32.gif
examples/org.eclipse.ui.examples.rcp.browser/icons/alt_about.gif
examples/org.eclipse.ui.examples.rcp.browser/icons/eclipse.gif
examples/org.eclipse.ui.examples.rcp.browser/icons/eclipse32.gif
examples/org.eclipse.ui.examples.rcp.browser/icons/eclipse_lg.gif
examples/org.eclipse.ui.examples.rcp.browser/plugin.properties
examples/org.eclipse.ui.examples.rcp.browser/plugin.xml
examples/org.eclipse.ui.examples.rcp.browser/plugin_customization.ini
examples/org.eclipse.ui.examples.rcp.browser/readme.html
examples/org.eclipse.ui.examples.rcp.browser/splash.bmp
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/BrowserActionBarAdvisor.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/BrowserAdvisor.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/BrowserApp.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/BrowserPerspectiveFactory.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/BrowserPlugin.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/BrowserPreferenceInitializer.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/BrowserView.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/BrowserWindowAdvisor.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/HistoryView.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/IBrowserConstants.java
examples/org.eclipse.ui.examples.rcp.browser/src/org/eclipse/ui/examples/rcp/browser/ISecondaryPart.java
examples/org.eclipse.ui.examples.readmetool/.classpath
examples/org.eclipse.ui.examples.readmetool/.cvsignore
examples/org.eclipse.ui.examples.readmetool/.project
examples/org.eclipse.ui.examples.readmetool/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.readmetool/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.readmetool/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeControlContribution.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferenceInitializer.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeTrimWidget.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java
examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties
examples/org.eclipse.ui.examples.readmetool/HelpContexts.xml
examples/org.eclipse.ui.examples.readmetool/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.readmetool/about.html
examples/org.eclipse.ui.examples.readmetool/build.properties
examples/org.eclipse.ui.examples.readmetool/doc-html/hglegal.htm
examples/org.eclipse.ui.examples.readmetool/doc-html/ui_readmetool_ex.html
examples/org.eclipse.ui.examples.readmetool/doc.zip
examples/org.eclipse.ui.examples.readmetool/doc/hglegal.htm
examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool.html
examples/org.eclipse.ui.examples.readmetool/doc/org_eclipse_ui_examples_readmetool_sectionParser.html
examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action1.gif
examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action2.gif
examples/org.eclipse.ui.examples.readmetool/icons/ctool16/action3.gif
examples/org.eclipse.ui.examples.readmetool/icons/ctool16/openbrwsr.gif
examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action1.gif
examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action2.gif
examples/org.eclipse.ui.examples.readmetool/icons/dtool16/action3.gif
examples/org.eclipse.ui.examples.readmetool/icons/dtool16/openbrwsr.gif
examples/org.eclipse.ui.examples.readmetool/icons/etool16/action1.gif
examples/org.eclipse.ui.examples.readmetool/icons/etool16/action2.gif
examples/org.eclipse.ui.examples.readmetool/icons/etool16/action3.gif
examples/org.eclipse.ui.examples.readmetool/icons/etool16/openbrwsr.gif
examples/org.eclipse.ui.examples.readmetool/icons/obj16/editor.gif
examples/org.eclipse.ui.examples.readmetool/icons/obj16/newreadme_wiz.gif
examples/org.eclipse.ui.examples.readmetool/icons/obj16/usereditor.gif
examples/org.eclipse.ui.examples.readmetool/icons/view16/sections.gif
examples/org.eclipse.ui.examples.readmetool/icons/wizban/newreadme_wiz.gif
examples/org.eclipse.ui.examples.readmetool/plugin.properties
examples/org.eclipse.ui.examples.readmetool/plugin.xml
examples/org.eclipse.ui.examples.undo/.classpath
examples/org.eclipse.ui.examples.undo/.cvsignore
examples/org.eclipse.ui.examples.undo/.project
examples/org.eclipse.ui.examples.undo/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.undo/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.undo/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/AddBoxOperation.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/Box.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/BoxOperation.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/Boxes.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/ClearBoxesOperation.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/MoveBoxOperation.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/PromptingUserApprover.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/UndoExampleMessages.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/UndoPlugin.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/messages.properties
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/preferences/PreferenceConstants.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/preferences/PreferenceInitializer.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/preferences/UndoPreferencePage.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/views/BoxView.java
examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/views/UndoHistoryView.java
examples/org.eclipse.ui.examples.undo/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.undo/about.html
examples/org.eclipse.ui.examples.undo/build.properties
examples/org.eclipse.ui.examples.undo/doc-html/ui_undo_ex.html
examples/org.eclipse.ui.examples.undo/icons/sample.gif
examples/org.eclipse.ui.examples.undo/plugin.properties
examples/org.eclipse.ui.examples.undo/plugin.xml
examples/org.eclipse.ui.examples.views.properties.tabbed.article/.classpath
examples/org.eclipse.ui.examples.views.properties.tabbed.article/.cvsignore
examples/org.eclipse.ui.examples.views.properties.tabbed.article/.project
examples/org.eclipse.ui.examples.views.properties.tabbed.article/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.article/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.article/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.article/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.views.properties.tabbed.article/about.html
examples/org.eclipse.ui.examples.views.properties.tabbed.article/build.properties
examples/org.eclipse.ui.examples.views.properties.tabbed.article/icons/sample.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.article/plugin.properties
examples/org.eclipse.ui.examples.views.properties.tabbed.article/plugin.xml
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/Activator.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/ButtonElement.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/ButtonElementProperties.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/CheckBoxPropertyDescriptor.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/FontDialogCellEditor.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/FontPropertyDescriptor.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/FontSection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/LabelSection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/SampleView.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/SizePropertySource.java
examples/org.eclipse.ui.examples.views.properties.tabbed.article/src/org/eclipse/ui/examples/views/properties/tabbed/article/views/SizeSection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/.classpath
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/.cvsignore
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/.project
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/about.html
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/build.properties
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/ctool16/CreateDefence_playerStats_PlayerStats.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/ctool16/CreateForward_playerStats_PlayerStats.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/ctool16/CreateGoalie_goalieStats_GoalieStats.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/ctool16/CreateLeague_teams_Team.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/ctool16/CreateTeam_arena_Arena.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/ctool16/CreateTeam_defencemen_Defence.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/ctool16/CreateTeam_forwards_Forward.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/ctool16/CreateTeam_goalies_Goalie.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/Arena.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/Defence.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/Forward.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/Goalie.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/GoalieStats.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/Height.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/HockeyleagueModelFile.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/HockeyleagueObject.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/League.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/Player.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/PlayerStats.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/Team.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/obj16/Weight.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/full/wizban/NewHockeyleague.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/icons/hockeyleague.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/model/hockeyleague.ecore
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/model/hockeyleague.genmodel
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/plugin.properties
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/plugin.xml
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/Arena.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/Defence.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/DefencePositionKind.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/Forward.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ForwardPositionKind.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/Goalie.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/GoalieStats.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/HeightKind.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/HockeyleagueFactory.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/HockeyleagueObject.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/HockeyleaguePackage.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/HockeyleaguePlugin.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/League.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/Player.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/PlayerStats.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ShotKind.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/Team.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/WeightKind.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/ArenaImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/DefenceImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/ForwardImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/GoalieImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/GoalieStatsImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/HockeyleagueFactoryImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/HockeyleagueObjectImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/HockeyleaguePackageImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/LeagueImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/PlayerImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/PlayerStatsImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/impl/TeamImpl.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/ArenaItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/DefenceItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/ForwardItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/GoalieItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/GoalieStatsItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/HockeyleagueItemProviderAdapterFactory.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/HockeyleagueObjectItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/LeagueItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/PlayerItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/PlayerStatsItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/provider/TeamItemProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/actions/HockeyleagueCreateChildAction.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/dialogs/HockeyleagueSetDefaultsDialog.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/editor/HockeyleagueActionBarContributor.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/editor/HockeyleagueEditor.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/HockeyleagueLabelProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/HockeyleaguePropertySheetPage.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/TextChangeHelper.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AbstractEnumerationPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AbstractHockeyleaguePropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AbstractIntegerPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AbstractMeasurementPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AbstractPlayersPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AbstractStringPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AbstractTablePropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AbstractTextPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AddressPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/AdvancedPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/BirthDatePropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/BirthPlacePropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/CapacityPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/DefencePositionPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/DefencemenPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/ForwardPositionPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/ForwardsPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/GoaliesPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/HeadOfficePropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/HeightPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/NamePropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/NumberPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/PlayerStatsPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/ShotPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/TeamsPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/properties/sections/WeightPropertySection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/wizards/NewHockeyleagueFileWizard.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/wizards/NewHockeyleagueFileWizardPage.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/ui/wizards/NewHockeyleagueProjectWizard.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/util/HockeyleagueAdapterFactory.java
examples/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague/src/org/eclipse/ui/examples/views/properties/tabbed/hockeyleague/util/HockeyleagueSwitch.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/.classpath
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/.cvsignore
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/.project
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/about.html
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/build.properties
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/icons/logic.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/icons/logicbanner.gif
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/plugin.properties
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/plugin.xml
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/Activator.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/LogicCreationWizard.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/LogicWizardPage1.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/TabbedPropertiesLogicEditor.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/AbstractSection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/LocationSection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/LogicElementLabelProvider.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/LogicElementSizeFilter.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/LogicElementTypeMapper.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/NameSection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/SizeSection.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/TextChangeHelper.java
examples/org.eclipse.ui.examples.views.properties.tabbed.logic/src/org/eclipse/ui/examples/views/properties/tabbed/logic/properties/ValueSection.java
examples/org.eclipse.ui.forms.examples/.classpath
examples/org.eclipse.ui.forms.examples/.cvsignore
examples/org.eclipse.ui.forms.examples/.project
examples/org.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.forms.examples/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.forms.examples/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.forms.examples/about.html
examples/org.eclipse.ui.forms.examples/build.properties
examples/org.eclipse.ui.forms.examples/icons/clear.gif
examples/org.eclipse.ui.forms.examples/icons/close_view.gif
examples/org.eclipse.ui.forms.examples/icons/container_obj.gif
examples/org.eclipse.ui.forms.examples/icons/e_search_menu.gif
examples/org.eclipse.ui.forms.examples/icons/file_obj.gif
examples/org.eclipse.ui.forms.examples/icons/form_banner.gif
examples/org.eclipse.ui.forms.examples/icons/help.gif
examples/org.eclipse.ui.forms.examples/icons/help_topic.gif
examples/org.eclipse.ui.forms.examples/icons/large_image.gif
examples/org.eclipse.ui.forms.examples/icons/linkto_help.gif
examples/org.eclipse.ui.forms.examples/icons/newprj_wiz.gif
examples/org.eclipse.ui.forms.examples/icons/nw.gif
examples/org.eclipse.ui.forms.examples/icons/progress.gif
examples/org.eclipse.ui.forms.examples/icons/sample.gif
examples/org.eclipse.ui.forms.examples/icons/th_horizontal.gif
examples/org.eclipse.ui.forms.examples/icons/th_vertical.gif
examples/org.eclipse.ui.forms.examples/icons/toc_closed.gif
examples/org.eclipse.ui.forms.examples/icons/toc_open.gif
examples/org.eclipse.ui.forms.examples/icons/topic_small.gif
examples/org.eclipse.ui.forms.examples/plugin.properties
examples/org.eclipse.ui.forms.examples/plugin.xml
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPlugin.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/ExamplesPluginResources.properties
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/FormEditorInput.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/OpenFormEditorAction.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/OpenFormDialog.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/dialogs/SampleFormDialog.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ErrorMessagesPage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/FreeFormPage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/HeadlessPage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/IModelListener.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NamedObject.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NewStylePage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSimpleFormEditorAction.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/OpenSingleHeaderEditorAction.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/PageWithSubPages.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesBlock.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesPage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SecondPage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditor.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleFormEditorInput.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SimpleModel.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SingleHeaderEditor.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ThirdPage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOne.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeOneDetailsPage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwo.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/TypeTwoDetailsPage.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/index.xml
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/FormView.java
examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/ShowHelpAction.java
tests/org.eclipse.jface.tests.databinding/.classpath
tests/org.eclipse.jface.tests.databinding/.cvsignore
tests/org.eclipse.jface.tests.databinding/.project
tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.jdt.ui.prefs
tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.pde.prefs
tests/org.eclipse.jface.tests.databinding/JFace-Data Binding Test Suite.launch
tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF
tests/org.eclipse.jface.tests.databinding/about.html
tests/org.eclipse.jface.tests.databinding/build.properties
tests/org.eclipse.jface.tests.databinding/plugin.properties
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateStrategyTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateValueStrategyTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/beans/BeansObservablesTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/RealmTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/AbstractObservableMapTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/ObservableMapTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/WritableMapTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableSetTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/WrappedConverterValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/conversion/IdentityConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/AbstractBindSupportFactoryTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBooleanPrimitiveTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBytePrimitiveTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryDoublePrimitiveTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryFloatPrimitiveTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryIntTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryLongPrimitiveTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryShortPrimitiveTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/validation/ObjectToPrimitiveValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractDefaultRealmTestCase.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractSWTTestCase.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/ComputedValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/DatabindingContextTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/IDiffsTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/ObservableTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/RandomAccessListIteratorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/SelectionAwareObservableCollectionTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/mask/EditMaskLexerAndTokenTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/mask/EditMaskParserTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/LockRealm.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/ThreadRealm.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/AbstractObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/ObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/WritableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/set/WritableSetTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/AbstractObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/AbstractVetoableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/WritableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/AutomationUtil.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/BindingScenariosTestSuite.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ButtonControlScenario.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboScenarios.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboUpdatingTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboViewerScenario.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomBeanModelType.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomBeanUpdateValueStrategy.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomConverterScenarios.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomScenarios.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/LabelControlScenario.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ListViewerScenario.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/MasterDetailScenarios.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/NPETestScenario.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/NewTableScenarios.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/PropertyScenarios.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ScenariosTestCase.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/SpinnerControlScenario.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TableScenarios.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TextControlScenario.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/smoketest/swt.xswt
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AbstractGetAndSetSelectionObservableCollectionTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AutoSelectTableViewerCollectionExtendedTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AutoSelectTableViewerCollectionTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/CComboObservableCollectionTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ComboObservableCollectionTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/CopyOfAutoSelectTableViewerCollectionExtendedTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ListObservableCollectionTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ObservableCollectionViewerTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/SWTObservablesTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/TableViewerObservableCollectionTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/TextObservableValueTests.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/util/EventTrackers.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/util/RealmTester.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableMapLabelProviderTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableSetContentProviderTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/model/PersonTests.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ListBindingTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ValueBindingTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/Bean.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableListDecoratorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableSetDecoratorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableValueDecoratorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableMapTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableSetTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/ListenerSupportTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/observable/UnmodifiableObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ButtonObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CLabelObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ControlObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/LabelObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TableObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextEditableObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/observable/AbstractObservableTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/observable/ObservablesTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/viewers/SelectionObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/test.xml
tests/org.eclipse.ui.tests.browser/.classpath
tests/org.eclipse.ui.tests.browser/.cvsignore
tests/org.eclipse.ui.tests.browser/.options
tests/org.eclipse.ui.tests.browser/.project
tests/org.eclipse.ui.tests.browser/about.html
tests/org.eclipse.ui.tests.browser/build.properties
tests/org.eclipse.ui.tests.browser/plugin.xml
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/AllTests.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/DialogsTestCase.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/ExistenceTestCase.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/ExternalBrowserTestCase.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/InternalBrowserEditorTestCase.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/InternalBrowserViewTestCase.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/OrderedTestSuite.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/PreferencesTestCase.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/ToolbarBrowserTestCase.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/UITestHelper.java
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/WebBrowserTestsPlugin.java
tests/org.eclipse.ui.tests.browser/test.xml
tests/org.eclipse.ui.tests.harness/.classpath
tests/org.eclipse.ui.tests.harness/.cvsignore
tests/org.eclipse.ui.tests.harness/.project
tests/org.eclipse.ui.tests.harness/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.ui.tests.harness/.settings/org.eclipse.jdt.ui.prefs
tests/org.eclipse.ui.tests.harness/.settings/org.eclipse.pde.prefs
tests/org.eclipse.ui.tests.harness/META-INF/MANIFEST.MF
tests/org.eclipse.ui.tests.harness/about.html
tests/org.eclipse.ui.tests.harness/build.properties
tests/org.eclipse.ui.tests.harness/icons/anything.gif
tests/org.eclipse.ui.tests.harness/plugin.xml
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/AllTests.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/UITestHarnessPlugin.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/tests/MocksTest.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/ActionUtil.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/ArrayUtil.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/AutomationUtil.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/CallHistory.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/EmptyPerspective.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/FileTool.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/FileUtil.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/ImageTests.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/Mocks.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/PlatformUtil.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/UITestCase.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/AccessibilityTestPass.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/FailureDialog.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/FocusTestPass.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/IDialogTestPass.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/SizingTestPass.java
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/internal/util/VerifyDialog.java
tests/org.eclipse.ui.tests.navigator/.classpath
tests/org.eclipse.ui.tests.navigator/.cvsignore
tests/org.eclipse.ui.tests.navigator/.project
tests/org.eclipse.ui.tests.navigator/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.ui.tests.navigator/.settings/org.eclipse.jdt.ui.prefs
tests/org.eclipse.ui.tests.navigator/META-INF/MANIFEST.MF
tests/org.eclipse.ui.tests.navigator/Navigator Test Suite.launch
tests/org.eclipse.ui.tests.navigator/about.html
tests/org.eclipse.ui.tests.navigator/build.properties
tests/org.eclipse.ui.tests.navigator/plugin.properties
tests/org.eclipse.ui.tests.navigator/plugin.xml
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/DisplayHelper.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/DisplayWaiter.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/EditorTestHelper.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/INavigatorContentServiceTests.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/NavigatorTestsPlugin.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/OpenTest.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/PipelineTest.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/ProgrammaticOpenTest.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/SWTEventHelper.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/DependentAction.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/DependentActionProvider.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestAction.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestActionProvider.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestContentProvider.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestDataSorter.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestExtensionAdapterFactory.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestExtensionTreeData.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestItemsThatEndIn3.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestLabelDecorator.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestLabelProvider.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/TestNestedActionProvider.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/util/ProjectUnzipUtil.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/util/TestWorkspace.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/wizards/ExportWizard1.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/wizards/ImportWizard1.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/wizards/NewWizard1.java
tests/org.eclipse.ui.tests.navigator/test.xml
tests/org.eclipse.ui.tests.navigator/testdata/Test.zip
tests/org.eclipse.ui.tests.performance/.classpath
tests/org.eclipse.ui.tests.performance/.cvsignore
tests/org.eclipse.ui.tests.performance/.project
tests/org.eclipse.ui.tests.performance/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.ui.tests.performance/.settings/org.eclipse.jdt.ui.prefs
tests/org.eclipse.ui.tests.performance/.settings/org.eclipse.pde.prefs
tests/org.eclipse.ui.tests.performance/META-INF/MANIFEST.MF
tests/org.eclipse.ui.tests.performance/about.html
tests/org.eclipse.ui.tests.performance/build.properties
tests/org.eclipse.ui.tests.performance/icons/anything.gif
tests/org.eclipse.ui.tests.performance/icons/binary_co.gif
tests/org.eclipse.ui.tests.performance/icons/dynamic.gif
tests/org.eclipse.ui.tests.performance/icons/editor.gif
tests/org.eclipse.ui.tests.performance/icons/mockeditorpart1.gif
tests/org.eclipse.ui.tests.performance/icons/mockeditorpart2.gif
tests/org.eclipse.ui.tests.performance/icons/view.gif
tests/org.eclipse.ui.tests.performance/plugin.xml
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/ComboViewerRefreshTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTableViewerRefreshTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/FastTreeTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/JFacePerformanceSuite.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListPopulationTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/ListViewerRefreshTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestContentProvider.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/RefreshTestTreeContentProvider.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/SWTTreeTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/TableViewerRefreshTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestElement.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/TestTreeElement.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/TreeViewerRefreshTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/jface/tests/performance/ViewerTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ActivitiesPerformanceSuite.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/BasicPerformanceTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/CommandsPerformanceTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ContentDescriberForTestsOnly.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorPerformanceSuite.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorSwitchTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorTestHelper.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/GenerateIdentifiersTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionClasses.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ObjectContributionsPerformance.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseEditorTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenClosePerspectiveTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseViewTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseWindowTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenMultipleEditorTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenNavigatorFolderTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective1.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformancePerspective2.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTestRunner.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerformanceTester.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/PerspectiveSwitchTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ProblemsViewPerformanceTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ResourceTestHelper.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/TestRunnable.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformancePlugin.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSetup.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestSuite.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/ViewPerformanceSuite.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/WorkbenchPerformanceSuite.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ComputeSizeTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ConstantAreaLayout.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/EditorWidgetFactory.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/LayoutTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PerspectiveWidgetFactory.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/PresentationWidgetFactory.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/RecursiveTrimLayoutWidgetFactory.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ResizeTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/TestWidgetFactory.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/layout/ViewWidgetFactory.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/marked.txt
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceEditorPart.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceProblemsView.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/parts/PerformanceViewPart.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivateTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationActivePartPropertyTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationCreateTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationInactivePartPropertyTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationPerformanceTestSuite.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationSelectTest.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/PresentationTestbed.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/StandaloneViewPerspective2.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/presentations/TestPresentablePart.java
tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/test_ideas.txt
tests/org.eclipse.ui.tests.performance/test.xml
tests/org.eclipse.ui.tests.rcp/.classpath
tests/org.eclipse.ui.tests.rcp/.cvsignore
tests/org.eclipse.ui.tests.rcp/.project
tests/org.eclipse.ui.tests.rcp/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.ui.tests.rcp/.settings/org.eclipse.jdt.ui.prefs
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/ActionBarConfigurerTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/IWorkbenchPageTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/PlatformUITest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/RcpTestSuite.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchAdvisorTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchConfigurerTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchListenerTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchSaveRestoreStateTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchWindowConfigurerTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/performance/EmptyWorkbenchPerfTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/performance/PlatformUIPerfTest.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/performance/RCPPerformanceTestSetup.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/performance/RCPPerformanceTestSuite.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/EmptyPerspective.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/EmptyView.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/IPerformanceMeterArray.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/IntervalMeters.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/NullMeters.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/OpenWorkbenchIntervalMonitor.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/RCPTestWorkbenchAdvisor.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/RestoreWorkbenchIntervalMonitor.java
tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/WorkbenchAdvisorObserver.java
tests/org.eclipse.ui.tests.rcp/META-INF/MANIFEST.MF
tests/org.eclipse.ui.tests.rcp/RCP Test Suite.launch
tests/org.eclipse.ui.tests.rcp/about.html
tests/org.eclipse.ui.tests.rcp/build.properties
tests/org.eclipse.ui.tests.rcp/icons/sample.gif
tests/org.eclipse.ui.tests.rcp/plugin.xml
tests/org.eclipse.ui.tests.rcp/test.xml
tests/org.eclipse.ui.tests.views.properties.tabbed/.classpath
tests/org.eclipse.ui.tests.views.properties.tabbed/.cvsignore
tests/org.eclipse.ui.tests.views.properties.tabbed/.project
tests/org.eclipse.ui.tests.views.properties.tabbed/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.ui.tests.views.properties.tabbed/.settings/org.eclipse.jdt.ui.prefs
tests/org.eclipse.ui.tests.views.properties.tabbed/.settings/org.eclipse.pde.prefs
tests/org.eclipse.ui.tests.views.properties.tabbed/META-INF/MANIFEST.MF
tests/org.eclipse.ui.tests.views.properties.tabbed/Tabbed Properties View-All Tests.launch
tests/org.eclipse.ui.tests.views.properties.tabbed/about.html
tests/org.eclipse.ui.tests.views.properties.tabbed/build.properties
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/sample.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/plugin.properties
tests/org.eclipse.ui.tests.views.properties.tabbed/plugin.xml
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/Activator.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/AllTests.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/TabbedPropertySheetPageTest.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/model/Element.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/model/Error.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/model/File.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/model/Folder.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/model/Information.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/model/Project.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/model/Warning.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/sections/InformationTwoSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/sections/LabelSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/sections/MessageSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/sections/NameSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/sections/ResourceSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/views/InformationTwoFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/views/LabelProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/views/TestsPerspective.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/views/TestsView.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/views/TestsViewContentProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/views/TypeMapper.java
tests/org.eclipse.ui.tests.views.properties.tabbed/test.xml
diff --git a/bundles/org.eclipse.core.databinding.beans/.classpath b/bundles/org.eclipse.core.databinding.beans/.classpath
deleted file mode 100644
index ce73933..0000000
--- a/bundles/org.eclipse.core.databinding.beans/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.core.databinding.beans/.cvsignore b/bundles/org.eclipse.core.databinding.beans/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/bundles/org.eclipse.core.databinding.beans/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.core.databinding.beans/.project b/bundles/org.eclipse.core.databinding.beans/.project
deleted file mode 100644
index b4a9c58..0000000
--- a/bundles/org.eclipse.core.databinding.beans/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.core.databinding.beans</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0aade4c..0000000
--- a/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,71 +0,0 @@
-#Thu Feb 01 22:33:45 EST 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=error
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 59509e0..0000000
--- a/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Thu Aug 24 15:24:48 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.javadoc=true
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) ${year} IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * IBM Corporation - initial API and implementation\n ******************************************************************************/\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @since 3.3\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template></templates>
diff --git a/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fee4b04..0000000
--- a/bundles/org.eclipse.core.databinding.beans/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Sat Mar 19 15:31:31 EST 2005
-compilers.p.deprecated=0
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF
deleted file mode 100644
index dff130c..0000000
--- a/bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.core.databinding.beans
-Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: .
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.core.databinding.beans,
- org.eclipse.core.internal.databinding.internal.beans;x-internal:=true
-Require-Bundle: org.eclipse.core.databinding;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.core.databinding.beans/about.html b/bundles/org.eclipse.core.databinding.beans/about.html
deleted file mode 100644
index 4602330..0000000
--- a/bundles/org.eclipse.core.databinding.beans/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.core.databinding.beans/build.properties b/bundles/org.eclipse.core.databinding.beans/build.properties
deleted file mode 100644
index 6f0a513..0000000
--- a/bundles/org.eclipse.core.databinding.beans/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = .,\
- META-INF/,\
- plugin.properties,\
- about.html
-output.databinding.jar = bin/
-src.includes = about.html
-source.. = src/
diff --git a/bundles/org.eclipse.core.databinding.beans/plugin.properties b/bundles/org.eclipse.core.databinding.beans/plugin.properties
deleted file mode 100644
index 083e360..0000000
--- a/bundles/org.eclipse.core.databinding.beans/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName = JFace Data Binding for JavaBeans
-providerName = Eclipse.org
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/BeansObservables.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/BeansObservables.java
deleted file mode 100644
index 6749099..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/BeansObservables.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164268, 171616
- * Brad Reynolds - bug 147515
- *******************************************************************************/
-package org.eclipse.core.databinding.beans;
-
-import java.beans.BeanInfo;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-
-import org.eclipse.core.databinding.BindingException;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
-import org.eclipse.core.databinding.observable.masterdetail.MasterDetailObservables;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableListDecorator;
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableSetDecorator;
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableValueDecorator;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableList;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableMap;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableSet;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableValue;
-
-/**
- * A factory for creating observable objects of Java
- * objects that conform to the <a
- * href="http://java.sun.com/products/javabeans/docs/spec.html">JavaBean
- * specification</a> for bound properties.
- *
- * @since 1.1
- *
- */
-final public class BeansObservables {
-
- /**
- *
- */
- public static final boolean DEBUG = true;
-
- /**
- * Returns an observable value in the default realm tracking the current
- * value of the named property of the given bean.
- *
- * @param bean
- * the object
- * @param propertyName
- * the name of the property
- * @return an observable value tracking the current value of the named
- * property of the given bean
- */
- public static IObservableValue observeValue(Object bean, String propertyName) {
- return observeValue(Realm.getDefault(), bean, propertyName);
- }
-
- /**
- * Returns an observable value in the given realm tracking the current value
- * of the named property of the given bean.
- *
- * @param realm
- * the realm
- * @param bean
- * the object
- * @param propertyName
- * the name of the property
- * @return an observable value tracking the current value of the named
- * property of the given bean
- */
- public static IObservableValue observeValue(Realm realm, Object bean,
- String propertyName) {
- PropertyDescriptor descriptor = getPropertyDescriptor(bean.getClass(),
- propertyName);
- return new JavaBeanObservableValue(realm, bean, descriptor, null);
- }
-
- /**
- * Returns an observable map in the default realm tracking the current
- * values of the named property for the beans in the given set.
- *
- * @param domain
- * the set of bean objects
- * @param beanClass
- * the common base type of bean objects that may be in the set
- * @param propertyName
- * the name of the property
- * @return an observable map tracking the current values of the named
- * property for the beans in the given domain set
- */
- public static IObservableMap observeMap(IObservableSet domain,
- Class beanClass, String propertyName) {
- PropertyDescriptor descriptor = getPropertyDescriptor(beanClass,
- propertyName);
- return new JavaBeanObservableMap(domain, descriptor);
- }
-
- private static PropertyDescriptor getPropertyDescriptor(Class beanClass,
- String propertyName) {
- BeanInfo beanInfo;
- try {
- beanInfo = Introspector.getBeanInfo(beanClass);
- } catch (IntrospectionException e) {
- // cannot introspect, give up
- return null;
- }
- PropertyDescriptor[] propertyDescriptors = beanInfo
- .getPropertyDescriptors();
- for (int i = 0; i < propertyDescriptors.length; i++) {
- PropertyDescriptor descriptor = propertyDescriptors[i];
- if (descriptor.getName().equals(propertyName)) {
- return descriptor;
- }
- }
- throw new BindingException(
- "Could not find property with name " + propertyName + " in class " + beanClass); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Returns an array of observable maps in the default realm tracking the
- * current values of the named propertys for the beans in the given set.
- *
- * @param domain
- * the set of objects
- * @param beanClass
- * the common base type of objects that may be in the set
- * @param propertyNames
- * the array of property names
- * @return an array of observable maps tracking the current values of the
- * named propertys for the beans in the given domain set
- */
- public static IObservableMap[] observeMaps(IObservableSet domain,
- Class beanClass, String[] propertyNames) {
- IObservableMap[] result = new IObservableMap[propertyNames.length];
- for (int i = 0; i < propertyNames.length; i++) {
- result[i] = observeMap(domain, beanClass, propertyNames[i]);
- }
- return result;
- }
-
- /**
- * Returns an observable list in the given realm tracking the
- * collection-typed named property of the given bean object
- *
- * @param realm
- * the realm
- * @param bean
- * the object
- * @param propertyName
- * the name of the collection-typed property
- * @return an observable list tracking the collection-typed named property
- * of the given bean object
- *
- */
- public static IObservableList observeList(Realm realm, Object bean,
- String propertyName) {
- return observeList(realm, bean, propertyName, null);
- }
-
- /**
- * Returns an observable list in the given realm tracking the
- * collection-typed named property of the given bean object
- *
- * @param realm
- * the realm
- * @param bean
- * the bean object
- * @param propertyName
- * the name of the property
- * @param elementType
- * type of the elements in the list. If <code>null</code> and
- * the property is an array the type will be inferred. If
- * <code>null</code> and the property type cannot be inferred
- * element type will be <code>null</code>.
- * @return an observable list tracking the collection-typed named property
- * of the given bean object
- */
- public static IObservableList observeList(Realm realm, Object bean,
- String propertyName, Class elementType) {
- PropertyDescriptor propertyDescriptor = getPropertyDescriptor(bean
- .getClass(), propertyName);
- elementType = getCollectionElementType(elementType, propertyDescriptor);
-
- return new JavaBeanObservableList(realm, bean, propertyDescriptor,
- elementType);
- }
-
- /**
- * Returns an observable set in the given realm tracking the
- * collection-typed named property of the given bean object
- *
- * @param realm
- * the realm
- * @param bean
- * the bean object
- * @param propertyName
- * the name of the property
- * @return an observable set tracking the collection-typed named property of
- * the given bean object
- */
- public static IObservableSet observeSet(Realm realm, Object bean,
- String propertyName) {
- return observeSet(realm, bean, propertyName, null);
- }
-
- /**
- * Returns a factory for creating obervable values tracking the given
- * property of a particular bean object
- *
- * @param realm
- * the realm to use
- * @param propertyName
- * the name of the property
- * @return an observable value factory
- */
- public static IObservableFactory valueFactory(final Realm realm,
- final String propertyName) {
- return new IObservableFactory() {
- public IObservable createObservable(Object target) {
- return observeValue(realm, target, propertyName);
- }
- };
- }
-
- /**
- * Returns a factory for creating obervable lists tracking the given
- * property of a particular bean object
- *
- * @param realm
- * the realm to use
- * @param propertyName
- * the name of the property
- * @param elementType
- * @return an observable list factory
- */
- public static IObservableFactory listFactory(final Realm realm,
- final String propertyName, final Class elementType) {
- return new IObservableFactory() {
- public IObservable createObservable(Object target) {
- return observeList(realm, target, propertyName, elementType);
- }
- };
- }
-
- /**
- * Returns a factory for creating obervable sets tracking the given property
- * of a particular bean object
- *
- * @param realm
- * the realm to use
- * @param propertyName
- * the name of the property
- * @return an observable set factory
- */
- public static IObservableFactory setFactory(final Realm realm,
- final String propertyName) {
- return new IObservableFactory() {
- public IObservable createObservable(Object target) {
- return observeSet(realm, target, propertyName);
- }
- };
- }
-
- /**
- * Helper method for
- * <code>MasterDetailObservables.detailValue(master, valueFactory(realm,
- propertyName), propertyType)</code>
- *
- * @param realm
- * @param master
- * @param propertyName
- * @param propertyType
- * can be <code>null</code>
- * @return an observable value that tracks the current value of the named
- * property for the current value of the master observable value
- *
- * @see MasterDetailObservables
- */
- public static IObservableValue observeDetailValue(Realm realm,
- IObservableValue master, String propertyName, Class propertyType) {
-
- IObservableValue value = MasterDetailObservables.detailValue(master,
- valueFactory(realm, propertyName), propertyType);
- BeanObservableValueDecorator decorator = new BeanObservableValueDecorator(
- value, master, getValueTypePropertyDescriptor(master,
- propertyName));
-
- return decorator;
- }
-
- /**
- * Helper method for
- * <code>MasterDetailObservables.detailList(master, listFactory(realm,
- propertyName, propertyType), propertyType)</code>
- *
- * @param realm
- * @param master
- * @param propertyName
- * @param propertyType
- * can be <code>null</code>
- * @return an observable list that tracks the named property for the current
- * value of the master observable value
- *
- * @see MasterDetailObservables
- */
- public static IObservableList observeDetailList(Realm realm,
- IObservableValue master, String propertyName, Class propertyType) {
- IObservableList observableList = MasterDetailObservables.detailList(
- master, listFactory(realm, propertyName, propertyType),
- propertyType);
- BeanObservableListDecorator decorator = new BeanObservableListDecorator(
- observableList, master, getValueTypePropertyDescriptor(master,
- propertyName));
-
- return decorator;
- }
-
- /**
- * Helper method for
- * <code>MasterDetailObservables.detailSet(master, setFactory(realm,
- propertyName), propertyType)</code>
- *
- * @param realm
- * @param master
- * @param propertyName
- * @param propertyType
- * can be <code>null</code>
- * @return an observable set that tracks the named property for the current
- * value of the master observable value
- *
- * @see MasterDetailObservables
- */
- public static IObservableSet observeDetailSet(Realm realm,
- IObservableValue master, String propertyName, Class propertyType) {
-
- IObservableSet observableSet = MasterDetailObservables.detailSet(
- master, setFactory(realm, propertyName, propertyType),
- propertyType);
- BeanObservableSetDecorator decorator = new BeanObservableSetDecorator(
- observableSet, master, getValueTypePropertyDescriptor(master,
- propertyName));
-
- return decorator;
- }
-
- /**
- * @param realm
- * @param bean
- * @param propertyName
- * @param elementType
- * can be <code>null</code>
- * @return an observable set that tracks the current value of the named
- * property for given bean object
- */
- public static IObservableSet observeSet(Realm realm, Object bean,
- String propertyName, Class elementType) {
- PropertyDescriptor propertyDescriptor = getPropertyDescriptor(bean
- .getClass(), propertyName);
- elementType = getCollectionElementType(elementType, propertyDescriptor);
-
- return new JavaBeanObservableSet(realm, bean, propertyDescriptor,
- elementType);
- }
-
- /**
- * @param realm
- * @param propertyName
- * @param elementType
- * can be <code>null</code>
- * @return an observable set factory for creating observable sets
- */
- public static IObservableFactory setFactory(final Realm realm,
- final String propertyName, final Class elementType) {
- return new IObservableFactory() {
- public IObservable createObservable(Object target) {
- return observeSet(realm, target, propertyName, elementType);
- }
- };
- }
-
- /**
- * @param elementType
- * can be <code>null</code>
- * @param propertyDescriptor
- * @return type of the items in a collection/array property
- */
- private static Class getCollectionElementType(Class elementType,
- PropertyDescriptor propertyDescriptor) {
- if (elementType == null) {
- Class propertyType = propertyDescriptor.getPropertyType();
- elementType = propertyType.isArray() ? propertyType
- .getComponentType() : Object.class;
- }
-
- return elementType;
- }
-
- /**
- * @param observable
- * @param propertyName
- * @return property descriptor or <code>null</code>
- */
- private static PropertyDescriptor getValueTypePropertyDescriptor(
- IObservableValue observable, String propertyName) {
- return (observable.getValueType() != null) ? getPropertyDescriptor(
- (Class) observable.getValueType(), propertyName) : null;
- }
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/IBeanObservable.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/IBeanObservable.java
deleted file mode 100644
index c2545ef..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/IBeanObservable.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 147515
- ******************************************************************************/
-
-package org.eclipse.core.databinding.beans;
-
-import java.beans.PropertyDescriptor;
-
-import org.eclipse.core.databinding.observable.IObserving;
-
-/**
- * Provides access to details of bean observables.
- * <p>
- * This interface is not meant to be implemented by clients.
- * </p>
- *
- * @since 3.3
- */
-public interface IBeanObservable extends IObserving {
- /**
- * @return property descriptor of the property being observed,
- * <code>null</code> if the runtime time information was not
- * provided on construction of the observable
- */
- public PropertyDescriptor getPropertyDescriptor();
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/package.html b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/package.html
deleted file mode 100644
index d720e2b..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/package.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <meta name="GENERATOR" content="Mozilla/4.5 [en] (Win98; I) [Netscape]">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-To be written.
-<h2>
-Package Specification</h2>
-<p>
-This package provides classes that can be used to ...</p>
-</body>
-</html>
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableListDecorator.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableListDecorator.java
deleted file mode 100644
index fdf1cdf..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableListDecorator.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.core.databinding.beans.IBeanObservable;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IListChangeListener;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-
-/**
- * {@link IBeanObservable} decorator for an {@link IObservableList}.
- *
- * @since 3.3
- */
-public class BeanObservableListDecorator implements IObservableList,
- IBeanObservable {
- private IObservableList delegate;
- private Object observed;
- private PropertyDescriptor propertyDescriptor;
-
- /**
- * @param delegate
- * @param observed
- * @param propertyDescriptor
- */
- public BeanObservableListDecorator(IObservableList delegate,
- Object observed, PropertyDescriptor propertyDescriptor) {
-
- this.delegate = delegate;
- this.observed = observed;
- this.propertyDescriptor = propertyDescriptor;
- }
-
- public void add(int index, Object element) {
- delegate.add(index, element);
- }
-
- public boolean add(Object o) {
- return delegate.add(o);
- }
-
- public boolean addAll(Collection c) {
- return delegate.addAll(c);
- }
-
- public boolean addAll(int index, Collection c) {
- return delegate.addAll(index, c);
- }
-
- public void addChangeListener(IChangeListener listener) {
- delegate.addChangeListener(listener);
- }
-
- public void addListChangeListener(IListChangeListener listener) {
- delegate.addListChangeListener(listener);
- }
-
- public void addStaleListener(IStaleListener listener) {
- delegate.addStaleListener(listener);
- }
-
- public void clear() {
- delegate.clear();
- }
-
- public boolean contains(Object o) {
- return delegate.contains(o);
- }
-
- public boolean containsAll(Collection c) {
- return delegate.containsAll(c);
- }
-
- public void dispose() {
- delegate.dispose();
- }
-
- public boolean equals(Object o) {
- return delegate.equals(o);
- }
-
- public Object get(int index) {
- return delegate.get(index);
- }
-
- public Object getElementType() {
- return delegate.getElementType();
- }
-
- public Realm getRealm() {
- return delegate.getRealm();
- }
-
- public int hashCode() {
- return delegate.hashCode();
- }
-
- public int indexOf(Object o) {
- return delegate.indexOf(o);
- }
-
- public boolean isEmpty() {
- return delegate.isEmpty();
- }
-
- public boolean isStale() {
- return delegate.isStale();
- }
-
- public Iterator iterator() {
- return delegate.iterator();
- }
-
- public int lastIndexOf(Object o) {
- return delegate.lastIndexOf(o);
- }
-
- public ListIterator listIterator() {
- return delegate.listIterator();
- }
-
- public ListIterator listIterator(int index) {
- return delegate.listIterator(index);
- }
-
- public Object remove(int index) {
- return delegate.remove(index);
- }
-
- public boolean remove(Object o) {
- return delegate.remove(o);
- }
-
- public boolean removeAll(Collection c) {
- return delegate.removeAll(c);
- }
-
- public void removeChangeListener(IChangeListener listener) {
- delegate.removeChangeListener(listener);
- }
-
- public void removeListChangeListener(IListChangeListener listener) {
- delegate.removeListChangeListener(listener);
- }
-
- public void removeStaleListener(IStaleListener listener) {
- delegate.removeStaleListener(listener);
- }
-
- public boolean retainAll(Collection c) {
- return delegate.retainAll(c);
- }
-
- public Object set(int index, Object element) {
- return delegate.set(index, element);
- }
-
- public int size() {
- return delegate.size();
- }
-
- public List subList(int fromIndex, int toIndex) {
- return delegate.subList(fromIndex, toIndex);
- }
-
- public Object[] toArray() {
- return delegate.toArray();
- }
-
- public Object[] toArray(Object[] a) {
- return delegate.toArray(a);
- }
-
- /**
- * @return list being delegated to
- */
- public IObservableList getDelegate() {
- return delegate;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getObserved()
- */
- public Object getObserved() {
- return observed;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getPropertyDescriptor()
- */
- public PropertyDescriptor getPropertyDescriptor() {
- return propertyDescriptor;
- }
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableSetDecorator.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableSetDecorator.java
deleted file mode 100644
index 420b078..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableSetDecorator.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.databinding.beans.IBeanObservable;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.ISetChangeListener;
-
-/**
- * {@link IBeanObservable} decorator for an {@link IObservableSet}.
- *
- * @since 3.3
- */
-public class BeanObservableSetDecorator implements IObservableSet, IBeanObservable {
- private IObservableSet delegate;
- private Object observed;
- private PropertyDescriptor propertyDescriptor;
-
- /**
- * @param delegate
- * @param observed
- * @param propertyDescriptor
- */
- public BeanObservableSetDecorator(IObservableSet delegate,
- Object observed,
- PropertyDescriptor propertyDescriptor) {
-
- this.delegate = delegate;
- this.observed = observed;
- this.propertyDescriptor = propertyDescriptor;
- }
-
- public boolean add(Object o) {
- return delegate.add(o);
- }
-
- public boolean addAll(Collection c) {
- return delegate.addAll(c);
- }
-
- public void addChangeListener(IChangeListener listener) {
- delegate.addChangeListener(listener);
- }
-
- public void addSetChangeListener(ISetChangeListener listener) {
- delegate.addSetChangeListener(listener);
- }
-
- public void addStaleListener(IStaleListener listener) {
- delegate.addStaleListener(listener);
- }
-
- public void clear() {
- delegate.clear();
- }
-
- public boolean contains(Object o) {
- return delegate.contains(o);
- }
-
- public boolean containsAll(Collection c) {
- return delegate.containsAll(c);
- }
-
- public void dispose() {
- delegate.dispose();
- }
-
- public boolean equals(Object o) {
- return delegate.equals(o);
- }
-
- public Object getElementType() {
- return delegate.getElementType();
- }
-
- public Realm getRealm() {
- return delegate.getRealm();
- }
-
- public int hashCode() {
- return delegate.hashCode();
- }
-
- public boolean isEmpty() {
- return delegate.isEmpty();
- }
-
- public boolean isStale() {
- return delegate.isStale();
- }
-
- public Iterator iterator() {
- return delegate.iterator();
- }
-
- public boolean remove(Object o) {
- return delegate.remove(o);
- }
-
- public boolean removeAll(Collection c) {
- return delegate.removeAll(c);
- }
-
- public void removeChangeListener(IChangeListener listener) {
- delegate.removeChangeListener(listener);
- }
-
- public void removeSetChangeListener(ISetChangeListener listener) {
- delegate.removeSetChangeListener(listener);
- }
-
- public void removeStaleListener(IStaleListener listener) {
- delegate.removeStaleListener(listener);
- }
-
- public boolean retainAll(Collection c) {
- return delegate.retainAll(c);
- }
-
- public int size() {
- return delegate.size();
- }
-
- public Object[] toArray() {
- return delegate.toArray();
- }
-
- public Object[] toArray(Object[] a) {
- return delegate.toArray(a);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getObserved()
- */
- public Object getObserved() {
- return observed;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getPropertyDescriptor()
- */
- public PropertyDescriptor getPropertyDescriptor() {
- return propertyDescriptor;
- }
-
- /**
- * @return the wrapped set
- */
- public IObservableSet getDelegate() {
- return delegate;
- }
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableValueDecorator.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableValueDecorator.java
deleted file mode 100644
index c64e6ca..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableValueDecorator.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-
-import org.eclipse.core.databinding.beans.IBeanObservable;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-
-/**
- * {@link IBeanObservable} decorator for an {@link IObservableValue}.
- *
- * @since 3.3
- */
-public class BeanObservableValueDecorator implements IObservableValue,
- IBeanObservable {
- private final IObservableValue delegate;
- private final PropertyDescriptor descriptor;
- private final IObservableValue observed;
-
- /**
- * @param delegate
- * @param observed
- * @param descriptor
- */
- public BeanObservableValueDecorator(IObservableValue delegate, IObservableValue observed,
- PropertyDescriptor descriptor) {
- this.delegate = delegate;
- this.observed = observed;
- this.descriptor = descriptor;
- }
-
- public void addChangeListener(IChangeListener listener) {
- delegate.addChangeListener(listener);
- }
-
- public void addStaleListener(IStaleListener listener) {
- delegate.addStaleListener(listener);
- }
-
- public void addValueChangeListener(IValueChangeListener listener) {
- delegate.addValueChangeListener(listener);
- }
-
- public void dispose() {
- delegate.dispose();
- }
-
- public boolean equals(Object obj) {
- return delegate.equals(obj);
- }
-
- public Realm getRealm() {
- return delegate.getRealm();
- }
-
- public Object getValue() {
- return delegate.getValue();
- }
-
- public Object getValueType() {
- return delegate.getValueType();
- }
-
- public int hashCode() {
- return delegate.hashCode();
- }
-
- public boolean isStale() {
- return delegate.isStale();
- }
-
- public void removeChangeListener(IChangeListener listener) {
- delegate.removeChangeListener(listener);
- }
-
- public void removeStaleListener(IStaleListener listener) {
- delegate.removeStaleListener(listener);
- }
-
- public void removeValueChangeListener(IValueChangeListener listener) {
- delegate.removeValueChangeListener(listener);
- }
-
- public void setValue(Object value) {
- delegate.setValue(value);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getObserved()
- */
- public Object getObserved() {
- return observed.getValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getPropertyDescriptor()
- */
- public PropertyDescriptor getPropertyDescriptor() {
- return descriptor;
- }
-
- /**
- * @return observable value delegate
- */
- public IObservableValue getDelegate() {
- return delegate;
- }
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/IdentityWrapper.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/IdentityWrapper.java
deleted file mode 100644
index 491f9ed..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/IdentityWrapper.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Daniel Kruegler - bug 137435
- ******************************************************************************/
-
-package org.eclipse.core.internal.databinding.internal.beans;
-
-/**
- * Used for wrapping objects that define their own implementations of equals()
- * and hashCode() when putting them in sets or hashmaps to ensure identity
- * comparison.
- *
- * @since 1.0
- *
- */
-public class IdentityWrapper {
- final Object o;
-
- /**
- * @param o
- */
- public IdentityWrapper(Object o) {
- this.o = o;
- }
-
- /**
- * @return the unwrapped object
- */
- public Object unwrap() {
- return o;
- }
-
- public boolean equals(Object obj) {
- if (obj == null || obj.getClass() != IdentityWrapper.class) {
- return false;
- }
- return o == ((IdentityWrapper) obj).o;
- }
-
- public int hashCode() {
- return System.identityHashCode(o);
- }
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableList.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableList.java
deleted file mode 100644
index ce16607..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableList.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 171616
- *******************************************************************************/
-
-package org.eclipse.core.internal.databinding.internal.beans;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.eclipse.core.databinding.beans.IBeanObservable;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.ObservableList;
-import org.eclipse.core.runtime.Assert;
-
-/**
- * @since 1.0
- *
- */
-public class JavaBeanObservableList extends ObservableList implements IBeanObservable {
-
- private final Object object;
-
- private PropertyChangeListener collectionListener = new PropertyChangeListener() {
- public void propertyChange(java.beans.PropertyChangeEvent event) {
- if (!updating) {
- updateWrappedList(Arrays.asList(getValues()));
- }
- }
- };
-
- private boolean updating = false;
-
- private PropertyDescriptor descriptor;
-
- private ListenerSupport collectionListenSupport;
-
- /**
- * @param realm
- * @param object
- * @param descriptor
- * @param elementType
- */
- public JavaBeanObservableList(Realm realm, Object object, PropertyDescriptor descriptor,
- Class elementType) {
- super(realm, new ArrayList(), elementType);
- this.object = object;
- this.descriptor = descriptor;
- this.collectionListenSupport = new ListenerSupport(collectionListener,
- descriptor.getName());
-
- // initialize list without firing events
- wrappedList.addAll(Arrays.asList(getValues()));
- }
-
- protected void firstListenerAdded() {
- collectionListenSupport.hookListener(this.object);
- }
-
- protected void lastListenerRemoved() {
- if (collectionListenSupport != null) {
- collectionListenSupport.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.databinding.observable.list.ObservableList#dispose()
- */
- public void dispose() {
- super.dispose();
- lastListenerRemoved();
- }
-
- private Object primGetValues() {
- try {
- Method readMethod = descriptor.getReadMethod();
- if (!readMethod.isAccessible()) {
- readMethod.setAccessible(true);
- }
- return readMethod.invoke(object, new Object[0]);
- } catch (IllegalArgumentException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- Assert.isTrue(false, "Could not read collection values"); //$NON-NLS-1$
- return null;
- }
-
- private Object[] getValues() {
- Object[] values = null;
-
- Object result = primGetValues();
- if (descriptor.getPropertyType().isArray())
- values = (Object[]) result;
- else {
- // TODO add jUnit for POJO (var. SettableValue) collections
- Collection list = (Collection) result;
- if (list != null) {
- values = list.toArray();
- } else {
- values = new Object[] {};
- }
- }
- return values;
- }
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getObserved()
- */
- public Object getObserved() {
- return object;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getPropertyDescriptor()
- */
- public PropertyDescriptor getPropertyDescriptor() {
- return descriptor;
- }
-}
-
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableMap.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableMap.java
deleted file mode 100644
index e8dfb77..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableMap.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 171616
- *******************************************************************************/
-
-package org.eclipse.core.internal.databinding.internal.beans;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-
-import org.eclipse.core.databinding.beans.IBeanObservable;
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.map.ComputedObservableMap;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.util.Policy;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-/**
- * @since 1.0
- *
- */
-public class JavaBeanObservableMap extends ComputedObservableMap implements IBeanObservable {
-
- private PropertyDescriptor propertyDescriptor;
-
- private PropertyChangeListener elementListener = new PropertyChangeListener() {
- public void propertyChange(final java.beans.PropertyChangeEvent event) {
- if (!updating) {
- fireMapChange(Diffs.createMapDiffSingleChange(
- event.getSource(), event.getOldValue(), event
- .getNewValue()));
- }
- }
- };
-
- private ListenerSupport listenerSupport;
-
- private boolean updating = false;
-
- /**
- * @param domain
- * @param propertyDescriptor
- */
- public JavaBeanObservableMap(IObservableSet domain,
- PropertyDescriptor propertyDescriptor) {
- super(domain);
-
- this.propertyDescriptor = propertyDescriptor;
- this.listenerSupport = new ListenerSupport(elementListener,
- propertyDescriptor.getName());
- init();
- }
-
- protected void hookListener(Object domainElement) {
- listenerSupport.hookListener(domainElement);
- }
-
- protected void unhookListener(Object domainElement) {
- listenerSupport.unhookListener(domainElement);
- }
-
- protected Object doGet(Object key) {
- try {
- Method readMethod = propertyDescriptor.getReadMethod();
- if (!readMethod.isAccessible()) {
- readMethod.setAccessible(true);
- }
- return readMethod.invoke(key, new Object[0]);
- } catch (Exception e) {
- Policy.getLog().log(
- new Status(IStatus.ERROR, Policy.JFACE_DATABINDING,
- IStatus.ERROR, "cannot get value", e)); //$NON-NLS-1$
- throw new RuntimeException(e);
- }
- }
-
- protected Object doPut(Object key, Object value) {
- try {
- Object oldValue = get(key);
- propertyDescriptor.getWriteMethod().invoke(key,
- new Object[] { value });
- keySet().add(key);
- return oldValue;
- } catch (Exception e) {
- Policy.getLog().log(
- new Status(IStatus.ERROR, Policy.JFACE_DATABINDING,
- IStatus.ERROR, "cannot set value", e)); //$NON-NLS-1$
- throw new RuntimeException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getObserved()
- */
- public Object getObserved() {
- return keySet();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getPropertyDescriptor()
- */
- public PropertyDescriptor getPropertyDescriptor() {
- return propertyDescriptor;
- }
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableSet.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableSet.java
deleted file mode 100644
index d81213d..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableSet.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 171616
- *******************************************************************************/
-
-package org.eclipse.core.internal.databinding.internal.beans;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.databinding.beans.IBeanObservable;
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.set.ObservableSet;
-import org.eclipse.core.runtime.Assert;
-
-/**
- * @since 1.0
- *
- */
-public class JavaBeanObservableSet extends ObservableSet implements IBeanObservable {
-
- private final Object object;
-
- private PropertyChangeListener collectionListener = new PropertyChangeListener() {
- public void propertyChange(java.beans.PropertyChangeEvent event) {
- if (!updating) {
- Set newElements = new HashSet(Arrays.asList(getValues()));
- Set addedElements = new HashSet(newElements);
- Set removedElements = new HashSet(wrappedSet);
- // remove all new elements from old elements to compute the
- // removed elements
- removedElements.removeAll(newElements);
- addedElements.removeAll(wrappedSet);
- wrappedSet = newElements;
- fireSetChange(Diffs.createSetDiff(addedElements,
- removedElements));
- }
- }
- };
-
- private boolean updating = false;
-
- private PropertyDescriptor descriptor;
-
- private ListenerSupport collectionListenSupport;
-
- /**
- * @param realm
- * @param object
- * @param descriptor
- * @param elementType
- */
- public JavaBeanObservableSet(Realm realm, Object object, PropertyDescriptor descriptor,
- Class elementType) {
- super(realm, new HashSet(), elementType);
- this.object = object;
- this.descriptor = descriptor;
- this.collectionListenSupport = new ListenerSupport(collectionListener, descriptor.getName());
-
- wrappedSet.addAll(Arrays.asList(getValues()));
- }
-
- protected void firstListenerAdded() {
- collectionListenSupport.hookListener(this.object);
- }
-
- protected void lastListenerRemoved() {
- if (collectionListenSupport != null) {
- collectionListenSupport.dispose();
- }
- }
-
- private Object primGetValues() {
- try {
- Method readMethod = descriptor.getReadMethod();
- if (!readMethod.isAccessible()) {
- readMethod.setAccessible(true);
- }
- return readMethod.invoke(object, new Object[0]);
- } catch (IllegalArgumentException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- Assert.isTrue(false, "Could not read collection values"); //$NON-NLS-1$
- return null;
- }
-
- private Object[] getValues() {
- Object[] values = null;
-
- Object result = primGetValues();
- if (descriptor.getPropertyType().isArray())
- values = (Object[]) result;
- else {
- // TODO add jUnit for POJO (var. SettableValue) collections
- Collection list = (Collection) result;
- if (list != null) {
- values = list.toArray();
- } else {
- values = new Object[] {};
- }
- }
- return values;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getObserved()
- */
- public Object getObserved() {
- return object;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.beans.IBeanObservable#getPropertyDescriptor()
- */
- public PropertyDescriptor getPropertyDescriptor() {
- return descriptor;
- }
-
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableValue.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableValue.java
deleted file mode 100644
index 9257d84..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableValue.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- * Brad Reynolds - bug 164134, 171616
- *******************************************************************************/
-package org.eclipse.core.internal.databinding.internal.beans;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-
-import org.eclipse.core.databinding.BindingException;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.beans.IBeanObservable;
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
-import org.eclipse.core.databinding.observable.value.ValueDiff;
-import org.eclipse.core.databinding.util.Policy;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-/**
- * @since 1.0
- *
- */
-public class JavaBeanObservableValue extends AbstractObservableValue implements IBeanObservable {
- private final Object object;
- private boolean updating = false;
-
- private final PropertyDescriptor propertyDescriptor;
- private final Class overrideType;
- private ListenerSupport listenerSupport;
-
- /**
- * @param realm
- * @param object
- * @param descriptor
- * @param overrideType
- */
- public JavaBeanObservableValue(Realm realm, Object object,
- PropertyDescriptor descriptor, Class overrideType) {
- super(realm);
- this.object = object;
- this.propertyDescriptor = descriptor;
- this.overrideType = overrideType;
- }
-
- protected void firstListenerAdded() {
- PropertyChangeListener listener = new PropertyChangeListener() {
- public void propertyChange(java.beans.PropertyChangeEvent event) {
- if (!updating) {
- final ValueDiff diff = Diffs.createValueDiff(event.getOldValue(),
- event.getNewValue());
- getRealm().exec(new Runnable(){
- public void run() {
- fireValueChange(diff);
- }});
- }
- }
- };
-
- if (listenerSupport == null) {
- listenerSupport = new ListenerSupport(listener, propertyDescriptor.getName());
- }
-
- listenerSupport.hookListener(object);
- }
-
- public void doSetValue(Object value) {
- updating = true;
- try {
- Object oldValue = doGetValue();
- Method writeMethod = propertyDescriptor.getWriteMethod();
- if (!writeMethod.isAccessible()) {
- writeMethod.setAccessible(true);
- }
- writeMethod.invoke(object, new Object[] { value });
- fireValueChange(Diffs.createValueDiff(oldValue, doGetValue()));
- } catch (Exception e) {
- if (BeansObservables.DEBUG) {
- Policy
- .getLog()
- .log(
- new Status(
- IStatus.WARNING,
- Policy.JFACE_DATABINDING,
- IStatus.OK,
- "Could not change value of " + object + "." + propertyDescriptor.getName(), e)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } finally {
- updating = false;
- }
- }
-
- public Object doGetValue() {
- try {
- Method readMethod = propertyDescriptor.getReadMethod();
- if (readMethod == null) {
- throw new BindingException(propertyDescriptor.getName()
- + " property does not have a read method."); //$NON-NLS-1$
- }
- if (!readMethod.isAccessible()) {
- readMethod.setAccessible(true);
- }
- return readMethod.invoke(object, null);
- } catch (Exception e) {
- if (BeansObservables.DEBUG) {
- Policy
- .getLog()
- .log(
- new Status(
- IStatus.WARNING,
- Policy.JFACE_DATABINDING,
- IStatus.OK,
- "Could not read value of " + object + "." + propertyDescriptor.getName(), e)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return null;
- }
- }
-
- protected void lastListenerRemoved() {
- unhookListener();
- }
-
- private void unhookListener() {
- if (listenerSupport != null) {
- listenerSupport.dispose();
- }
- }
-
- public Object getValueType() {
- Class type = propertyDescriptor.getPropertyType();
- if (type == Object.class && overrideType != null)
- type = overrideType;
- return type;
- }
-
- public Object getObserved() {
- return object;
- }
-
- public PropertyDescriptor getPropertyDescriptor() {
- return propertyDescriptor;
- }
-
- public synchronized void dispose() {
- unhookListener();
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/ListenerSupport.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/ListenerSupport.java
deleted file mode 100644
index 8144891..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/ListenerSupport.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.databinding.internal.beans;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.util.Policy;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-/**
- * This is a helper that will hook up and listen for <code>PropertyChangeEvent</code> events
- * for a set of target JavaBeans
- *
- * @since 1.0
- */
-public class ListenerSupport {
-
- private Set elementsListenedTo = new HashSet();
-
- private PropertyChangeListener listener;
-
- private String propertyName;
-
- /**
- * Constructs a new instance.
- *
- * @param listener is the callback that will be called
- * when a <code>PropertyChangeEvent</code> is fired on any
- * of the target objects. Will only receive change events
- * when the provided <code>propertyName</code> changes.
- * @param propertyName
- */
- public ListenerSupport(final PropertyChangeListener listener,
- final String propertyName) {
- Assert.isNotNull(listener);
- Assert.isNotNull(propertyName);
-
- this.propertyName = propertyName;
- this.listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent evt) {
- if (propertyName.equals(evt.getPropertyName())) {
- listener.propertyChange(evt);
- }
- }
- };
- }
-
- /**
- * Start listen to target (if it supports the JavaBean property change listener pattern)
- *
- * @param target
- */
- public void hookListener(Object target) {
- if (processListener(
- "addPropertyChangeListener", "Could not attach listener to ", target)) { //$NON-NLS-1$ //$NON-NLS-2$
- elementsListenedTo.add(new IdentityWrapper(target));
- }
- }
-
- /**
- * Add listeners for new targets (those this instance of<code>ListenerSupport</code> does not
- * already listen to),
- * Stop to listen to those object that this instance listen to and is one of the object in targets
- *
- * @param targets
- */
- public void setHookTargets(Object[] targets) {
- Set elementsToUnhook = new HashSet(elementsListenedTo);
- if (targets!=null) {
- for (int i = 0; i < targets.length; i++) {
- Object newValue = targets[i];
- IdentityWrapper identityWrapper = new IdentityWrapper(newValue);
- if(!elementsToUnhook.remove(identityWrapper))
- hookListener(newValue);
- }
- }
-
- for (Iterator it = elementsToUnhook.iterator(); it.hasNext();) {
- Object o = it.next();
- if (o.getClass()!=IdentityWrapper.class)
- o = new IdentityWrapper(o);
- elementsListenedTo.remove(o);
- unhookListener(o);
- }
- }
-
- /**
- * Stop listen to target
- *
- * @param target
- */
- public void unhookListener(Object target) {
- if (target.getClass() == IdentityWrapper.class)
- target = ((IdentityWrapper) target).unwrap();
-
- if (processListener(
- "removePropertyChangeListener", "Cound not remove listener from ", target)) { //$NON-NLS-1$//$NON-NLS-2$
- elementsListenedTo.remove(new IdentityWrapper(target));
- }
- }
-
-
- /**
- *
- */
- public void dispose() {
- if (elementsListenedTo!=null) {
- Object[] targets = elementsListenedTo.toArray();
- for (int i = 0; i < targets.length; i++) {
- unhookListener(targets[i]);
- }
- elementsListenedTo=null;
- listener=null;
- }
- }
-
- /**
- * @return elements that were registred to
- */
- public Object[] getHookedTargets() {
- Object[] targets = null;
- if (elementsListenedTo!=null && elementsListenedTo.size()>0) {
- Object[] identityList = elementsListenedTo.toArray();
- targets = new Object[identityList.length];
- for (int i = 0; i < identityList.length; i++)
- targets[i]=((IdentityWrapper)identityList[i]).unwrap();
- }
- return targets;
- }
-
- /**
- * Invokes the method for the provided <code>methodName</code> attempting
- * to first use the method with the property name and then the unnamed
- * version.
- *
- * @param methodName
- * either addPropertyChangeListener or
- * removePropertyChangeListener
- * @param message
- * string that will be prefixed to the target in an error message
- * @param target
- * object to invoke the method on
- * @return <code>true</code> if the method was invoked successfully
- */
- private boolean processListener(String methodName, String message,
- Object target) {
- Method method = null;
- Object[] parameters = null;
-
- try {
- try {
- method = target.getClass().getMethod(
- methodName,
- new Class[] { String.class,
- PropertyChangeListener.class });
-
- parameters = new Object[] { propertyName, listener };
- } catch (NoSuchMethodException e) {
- method = target.getClass().getMethod(methodName,
- new Class[] { PropertyChangeListener.class });
-
- parameters = new Object[] { listener };
- }
- } catch (SecurityException e) {
- // ignore
- } catch (NoSuchMethodException e) {
- log(IStatus.WARNING, message + target, e);
- }
-
- if (method != null) {
- if (!method.isAccessible()) {
- method.setAccessible(true);
- }
- try {
- method.invoke(target, parameters);
- return true;
- } catch (IllegalArgumentException e) {
- log(IStatus.WARNING, message + target, e);
- } catch (IllegalAccessException e) {
- log(IStatus.WARNING, message + target, e);
- } catch (InvocationTargetException e) {
- log(IStatus.WARNING, message + target, e);
- }
- }
- return false;
- }
-
- /**
- * Logs a message to the Data Binding logger.
- */
- private void log(int severity, String message, Throwable throwable) {
- if (BeansObservables.DEBUG) {
- Policy.getLog().log(
- new Status(severity, Policy.JFACE_DATABINDING, IStatus.OK,
- message, throwable));
- }
- }
-}
diff --git a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/package.html b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/package.html
deleted file mode 100644
index d720e2b..0000000
--- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/package.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <meta name="GENERATOR" content="Mozilla/4.5 [en] (Win98; I) [Netscape]">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-To be written.
-<h2>
-Package Specification</h2>
-<p>
-This package provides classes that can be used to ...</p>
-</body>
-</html>
diff --git a/bundles/org.eclipse.jface.databinding/.classpath b/bundles/org.eclipse.jface.databinding/.classpath
deleted file mode 100644
index ce0c7a5..0000000
--- a/bundles/org.eclipse.jface.databinding/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.0%Foundation-1.0"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jface.databinding/.cvsignore b/bundles/org.eclipse.jface.databinding/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/bundles/org.eclipse.jface.databinding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.jface.databinding/.project b/bundles/org.eclipse.jface.databinding/.project
deleted file mode 100644
index e65e985..0000000
--- a/bundles/org.eclipse.jface.databinding/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jface.databinding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index bc38b60..0000000
--- a/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,71 +0,0 @@
-#Thu Feb 01 22:54:44 EST 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.3
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=error
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 59509e0..0000000
--- a/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Thu Aug 24 15:24:48 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.javadoc=true
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) ${year} IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * IBM Corporation - initial API and implementation\n ******************************************************************************/\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @since 3.3\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template></templates>
diff --git a/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fee4b04..0000000
--- a/bundles/org.eclipse.jface.databinding/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Sat Mar 19 15:31:31 EST 2005
-compilers.p.deprecated=0
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=1
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.jface.databinding/META-INF/MANIFEST.MF b/bundles/org.eclipse.jface.databinding/META-INF/MANIFEST.MF
deleted file mode 100644
index 31ed8a7..0000000
--- a/bundles/org.eclipse.jface.databinding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jface.databinding
-Bundle-Version: 1.1.0.qualifier
-Bundle-ClassPath: .
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.jface.databinding.swt,
- org.eclipse.jface.databinding.viewers,
- org.eclipse.jface.internal.databinding.internal.swt;x-internal:=true,
- org.eclipse.jface.internal.databinding.internal.viewers;x-internal:=true,
- org.eclipse.jface.internal.databinding.provisional.swt;x-internal:=false,
- org.eclipse.jface.internal.databinding.provisional.viewers;x-internal:=false
-Require-Bundle: org.eclipse.core.databinding;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.swt;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jface;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)"
-Import-Package: com.ibm.icu.text
-Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
- J2SE-1.3
diff --git a/bundles/org.eclipse.jface.databinding/about.html b/bundles/org.eclipse.jface.databinding/about.html
deleted file mode 100644
index 4602330..0000000
--- a/bundles/org.eclipse.jface.databinding/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jface.databinding/build.properties b/bundles/org.eclipse.jface.databinding/build.properties
deleted file mode 100644
index 6f0a513..0000000
--- a/bundles/org.eclipse.jface.databinding/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = .,\
- META-INF/,\
- plugin.properties,\
- about.html
-output.databinding.jar = bin/
-src.includes = about.html
-source.. = src/
diff --git a/bundles/org.eclipse.jface.databinding/plugin.properties b/bundles/org.eclipse.jface.databinding/plugin.properties
deleted file mode 100644
index 2880743..0000000
--- a/bundles/org.eclipse.jface.databinding/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName = JFace Data Binding for SWT and JFace
-providerName = Eclipse.org
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/ISWTObservable.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/ISWTObservable.java
deleted file mode 100644
index f3a74f8..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/ISWTObservable.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.databinding.swt;
-
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * {@link IObservable} observing an SWT widget.
- *
- * @since 1.1
- *
- */
-public interface ISWTObservable extends IObservable {
-
- /**
- * Returns the widget of this observable
- *
- * @return the widget
- */
- public Widget getWidget();
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/ISWTObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/ISWTObservableValue.java
deleted file mode 100644
index b8f65a6..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/ISWTObservableValue.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.databinding.swt;
-
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-
-/**
- * {@link IObservableValue} observing an SWT widget.
- *
- * @since 1.0
- *
- */
-public interface ISWTObservableValue extends ISWTObservable, IObservableValue {
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/SWTObservables.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/SWTObservables.java
deleted file mode 100644
index 1180c2a..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/SWTObservables.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Matt Carter - bug 170668
- * Brad Reynolds - bug 170848
- *******************************************************************************/
-package org.eclipse.jface.databinding.swt;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.jface.internal.databinding.internal.swt.ButtonObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.CComboObservableList;
-import org.eclipse.jface.internal.databinding.internal.swt.CComboObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.CLabelObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.ComboObservableList;
-import org.eclipse.jface.internal.databinding.internal.swt.ComboObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.ControlObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.LabelObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.ListObservableList;
-import org.eclipse.jface.internal.databinding.internal.swt.ListObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties;
-import org.eclipse.jface.internal.databinding.internal.swt.ScaleObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.SpinnerObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.TableObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.TextEditableObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.TextObservableValue;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Scale;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * A factory for creating observables for SWT widgets
- *
- * @since 1.1
- *
- */
-public class SWTObservables {
-
- private static java.util.List realms = new ArrayList();
-
- /**
- * Returns the realm representing the UI thread for the given display.
- *
- * @param display
- * @return the realm representing the UI thread for the given display
- */
- public static Realm getRealm(final Display display) {
- synchronized (realms) {
- for (Iterator it = realms.iterator(); it.hasNext();) {
- DisplayRealm displayRealm = (DisplayRealm) it.next();
- if (displayRealm.display == display) {
- return displayRealm;
- }
- }
- DisplayRealm result = new DisplayRealm(display);
- realms.add(result);
- return result;
- }
- }
-
- /**
- * @param control
- * @return an observable value tracking the enabled state of the given
- * control
- */
- public static ISWTObservableValue observeEnabled(Control control) {
- return new ControlObservableValue(control, SWTProperties.ENABLED);
- }
-
- /**
- * @param control
- * @return an observable value tracking the visible state of the given
- * control
- */
- public static ISWTObservableValue observeVisible(Control control) {
- return new ControlObservableValue(control, SWTProperties.VISIBLE);
- }
-
- /**
- * @param control
- * @return an observable value tracking the tooltip text of the given
- * control
- */
- public static ISWTObservableValue observeTooltipText(Control control) {
- return new ControlObservableValue(control, SWTProperties.TOOLTIP_TEXT);
- }
-
- /**
- * Returns an observable observing the selection attribute of the provided
- * <code>control</code>. The supported types are:
- * <ul>
- * <li>org.eclipse.swt.widgets.Spinner</li>
- * <li>org.eclipse.swt.widgets.Button</li>
- * <li>org.eclipse.swt.widgets.Combo</li>
- * <li>org.eclipse.swt.custom.CCombo</li>
- * <li>org.eclipse.swt.widgets.List</li>
- * <li>org.eclipse.swt.widgets.Scale</li>
- * </ul>
- *
- * @param control
- * @return observable value
- * @throws IllegalArgumentException
- * if <code>control</code> type is unsupported
- */
- public static ISWTObservableValue observeSelection(Control control) {
- if (control instanceof Spinner) {
- return new SpinnerObservableValue((Spinner) control,
- SWTProperties.SELECTION);
- } else if (control instanceof Button) {
- return new ButtonObservableValue((Button) control);
- } else if (control instanceof Combo) {
- return new ComboObservableValue((Combo) control,
- SWTProperties.SELECTION);
- } else if (control instanceof CCombo) {
- return new CComboObservableValue((CCombo) control,
- SWTProperties.SELECTION);
- } else if (control instanceof List) {
- return new ListObservableValue((List) control);
- } else if (control instanceof Scale) {
- return new ScaleObservableValue((Scale) control,
- SWTProperties.SELECTION);
- }
-
- throw new IllegalArgumentException(
- "Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * Returns an observable observing the minimum attribute of the provided
- * <code>control</code>. The supported types are:
- * <ul>
- * <li>org.eclipse.swt.widgets.Spinner</li>
- * <li>org.eclipse.swt.widgets.Scale</li>
- * </ul>
- *
- * @param control
- * @return observable value
- * @throws IllegalArgumentException
- * if <code>control</code> type is unsupported
- */
- public static ISWTObservableValue observeMin(Control control) {
- if (control instanceof Spinner) {
- return new SpinnerObservableValue((Spinner) control,
- SWTProperties.MIN);
- } else if (control instanceof Scale) {
- return new ScaleObservableValue((Scale) control, SWTProperties.MIN);
- }
-
- throw new IllegalArgumentException(
- "Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * Returns an observable observing the maximum attribute of the provided
- * <code>control</code>. The supported types are:
- * <ul>
- * <li>org.eclipse.swt.widgets.Spinner</li>
- * <li>org.eclipse.swt.widgets.Scale</li>
- * </ul>
- *
- * @param control
- * @return observable value
- * @throws IllegalArgumentException
- * if <code>control</code> type is unsupported
- */
- public static ISWTObservableValue observeMax(Control control) {
- if (control instanceof Spinner) {
- return new SpinnerObservableValue((Spinner) control,
- SWTProperties.MAX);
- } else if (control instanceof Scale) {
- return new ScaleObservableValue((Scale) control, SWTProperties.MAX);
- }
-
- throw new IllegalArgumentException(
- "Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * Returns an observable observing the text attribute of the provided
- * <code>control</code>. The supported types are:
- * <ul>
- * <li>org.eclipse.swt.widgets.Text</li>
- * </ul>
- *
- * @param control
- * @param event event type to register for change events
- * @return observable value
- * @throws IllegalArgumentException
- * if <code>control</code> type is unsupported
- */
- public static ISWTObservableValue observeText(Control control, int event) {
- if (control instanceof Text) {
- return new TextObservableValue((Text) control, event);
- }
-
- throw new IllegalArgumentException(
- "Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * Returns an observable observing the text attribute of the provided
- * <code>control</code>. The supported types are:
- * <ul>
- * <li>org.eclipse.swt.widgets.Label</li>
- * <li>org.eclipse.swt.custom.Label</li>
- * <li>org.eclipse.swt.widgets.Combo</li>
- * <li>org.eclipse.swt.custom.CCombo</li>
- * </ul>
- *
- * @param control
- * @return observable value
- * @throws IllegalArgumentException
- * if <code>control</code> type is unsupported
- */
- public static ISWTObservableValue observeText(Control control) {
- if (control instanceof Label) {
- return new LabelObservableValue((Label) control);
- } else if (control instanceof CLabel) {
- return new CLabelObservableValue((CLabel) control);
- } else if (control instanceof Combo) {
- return new ComboObservableValue((Combo) control, SWTProperties.TEXT);
- } else if (control instanceof CCombo) {
- return new CComboObservableValue((CCombo) control,
- SWTProperties.TEXT);
- }
-
- throw new IllegalArgumentException(
- "Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * Returns an observable observing the items attribute of the provided
- * <code>control</code>. The supported types are:
- * <ul>
- * <li>org.eclipse.swt.widgets.Combo</li>
- * <li>org.eclipse.swt.custom.CCombo</li>
- * <li>org.eclipse.swt.widgets.List</li>
- * </ul>
- *
- * @param control
- * @return observable list
- * @throws IllegalArgumentException
- * if <code>control</code> type is unsupported
- */
- public static IObservableList observeItems(Control control) {
- if (control instanceof Combo) {
- return new ComboObservableList((Combo) control);
- } else if (control instanceof CCombo) {
- return new CComboObservableList((CCombo) control);
- } else if (control instanceof List) {
- return new ListObservableList((List) control);
- }
-
- throw new IllegalArgumentException(
- "Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * Returns an observable observing the single selection index attribute of
- * the provided <code>control</code>. The supported types are:
- * <ul>
- * <li>org.eclipse.swt.widgets.Table</li>
- * </ul>
- *
- * @param control
- * @return observable value
- * @throws IllegalArgumentException
- * if <code>control</code> type is unsupported
- */
- public static ISWTObservableValue observeSingleSelectionIndex(
- Control control) {
- if (control instanceof Table) {
- return new TableObservableValue((Table) control,
- SWTProperties.SELECTION);
- }
-
- throw new IllegalArgumentException(
- "Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /**
- * @param control
- * @return an observable value tracking the foreground color of the given
- * control
- */
- public static ISWTObservableValue observeForeground(Control control) {
- return new ControlObservableValue(control, SWTProperties.FOREGROUND);
- }
-
- /**
- * @param control
- * @return an observable value tracking the background color of the given
- * control
- */
- public static ISWTObservableValue observeBackground(Control control) {
- return new ControlObservableValue(control, SWTProperties.BACKGROUND);
- }
-
- /**
- * @param control
- * @return an observable value tracking the font of the given control
- */
- public static ISWTObservableValue observeFont(Control control) {
- return new ControlObservableValue(control, SWTProperties.FONT);
- }
-
- /**
- * Returns an observable observing the editable attribute of
- * the provided <code>control</code>. The supported types are:
- * <ul>
- * <li>org.eclipse.swt.widgets.Text</li>
- * </ul>
- *
- * @param control
- * @return observable value
- * @throws IllegalArgumentException
- * if <code>control</code> type is unsupported
- */
- public static ISWTObservableValue observeEditable(Control control) {
- if (control instanceof Text) {
- return new TextEditableObservableValue((Text) control);
- }
-
- throw new IllegalArgumentException(
- "Widget [" + control.getClass().getName() + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- private static class DisplayRealm extends Realm {
- private Display display;
-
- /**
- * @param display
- */
- private DisplayRealm(Display display) {
- this.display = display;
- }
-
- public boolean isCurrent() {
- return Display.getCurrent() == display;
- }
-
- public void asyncExec(final Runnable runnable) {
- Runnable safeRunnable = new Runnable() {
- public void run() {
- safeRun(runnable);
- }
- };
- if (!display.isDisposed()) {
- display.asyncExec(safeRunnable);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return (display == null) ? 0 : display.hashCode();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final DisplayRealm other = (DisplayRealm) obj;
- if (display == null) {
- if (other.display != null)
- return false;
- } else if (!display.equals(other.display))
- return false;
- return true;
- }
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/package.html b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/package.html
deleted file mode 100644
index d720e2b..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/package.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <meta name="GENERATOR" content="Mozilla/4.5 [en] (Win98; I) [Netscape]">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-To be written.
-<h2>
-Package Specification</h2>
-<p>
-This package provides classes that can be used to ...</p>
-</body>
-</html>
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ListeningLabelProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ListeningLabelProvider.java
deleted file mode 100644
index 7cdd593..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ListeningLabelProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.databinding.viewers;
-
-import java.util.Iterator;
-
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.ISetChangeListener;
-import org.eclipse.core.databinding.observable.set.SetChangeEvent;
-import org.eclipse.jface.internal.databinding.provisional.viewers.ViewerLabelProvider;
-
-/**
- * @since 1.0
- *
- */
-public abstract class ListeningLabelProvider extends ViewerLabelProvider {
-
- private ISetChangeListener listener = new ISetChangeListener() {
- public void handleSetChange(SetChangeEvent event) {
- for (Iterator it = event.diff.getAdditions().iterator(); it.hasNext();) {
- addListenerTo(it.next());
- }
- for (Iterator it = event.diff.getRemovals().iterator(); it.hasNext();) {
- removeListenerFrom(it.next());
- }
- }
- };
-
- private IObservableSet items;
-
- /**
- * @param itemsThatNeedLabels
- */
- public ListeningLabelProvider(IObservableSet itemsThatNeedLabels) {
- this.items = itemsThatNeedLabels;
- items.addSetChangeListener(listener);
- for (Iterator it = items.iterator(); it.hasNext();) {
- addListenerTo(it.next());
- }
- }
-
- /**
- * @param next
- */
- protected abstract void removeListenerFrom(Object next);
-
- /**
- * @param next
- */
- protected abstract void addListenerTo(Object next);
-
- public void dispose() {
- for (Iterator iter = items.iterator(); iter.hasNext();) {
- removeListenerFrom(iter.next());
- }
- items.removeSetChangeListener(listener);
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableListContentProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableListContentProvider.java
deleted file mode 100644
index 406841b..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableListContentProvider.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.databinding.viewers;
-
-import org.eclipse.core.databinding.observable.list.IListChangeListener;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.ListChangeEvent;
-import org.eclipse.core.databinding.observable.list.ListDiffEntry;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.WritableSet;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.viewers.AbstractListViewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 1.0
- *
- */
-public class ObservableListContentProvider implements
- IStructuredContentProvider {
-
- private IObservableList observableList;
-
- private Viewer viewer;
-
- private IListChangeListener listener = new IListChangeListener() {
- public void handleListChange(ListChangeEvent event) {
- if (viewer.getControl().isDisposed()) {
- return;
- }
- ListDiffEntry[] differences = event.diff.getDifferences();
- for (int i = 0; i < differences.length; i++) {
- ListDiffEntry entry = differences[i];
- if (entry.isAddition()) {
- knownElements.add(entry.getElement());
- if (viewer instanceof AbstractListViewer) {
- ((AbstractListViewer) viewer).add(entry.getElement());
- } else {
- ((TableViewer) viewer).insert(entry.getElement(), entry
- .getPosition());
- }
- } else {
- if (viewer instanceof AbstractListViewer) {
- ((AbstractListViewer) viewer)
- .remove(entry.getElement());
- } else {
- ((TableViewer) viewer).remove(entry.getElement());
- }
- knownElements.remove(entry.getElement());
- }
- }
- }
- };
-
- private IObservableSet knownElements;
-
- /**
- *
- */
- public ObservableListContentProvider() {
- observableList = new WritableList(SWTObservables.getRealm(Display.getDefault()));
- knownElements = new WritableSet(SWTObservables.getRealm(Display.getDefault()));
- }
-
- public Object[] getElements(Object inputElement) {
- return observableList.toArray();
- }
-
- public void dispose() {
- observableList.removeListChangeListener(listener);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- this.viewer = viewer;
-
- if (!(viewer instanceof TableViewer || viewer instanceof AbstractListViewer)) {
- throw new IllegalArgumentException(
- "This content provider only works with TableViewer or AbstractListViewer"); //$NON-NLS-1$
- }
-
- if (newInput != null && !(newInput instanceof IObservableList)) {
- throw new IllegalArgumentException(
- "This content provider only works with input of type IObservableList"); //$NON-NLS-1$
- }
-
- setInput((IObservableList) newInput);
- }
-
- /**
- * @param list
- */
- private void setInput(IObservableList list) {
-
- if (list == null) {
- list = new WritableList(SWTObservables.getRealm(Display.getDefault()));
- }
-
- if (observableList != null) {
- observableList.removeListChangeListener(listener);
- }
-
- knownElements.clear();
-
- observableList = list;
-
- knownElements.addAll(list);
-
- observableList.addListChangeListener(listener);
- }
-
- /**
- * @return the set of elements known to this content provider. Label providers may track
- * this set if they need to be notified about additions before the viewer sees the added
- * element, and notified about removals after the element was removed from the viewer.
- */
- public IObservableSet getKnownElements() {
- return knownElements;
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableMapLabelProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableMapLabelProvider.java
deleted file mode 100644
index 1b79d37..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableMapLabelProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164247
- * Brad Reynolds - bug 164134
- ******************************************************************************/
-
-package org.eclipse.jface.databinding.viewers;
-
-import java.util.Set;
-
-import org.eclipse.core.databinding.observable.map.IMapChangeListener;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.map.MapChangeEvent;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @since 3.3
- *
- */
-public class ObservableMapLabelProvider extends LabelProvider
- implements ILabelProvider, ITableLabelProvider {
-
- private final IObservableMap[] attributeMaps;
-
- private IMapChangeListener mapChangeListener = new IMapChangeListener() {
- public void handleMapChange(MapChangeEvent event) {
- Set affectedElements = event.diff.getChangedKeys();
- LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent(
- ObservableMapLabelProvider.this, affectedElements
- .toArray());
- fireLabelProviderChanged(newEvent);
- }
- };
-
- /**
- * @param attributeMap
- */
- public ObservableMapLabelProvider(IObservableMap attributeMap) {
- this(new IObservableMap[] { attributeMap });
- }
-
- /**
- * @param attributeMaps
- */
- public ObservableMapLabelProvider(IObservableMap[] attributeMaps) {
- this.attributeMaps = attributeMaps;
- for (int i = 0; i < attributeMaps.length; i++) {
- attributeMaps[i].addMapChangeListener(mapChangeListener);
- }
- }
-
- public void dispose() {
- for (int i = 0; i < attributeMaps.length; i++) {
- attributeMaps[i].removeMapChangeListener(mapChangeListener);
- }
- super.dispose();
- }
-
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return getColumnText(element, 0);
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if (columnIndex < attributeMaps.length) {
- Object result = attributeMaps[columnIndex].get(element);
- return result == null ? "" : result.toString(); //$NON-NLS-1$
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableSetContentProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableSetContentProvider.java
deleted file mode 100644
index 21e537e..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableSetContentProvider.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.databinding.viewers;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.StaleEvent;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.ISetChangeListener;
-import org.eclipse.core.databinding.observable.set.ObservableSet;
-import org.eclipse.core.databinding.observable.set.SetChangeEvent;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.viewers.AbstractListViewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 1.0
- *
- */
-public final class ObservableSetContentProvider implements
- IStructuredContentProvider {
-
- private class KnownElementsSet extends ObservableSet {
-
- KnownElementsSet(Set wrappedSet) {
- super(SWTObservables.getRealm(Display.getDefault()), wrappedSet, Object.class);
- }
-
- void doFireDiff(Set added, Set removed) {
- fireSetChange(Diffs.createSetDiff(added, removed));
- }
-
- void doFireStale(boolean isStale) {
- if (isStale) {
- fireStale();
- } else {
- fireChange();
- }
- }
- }
-
- private IObservableSet readableSet;
-
- private Viewer viewer;
-
- /**
- * This readableSet returns the same elements as the input readableSet.
- * However, it only fires events AFTER the elements have been added or
- * removed from the viewer.
- */
- private KnownElementsSet knownElements;
-
- private ISetChangeListener listener = new ISetChangeListener() {
-
- public void handleSetChange(SetChangeEvent event) {
- boolean wasStale = knownElements.isStale();
- if (isDisposed()) {
- return;
- }
- doDiff(event.diff.getAdditions(), event.diff.getRemovals(), true);
- if (!wasStale && event.getObservableSet().isStale()) {
- knownElements.doFireStale(true);
- }
- }
- };
-
- private IStaleListener staleListener = new IStaleListener() {
- public void handleStale(StaleEvent event) {
- knownElements.doFireStale(event.getObservable().isStale());
- }
- };
-
- /**
- *
- */
- public ObservableSetContentProvider() {
- readableSet = new ObservableSet(SWTObservables.getRealm(Display.getDefault()),
- Collections.EMPTY_SET, Object.class) {
- };
- knownElements = new KnownElementsSet(readableSet);
- }
-
- public void dispose() {
- setInput(null);
- }
-
- private void doDiff(Set added, Set removed, boolean updateViewer) {
- knownElements.doFireDiff(added, Collections.EMPTY_SET);
-
- if (updateViewer) {
- Object[] toAdd = added.toArray();
- if (viewer instanceof TableViewer) {
- TableViewer tv = (TableViewer) viewer;
- tv.add(toAdd);
- } else if (viewer instanceof AbstractListViewer) {
- AbstractListViewer lv = (AbstractListViewer) viewer;
- lv.add(toAdd);
- }
- Object[] toRemove = removed.toArray();
- if (viewer instanceof TableViewer) {
- TableViewer tv = (TableViewer) viewer;
- tv.remove(toRemove);
- } else if (viewer instanceof AbstractListViewer) {
- AbstractListViewer lv = (AbstractListViewer) viewer;
- lv.remove(toRemove);
- }
- }
- knownElements.doFireDiff(Collections.EMPTY_SET, removed);
- }
-
- public Object[] getElements(Object inputElement) {
- return readableSet.toArray();
- }
-
- /**
- * Returns the readableSet of elements known to this content provider. Items
- * are added to this readableSet before being added to the viewer, and they
- * are removed after being removed from the viewer. The readableSet is
- * always updated after the viewer. This is intended for use by label
- * providers, as it will always return the items that need labels.
- *
- * @return readableSet of items that will need labels
- */
- public IObservableSet getKnownElements() {
- return knownElements;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- this.viewer = viewer;
-
- if (!(viewer instanceof TableViewer || viewer instanceof AbstractListViewer)) {
- throw new IllegalArgumentException(
- "This content provider only works with TableViewer or AbstractListViewer"); //$NON-NLS-1$
- }
-
- if (newInput != null && !(newInput instanceof IObservableSet)) {
- throw new IllegalArgumentException(
- "This content provider only works with input of type IReadableSet"); //$NON-NLS-1$
- }
-
- setInput((IObservableSet) newInput);
- }
-
- private boolean isDisposed() {
- return viewer.getControl() == null || viewer.getControl().isDisposed();
- }
-
- private void setInput(IObservableSet newSet) {
- boolean updateViewer = true;
- if (newSet == null) {
- newSet = new ObservableSet(SWTObservables.getRealm(Display.getDefault()), Collections.EMPTY_SET, Object.class) {
- };
- // don't update the viewer - its input is null
- updateViewer = false;
- }
-
- boolean wasStale = false;
- if (readableSet != null) {
- wasStale = readableSet.isStale();
- readableSet.removeSetChangeListener(listener);
- readableSet.removeStaleListener(staleListener);
- }
-
- HashSet additions = new HashSet();
- HashSet removals = new HashSet();
-
- additions.addAll(newSet);
- additions.removeAll(readableSet);
-
- removals.addAll(readableSet);
- removals.removeAll(newSet);
-
- readableSet = newSet;
-
- doDiff(additions, removals, updateViewer);
-
- if (readableSet != null) {
- readableSet.addSetChangeListener(listener);
- readableSet.addStaleListener(staleListener);
- }
-
- boolean isStale = (readableSet != null && readableSet.isStale());
- if (isStale != wasStale) {
- knownElements.doFireStale(isStale);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ViewersObservables.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ViewersObservables.java
deleted file mode 100644
index 1f4a76d..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ViewersObservables.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.databinding.viewers;
-
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.internal.databinding.internal.viewers.SelectionProviderSingleSelectionObservableValue;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.3
- *
- */
-public class ViewersObservables {
-
- /**
- * @param selectionProvider
- * @return the observable value tracking the (single) selection of the given
- * selection provider
- */
- public static IObservableValue observeSingleSelection(
- ISelectionProvider selectionProvider) {
- return new SelectionProviderSingleSelectionObservableValue(
- SWTObservables.getRealm(Display.getDefault()),
- selectionProvider);
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/package.html b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/package.html
deleted file mode 100644
index d720e2b..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/package.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <meta name="GENERATOR" content="Mozilla/4.5 [en] (Win98; I) [Netscape]">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-To be written.
-<h2>
-Package Specification</h2>
-<p>
-This package provides classes that can be used to ...</p>
-</body>
-</html>
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java
deleted file mode 100644
index dd82880..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.databinding.wizard;
-
-import java.util.Iterator;
-
-import org.eclipse.core.databinding.AggregateValidationStatus;
-import org.eclipse.core.databinding.Binding;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.list.IListChangeListener;
-import org.eclipse.core.databinding.observable.list.ListChangeEvent;
-import org.eclipse.core.databinding.observable.list.ListDiff;
-import org.eclipse.core.databinding.observable.list.ListDiffEntry;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.wizard.WizardPage;
-
-/**
- * Connects the validation result from the given data binding context to the
- * given wizard page, updating the wizard page's completion state and its error
- * message accordingly.
- *
- * This class is not intended to be extended by clients.
- *
- * @since 1.1
- */
-public class WizardPageSupport {
-
- private WizardPage wizardPage;
- private DataBindingContext dbc;
- private AggregateValidationStatus aggregateStatus;
- private boolean uiChanged = false;
-
- /**
- * Connect the validation result from the given data binding context to the
- * given wizard page. Upon creation, the wizard page support will use the
- * context's validation result to determine whether the page is complete.
- * The page's error message will not be set at this time ensuring that the
- * wizard page does not show an error right away. Upon any validation result
- * change, {@link WizardPage#setPageComplete(boolean)} will be called
- * reflecting the new validation result, and the wizard page's error message
- * will be updated according to the current validation result.
- *
- * @param wizardPage
- * @param dbc
- * @return an instance of WizardPageSupport
- */
- public static WizardPageSupport create(WizardPage wizardPage,
- DataBindingContext dbc) {
- return new WizardPageSupport(wizardPage, dbc);
- }
-
- private WizardPageSupport(WizardPage wizardPage, DataBindingContext dbc) {
- this.wizardPage = wizardPage;
- this.dbc = dbc;
- init();
- }
-
- private IChangeListener uiChangeListener = new IChangeListener() {
- public void handleChange(ChangeEvent event) {
- handleUIChanged();
- }
- };
- private IListChangeListener bindingsListener = new IListChangeListener() {
- public void handleListChange(ListChangeEvent event) {
- ListDiff diff = event.diff;
- ListDiffEntry[] differences = diff.getDifferences();
- for (int i = 0; i < differences.length; i++) {
- ListDiffEntry listDiffEntry = differences[i];
- Binding binding = (Binding) listDiffEntry.getElement();
- if (listDiffEntry.isAddition()) {
- binding.getTarget().addChangeListener(uiChangeListener);
- } else {
- binding.getTarget().removeChangeListener(uiChangeListener);
- }
- }
- }
- };
- private IStatus currentStatus;
-
- protected void init() {
- aggregateStatus = new AggregateValidationStatus(dbc.getBindings(),
- AggregateValidationStatus.MAX_SEVERITY);
- aggregateStatus.addValueChangeListener(new IValueChangeListener() {
- public void handleValueChange(ValueChangeEvent event) {
-
- currentStatus = (IStatus) event.diff.getNewValue();
- handleStatusChanged();
- }
- });
- currentStatus = (IStatus) aggregateStatus.getValue();
- handleStatusChanged();
- dbc.getBindings().addListChangeListener(bindingsListener);
- for (Iterator it = dbc.getBindings().iterator(); it.hasNext();) {
- Binding binding = (Binding) it.next();
- binding.getTarget().addChangeListener(uiChangeListener);
- }
- }
-
- protected void handleUIChanged() {
- uiChanged = true;
- if (currentStatus != null) {
- handleStatusChanged();
- }
- dbc.getBindings().removeListChangeListener(bindingsListener);
- for (Iterator it = dbc.getBindings().iterator(); it.hasNext();) {
- Binding binding = (Binding) it.next();
- binding.getTarget().removeChangeListener(uiChangeListener);
- }
- }
-
- protected void handleStatusChanged() {
- if (currentStatus != null
- && currentStatus.getSeverity() == IStatus.ERROR) {
- wizardPage.setPageComplete(false);
- wizardPage.setErrorMessage(uiChanged ? currentStatus.getMessage()
- : null);
- } else {
- wizardPage.setPageComplete(true);
- wizardPage.setErrorMessage(null);
- }
- }
-
- /**
- * Disposes of this wizard page support object, removing any listeners it
- * may have attached.
- */
- public void dispose() {
- aggregateStatus.dispose();
- if (!uiChanged) {
- for (Iterator it = dbc.getBindings().iterator(); it.hasNext();) {
- Binding binding = (Binding) it.next();
- binding.getTarget().removeChangeListener(uiChangeListener);
- }
- dbc.getBindings().removeListChangeListener(bindingsListener);
- }
- aggregateStatus = null;
- dbc = null;
- uiChangeListener = null;
- bindingsListener = null;
- wizardPage = null;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ButtonObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ButtonObservableValue.java
deleted file mode 100644
index 804a9f8..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ButtonObservableValue.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * @since 1.0
- *
- */
-public class ButtonObservableValue extends AbstractSWTObservableValue {
-
- private final Button button;
-
- private boolean selectionValue;
-
- private Listener updateListener = new Listener() {
- public void handleEvent(Event event) {
- boolean oldSelectionValue = selectionValue;
- selectionValue = button.getSelection();
- fireValueChange(Diffs.createValueDiff(oldSelectionValue ? Boolean.TRUE : Boolean.FALSE,
- selectionValue ? Boolean.TRUE : Boolean.FALSE));
- }
- };
-
- /**
- * @param button
- */
- public ButtonObservableValue(Button button) {
- super(button);
- this.button = button;
- button.addListener(SWT.Selection, updateListener);
- button.addListener(SWT.DefaultSelection, updateListener);
- }
-
- public void doSetValue(final Object value) {
- boolean oldSelectionValue = selectionValue;
- selectionValue = value == null ? false : ((Boolean) value)
- .booleanValue();
- button.setSelection(selectionValue);
- fireValueChange(Diffs.createValueDiff(oldSelectionValue ? Boolean.TRUE : Boolean.FALSE,
- selectionValue ? Boolean.TRUE : Boolean.FALSE));
- }
-
- public Object doGetValue() {
- return button.getSelection() ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public Object getValueType() {
- return Boolean.class;
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableList.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableList.java
deleted file mode 100644
index 3ec3cc3..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableList.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.custom.CCombo;
-
-/**
- * @since 3.2
- *
- */
-public class CComboObservableList extends SWTObservableList {
-
- private final CCombo ccombo;
-
- /**
- * @param ccombo
- */
- public CComboObservableList(CCombo ccombo) {
- super(SWTObservables.getRealm(ccombo.getDisplay()));
- this.ccombo = ccombo;
- }
-
- protected int getItemCount() {
- return ccombo.getItemCount();
- }
-
- protected void setItems(String[] newItems) {
- ccombo.setItems(newItems);
- }
-
- protected String[] getItems() {
- return ccombo.getItems();
- }
-
- protected String getItem(int index) {
- return ccombo.getItem(index);
- }
-
- protected void setItem(int index, String string) {
- ccombo.setItem(index, string);
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableValue.java
deleted file mode 100644
index 9f0f88e..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableValue.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-
-/**
- * @since 3.2
- *
- */
-public class CComboObservableValue extends AbstractSWTObservableValue {
-
- /**
- *
- */
-
- private final CCombo ccombo;
-
- private final String attribute;
-
- private boolean updating = false;
-
- private String currentValue;
-
- /**
- * @param ccombo
- * @param attribute
- */
- public CComboObservableValue(CCombo ccombo, String attribute) {
- super(ccombo);
- this.ccombo = ccombo;
- this.attribute = attribute;
-
- if (attribute.equals(SWTProperties.SELECTION)
- || attribute.equals(SWTProperties.TEXT)) {
- this.currentValue = ccombo.getText();
- ccombo.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- if (!updating) {
- String oldValue = currentValue;
- currentValue = CComboObservableValue.this.ccombo
- .getText();
- fireValueChange(Diffs.createValueDiff(oldValue,
- currentValue));
- }
- }
- });
- } else
- throw new IllegalArgumentException();
- }
-
- public void doSetValue(final Object value) {
- String oldValue = ccombo.getText();
- try {
- updating = true;
- if (attribute.equals(SWTProperties.TEXT)) {
- String stringValue = value != null ? value.toString() : ""; //$NON-NLS-1$
- ccombo.setText(stringValue);
- } else if (attribute.equals(SWTProperties.SELECTION)) {
- String items[] = ccombo.getItems();
- int index = -1;
- if (items != null && value != null) {
- for (int i = 0; i < items.length; i++) {
- if (value.equals(items[i])) {
- index = i;
- break;
- }
- }
- if (index == -1) {
- ccombo.setText((String) value);
- } else {
- ccombo.select(index); // -1 will not "unselect"
- }
- }
- }
- } finally {
- updating = false;
- }
- fireValueChange(Diffs.createValueDiff(oldValue, ccombo.getText()));
- }
-
- public Object doGetValue() {
- if (attribute.equals(SWTProperties.TEXT))
- return ccombo.getText();
-
- Assert.isTrue(attribute.equals(SWTProperties.SELECTION),
- "unexpected attribute: " + attribute); //$NON-NLS-1$
- // The problem with a ccombo, is that it changes the text and
- // fires before it update its selection index
- return ccombo.getText();
- }
-
- public Object getValueType() {
- Assert.isTrue(attribute.equals(SWTProperties.TEXT)
- || attribute.equals(SWTProperties.SELECTION),
- "unexpected attribute: " + attribute); //$NON-NLS-1$
- return String.class;
- }
-
- /**
- * @return attribute being observed
- */
- public String getAttribute() {
- return attribute;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CLabelObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CLabelObservableValue.java
deleted file mode 100644
index 2c6ce05..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CLabelObservableValue.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.swt.custom.CLabel;
-
-/**
- * @since 1.0
- *
- */
-public class CLabelObservableValue extends AbstractSWTObservableValue {
-
- private final CLabel label;
-
- /**
- * @param label
- */
- public CLabelObservableValue(CLabel label) {
- super(label);
- this.label = label;
- }
-
- public void doSetValue(final Object value) {
- String oldValue = label.getText();
- label.setText(value == null ? "" : value.toString()); //$NON-NLS-1$
- fireValueChange(Diffs.createValueDiff(oldValue, label.getText()));
- }
-
- public Object doGetValue() {
- return label.getText();
- }
-
- public Object getValueType() {
- return String.class;
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableList.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableList.java
deleted file mode 100644
index ab49b14..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableList.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.widgets.Combo;
-
-/**
- * @since 3.2
- *
- */
-public class ComboObservableList extends SWTObservableList {
-
- private final Combo combo;
-
- /**
- * @param combo
- */
- public ComboObservableList(Combo combo) {
- super(SWTObservables.getRealm(combo.getDisplay()));
- this.combo = combo;
- }
-
- protected int getItemCount() {
- return combo.getItemCount();
- }
-
- protected void setItems(String[] newItems) {
- combo.setItems(newItems);
- }
-
- protected String[] getItems() {
- return combo.getItems();
- }
-
- protected String getItem(int index) {
- return combo.getItem(index);
- }
-
- protected void setItem(int index, String string) {
- combo.setItem(index, string);
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableValue.java
deleted file mode 100644
index 04cf1e2..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableValue.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Combo;
-
-/**
- * @since 3.2
- *
- */
-public class ComboObservableValue extends AbstractSWTObservableValue {
-
- private final Combo combo;
- private final String attribute;
- private boolean updating = false;
- private String currentValue;
-
- /**
- * @param combo
- * @param attribute
- */
- public ComboObservableValue(Combo combo, String attribute) {
- super(combo);
- this.combo = combo;
- this.attribute = attribute;
-
- if (attribute.equals(SWTProperties.SELECTION)
- || attribute.equals(SWTProperties.TEXT)) {
- this.currentValue = combo.getText();
- combo.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- if (!updating) {
- String oldValue = currentValue;
- currentValue = ComboObservableValue.this.combo
- .getText();
- fireValueChange(Diffs.createValueDiff(oldValue,
- currentValue));
- }
- }
- });
- } else
- throw new IllegalArgumentException();
- }
-
- public void doSetValue(final Object value) {
- String oldValue = combo.getText();
- try {
- updating = true;
- if (attribute.equals(SWTProperties.TEXT)) {
- String stringValue = value != null ? value.toString() : ""; //$NON-NLS-1$
- combo.setText(stringValue);
- } else if (attribute.equals(SWTProperties.SELECTION)) {
- String items[] = combo.getItems();
- int index = -1;
- if (items != null && value != null) {
- for (int i = 0; i < items.length; i++) {
- if (value.equals(items[i])) {
- index = i;
- break;
- }
- }
- if (index == -1) {
- combo.setText((String) value);
- } else {
- combo.select(index); // -1 will not "unselect"
- }
- }
- }
- } finally {
- updating = false;
- }
- fireValueChange(Diffs.createValueDiff(oldValue, combo.getText()));
- }
-
- public Object doGetValue() {
- if (attribute.equals(SWTProperties.TEXT))
- return combo.getText();
-
- Assert.isTrue(attribute.equals(SWTProperties.SELECTION),
- "unexpected attribute: " + attribute); //$NON-NLS-1$
- // The problem with a ccombo, is that it changes the text and
- // fires before it update its selection index
- return combo.getText();
- }
-
- public Object getValueType() {
- Assert.isTrue(attribute.equals(SWTProperties.TEXT)
- || attribute.equals(SWTProperties.SELECTION),
- "unexpected attribute: " + attribute); //$NON-NLS-1$
- return String.class;
- }
-
- /**
- * @return attribute being observed
- */
- public String getAttribute() {
- return attribute;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ControlObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ControlObservableValue.java
deleted file mode 100644
index 49b77aa..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ControlObservableValue.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- * Matt Carter - bug 170668
- * Brad Reynolds - bug 170848
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @since 1.0
- *
- */
-public class ControlObservableValue extends AbstractSWTObservableValue {
-
- private final Control control;
-
- private final String attribute;
-
- private Object valueType;
-
- private static final Map SUPPORTED_ATTRIBUTES = new HashMap();
- static {
- SUPPORTED_ATTRIBUTES.put(SWTProperties.ENABLED, Boolean.TYPE);
- SUPPORTED_ATTRIBUTES.put(SWTProperties.VISIBLE, Boolean.TYPE);
- SUPPORTED_ATTRIBUTES.put(SWTProperties.TOOLTIP_TEXT, String.class);
- SUPPORTED_ATTRIBUTES.put(SWTProperties.FOREGROUND, Color.class);
- SUPPORTED_ATTRIBUTES.put(SWTProperties.BACKGROUND, Color.class);
- SUPPORTED_ATTRIBUTES.put(SWTProperties.FONT, Font.class);
- }
-
- /**
- * @param control
- * @param attribute
- */
- public ControlObservableValue(Control control, String attribute) {
- super(control);
- this.control = control;
- this.attribute = attribute;
- if (SUPPORTED_ATTRIBUTES.keySet().contains(attribute)) {
- this.valueType = SUPPORTED_ATTRIBUTES.get(attribute);
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- public void doSetValue(Object value) {
- Object oldValue = doGetValue();
- if (attribute.equals(SWTProperties.ENABLED)) {
- control.setEnabled(((Boolean) value).booleanValue());
- } else if (attribute.equals(SWTProperties.VISIBLE)) {
- control.setVisible(((Boolean) value).booleanValue());
- } else if (attribute.equals(SWTProperties.TOOLTIP_TEXT)) {
- control.setToolTipText((String) value);
- } else if (attribute.equals(SWTProperties.FOREGROUND)) {
- control.setForeground((Color) value);
- } else if (attribute.equals(SWTProperties.BACKGROUND)) {
- control.setBackground((Color) value);
- } else if (attribute.equals(SWTProperties.FONT)) {
- control.setFont((Font) value);
- }
- fireValueChange(Diffs.createValueDiff(oldValue, value));
- }
-
- public Object doGetValue() {
- if (attribute.equals(SWTProperties.ENABLED)) {
- return control.getEnabled() ? Boolean.TRUE : Boolean.FALSE;
- }
- if (attribute.equals(SWTProperties.VISIBLE)) {
- return control.getVisible() ? Boolean.TRUE : Boolean.FALSE;
- }
- if (attribute.equals(SWTProperties.TOOLTIP_TEXT)) {
- return control.getToolTipText();
- }
- if (attribute.equals(SWTProperties.FOREGROUND)) {
- return control.getForeground();
- }
- if (attribute.equals(SWTProperties.BACKGROUND)) {
- return control.getBackground();
- }
- if (attribute.equals(SWTProperties.FONT)) {
- return control.getFont();
- }
-
- return null;
- }
-
- public Object getValueType() {
- return valueType;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/LabelObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/LabelObservableValue.java
deleted file mode 100644
index 16c6570..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/LabelObservableValue.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * @since 3.3
- *
- */
-public class LabelObservableValue extends AbstractSWTObservableValue {
-
- private final Label label;
-
- /**
- * @param label
- */
- public LabelObservableValue(Label label) {
- super(label);
- this.label = label;
- }
-
- public void doSetValue(final Object value) {
- String oldValue = label.getText();
- label.setText(value == null ? "" : value.toString()); //$NON-NLS-1$
- fireValueChange(Diffs.createValueDiff(oldValue, label.getText()));
- }
-
- public Object doGetValue() {
- return label.getText();
- }
-
- public Object getValueType() {
- return String.class;
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableList.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableList.java
deleted file mode 100644
index 2928c1c..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableList.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.widgets.List;
-
-/**
- * @since 3.2
- *
- */
-public class ListObservableList extends SWTObservableList {
-
- private final List list;
-
- /**
- * @param list
- */
- public ListObservableList(List list) {
- super(SWTObservables.getRealm(list.getDisplay()));
- this.list = list;
- }
-
- protected int getItemCount() {
- return list.getItemCount();
- }
-
- protected void setItems(String[] newItems) {
- list.setItems(newItems);
- }
-
- protected String[] getItems() {
- return list.getItems();
- }
-
- protected String getItem(int index) {
- return list.getItem(index);
- }
-
- protected void setItem(int index, String string) {
- list.setItem(index, string);
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableValue.java
deleted file mode 100644
index 5a5d105..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableValue.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * @since 3.2
- *
- */
-public class ListObservableValue extends AbstractSWTObservableValue {
-
- private final List list;
-
- private boolean updating = false;
-
- private String currentValue;
-
- /**
- * @param list
- */
- public ListObservableValue(List list) {
- super(list);
- this.list = list;
- this.currentValue = (String) doGetValue();
-
- if ((list.getStyle() & SWT.MULTI) > 0)
- throw new IllegalArgumentException(
- "SWT.SINGLE support only for a List selection"); //$NON-NLS-1$
-
- list.addListener(SWT.Selection, new Listener() {
-
- public void handleEvent(Event event) {
- if (!updating) {
- Object oldValue = currentValue;
- currentValue = (String) doGetValue();
- fireValueChange(Diffs.createValueDiff(oldValue,
- currentValue));
- }
- }
-
- });
- }
-
- public void doSetValue(Object value) {
- String oldValue = null;
- if (list.getSelection() != null && list.getSelection().length > 0)
- oldValue = list.getSelection()[0];
- try {
- updating = true;
- String items[] = list.getItems();
- int index = -1;
- if (items != null && value != null) {
- for (int i = 0; i < items.length; i++) {
- if (value.equals(items[i])) {
- index = i;
- break;
- }
- }
- list.select(index); // -1 will not "unselect"
- }
- currentValue = (String) value;
- } finally {
- updating = false;
- }
- fireValueChange(Diffs.createValueDiff(oldValue, value));
- }
-
- public Object doGetValue() {
- int index = list.getSelectionIndex();
- if (index >= 0)
- return list.getItem(index);
- return null;
- }
-
- public Object getValueType() {
- return String.class;
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SWTObservableList.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SWTObservableList.java
deleted file mode 100644
index 0941879..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SWTObservableList.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.BindingException;
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.ObservableTracker;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.AbstractObservableList;
-
-/**
- * Abstract base class of CComboObservableList, ComboObservableList, and
- * ListObservableList.
- *
- * @since 3.2
- *
- */
-public abstract class SWTObservableList extends AbstractObservableList {
-
- /**
- *
- */
- public SWTObservableList() {
- super();
- }
-
- /**
- * @param realm
- */
- public SWTObservableList(Realm realm) {
- super(realm);
- }
-
- public void add(int index, Object element) {
- int size = doGetSize();
- if (index < 0 || index > size)
- index = size;
- String[] newItems = new String[size + 1];
- System.arraycopy(getItems(), 0, newItems, 0, index);
- newItems[index] = (String) element;
- System.arraycopy(getItems(), index, newItems, index + 1, size - index);
- setItems(newItems);
- fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index,
- true, element)));
- }
-
- public int doGetSize() {
- return getItemCount();
- }
-
- public Object get(int index) {
- getterCalled();
- return getItem(index);
- }
-
- public Object getElementType() {
- return String.class;
- }
-
- /**
- * @param index
- * @return the item at the given index
- */
- protected abstract String getItem(int index);
-
- /**
- * @return the item count
- */
- protected abstract int getItemCount();
-
- /**
- * @return the items
- */
- protected abstract String[] getItems();
-
- private void getterCalled() {
- ObservableTracker.getterCalled(this);
- }
-
- public Object remove(int index) {
- getterCalled();
- int size = doGetSize();
- if (index < 0 || index > size - 1)
- throw new BindingException(
- "Request to remove an element out of the collection bounds"); //$NON-NLS-1$
-
- String[] newItems = new String[size - 1];
- String oldElement = getItem(index);
- if (newItems.length > 0) {
- System.arraycopy(getItems(), 0, newItems, 0, index);
- if (size - 1 > index) {
- System.arraycopy(getItems(), index + 1, newItems, index, size
- - index - 1);
- }
- }
- setItems(newItems);
- fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index,
- false, oldElement)));
- return oldElement;
- }
-
- public Object set(int index, Object element) {
- String oldElement = getItem(index);
- setItem(index, (String) element);
- fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index,
- false, oldElement), Diffs.createListDiffEntry(index, true,
- element)));
- return oldElement;
- }
-
- /**
- * @param index
- * @param string
- */
- protected abstract void setItem(int index, String string);
-
- /**
- * @param newItems
- */
- protected abstract void setItems(String[] newItems);
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SWTProperties.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SWTProperties.java
deleted file mode 100644
index b5dfd1d..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SWTProperties.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Matt Carter - bug 170668
- * Brad Reynolds - bug 170848
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-/**
- * Constants used to describe properties of SWT controls.
- *
- * @since 1.0
- *
- */
-public interface SWTProperties {
-
- /**
- * Applies to Control
- */
- public static final String ENABLED = "enabled"; //$NON-NLS-1$
- /**
- * Applies to Control
- */
- public static final String VISIBLE = "visible"; //$NON-NLS-1$
- /**
- * Applies to Control
- */
- public static final String TOOLTIP_TEXT = "tooltip"; //$NON-NLS-1$
- /**
- * Applies to
- */
- public static final String ITEMS = "items"; //$NON-NLS-1$
- /**
- * Applies to Spinner
- */
- public static final String MAX = "max"; //$NON-NLS-1$
- /**
- * Applies to Spinner
- */
- public static final String MIN = "min"; //$NON-NLS-1$
- /**
- * Applies to Spinner, Button
- */
- public static final String SELECTION = "selection"; //$NON-NLS-1$
- /**
- * Applies to Spinner, Button
- */
- public static final String SELECTION_INDEX = "index"; //$NON-NLS-1$
- /**
- * Applies to Text, Label, Combo
- */
- public static final String TEXT = "text"; //$NON-NLS-1$
-
- /**
- * Applies to Label, CLabel.
- */
- public static final String IMAGE = "image"; //$NON-NLS-1$
- /**
- * Applies to Control
- */
- public static final String FOREGROUND = "foreground"; //$NON-NLS-1$
- /**
- * Applies to Control
- */
- public static final String BACKGROUND = "background"; //$NON-NLS-1$
- /**
- * Applies to Control
- */
- public static final String FONT = "font"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ScaleObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ScaleObservableValue.java
deleted file mode 100644
index 6d16e0e..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ScaleObservableValue.java
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SpinnerObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SpinnerObservableValue.java
deleted file mode 100644
index 044f087..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SpinnerObservableValue.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Spinner;
-
-/**
- * @since 1.0
- *
- */
-public class SpinnerObservableValue extends AbstractSWTObservableValue {
-
- private final Spinner spinner;
-
- private final String attribute;
-
- private boolean updating = false;
-
- private int currentSelection;
-
- /**
- * @param spinner
- * @param attribute
- */
- public SpinnerObservableValue(Spinner spinner, String attribute) {
- super(spinner);
- this.spinner = spinner;
- this.attribute = attribute;
- if (attribute.equals(SWTProperties.SELECTION)) {
- currentSelection = spinner.getSelection();
- spinner.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!updating) {
- int newSelection = SpinnerObservableValue.this.spinner
- .getSelection();
- fireValueChange(Diffs.createValueDiff(new Integer(
- currentSelection), new Integer(newSelection)));
- currentSelection = newSelection;
- }
- }
- });
- } else if (!attribute.equals(SWTProperties.MIN)
- && !attribute.equals(SWTProperties.MAX)) {
- throw new IllegalArgumentException(
- "Attribute name not valid: " + attribute); //$NON-NLS-1$
- }
- }
-
- public void doSetValue(final Object value) {
- int oldValue;
- int newValue;
- try {
- updating = true;
- newValue = ((Integer) value).intValue();
- if (attribute.equals(SWTProperties.SELECTION)) {
- oldValue = spinner.getSelection();
- spinner.setSelection(newValue);
- currentSelection = newValue;
- } else if (attribute.equals(SWTProperties.MIN)) {
- oldValue = spinner.getMinimum();
- spinner.setMinimum(newValue);
- } else if (attribute.equals(SWTProperties.MAX)) {
- oldValue = spinner.getMaximum();
- spinner.setMaximum(newValue);
- } else {
- Assert.isTrue(false, "invalid attribute name:" + attribute); //$NON-NLS-1$
- return;
- }
- fireValueChange(Diffs.createValueDiff(new Integer(oldValue),
- new Integer(newValue)));
- } finally {
- updating = false;
- }
- }
-
- public Object doGetValue() {
- int value = 0;
- if (attribute.equals(SWTProperties.SELECTION)) {
- value = spinner.getSelection();
- } else if (attribute.equals(SWTProperties.MIN)) {
- value = spinner.getMinimum();
- } else if (attribute.equals(SWTProperties.MAX)) {
- value = spinner.getMaximum();
- }
- return new Integer(value);
- }
-
- public Object getValueType() {
- return Integer.TYPE;
- }
-
- /**
- * @return attribute being observed
- */
- public String getAttribute() {
- return attribute;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TableObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TableObservableValue.java
deleted file mode 100644
index 131f9a4..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TableObservableValue.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Table;
-
-/**
- * @since 1.0
- *
- */
-public class TableObservableValue extends AbstractSWTObservableValue {
-
- private final Table table;
-
- private boolean updating = false;
-
- private int currentSelection;
- private String attribute;
-
- /**
- * @param table
- * @param attribute
- */
- public TableObservableValue(Table table, String attribute) {
- super(table);
- this.table = table;
- this.attribute = attribute;
-
- currentSelection = table.getSelectionIndex();
- if (attribute.equals(SWTProperties.SELECTION)) {
- currentSelection = table.getSelectionIndex();
- table.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- if (!updating) {
- int newSelection = TableObservableValue.this.table
- .getSelectionIndex();
- fireValueChange(Diffs.createValueDiff(new Integer(
- currentSelection), new Integer(newSelection)));
- currentSelection = newSelection;
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- public void doSetValue(Object value) {
- try {
- updating = true;
- int intValue = ((Integer) value).intValue();
- table.setSelection(intValue);
- currentSelection = intValue;
- } finally {
- updating = false;
- }
- }
-
- public Object doGetValue() {
- return new Integer(table.getSelectionIndex());
- }
-
- public Object getValueType() {
- return Integer.class;
- }
-
- /**
- * @return attribute being observed
- */
- public String getAttribute() {
- return attribute;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextEditableObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextEditableObservableValue.java
deleted file mode 100644
index d88476e..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextEditableObservableValue.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Observable value for the editable property of a Text.
- *
- * @since 1.1
- */
-public class TextEditableObservableValue extends AbstractSWTObservableValue {
- private Text text;
-
- /**
- * @param text
- */
- public TextEditableObservableValue(Text text) {
- super(text);
-
- this.text = text;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doGetValue()
- */
- protected Object doGetValue() {
- return (text.getEditable()) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType()
- */
- public Object getValueType() {
- return Boolean.TYPE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doSetValue(java.lang.Object)
- */
- protected void doSetValue(Object value) {
- if (Boolean.TRUE.equals(value)) {
- text.setEditable(true);
- } else if (Boolean.FALSE.equals(value)) {
- text.setEditable(false);
- }
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextObservableValue.java
deleted file mode 100644
index 737d6a8..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextObservableValue.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds (bug 135446)
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTVetoableValue;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.events.ShellListener;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * {@link IObservable} implementation that wraps a {@link Text} widget. The time
- * at which listeners should be notified about changes to the text is specified
- * on construction.
- *
- * <dl>
- * <dt>Events:</dt>
- * <dd> If the update event type (specified on construction) is
- * <code>SWT.Modify</code> a value change event will be fired on every key
- * stroke. If the update event type is <code>SWT.FocusOut</code> a value
- * change event will be fired on focus out. When in either mode if the user is
- * entering text and presses [Escape] the value will be reverted back to the
- * last value set using doSetValue(). Regardless of the update event type a
- * value changing event will fire on verify to enable vetoing of changes.</dd>
- * </dl>
- *
- * @since 1.0
- */
-public class TextObservableValue extends AbstractSWTVetoableValue {
-
- /**
- * {@link Text} widget that this is being observed.
- */
- private final Text text;
-
- /**
- * Flag to track when the model is updating the widget. When
- * <code>true</code> the handlers for the SWT events should not process
- * the event as this would cause an infinite loop.
- */
- private boolean updating = false;
-
- /**
- * SWT event that on firing this observable will fire change events to its
- * listeners.
- */
- private int updateEventType;
-
- /**
- * Valid types for the {@link #updateEventType}.
- */
- private static final int[] validUpdateEventTypes = new int[] { SWT.Modify,
- SWT.FocusOut, SWT.NONE };
-
- /**
- * Last value set using doSetValue(), or null. This is maintained so that
- * when entering text if the consumer were to press [Escape] the value can
- * be reverted back to the last known externally-set value.
- */
- private String bufferedValue;
-
- private Listener updateListener = new Listener() {
- public void handleEvent(Event event) {
- if (!updating) {
- String oldValue = bufferedValue;
- String newValue = text.getText();
-
- // If we are updating on focus lost then when we fire the change
- // event change the buffered value
- if (updateEventType == SWT.FocusOut) {
- bufferedValue = text.getText();
-
- if (!newValue.equals(oldValue)) {
- fireValueChange(Diffs.createValueDiff(oldValue,
- newValue));
- }
- } else {
- fireValueChange(Diffs.createValueDiff(oldValue, text
- .getText()));
- }
- }
- }
- };
-
- private VerifyListener verifyListener;
-
- private KeyListener keyListener;
-
- private ShellListener shellListener;
-
- /**
- * Constructs a new instance bound to the given <code>text</code> widget
- * and configured to fire change events to its listeners at the time of the
- * <code>updateEventType</code>.
- *
- * @param text
- * @param updateEventType
- * SWT event constant as to what SWT event to update the model in
- * response to. Appropriate values are: <code>SWT.Modify</code>,
- * <code>SWT.FocusOut</code>, <code>SWT.NONE</code>.
- * @throws IllegalArgumentException
- * if <code>updateEventType</code> is an incorrect type.
- */
- public TextObservableValue(final Text text, int updateEventType) {
- super(text);
- boolean eventValid = false;
- for (int i = 0; !eventValid && i < validUpdateEventTypes.length; i++) {
- eventValid = (updateEventType == validUpdateEventTypes[i]);
- }
- if (!eventValid) {
- throw new IllegalArgumentException(
- "UpdateEventType [" + updateEventType + "] is not supported."); //$NON-NLS-1$//$NON-NLS-2$
- }
- this.text = text;
- this.updateEventType = updateEventType;
- if (updateEventType != SWT.None) {
- text.addListener(updateEventType, updateListener);
- }
- // If the update policy is SWT.Modify then the model is notified of
- // changed on key stroke by key stroke
- // When escape is pressed we need to rollback to the previous value
- // which is done with a key listener, however
- // the bufferedValue (the last remembered change value) must be changed
- // on focus lost
- if (updateEventType == SWT.Modify) {
- text.addListener(SWT.FocusOut, new Listener() {
- public void handleEvent(Event event) {
- if (!updating) {
- bufferedValue = text.getText();
- }
- }
- });
- }
- verifyListener = new VerifyListener() {
- public void verifyText(VerifyEvent e) {
- if (!updating) {
- String currentText = TextObservableValue.this.text
- .getText();
- String newText = currentText.substring(0, e.start) + e.text
- + currentText.substring(e.end);
- if (!fireValueChanging(Diffs.createValueDiff(currentText,
- newText))) {
- e.doit = false;
- }
- }
- }
- };
- text.addVerifyListener(verifyListener);
- keyListener = new KeyListener() {
- public void keyPressed(KeyEvent e) {
- if (e.character == SWT.ESC && bufferedValue != null) {
- // Revert the value in the text field to the model value
- text.setText(bufferedValue);
- }
- }
-
- public void keyReleased(KeyEvent e) {
- }
- };
- text.addKeyListener(keyListener);
- shellListener = new ShellAdapter() {
- public void shellClosed(ShellEvent e) {
- if (!text.isDisposed()) {
- String oldValue = bufferedValue;
- String newValue = text.getText();
-
- if (!newValue.equals(oldValue)) {
- fireValueChange(Diffs.createValueDiff(oldValue,
- newValue));
- }
- }
- }
- };
- text.getShell().addShellListener(shellListener);
- }
-
- /**
- * Sets the bound {@link Text Text's} text to the passed <code>value</code>.
- *
- * @param value
- * new value, String expected
- * @see org.eclipse.core.databinding.observable.value.AbstractVetoableValue#doSetApprovedValue(java.lang.Object)
- * @throws ClassCastException
- * if the value is anything other than a String
- */
- public void doSetApprovedValue(final Object value) {
- try {
- updating = true;
- bufferedValue = (String) value;
- text.setText(value == null ? "" : value.toString()); //$NON-NLS-1$
- } finally {
- updating = false;
- }
- }
-
- /**
- * Returns the current value of the {@link Text}.
- *
- * @see org.eclipse.core.databinding.observable.value.AbstractVetoableValue#doGetValue()
- */
- public Object doGetValue() {
- return text.getText();
- }
-
- /**
- * Returns the type of the value from {@link #doGetValue()}, i.e.
- * String.class
- *
- * @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType()
- */
- public Object getValueType() {
- return String.class;
- }
-
- public void dispose() {
- if (!text.isDisposed()) {
- text.removeKeyListener(keyListener);
- if (updateEventType != SWT.None) {
- text.removeListener(updateEventType, updateListener);
- }
- text.removeVerifyListener(verifyListener);
- text.getShell().removeShellListener(shellListener);
- }
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/IPrefetchingTree.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/IPrefetchingTree.java
deleted file mode 100644
index ca443cf..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/IPrefetchingTree.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.viewers;
-
-/**
- * @since 3.3
- *
- */
-public interface IPrefetchingTree {
- /**
- * Returns true if and only if the content provider should
- * try to prefetch the children of the given node.
- * Prefetching uses unused CPU cycles to fetch the children
- * of visible nodes so that they expand faster. This will
- * generally cause the application to run faster so should
- * usually be enabled.
- * <p>
- * In some circumstances computing the children of a node may
- * require network resources that need to be conserved, so
- * prefetching can be explicitly disabled these nodes. This
- * means that the user will need to wait for a "pending" node
- * every time they expand the parent node.
- * </p>
- *
- * @param parentNode
- * @return true iff the children should be eagerly fetched
- */
- boolean shouldPrefetch(Object parentNode);
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/LeafNodesSet.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/LeafNodesSet.java
deleted file mode 100644
index bdd0af3..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/LeafNodesSet.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.viewers;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.StaleEvent;
-import org.eclipse.core.databinding.observable.set.AbstractObservableSet;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.ISetChangeListener;
-import org.eclipse.core.databinding.observable.set.SetChangeEvent;
-import org.eclipse.core.databinding.observable.set.SetDiff;
-import org.eclipse.core.internal.databinding.observable.tree.IUnorderedTreeProvider;
-import org.eclipse.core.internal.databinding.observable.tree.TreePath;
-
-/**
- * This set consists of all leaf nodes from the given tree (that is, all nodes
- * for which ITreeProvider.createChildSet returns null).
- */
-public class LeafNodesSet extends AbstractObservableSet {
-
- private HashSet leafNodes = new HashSet();
-
- private HashMap mapElementsOntoNodeInfo = new HashMap();
-
- private IUnorderedTreeProvider tree;
-
- private Object input;
-
- private int staleCount = 0;
-
- private class NodeInfo implements IStaleListener, ISetChangeListener {
- // Number of times the element occurs in the tree
- private int count;
-
- // Element
- private TreePath treePath;
-
- // Children set (or null if this is a leaf node)
- IObservableSet children;
-
- private boolean wasStale = false;
-
- /**
- * @param treePath
- */
- public NodeInfo(TreePath treePath) {
- this.treePath = treePath;
- children = tree.createChildSet(this.treePath);
- if (children != null) {
- children.addStaleListener(this);
- children.addSetChangeListener(this);
- }
- count = 1;
- }
-
- public void handleSetChange(SetChangeEvent event) {
- processDiff(treePath, event.diff);
- }
-
- public void handleStale(StaleEvent event) {
- if (wasStale != children.isStale()) {
- if (wasStale) {
- staleCount--;
- } else {
- staleCount++;
- }
- wasStale = !wasStale;
- }
- setStale(staleCount > 0);
- }
-
- /**
- *
- */
- public void dispose() {
- if (children != null) {
- children.dispose();
- children = null;
- if (wasStale) {
- staleCount--;
- }
- }
- }
- }
-
- /**
- * Creates a set that will contain the leaf nodes from the given tree
- *
- * @param tree
- * tree whose leaf nodes will be computed
- */
- public LeafNodesSet(IUnorderedTreeProvider tree) {
- this(null, tree);
- }
-
- /**
- * Creates a set that will contain the leaf nodes from the given tree, and
- * sets the root of the tree to the given element.
- *
- * @param initialInput
- * root of the tree
- * @param tree
- * tree whose leaf nodes will be computed
- */
- public LeafNodesSet(Object initialInput, IUnorderedTreeProvider tree) {
- super(tree.getRealm());
- this.tree = tree;
- if (initialInput != null) {
- setInput(initialInput);
- }
- }
-
- private void processDiff(TreePath treePath, SetDiff diff) {
- Set removals = new HashSet();
- HashSet additions = new HashSet();
-
- for (Iterator iter = diff.getRemovals().iterator(); iter.hasNext();) {
- Object next = iter.next();
-
- elementRemoved(treePath.createChildPath(next), removals);
- }
-
- for (Iterator iter = diff.getAdditions().iterator(); iter.hasNext();) {
- Object next = iter.next();
-
- elementDiscovered(treePath.createChildPath(next), additions);
- }
-
- HashSet newRemovals = new HashSet();
- newRemovals.addAll(removals);
- newRemovals.removeAll(additions);
-
- HashSet newAdditions = new HashSet();
- newAdditions.addAll(additions);
- newAdditions.removeAll(removals);
-
- leafNodes.addAll(newAdditions);
- leafNodes.removeAll(newRemovals);
-
- if (!newAdditions.isEmpty() || !newRemovals.isEmpty()) {
- setStale(staleCount > 0);
- fireSetChange(Diffs.createSetDiff(newAdditions, newRemovals));
- }
- }
-
- /**
- * Sets the root of the tree to the given element.
- *
- * @param input
- * new root of the tree
- */
- public void setInput(Object input) {
- Set removals = Collections.EMPTY_SET;
- Set additions = Collections.EMPTY_SET;
- if (this.input != null) {
- removals = Collections.singleton(this.input);
- } else if (input != null) {
- additions = Collections.singleton(input);
- }
- this.input = input;
- processDiff(TreePath.EMPTY, Diffs.createSetDiff(additions, removals));
- }
-
- /**
- * Called when an element is removed from the tree. The given HashSet will
- * be filled in with all removed leaf nodes.
- *
- * @param treePath
- * @param removals
- */
- private void elementRemoved(TreePath treePath, Set removals) {
- NodeInfo newNode = (NodeInfo) mapElementsOntoNodeInfo.get(treePath);
-
- if (newNode != null) {
- newNode = new NodeInfo(treePath);
- newNode.count--;
- if (newNode.count == 0) {
- mapElementsOntoNodeInfo.remove(treePath);
- if (newNode.children != null) {
- for (Iterator iter = newNode.children.iterator(); iter
- .hasNext();) {
- Object next = iter.next();
-
- elementRemoved(treePath.createChildPath(next), removals);
- }
- newNode.children.dispose();
- } else {
- removals.add(treePath);
- }
- }
- }
- }
-
- /**
- * Called when a new element is discovered in the tree. The given HashSet
- * will be filled in with all newly discovered leaf nodes.
- *
- * @param treePath
- * @param additions
- */
- private void elementDiscovered(TreePath treePath, HashSet additions) {
- NodeInfo newNode = (NodeInfo) mapElementsOntoNodeInfo.get(treePath);
-
- if (newNode == null) {
- newNode = new NodeInfo(treePath);
- mapElementsOntoNodeInfo.put(treePath, newNode);
- if (newNode.children != null) {
- for (Iterator iter = newNode.children.iterator(); iter
- .hasNext();) {
- Object next = iter.next();
-
- elementDiscovered(treePath.createChildPath(next), additions);
- }
- } else {
- additions.add(treePath);
- }
- } else {
- // If this node was already known, increment the reference count.
- newNode.count++;
- }
- }
-
- protected Set getWrappedSet() {
- return leafNodes;
- }
-
- public Object getElementType() {
- return Object.class;
- }
-
- public void dispose() {
- for (Iterator iter = mapElementsOntoNodeInfo.values().iterator(); iter
- .hasNext();) {
- NodeInfo next = (NodeInfo) iter.next();
-
- if (next.children != null) {
- next.dispose();
- }
- }
-
- mapElementsOntoNodeInfo.clear();
- leafNodes.clear();
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/OrderedTreeContentProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/OrderedTreeContentProvider.java
deleted file mode 100644
index 783ded3..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/OrderedTreeContentProvider.java
+++ /dev/null
@@ -1,433 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.viewers;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.set.AbstractObservableSet;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.SetDiff;
-import org.eclipse.core.internal.databinding.observable.tree.IOrderedTreeProvider;
-import org.eclipse.jface.viewers.ITreePathContentProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Converts an IOrderedTreeProvider into an ITreeContentProvider that is
- * suitable for use with a JFace TreeViewer.
- *
- * <p>
- * This content provider works correctly with trees containing duplicate
- * elements.
- * </p>
- *
- * @since 3.3
- */
-public class OrderedTreeContentProvider implements ITreePathContentProvider {
-
- private HashMap mapElementToTreeNode = new HashMap();
-
- private LinkedList enqueuedPrefetches = new LinkedList();
-
- class KnownElementsSet extends AbstractObservableSet {
-
- /**
- */
- protected KnownElementsSet() {
- super(provider.getRealm());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.internal.databinding.provisional.observable.set.AbstractObservableSet#getWrappedSet()
- */
- protected Set getWrappedSet() {
- return mapElementToTreeNode.keySet();
- }
-
- void doFireDiff(Set added, Set removed) {
- fireSetChange(Diffs.createSetDiff(added, removed));
- }
-
- void doFireStale(boolean isStale) {
- if (isStale) {
- fireStale();
- } else {
- fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET,
- Collections.EMPTY_SET));
- }
- }
-
- public Object getElementType() {
- return Object.class;
- }
-
- protected void fireSetChange(SetDiff diff) {
- super.fireSetChange(diff);
- }
- }
-
- KnownElementsSet elements;
-
- private ITreeViewerListener expandListener = new ITreeViewerListener() {
- public void treeCollapsed(TreeExpansionEvent event) {
- }
-
- public void treeExpanded(TreeExpansionEvent event) {
- }
- };
-
- private IPrefetchingTree prefetchingTree;
-
- private IOrderedTreeProvider provider;
-
- private Object pendingNode;
-
- private int avoidViewerUpdates;
-
- private TreeViewer treeViewer;
-
- private int staleCount = 0;
-
- private boolean useRefresh;
-
- private int maxPrefetches = -1;
-
- /**
- * Constructs a content provider that will render the given tree in a
- * TreeViewer.
- *
- * @param provider
- * IObservableTree that provides the contents of the tree. The
- * given provider may optionally implement IPrefetchingTree if it
- * wants to selectively enable or disable prefetching from
- * particular nodes.
- * @param pendingNode
- * element to insert whenever a node is being fetched in the
- * background
- */
- public OrderedTreeContentProvider(IOrderedTreeProvider provider,
- Object pendingNode) {
- this(provider, pendingNode, false);
- }
-
- /**
- * Constructs a content provider that will render the given tree in a
- * TreeViewer.
- *
- * @param provider
- * IObservableTree that provides the contents of the tree
- * @param pendingNode
- * element to insert whenever a node is being fetched in the
- * background
- * @param useRefresh
- * true = notify the viewer of changes by calling refresh(...),
- * false = notify the viewer of changes by calling add(...) and
- * remove(...). Using false is more efficient, but may not work
- * with TreeViewer subclasses.
- */
- public OrderedTreeContentProvider(IOrderedTreeProvider provider,
- Object pendingNode, boolean useRefresh) {
- this.provider = provider;
- this.prefetchingTree = PrefetchingTree.getPrefetchingTree(provider);
- this.pendingNode = pendingNode;
- this.useRefresh = useRefresh;
- elements = new KnownElementsSet();
- }
-
- /**
- * Sets the maximum number of pending prefetches.
- *
- * @param maxPrefetches
- */
- public void setMaxPrefetches(int maxPrefetches) {
- this.maxPrefetches = maxPrefetches;
- }
-
- /* package */IObservableList createChildList(TreePath treePath) {
- Object[] segments = new Object[treePath.getSegmentCount()];
- for (int i = 0; i < segments.length; i++) {
- segments[i] = treePath.getSegment(i);
- }
- return provider.createChildList(new org.eclipse.core.internal.databinding.observable.tree.TreePath(segments));
- }
-
- /* package */void remove(Object element, List removals, boolean lastElement) {
- if (avoidViewerUpdates == 0) {
- for (Iterator iter = removals.iterator(); iter.hasNext();) {
- Object next = iter.next();
-
- OrderedTreeNode nextNode = (OrderedTreeNode) mapElementToTreeNode
- .get(next);
- if (nextNode != null) {
- nextNode.removeParent(element);
- removeIfUnused(nextNode);
- }
- }
-
- if (lastElement || useRefresh) {
- treeViewer.refresh(element);
- } else {
- treeViewer.remove(element, removals.toArray());
- }
- }
- }
-
- /* package */void add(TreePath element, List additions) {
- if (avoidViewerUpdates == 0) {
- // Handle new parents
- addParent(element, additions);
- if (useRefresh) {
- treeViewer.refresh(element);
- } else {
- treeViewer.add(element, additions);
- }
- }
- }
-
- /* package */void insert(TreePath element, Object addition, int position) {
- if (avoidViewerUpdates == 0) {
- // Handle new parents
- addParent(element, Collections.singletonList(addition));
- if (useRefresh) {
- treeViewer.refresh(element);
- } else {
- treeViewer.insert(element, addition, position);
- }
- }
- }
-
- /**
- * Ensures that the given set of children have the given parent as one of
- * their parents.
- *
- * @param parentPath
- * @param children
- */
- private void addParent(TreePath parentPath, List children) {
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- Object next = iter.next();
-
- OrderedTreeNode nextNode = getNode(parentPath.createChildPath(next));
- nextNode.addParent(parentPath);
- }
- }
-
- /**
- * Returns the element that should be inserted into the tree when fetching
- * the children of the node that is both stale and empty.
- *
- * @return the element that should be inserted into the tree when fetching
- * the children of a node that is stale and empty
- */
- public final Object getPendingNode() {
- return pendingNode;
- }
-
- /**
- * Returns the IObservableList representing the children of the given node.
- * Never null.
- *
- * @param parent
- * parent element. Must be a valid node from the tree.
- * @return the list of children of the given parent node
- */
- public IObservableList getChildrenList(TreePath parent) {
- IObservableList result = getNode(parent).getChildrenList();
-
- return result;
- }
-
- public void dispose() {
- if (treeViewer != null) {
- try {
- avoidViewerUpdates++;
- enqueuedPrefetches.clear();
- Object[] keys = mapElementToTreeNode.keySet().toArray();
-
- for (int i = 0; i < keys.length; i++) {
- Object key = keys[i];
-
- OrderedTreeNode result = (OrderedTreeNode) mapElementToTreeNode.get(key);
- if (result != null) {
- result.dispose();
- }
- }
- } finally {
- avoidViewerUpdates--;
- }
- }
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // This should only ever be called for a single viewer
- setViewer(viewer);
-
- if (oldInput != null && newInput != null && oldInput.equals(newInput)) {
- return;
- }
-
- try {
- avoidViewerUpdates++;
- removeIfUnused(oldInput);
- } finally {
- avoidViewerUpdates--;
- }
- }
-
- private void removeIfUnused(Object element) {
- OrderedTreeNode result = (OrderedTreeNode) mapElementToTreeNode
- .get(element);
- if (result != null && result.getParent() == null) {
- mapElementToTreeNode.remove(element);
- elements.doFireDiff(Collections.EMPTY_SET, Collections
- .singleton(element));
- result.dispose();
- }
- }
-
- private void setViewer(Viewer viewer) {
- if (!(viewer instanceof TreeViewer)) {
- throw new IllegalArgumentException(
- "This content provider can only be used with TreeViewers"); //$NON-NLS-1$
- }
- TreeViewer newTreeViewer = (TreeViewer) viewer;
-
- if (newTreeViewer != treeViewer) {
- if (treeViewer != null) {
- treeViewer.removeTreeListener(expandListener);
- }
-
- this.treeViewer = newTreeViewer;
- if (newTreeViewer != null) {
- newTreeViewer.addTreeListener(expandListener);
- }
- }
- }
-
- public Object[] getChildren(TreePath parentElement) {
- List result = getNode(parentElement).getChildren();
-
- addParent(parentElement, result);
-
- return result.toArray();
- }
-
- private OrderedTreeNode getNode(TreePath parentElement) {
- OrderedTreeNode result = (OrderedTreeNode) mapElementToTreeNode
- .get(parentElement);
- if (result == null) {
- result = new OrderedTreeNode(parentElement, this);
- mapElementToTreeNode.put(parentElement, result);
- elements.fireSetChange(Diffs.createSetDiff(Collections
- .singleton(parentElement), Collections.EMPTY_SET));
- }
- return result;
- }
-
- /**
- * Returns the set of all elements that have been discovered in this tree so
- * far. Callers must not dispose this set. Never null.
- *
- * @return the set of all elements that have been discovered in this tree so
- * far.
- */
- public IObservableSet getKnownElements() {
- return elements;
- }
-
- /* package */void changeStale(int staleDelta) {
- staleCount += staleDelta;
- processPrefetches();
- elements.setStale(staleCount != 0);
- }
-
- /**
- * Returns the associated tree viewer.
- *
- * @return the associated tree viewer
- */
- public TreeViewer getViewer() {
- return treeViewer;
- }
-
- /**
- * Returns true iff the given element is stale.
- *
- * @param element
- * the element to query for staleness. Must exist in the tree.
- * @return true iff the given element is stale
- */
- public boolean isDirty(TreePath element) {
- return getChildrenList(element).isStale();
- }
-
- /* package */void enqueuePrefetch(OrderedTreeNode node) {
- if (prefetchingTree.shouldPrefetch(node.getElement())) {
- if (staleCount == 0) {
- // Call node.getChildren()... this will cause us to start
- // listening to the
- // node and will trigger prefetching. Don't call prefetch since
- // this method
- // is intended to be called inside getters (which will simply
- // return the
- // fetched nodes) and prefetch() is intended to be called inside
- // an asyncExec,
- // which will notify the viewer directly of the newly discovered
- // nodes.
- node.getChildren();
- } else {
- enqueuedPrefetches.add(node);
- while (maxPrefetches >= 0
- && enqueuedPrefetches.size() > maxPrefetches) {
- enqueuedPrefetches.removeFirst();
- }
- }
- }
- }
-
- private void processPrefetches() {
- while (staleCount == 0 && !enqueuedPrefetches.isEmpty()) {
- OrderedTreeNode next = (OrderedTreeNode) enqueuedPrefetches.removeLast();
-
- // Note that we don't remove nodes from the prefetch queue when they
- // are disposed,
- // so we may encounter disposed nodes at this time.
- if (!next.isDisposed()) {
- next.prefetch();
- }
- }
- }
-
- public TreePath[] getParents(Object element) {
- return new TreePath[0];
- }
-
- public boolean hasChildren(TreePath path) {
- return getNode(path).shouldShowPlus();
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(new TreePath(new Object[]{inputElement}));
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/OrderedTreeNode.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/OrderedTreeNode.java
deleted file mode 100644
index 6fd08ae..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/OrderedTreeNode.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.viewers;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.Observables;
-import org.eclipse.core.databinding.observable.StaleEvent;
-import org.eclipse.core.databinding.observable.list.IListChangeListener;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.ListChangeEvent;
-import org.eclipse.core.databinding.observable.list.ListDiffEntry;
-import org.eclipse.jface.viewers.TreePath;
-
-/* package */class OrderedTreeNode implements IListChangeListener,
- IStaleListener {
- private OrderedTreeContentProvider contentProvider;
-
- private TreePath element;
-
- // Stores the set of parents (null if there are less than 2)
- private HashSet parents = null;
-
- // Stores one representative parent. If there is more than one parent,
- // the complete set of parents can be found in the parents set.
- Object parent;
-
- /**
- * List of child elements.
- */
- private IObservableList children;
-
- private boolean hasPendingNode = false;
-
- private boolean isStale;
-
- private boolean listeningToChildren = false;
-
- private boolean prefetchEnqueued = false;
-
- /**
- * @param treePath
- * @param cp
- */
- public OrderedTreeNode(TreePath treePath, OrderedTreeContentProvider cp) {
- this.element = treePath;
- this.contentProvider = cp;
- children = contentProvider.createChildList(treePath);
- if (children == null) {
- children = Observables.emptyObservableList(contentProvider.getKnownElements().getRealm());
- listeningToChildren = true;
- }
- hasPendingNode = children.isStale();
- }
-
- /**
- * @param parent
- */
- public void addParent(Object parent) {
- if (this.parent == null) {
- this.parent = parent;
- } else {
- if (parent.equals(this.parent)) {
- return;
- }
- if (parents == null) {
- parents = new HashSet();
- parents.add(this.parent);
- }
- parents.add(parent);
- }
- }
-
- /**
- * @param parent
- */
- public void removeParent(Object parent) {
- if (this.parents != null) {
- parents.remove(parent);
- }
-
- if (parent == this.parent) {
- if (parents == null || parents.isEmpty()) {
- this.parent = null;
- } else {
- this.parent = parents.iterator().next();
- }
- }
-
- if (this.parents != null && this.parents.size() <= 1) {
- this.parents = null;
- }
- }
-
- /**
- * Returns the list of children for this node. If new children are
- * discovered later, they will be added directly to the viewer.
- *
- * @return the list of children of this node
- */
- public List getChildren() {
- if (!listeningToChildren) {
- listeningToChildren = true;
- children.addListChangeListener(this);
- hasPendingNode = children.isEmpty() && children.isStale();
- children.addStaleListener(this);
- updateStale();
- }
-
- // If the child set is stale and empty, show the "pending" node
- if (hasPendingNode) {
- Object pendingNode = contentProvider.getPendingNode();
- return Collections.singletonList(pendingNode);
- }
- return children;
- }
-
- /**
- * @return the observable list of children for this node
- */
- public IObservableList getChildrenList() {
- return children;
- }
-
- private void updateStale() {
- boolean willBeStale = children.isStale();
- if (willBeStale != isStale) {
- isStale = willBeStale;
-
- contentProvider.changeStale(isStale ? 1 : -1);
- }
- }
-
- /**
- * @return whether this node's children will change soon
- */
- public boolean isStale() {
- return isStale;
- }
-
- /**
- * Returns true if the viewer should show a plus sign for expanding this
- * node.
- *
- * @return <code>true</code> if this node has children
- */
- public boolean shouldShowPlus() {
- if (children == null) {
- // if (!hasPendingNode) {
- // hasPendingNode = true;
- // contentProvider.add(element,
- // Collections.singleton(contentProvider.getPendingNode()));
- // }
- return true;
- }
- if (!listeningToChildren && !prefetchEnqueued) {
- prefetchEnqueued = true;
- contentProvider.enqueuePrefetch(this);
- }
- return !listeningToChildren || hasPendingNode || !children.isEmpty();
- }
-
- /**
- * Disposes this node and removes all remaining children.
- */
- public void dispose() {
- if (children != null) {
- if (listeningToChildren) {
- contentProvider.remove(element, children, true);
- children.removeListChangeListener(this);
- children.removeStaleListener(this);
- }
- children.dispose();
- children = null;
-
- if (listeningToChildren && isStale) {
- contentProvider.changeStale(-1);
- }
- }
- }
-
- /**
- * @return <code>true</code> if this node is disposed
- */
- public boolean isDisposed() {
- return children == null;
- }
-
- /**
- * Returns one representative parent, or null if this node is unparented.
- * Use getParents() to get the complete set of known parents.
- *
- * @return a parent node, or <code>null</code>
- */
- public Object getParent() {
- return parent;
- }
-
- /**
- * @return the set of known parent nodes
- */
- public Set getParents() {
- if (parents == null) {
- if (parent == null) {
- return Collections.EMPTY_SET;
- }
- return Collections.singleton(parent);
- }
- return parents;
- }
-
- /**
- * Called when the child set changes. Should not be called directly by the
- * viewer.
- */
- public void handleListChange(ListChangeEvent event) {
- boolean shouldHavePendingNode = children.isEmpty()
- && children.isStale();
-
- List removals = new ArrayList();
- ListDiffEntry[] differences = event.diff.getDifferences();
- for (int i = 0; i < differences.length; i++) {
- ListDiffEntry diffEntry = differences[i];
- if (diffEntry.isAddition()) {
- contentProvider.insert(element, diffEntry.getElement(),
- diffEntry.getPosition());
- } else {
- removals.add(diffEntry.getElement());
- }
- }
-
- // Check if we should add the pending node
- if (shouldHavePendingNode && !hasPendingNode) {
- contentProvider
- .insert(element, contentProvider.getPendingNode(), 0);
- hasPendingNode = true;
- }
-
- // Check if we should remove the pending node
- if (!shouldHavePendingNode && hasPendingNode) {
- removals.add(contentProvider.getPendingNode());
- hasPendingNode = false;
- }
- if (!removals.isEmpty()) {
- contentProvider.remove(element, removals, children.isEmpty()
- && !hasPendingNode);
- }
-
- updateStale();
- }
-
- public void handleStale(StaleEvent event) {
- boolean shouldHavePendingNode = children.isEmpty()
- && children.isStale();
-
- // Check if we should add the pending node
- if (shouldHavePendingNode && !hasPendingNode) {
- hasPendingNode = shouldHavePendingNode;
- contentProvider.insert(element, Collections
- .singletonList(contentProvider.getPendingNode()), 0);
- }
-
- // Check if we should remove the pending node
- if (!shouldHavePendingNode && hasPendingNode) {
- hasPendingNode = shouldHavePendingNode;
- contentProvider.remove(element, Collections
- .singletonList(contentProvider.getPendingNode()), true);
- }
-
- updateStale();
- }
-
- /**
- * @return the element
- */
- public Object getElement() {
- return element;
- }
-
- /**
- *
- */
- public void prefetch() {
- List children = getChildren();
- if (!children.isEmpty()) {
- contentProvider.add(element, children);
- } else {
- // We need to remove the + sign, and adding/removing elements won't
- // do the trick
- contentProvider.getViewer().refresh(element);
- }
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/PrefetchingTree.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/PrefetchingTree.java
deleted file mode 100644
index ac33cd5..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/PrefetchingTree.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.viewers;
-
-
-
-/* package */ class PrefetchingTree implements IPrefetchingTree {
-
- private static IPrefetchingTree instance;
-
- private PrefetchingTree() {
- }
-
- public boolean shouldPrefetch(Object parentNode) {
- return true;
- }
-
- /**
- * @param treeProvider
- * @return a prefetching tree
- */
- public static IPrefetchingTree getPrefetchingTree(Object treeProvider) {
- if (treeProvider instanceof IPrefetchingTree) {
- return (IPrefetchingTree)treeProvider;
- }
- if (instance == null) {
- instance = new PrefetchingTree();
- }
- return instance;
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValue.java
deleted file mode 100644
index 5b95f66..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValue.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 137877
- * Brad Reynolds - bug 164653
- * Brad Reynolds - bug 147515
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.internal.viewers;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
-import org.eclipse.jface.util.Util;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-/**
- * Observes single selection of an <code>ISelectionProvider</code>.
- *
- * @since 1.1
- */
-public class SelectionProviderSingleSelectionObservableValue extends
- AbstractObservableValue {
-
- private final ISelectionProvider selectionProvider;
-
- private boolean updating = false;
-
- private Object currentSelection;
-
- /**
- * Constructs a new instance associated with the provided
- * <code>selectionProvider</code>. In order to initialize itself properly
- * the constructor invokes {@link #doGetValue()}. This could be dangerous
- * for subclasses, see {@link #doGetValue()} for an explanation.
- * @param realm
- *
- * @param selectionProvider
- * @see #doGetValue()
- */
- public SelectionProviderSingleSelectionObservableValue(Realm realm,
- ISelectionProvider selectionProvider) {
- super(realm);
- if (selectionProvider == null) {
- throw new IllegalArgumentException(
- "The 'selectionProvider' parameter is null."); //$NON-NLS-1$
- }
-
- this.selectionProvider = selectionProvider;
- this.currentSelection = doGetValue();
-
- selectionProvider
- .addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (!updating) {
- Object oldSelection = currentSelection;
- currentSelection = doGetValue();
- fireValueChange(Diffs.createValueDiff(oldSelection,
- currentSelection));
- }
- }
- });
- }
-
- /**
- * Sets the selection to the provided <code>value</code>. Value change
- * events are fired after selection is set in the selection provider.
- *
- * @param value
- * object to set as selected, <code>null</code> if wanting to
- * remove selection
- */
- public void doSetValue(final Object value) {
- try {
- updating = true;
-
- Object oldSelection = currentSelection;
- selectionProvider
- .setSelection(value == null ? StructuredSelection.EMPTY
- : new StructuredSelection(value));
- currentSelection = doGetValue();
- if (!Util.equals(oldSelection, currentSelection)) {
- fireValueChange(Diffs.createValueDiff(oldSelection,
- currentSelection));
- }
- } finally {
- updating = false;
- }
- }
-
- /**
- * Retrieves the current selection.
- * <p>
- * If a subclass overrides this method it must not depend upon the subclass
- * to have been fully initialized before this method is invoked.
- * <code>doGetValue()</code> is invoked by the
- * {@link #SelectionProviderSingleSelectionObservableValue(Realm, ISelectionProvider) constructor}
- * which means the subclass's constructor will not have fully executed
- * before this method is invoked.
- * </p>
- *
- * @return selection will be an instance of
- * <code>IStructuredSelection</code> if a selection exists,
- * <code>null</code> if no selection
- * @see #SelectionProviderSingleSelectionObservableValue(Realm, ISelectionProvider)
- */
- protected Object doGetValue() {
- ISelection selection = selectionProvider.getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection sel = (IStructuredSelection) selection;
- return sel.getFirstElement();
- }
-
- return null;
- }
-
- public Object getValueType() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/UnorderedTreeContentProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/UnorderedTreeContentProvider.java
deleted file mode 100644
index fbd7dbd..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/UnorderedTreeContentProvider.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.viewers;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Set;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.set.AbstractObservableSet;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.SetDiff;
-import org.eclipse.core.internal.databinding.observable.tree.IUnorderedTreeProvider;
-import org.eclipse.jface.viewers.ITreePathContentProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Converts an ITreeProvider into an ITreeContentProvider that is suitable for
- * use with a JFace TreeViewer.
- *
- * <p>
- * This content provider works correctly with trees containing duplicate
- * elements.
- * </p>
- *
- * @since 3.3
- */
-public class UnorderedTreeContentProvider implements ITreePathContentProvider {
-
- private HashMap mapElementToTreeNode = new HashMap();
-
- private LinkedList enqueuedPrefetches = new LinkedList();
-
- class KnownElementsSet extends AbstractObservableSet {
-
- /**
- */
- protected KnownElementsSet() {
- super(provider.getRealm());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.internal.databinding.provisional.observable.set.AbstractObservableSet#getWrappedSet()
- */
- protected Set getWrappedSet() {
- return mapElementToTreeNode.keySet();
- }
-
- void doFireDiff(Set added, Set removed) {
- fireSetChange(Diffs.createSetDiff(added, removed));
- }
-
- void doFireStale(boolean isStale) {
- if (isStale) {
- fireStale();
- } else {
- fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET,
- Collections.EMPTY_SET));
- }
- }
-
- public Object getElementType() {
- return new Object();
- }
-
- protected void fireSetChange(SetDiff diff) {
- super.fireSetChange(diff);
- }
- }
-
- KnownElementsSet elements;
-
- private ITreeViewerListener expandListener = new ITreeViewerListener() {
- public void treeCollapsed(TreeExpansionEvent event) {
- }
-
- public void treeExpanded(TreeExpansionEvent event) {
- }
- };
-
- private IPrefetchingTree prefetchingTree;
-
- private IUnorderedTreeProvider provider;
-
- private Object pendingNode;
-
- private int avoidViewerUpdates;
-
- private TreeViewer treeViewer;
-
- private int staleCount = 0;
-
- private boolean useRefresh;
-
- private int maxPrefetches = -1;
-
- /**
- * Constructs a content provider that will render the given tree in a
- * TreeViewer.
- *
- * @param provider
- * IObservableTree that provides the contents of the tree. The
- * given provider map optionally implement IPrefetchingTree if it
- * wants to selectively enable or disable prefetching from
- * particular nodes.
- * @param pendingNode
- * element to insert whenever a node is being fetched in the
- * background
- */
- public UnorderedTreeContentProvider(IUnorderedTreeProvider provider,
- Object pendingNode) {
- this(provider, pendingNode, false);
- }
-
- /**
- * Constructs a content provider that will render the given tree in a
- * TreeViewer.
- *
- * @param provider
- * IObservableTree that provides the contents of the tree
- * @param pendingNode
- * element to insert whenever a node is being fetched in the
- * background
- * @param useRefresh
- * true = notify the viewer of changes by calling refresh(...),
- * false = notify the viewer of changes by calling add(...) and
- * remove(...). Using false is more efficient, but may not work
- * with TreeViewer subclasses.
- */
- public UnorderedTreeContentProvider(IUnorderedTreeProvider provider,
- Object pendingNode, boolean useRefresh) {
- this.provider = provider;
- this.prefetchingTree = PrefetchingTree.getPrefetchingTree(provider);
- this.pendingNode = pendingNode;
- this.useRefresh = useRefresh;
- elements = new KnownElementsSet();
- }
-
- /**
- * Sets the maximum number of pending prefetches.
- *
- * @param maxPrefetches
- */
- public void setMaxPrefetches(int maxPrefetches) {
- this.maxPrefetches = maxPrefetches;
- }
-
- /* package */IObservableSet createChildSet(TreePath treePath) {
- Object[] segments = new Object[treePath.getSegmentCount()];
- for (int i = 0; i < segments.length; i++) {
- segments[i] = treePath.getSegment(i);
- }
- return provider
- .createChildSet(new org.eclipse.core.internal.databinding.observable.tree.TreePath(
- segments));
- }
-
- /* package */void remove(Object element, Set removals, boolean lastElement) {
- if (avoidViewerUpdates == 0) {
- for (Iterator iter = removals.iterator(); iter.hasNext();) {
- Object next = iter.next();
-
- UnorderedTreeNode nextNode = (UnorderedTreeNode) mapElementToTreeNode
- .get(next);
- if (nextNode != null) {
- nextNode.removeParent(element);
- removeIfUnused(nextNode);
- }
- }
-
- if (lastElement || useRefresh) {
- treeViewer.refresh(element);
- } else {
- treeViewer.remove(element, removals.toArray());
- }
- }
- }
-
- /* package */void add(TreePath treePath, Set additions) {
- if (avoidViewerUpdates == 0) {
- // Handle new parents
- addParent(treePath, additions);
- if (useRefresh) {
- treeViewer.refresh(treePath);
- } else {
- treeViewer.add(treePath, additions.toArray());
- }
- }
- }
-
- /**
- * Ensures that the given set of children have the given parent as one of
- * their parents.
- *
- * @param parent
- * @param children
- */
- private void addParent(TreePath parent, Set children) {
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- Object next = iter.next();
-
- UnorderedTreeNode nextNode = getNode(parent.createChildPath(next));
- nextNode.addParent(parent);
- }
- }
-
- /**
- * Returns the element that should be inserted into the tree when fetching
- * the children of the node that is both stale and empty.
- *
- * @return the element that should be inserted into the tree when fetching
- * the children of a node that is stale and empty
- */
- public final Object getPendingNode() {
- return pendingNode;
- }
-
- /**
- * Returns the IObservableSet representing the children of the given node.
- * Never null.
- *
- * @param parent
- * parent element. Must be a valid node from the tree.
- * @return the set of children of the given parent node
- */
- public IObservableSet getChildrenSet(TreePath parent) {
- IObservableSet result = getNode(parent).getChildrenSet();
-
- return result;
- }
-
- public void dispose() {
- if (treeViewer != null) {
- try {
- avoidViewerUpdates++;
- enqueuedPrefetches.clear();
- Object[] keys = mapElementToTreeNode.keySet().toArray();
-
- for (int i = 0; i < keys.length; i++) {
- Object key = keys[i];
-
- UnorderedTreeNode result = (UnorderedTreeNode) mapElementToTreeNode
- .get(key);
- if (result != null) {
- result.dispose();
- }
- }
- } finally {
- avoidViewerUpdates--;
- }
- }
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // This should only ever be called for a single viewer
- setViewer(viewer);
-
- if (oldInput != null && newInput != null && oldInput.equals(newInput)) {
- return;
- }
-
- try {
- avoidViewerUpdates++;
- removeIfUnused(oldInput);
- } finally {
- avoidViewerUpdates--;
- }
- }
-
- private void removeIfUnused(Object element) {
- UnorderedTreeNode result = (UnorderedTreeNode) mapElementToTreeNode
- .get(element);
- if (result != null && result.getParent() == null) {
- mapElementToTreeNode.remove(element);
- elements.doFireDiff(Collections.EMPTY_SET, Collections
- .singleton(element));
- result.dispose();
- }
- }
-
- private void setViewer(Viewer viewer) {
- if (!(viewer instanceof TreeViewer)) {
- throw new IllegalArgumentException(
- "This content provider can only be used with TreeViewers"); //$NON-NLS-1$
- }
- TreeViewer newTreeViewer = (TreeViewer) viewer;
-
- if (newTreeViewer != treeViewer) {
- if (treeViewer != null) {
- treeViewer.removeTreeListener(expandListener);
- }
-
- this.treeViewer = newTreeViewer;
- if (newTreeViewer != null) {
- newTreeViewer.addTreeListener(expandListener);
- }
- }
- }
-
- public Object[] getChildren(TreePath parentPath) {
- Set result = getNode(parentPath).getChildren();
-
- addParent(parentPath, result);
-
- return result.toArray();
- }
-
- private UnorderedTreeNode getNode(TreePath parentPath) {
- UnorderedTreeNode result = (UnorderedTreeNode) mapElementToTreeNode
- .get(parentPath);
- if (result == null) {
- result = new UnorderedTreeNode(parentPath, this);
- mapElementToTreeNode.put(parentPath, result);
- elements.fireSetChange(Diffs.createSetDiff(Collections
- .singleton(parentPath), Collections.EMPTY_SET));
- }
- return result;
- }
-
- public TreePath[] getParents(Object element) {
- return new TreePath[0];
- }
-
- public boolean hasChildren(TreePath element) {
- return getNode(element).shouldShowPlus();
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(new TreePath(new Object[]{inputElement}));
- }
-
- /**
- * Returns the set of all elements that have been discovered in this tree so
- * far. Callers must not dispose this set. Never null.
- *
- * @return the set of all elements that have been discovered in this tree so
- * far.
- */
- public IObservableSet getKnownElements() {
- return elements;
- }
-
- /* package */void changeStale(int staleDelta) {
- staleCount += staleDelta;
- processPrefetches();
- elements.setStale(staleCount != 0);
- }
-
- /**
- * Returns the associated tree viewer.
- *
- * @return the associated tree viewer
- */
- public TreeViewer getViewer() {
- return treeViewer;
- }
-
- /**
- * Returns true iff the given element is stale.
- *
- * @param element
- * the element to query for staleness. Must exist in the tree.
- * @return true iff the given element is stale
- */
- public boolean isDirty(TreePath element) {
- return getChildrenSet(element).isStale();
- }
-
- /* package */void enqueuePrefetch(UnorderedTreeNode node) {
- if (prefetchingTree.shouldPrefetch(node.getElement())) {
- if (staleCount == 0) {
- // Call node.getChildren()... this will cause us to start
- // listening to the
- // node and will trigger prefetching. Don't call prefetch since
- // this method
- // is intended to be called inside getters (which will simply
- // return the
- // fetched nodes) and prefetch() is intended to be called inside
- // an asyncExec,
- // which will notify the viewer directly of the newly discovered
- // nodes.
- node.getChildren();
- } else {
- enqueuedPrefetches.add(node);
- while (maxPrefetches >= 0
- && enqueuedPrefetches.size() > maxPrefetches) {
- enqueuedPrefetches.removeFirst();
- }
- }
- }
- }
-
- private void processPrefetches() {
- while (staleCount == 0 && !enqueuedPrefetches.isEmpty()) {
- UnorderedTreeNode next = (UnorderedTreeNode) enqueuedPrefetches
- .removeLast();
-
- // Note that we don't remove nodes from the prefetch queue when they
- // are disposed,
- // so we may encounter disposed nodes at this time.
- if (!next.isDisposed()) {
- next.prefetch();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/UnorderedTreeNode.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/UnorderedTreeNode.java
deleted file mode 100644
index f9abf73..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/UnorderedTreeNode.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.internal.viewers;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.Observables;
-import org.eclipse.core.databinding.observable.StaleEvent;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.ISetChangeListener;
-import org.eclipse.core.databinding.observable.set.SetChangeEvent;
-import org.eclipse.jface.viewers.TreePath;
-
-/* package */ class UnorderedTreeNode implements ISetChangeListener, IStaleListener {
- private UnorderedTreeContentProvider contentProvider;
- private TreePath treePath;
-
- // Stores the set of parents (null if there are less than 2)
- private HashSet parents = null;
-
- // Stores one representative parent. If there is more than one parent,
- // the complete set of parents can be found in the parents set.
- Object parent;
-
- /**
- * Set of child elements.
- */
- private IObservableSet children;
-
- private boolean hasPendingNode = false;
- private boolean isStale;
- private boolean listeningToChildren = false;
- private boolean prefetchEnqueued = false;
-
- /**
- * @param element
- * @param cp
- */
- public UnorderedTreeNode(TreePath element, UnorderedTreeContentProvider cp) {
- this.treePath = element;
- this.contentProvider = cp;
- children = contentProvider.createChildSet(element);
- if (children == null) {
- children = Observables.emptyObservableSet(contentProvider.getKnownElements().getRealm());
- listeningToChildren = true;
- }
- hasPendingNode = children.isStale();
- }
-
- /**
- * @param parent
- */
- public void addParent(Object parent) {
- if (this.parent == null) {
- this.parent = parent;
- } else {
- if (parent.equals(this.parent)) {
- return;
- }
- if (parents == null) {
- parents = new HashSet();
- parents.add(this.parent);
- }
- parents.add(parent);
- }
- }
-
- /**
- * @param parent
- */
- public void removeParent(Object parent) {
- if (this.parents != null) {
- parents.remove(parent);
- }
-
- if (parent == this.parent) {
- if (parents == null || parents.isEmpty()) {
- this.parent = null;
- } else {
- this.parent = parents.iterator().next();
- }
- }
-
- if (this.parents != null && this.parents.size() <= 1) {
- this.parents = null;
- }
- }
-
- /**
- * Returns the set of children for this node. If new children are discovered later, they
- * will be added directly to the viewer.
- *
- * @return the set of children
- */
- public Set getChildren() {
- if (!listeningToChildren) {
- listeningToChildren = true;
- children.addSetChangeListener(this);
- hasPendingNode = children.isEmpty() && children.isStale();
- children.addStaleListener(this);
- updateStale();
- }
-
- // If the child set is stale and empty, show the "pending" node
- if (hasPendingNode) {
- Object pendingNode = contentProvider.getPendingNode();
- return Collections.singleton(pendingNode);
- }
- return children;
- }
-
- /**
- * @return the observable set of children
- */
- public IObservableSet getChildrenSet() {
- return children;
- }
-
- private void updateStale() {
- boolean willBeStale = children.isStale();
- if (willBeStale != isStale) {
- isStale = willBeStale;
-
- contentProvider.changeStale(isStale? 1 : -1);
- }
- }
-
- /**
- * @return <code>true</code> if the children of this node will change soon
- */
- public boolean isStale() {
- return isStale;
- }
-
- /**
- * Returns true if the viewer should show a plus sign for expanding this
- * node.
- *
- * @return <code>true</code> if this node may have children
- */
- public boolean shouldShowPlus() {
- if (children == null) {
-// if (!hasPendingNode) {
-// hasPendingNode = true;
-// contentProvider.add(element, Collections.singleton(contentProvider.getPendingNode()));
-// }
- return true;
- }
- if (!listeningToChildren && !prefetchEnqueued) {
- prefetchEnqueued = true;
- contentProvider.enqueuePrefetch(this);
- }
- return !listeningToChildren || hasPendingNode || !children.isEmpty();
- }
-
- /**
- * Disposes this node and removes all remaining children.
- */
- public void dispose() {
- if (children != null) {
- if (listeningToChildren) {
- contentProvider.remove(treePath, children, true);
- children.removeSetChangeListener(this);
- children.removeStaleListener(this);
- }
- children.dispose();
- children = null;
-
- if (listeningToChildren && isStale) {
- contentProvider.changeStale(-1);
- }
- }
- }
-
- /**
- * @return <code>true</code> if this node is disposed
- */
- public boolean isDisposed() {
- return children == null;
- }
-
- /**
- * Returns one representative parent, or null if this node is unparented. Use
- * getParents() to get the complete set of known parents.
- *
- * @return a parent node, or null
- */
- public Object getParent() {
- return parent;
- }
-
- /**
- * @return the set of known parent nodes
- */
- public Set getParents() {
- if (parents == null) {
- if (parent == null) {
- return Collections.EMPTY_SET;
- }
- return Collections.singleton(parent);
- }
- return parents;
- }
-
- /**
- * Called when the child set changes. Should not be called directly by the viewer.
- */
- public void handleSetChange(SetChangeEvent event) {
- boolean shouldHavePendingNode = children.isEmpty() && children.isStale();
-
- Set additions = event.diff.getAdditions();
- // Check if we should add the pending node
- if (shouldHavePendingNode && !hasPendingNode) {
- HashSet newAdditions = new HashSet();
- newAdditions.addAll(additions);
- newAdditions.add(contentProvider.getPendingNode());
- additions = newAdditions;
- hasPendingNode = true;
- }
-
- Set removals = event.diff.getRemovals();
- // Check if we should remove the pending node
- if (!shouldHavePendingNode && hasPendingNode) {
- HashSet newRemovals = new HashSet();
- newRemovals.addAll(removals);
- newRemovals.add(contentProvider.getPendingNode());
- removals = newRemovals;
- hasPendingNode = false;
- }
- if (!additions.isEmpty()) {
- contentProvider.add(treePath, additions);
- }
- if (!removals.isEmpty()) {
- contentProvider.remove(treePath, removals, children.isEmpty() && !hasPendingNode);
- }
-
- updateStale();
- }
-
- public void handleStale(StaleEvent event) {
- boolean shouldHavePendingNode = children.isEmpty() && children.isStale();
-
- // Check if we should add the pending node
- if (shouldHavePendingNode && !hasPendingNode) {
- hasPendingNode = shouldHavePendingNode;
- contentProvider.add(treePath, Collections.singleton(contentProvider.getPendingNode()));
- }
-
- // Check if we should remove the pending node
- if (!shouldHavePendingNode && hasPendingNode) {
- hasPendingNode = shouldHavePendingNode;
- contentProvider.remove(treePath, Collections.singleton(contentProvider.getPendingNode()), true);
- }
-
- updateStale();
- }
-
- /**
- * @return the element
- */
- public Object getElement() {
- return treePath;
- }
-
- /**
- *
- */
- public void prefetch() {
- Set children = getChildren();
- if (!children.isEmpty()) {
- contentProvider.add(treePath, children);
- } else {
- // We need to remove the + sign, and adding/removing elements won't do the trick
- contentProvider.getViewer().refresh(treePath);
- }
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTObservableValue.java
deleted file mode 100644
index f01cadf..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTObservableValue.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef, Inc. 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:
- * The Pampered Chef, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.swt;
-
-import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
-import org.eclipse.jface.databinding.swt.ISWTObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * An abstract superclass for observable values that gurantees that the
- * observable will be disposed when the control to which it is attached is
- * disposed.
- *
- * @since 3.3
- */
-public abstract class AbstractSWTObservableValue extends AbstractObservableValue implements ISWTObservableValue {
-
- private final Widget widget;
-
- /**
- * Standard constructor for an SWT ObservableValue. Makes sure that
- * the observable gets disposed when the SWT widget is disposed.
- *
- * @param widget
- */
- protected AbstractSWTObservableValue(Widget widget) {
- super(SWTObservables.getRealm(widget.getDisplay()));
- this.widget = widget;
- widget.addDisposeListener(disposeListener);
- }
-
- private DisposeListener disposeListener = new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- AbstractSWTObservableValue.this.dispose();
- }
- };
-
- /**
- * @return Returns the widget.
- */
- public Widget getWidget() {
- return widget;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTVetoableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTVetoableValue.java
deleted file mode 100644
index eea29fe..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTVetoableValue.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef, Inc. 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:
- * The Pampered Chef, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.swt;
-
-import org.eclipse.core.databinding.observable.value.AbstractVetoableValue;
-import org.eclipse.jface.databinding.swt.ISWTObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * An abstract superclass for vetoable values that gurantees that the
- * observable will be disposed when the control to which it is attached is
- * disposed.
- *
- * @since 3.3
- */
-public abstract class AbstractSWTVetoableValue extends AbstractVetoableValue implements ISWTObservableValue {
-
- private final Widget widget;
-
- /**
- * Standard constructor for an SWT VetoableValue. Makes sure that
- * the observable gets disposed when the SWT widget is disposed.
- *
- * @param widget
- */
- protected AbstractSWTVetoableValue(Widget widget) {
- super(SWTObservables.getRealm(widget.getDisplay()));
- this.widget = widget;
- if (widget == null) {
- throw new IllegalArgumentException("The widget parameter is null."); //$NON-NLS-1$
- }
- widget.addDisposeListener(disposeListener);
- }
-
- private DisposeListener disposeListener = new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- AbstractSWTVetoableValue.this.dispose();
- }
- };
-
- /**
- * @return Returns the widget.
- */
- public Widget getWidget() {
- return widget;
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/CompositeUpdater.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/CompositeUpdater.java
deleted file mode 100644
index 04dce3d..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/CompositeUpdater.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * Boris Bokowski, IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.provisional.swt;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.ObservableTracker;
-import org.eclipse.core.databinding.observable.list.IListChangeListener;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.ListChangeEvent;
-import org.eclipse.core.databinding.observable.list.ListDiffEntry;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * @since 1.1
- *
- */
-public abstract class CompositeUpdater {
-
- private class UpdateRunnable implements Runnable, IChangeListener {
- private Widget widget;
- Object element;
-
- private boolean dirty = true;
-
- private IObservable[] dependencies = new IObservable[0];
-
- UpdateRunnable(Widget widget, Object element) {
- this.widget = widget;
- this.element = element;
- }
-
- // Runnable implementation. This method runs at most once per repaint
- // whenever the
- // value gets marked as dirty.
- public void run() {
- if (theComposite != null && !theComposite.isDisposed()
- && widget != null && !widget.isDisposed()) {
- updateIfNecessary();
- }
- }
-
- private void updateIfNecessary() {
- if (dirty) {
- dependencies = ObservableTracker.runAndMonitor(new Runnable() {
- public void run() {
- updateWidget(widget, element);
- }
- }, this, null);
- dirty = false;
- }
- }
-
- // IChangeListener implementation (listening to any dependency)
- public void handleChange(ChangeEvent event) {
- // Whenever this updator becomes dirty, schedule the run() method
- makeDirty();
- }
-
- protected final void makeDirty() {
- if (!dirty) {
- dirty = true;
- stopListening();
- if (!theComposite.isDisposed()) {
- SWTUtil.runOnce(theComposite.getDisplay(), this);
- }
- }
- }
-
- private void stopListening() {
- // Stop listening for dependency changes
- for (int i = 0; i < dependencies.length; i++) {
- IObservable observable = dependencies[i];
-
- observable.removeChangeListener(this);
- }
- }
- }
-
- private class PrivateInterface implements DisposeListener,
- IListChangeListener {
-
- // DisposeListener implementation
- public void widgetDisposed(DisposeEvent e) {
- CompositeUpdater.this.dispose();
- }
-
- public void handleListChange(ListChangeEvent event) {
- ListDiffEntry[] diffs = event.diff.getDifferences();
- for (int i = 0; i < diffs.length; i++) {
- ListDiffEntry listDiffEntry = diffs[i];
- if (listDiffEntry.isAddition()) {
- Widget newChild = createWidget(listDiffEntry.getPosition());
- final UpdateRunnable updateRunnable = new UpdateRunnable(newChild, listDiffEntry
- .getElement());
- newChild.setData(updateRunnable);
- updateRunnable.updateIfNecessary();
- } else {
- theComposite.getChildren()[listDiffEntry.getPosition()]
- .dispose();
- }
- }
- theComposite.layout();
- }
-
- }
-
- private PrivateInterface privateInterface = new PrivateInterface();
-
- private Composite theComposite;
-
- private IObservableList model;
-
- /**
- * Creates an updater for the given control and list. For each element of
- * the list, a child widget of the composite will be created using
- * {@link #createWidget(int)}.
- *
- * @param toUpdate
- * composite to update
- * @param model
- * an observable list to track
- */
- public CompositeUpdater(Composite toUpdate, IObservableList model) {
- this.theComposite = toUpdate;
- this.model = model;
-
- model.addListChangeListener(privateInterface);
- theComposite.addDisposeListener(privateInterface);
- }
-
- /**
- * This is called automatically when the control is disposed. It may also be
- * called explicitly to remove this updator from the control. Subclasses
- * will normally extend this method to detach any listeners they attached in
- * their constructor.
- */
- public void dispose() {
- theComposite.removeDisposeListener(privateInterface);
- model.removeListChangeListener(privateInterface);
- }
-
- /**
- * Creates a new child widget for the target composite at the given index.
- *
- * <p>
- * Subclasses should implement this method to provide the code that creates
- * a child widget at a specific index. Note that
- * {@link #updateWidget(Widget, Object)} will be called after this method
- * returns. Only those properties of the widget that don't change over time
- * should be set in this method.
- * </p>
- *
- * @param index
- * the at which to create the widget
- * @return the widget
- */
- protected abstract Widget createWidget(int index);
-
- /**
- * Updates the given widget based on the element found in the model list.
- * This method will be invoked once after the widget is created, and once
- * before any repaint during which the control is visible and dirty.
- *
- * <p>
- * Subclasses should implement this method to provide any code that changes
- * the appearance of the widget.
- * </p>
- *
- * @param widget
- * the widget to update
- * @param element
- * the element associated with the widget
- */
- protected abstract void updateWidget(Widget widget, Object element);
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/ControlUpdater.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/ControlUpdater.java
deleted file mode 100644
index fa2b7b3..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/ControlUpdater.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.provisional.swt;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.ObservableTracker;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A ControlUpdater updates an SWT control in response to changes in the model.
- * By wrapping a block of code in a ControlUpdater, clients can rely on the fact
- * that the block of code will be re-executed whenever anything changes in the
- * model that might affect its behavior.
- *
- * <p>
- * ControlUpdaters only execute when their controls are visible. If something changes
- * in the model while the control is invisible, the updator is flagged as dirty and
- * the updator stops listening to the model until the next time the control repaints.
- * This saves CPU cycles by deferring UI updates to widgets that are currently invisible.
- * </p>
- *
- * <p>
- * Clients should subclass this when copying information from the model to
- * a control. Typical usage:
- * </p>
- *
- * <ul>
- * <li>Override updateControl. It should do whatever is necessary to display
- * the contents of the model in the control.</li>
- * <li>In the constructor, attach listeners to the model. The listeners should
- * call markDirty whenever anything changes in the model that affects
- * updateControl. Note: this step can be omitted when calling any method
- * tagged with "@TrackedGetter" since ControlUpdater will automatically attach
- * a listener to any object if a "@TrackedGetter" method is called in
- * updateControl.</li>
- * <li>(optional)Extend dispose() to remove any listeners attached in the constructor</li>
- * </ul>
- *
- * <p>
- * Example:
- * </p>
- *
- * <code>
- * // Displays an observable value in a label and keeps the label in synch with changes
- * // in the value.
- * IReadableValue someValue = ...
- * final Label myLabel = new Label(parent, SWT.NONE);
- * new ControlUpdater(myLabel) {
- * protected void updateControl() {
- * myLabel.setText(someValue.getValue().toString);
- * }
- * }
- * // myLabel will display the value of someValue the next time it repaints, and will automatically
- * // be updated whenever someValue changes and the label is visible
- * </code>
- *
- * @since 1.0
- */
-public abstract class ControlUpdater {
-
- private class PrivateInterface implements PaintListener,
- DisposeListener, Runnable, IChangeListener {
-
- // PaintListener implementation
- public void paintControl(PaintEvent e) {
- updateIfNecessary();
- }
-
- // DisposeListener implementation
- public void widgetDisposed(DisposeEvent e) {
- ControlUpdater.this.dispose();
- }
-
- // Runnable implementation. This method runs at most once per repaint whenever the
- // value gets marked as dirty.
- public void run() {
- if (theControl != null && !theControl.isDisposed() && theControl.isVisible()) {
- updateIfNecessary();
- }
- }
-
- // IChangeListener implementation (listening to the ComputedValue)
- public void handleChange(ChangeEvent event) {
- // Whenever this updator becomes dirty, schedule the run() method
- makeDirty();
- }
-
- }
-
- private Runnable updateRunnable = new Runnable() {
- public void run() {
- updateControl();
- }
- };
-
- private PrivateInterface privateInterface = new PrivateInterface();
- private Control theControl;
- private IObservable[] dependencies = new IObservable[0];
- private boolean dirty = false;
-
- /**
- * Creates an updator for the given control.
- *
- * @param toUpdate control to update
- */
- public ControlUpdater(Control toUpdate) {
- theControl = toUpdate;
-
- theControl.addDisposeListener(privateInterface);
- theControl.addPaintListener(privateInterface);
- makeDirty();
- }
-
- private void updateIfNecessary() {
- if (dirty) {
- dependencies = ObservableTracker.runAndMonitor(updateRunnable, privateInterface, null);
- dirty = false;
- }
- }
-
- /**
- * This is called automatically when the control is disposed. It may also
- * be called explicitly to remove this updator from the control. Subclasses
- * will normally extend this method to detach any listeners they attached
- * in their constructor.
- */
- public void dispose() {
- theControl.removeDisposeListener(privateInterface);
- theControl.removePaintListener(privateInterface);
-
- stopListening();
- }
-
- private void stopListening() {
- // Stop listening for dependency changes
- for (int i = 0; i < dependencies.length; i++) {
- IObservable observable = dependencies[i];
-
- observable.removeChangeListener(privateInterface);
- }
- }
-
- /**
- * Updates the control. This method will be invoked once after the
- * updator is created, and once before any repaint during which the
- * control is visible and dirty.
- *
- * <p>
- * Subclasses should overload this method to provide any code that
- * changes the appearance of the widget.
- * </p>
- */
- protected abstract void updateControl();
-
- /**
- * Marks this updator as dirty. Causes the updateControl method to
- * be invoked before the next time the control is repainted.
- */
- protected final void makeDirty() {
- if (!dirty) {
- dirty = true;
- stopListening();
- SWTUtil.runOnce(theControl.getDisplay(), privateInterface);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/MenuUpdater.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/MenuUpdater.java
deleted file mode 100644
index f614bae..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/MenuUpdater.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.provisional.swt;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.ObservableTracker;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * A MenuUpdater updates an SWT menu in response to changes in the model. By
- * wrapping a block of code in a MenuUpdater, clients can rely on the fact that
- * the block of code will be re-executed whenever anything changes in the model
- * that might affect its behavior.
- *
- * <p>
- * MenuUpdaters only execute once their menus are shown. If something changes in
- * the model, the updater is flagged as dirty and it stops listening to the
- * model until the next time the menu is shown. If the menu is visible while the
- * model changes, it will be updated right away.
- * </p>
- *
- * <p>
- * Clients should subclass this when copying information from the model to a
- * menu. Typical usage:
- * </p>
- *
- * <ul>
- * <li>Override updateMenu. It should do whatever is necessary to display the
- * contents of the model in the menu.</li>
- * <li>In the constructor, attach listeners to the model. The listeners should
- * call markDirty whenever anything changes in the model that affects
- * updateMenu. Note: this step can be omitted when calling any method tagged
- * with "@TrackedGetter" since MenuUpdater will automatically attach a listener
- * to any object if a "@TrackedGetter" method is called in updateMenu.</li>
- * <li>(optional)Extend dispose() to remove any listeners attached in the
- * constructor</li>
- * </ul>
- *
- * @since 1.1
- */
-public abstract class MenuUpdater {
-
- private class PrivateInterface implements MenuListener,
- DisposeListener, Runnable, IChangeListener {
-
- // DisposeListener implementation
- public void widgetDisposed(DisposeEvent e) {
- MenuUpdater.this.dispose();
- }
-
- // Runnable implementation. This method runs at most once per repaint whenever the
- // value gets marked as dirty.
- public void run() {
- if (theMenu != null && !theMenu.isDisposed() && theMenu.isVisible()) {
- updateIfNecessary();
- }
- }
-
- // IChangeListener implementation (listening to the ComputedValue)
- public void handleChange(ChangeEvent event) {
- // Whenever this updator becomes dirty, schedule the run() method
- makeDirty();
- }
-
- public void menuHidden(MenuEvent e) {
- // do nothing
- }
-
- public void menuShown(MenuEvent e) {
- updateIfNecessary();
- }
-
- }
-
- private Runnable updateRunnable = new Runnable() {
- public void run() {
- updateMenu();
- }
- };
-
- private PrivateInterface privateInterface = new PrivateInterface();
- private Menu theMenu;
- private IObservable[] dependencies = new IObservable[0];
- private boolean dirty = false;
-
- /**
- * Creates an updator for the given menu.
- *
- * @param toUpdate menu to update
- */
- public MenuUpdater(Menu toUpdate) {
- theMenu = toUpdate;
-
- theMenu.addDisposeListener(privateInterface);
- theMenu.addMenuListener(privateInterface);
- makeDirty();
- }
-
- private void updateIfNecessary() {
- if (dirty) {
- dependencies = ObservableTracker.runAndMonitor(updateRunnable, privateInterface, null);
- dirty = false;
- }
- }
-
- /**
- * This is called automatically when the menu is disposed. It may also
- * be called explicitly to remove this updator from the menu. Subclasses
- * will normally extend this method to detach any listeners they attached
- * in their constructor.
- */
- public void dispose() {
- theMenu.removeDisposeListener(privateInterface);
- theMenu.removeMenuListener(privateInterface);
-
- stopListening();
- }
-
- private void stopListening() {
- // Stop listening for dependency changes
- for (int i = 0; i < dependencies.length; i++) {
- IObservable observable = dependencies[i];
-
- observable.removeChangeListener(privateInterface);
- }
- }
-
- /**
- * Updates the menu. This method will be invoked once after the
- * updater is created, and once for any SWT.Show event if this
- * updater is marked as dirty at that time.
- *
- * <p>
- * Subclasses should overload this method to provide any code that
- * udates the menu.
- * </p>
- */
- protected abstract void updateMenu();
-
- /**
- * Marks this updator as dirty. Causes the updateControl method to
- * be invoked before the next time the control is repainted.
- */
- protected final void makeDirty() {
- if (!dirty) {
- dirty = true;
- stopListening();
- SWTUtil.runOnce(theMenu.getDisplay(), privateInterface);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/SWTUtil.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/SWTUtil.java
deleted file mode 100644
index b0c2512..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/SWTUtil.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jface.internal.databinding.provisional.swt;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 1.0
- */
-public class SWTUtil {
- /**
- * Stores a work queue for each display
- */
- private static Map mapDisplayOntoWorkQueue = new HashMap();
-
- private SWTUtil() {
- }
-
- /**
- * Runs the given runnable on the given display as soon as possible. If
- * possible, the runnable will be executed before the next widget is
- * repainted, but this behavior is not guaranteed. Use this method to
- * schedule work will affect the way one or more widgets are drawn.
- *
- * <p>
- * This is threadsafe.
- * </p>
- *
- * @param d
- * display
- * @param r
- * runnable to execute in the UI thread.
- */
- public static void greedyExec(Display d, Runnable r) {
- if (d.isDisposed()) {
- return;
- }
-
- // if (Display.getCurrent() == d) {
- // r.run();
- // } else {
- WorkQueue queue = getQueueFor(d);
- queue.asyncExec(r);
- // }
- }
-
- /**
- * Runs the given runnable on the given display as soon as possible. Unlike
- * greedyExec, this has no effect if the given runnable has already been
- * scheduled for execution. Use this method to schedule work that will
- * affect the way one or more wigdets are drawn, but that should only happen
- * once.
- *
- * <p>
- * This is threadsafe.
- * </p>
- *
- * @param d
- * display
- * @param r
- * runnable to execute in the UI thread. Has no effect if the
- * given runnable has already been scheduled but has not yet run.
- */
- public static void runOnce(Display d, Runnable r) {
- if (d.isDisposed()) {
- return;
- }
- WorkQueue queue = getQueueFor(d);
- queue.runOnce(r);
- }
-
- /**
- * Cancels a greedyExec or runOnce that was previously scheduled on the
- * given display. Has no effect if the given runnable is not in the queue
- * for the given display
- *
- * @param d
- * target display
- * @param r
- * runnable to execute
- */
- public static void cancelExec(Display d, Runnable r) {
- if (d.isDisposed()) {
- return;
- }
- WorkQueue queue = getQueueFor(d);
- queue.cancelExec(r);
- }
-
- /**
- * Returns the work queue for the given display. Creates a work queue if
- * none exists yet.
- *
- * @param d
- * display to return queue for
- * @return a work queue (never null)
- */
- private static WorkQueue getQueueFor(final Display d) {
- WorkQueue result;
- synchronized (mapDisplayOntoWorkQueue) {
- // Look for existing queue
- result = (WorkQueue) mapDisplayOntoWorkQueue.get(d);
-
- if (result == null) {
- // If none, create new queue
- result = new WorkQueue(d);
- final WorkQueue q = result;
- mapDisplayOntoWorkQueue.put(d, result);
- d.asyncExec(new Runnable() {
- public void run() {
- d.disposeExec(new Runnable() {
- public void run() {
- synchronized (mapDisplayOntoWorkQueue) {
- q.cancelAll();
- mapDisplayOntoWorkQueue.remove(d);
- }
- }
- });
- }
- });
- }
- return result;
- }
- }
-
- /**
- * @param rgb1
- * @param rgb2
- * @param ratio
- * @return the RGB object
- */
- public static RGB mix(RGB rgb1, RGB rgb2, double ratio) {
- return new RGB(interp(rgb1.red, rgb2.red, ratio),
- interp(rgb1.green, rgb2.green, ratio),
- interp(rgb1.blue, rgb2.blue, ratio));
- }
-
- private static int interp(int i1, int i2, double ratio) {
- int result = (int)(i1 * ratio + i2 * (1.0d - ratio));
- if (result < 0) result = 0;
- if (result > 255) result = 255;
- return result;
- }
-
- /**
- * Logs an exception as though it was thrown by a SafeRunnable
- * being run with the default ISafeRunnableRunner. Will not
- * open modal dialogs or spin the event loop.
- *
- * @param t throwable to log
- */
- public static void logException(final Exception t) {
- SafeRunnable.run(new SafeRunnable() {
- public void run() throws Exception {
- throw t;
- }
- public void handleException(Throwable e) {
- // IMPORTANT: Do not call the super implementation, since
- // it opens a modal dialog, and may cause *syncExecs to run
- // too early.
- }
- });
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/TableUpdater.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/TableUpdater.java
deleted file mode 100644
index a72372b..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/TableUpdater.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.provisional.swt;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.ObservableTracker;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * @since 1.1
- *
- */
-public abstract class TableUpdater {
-
- private class UpdateRunnable implements Runnable, IChangeListener,
- DisposeListener {
- private TableItem item;
-
- private boolean dirty = false;
-
- private IObservable[] dependencies = new IObservable[0];
-
- UpdateRunnable(TableItem item) {
- this.item = item;
- item.addDisposeListener(this);
- }
-
- // Runnable implementation. This method runs at most once per repaint
- // whenever the
- // value gets marked as dirty.
- public void run() {
- if (theTable != null && !theTable.isDisposed() && item != null && !item.isDisposed()) {
- if (theTable.isVisible()) {
- int tableHeight = theTable.getClientArea().height;
- int numVisibleItems = tableHeight / theTable.getItemHeight();
- int indexOfItem = theTable.indexOf(item);
- int topIndex = theTable.getTopIndex();
- if (indexOfItem >= topIndex && indexOfItem <= topIndex+numVisibleItems) {
- updateIfNecessary();
- return;
- }
- }
- theTable.clear(theTable.indexOf(item));
- }
- }
-
- private void updateIfNecessary() {
- if (dirty) {
- dependencies = ObservableTracker.runAndMonitor(new Runnable() {
- public void run() {
- updateItem(item);
- }
- }, this, null);
- dirty = false;
- }
- }
-
- // IChangeListener implementation (listening to the ComputedValue)
- public void handleChange(ChangeEvent event) {
- // Whenever this updator becomes dirty, schedule the run() method
- makeDirty();
- }
-
- protected final void makeDirty() {
- if (!dirty) {
- dirty = true;
- stopListening();
- SWTUtil.runOnce(theTable.getDisplay(), this);
- }
- }
-
- private void stopListening() {
- // Stop listening for dependency changes
- for (int i = 0; i < dependencies.length; i++) {
- IObservable observable = dependencies[i];
-
- observable.removeChangeListener(this);
- }
- }
-
- // DisposeListener implementation
- public void widgetDisposed(DisposeEvent e) {
- stopListening();
- dependencies = null;
- item = null;
- }
- }
-
- private class PrivateInterface implements Listener, DisposeListener {
-
- // Listener implementation
- public void handleEvent(Event e) {
- if (e.type == SWT.SetData) {
- UpdateRunnable runnable = (UpdateRunnable) e.item.getData();
- if (runnable == null) {
- runnable = new UpdateRunnable((TableItem) e.item);
- e.item.setData(runnable);
- runnable.makeDirty();
- } else {
- runnable.updateIfNecessary();
- }
- }
- }
-
- // DisposeListener implementation
- public void widgetDisposed(DisposeEvent e) {
- TableUpdater.this.dispose();
- }
-
- }
-
- private PrivateInterface privateInterface = new PrivateInterface();
-
- private Table theTable;
-
- /**
- * Creates an updator for the given control.
- *
- * @param toUpdate
- * table to update
- */
- public TableUpdater(Table toUpdate) {
- Assert.isLegal((toUpdate.getStyle() & SWT.VIRTUAL) != 0, "TableUpdater requires virtual table"); //$NON-NLS-1$
- theTable = toUpdate;
-
- theTable.addDisposeListener(privateInterface);
- theTable.addListener(SWT.SetData, privateInterface);
- }
-
- /**
- * This is called automatically when the control is disposed. It may also be
- * called explicitly to remove this updator from the control. Subclasses
- * will normally extend this method to detach any listeners they attached in
- * their constructor.
- */
- public void dispose() {
- theTable.removeDisposeListener(privateInterface);
- theTable.removeListener(SWT.SetData, privateInterface);
-
- }
-
- /**
- * Updates the control. This method will be invoked once after the updator
- * is created, and once before any repaint during which the control is
- * visible and dirty.
- *
- * <p>
- * Subclasses should overload this method to provide any code that changes
- * the appearance of the widget.
- * </p>
- * @param item the item to update
- */
- protected abstract void updateItem(TableItem item);
-
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/WorkQueue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/WorkQueue.java
deleted file mode 100644
index bb41096..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/WorkQueue.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jface.internal.databinding.provisional.swt;
-
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.Set;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * @since 3.2
- *
- */
-public class WorkQueue {
-
- private boolean updateScheduled = false;
-
- private boolean paintListenerAttached = false;
-
- private LinkedList pendingWork = new LinkedList();
-
- private Display d;
-
- private Set pendingWorkSet = new HashSet();
-
- private Runnable updateJob = new Runnable() {
- public void run() {
- doUpdate();
- updateScheduled = false;
- }
- };
-
- private Listener paintListener = new Listener() {
- public void handleEvent(Event event) {
- paintListenerAttached = false;
- d.removeFilter(SWT.Paint, this);
- doUpdate();
- }
- };
-
- /**
- * @param targetDisplay
- */
- public WorkQueue(Display targetDisplay) {
- d = targetDisplay;
- }
-
- private void doUpdate() {
- for (;;) {
- Runnable next;
- synchronized (pendingWork) {
- if (pendingWork.isEmpty()) {
- break;
- }
- next = (Runnable) pendingWork.removeFirst();
- pendingWorkSet.remove(next);
- }
-
- next.run();
- }
- }
-
- /**
- * Schedules some work to happen in the UI thread as soon as possible. If
- * possible, the work will happen before the next control redraws. The given
- * runnable will only be run once. Has no effect if this runnable has
- * already been queued for execution.
- *
- * @param work
- * runnable to execute
- */
- public void runOnce(Runnable work) {
- synchronized (pendingWork) {
- if (pendingWorkSet.contains(work)) {
- return;
- }
-
- pendingWorkSet.add(work);
-
- asyncExec(work);
- }
- }
-
- /**
- * Schedules some work to happen in the UI thread as soon as possible. If
- * possible, the work will happen before the next control redraws. Unlike
- * runOnce, calling asyncExec twice with the same runnable will cause that
- * runnable to run twice.
- *
- * @param work
- * runnable to execute
- */
- public void asyncExec(Runnable work) {
- synchronized (pendingWork) {
- pendingWork.add(work);
- if (!updateScheduled) {
- updateScheduled = true;
- d.asyncExec(updateJob);
- }
-
- // If we're in the UI thread, add an event filter to ensure
- // the work happens ASAP
- if (Display.getCurrent() == d) {
- if (!paintListenerAttached) {
- paintListenerAttached = true;
- d.addFilter(SWT.Paint, paintListener);
- }
- }
- }
- }
-
- /**
- * Cancels a previously-scheduled runnable. Has no effect if the given
- * runnable was not previously scheduled or has already executed.
- *
- * @param toCancel
- * runnable to cancel
- */
- public void cancelExec(Runnable toCancel) {
- synchronized (pendingWork) {
- pendingWork.remove(toCancel);
- pendingWorkSet.remove(toCancel);
- }
- }
-
- /**
- * Cancels all pending work.
- */
- public void cancelAll() {
- synchronized (pendingWork) {
- pendingWork.clear();
- pendingWorkSet.clear();
- }
- }
-}
diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/ViewerLabelProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/ViewerLabelProvider.java
deleted file mode 100644
index 46bbb72..0000000
--- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/ViewerLabelProvider.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.internal.databinding.provisional.viewers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jface.internal.databinding.provisional.swt.SWTUtil;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IViewerLabelProvider;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @since 1.0
- *
- */
-public class ViewerLabelProvider implements IViewerLabelProvider,
- ILabelProvider {
-
- private List listeners = new ArrayList();
-
- /**
- * Subclasses should override this method. They should not call the base
- * class implementation.
- */
- public void updateLabel(ViewerLabel label, Object element) {
- label.setText(element.toString());
- }
-
- protected final void fireChangeEvent(Collection changes) {
- final LabelProviderChangedEvent event = new LabelProviderChangedEvent(
- this, changes.toArray());
- ILabelProviderListener[] listenerArray = (ILabelProviderListener[]) listeners
- .toArray(new ILabelProviderListener[listeners.size()]);
- for (int i = 0; i < listenerArray.length; i++) {
- ILabelProviderListener listener = listenerArray[i];
- try {
- listener.labelProviderChanged(event);
- } catch (Exception e) {
- SWTUtil.logException(e);
- }
- }
- }
-
- public final Image getImage(Object element) {
- ViewerLabel label = new ViewerLabel("", null); //$NON-NLS-1$
- updateLabel(label, element);
- return label.getImage();
- }
-
- public final String getText(Object element) {
- ViewerLabel label = new ViewerLabel("", null); //$NON-NLS-1$
- updateLabel(label, element);
- return label.getText();
- }
-
- public void addListener(ILabelProviderListener listener) {
- listeners.add(listener);
- }
-
- public void dispose() {
- listeners.clear();
- }
-
- public final boolean isLabelProperty(Object element, String property) {
- return true;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- listeners.remove(listener);
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/.classpath b/examples/org.eclipse.jface.examples.databinding/.classpath
deleted file mode 100644
index d512f63..0000000
--- a/examples/org.eclipse.jface.examples.databinding/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/executionEnvironments/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.jface.examples.databinding/.cvsignore b/examples/org.eclipse.jface.examples.databinding/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/examples/org.eclipse.jface.examples.databinding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/examples/org.eclipse.jface.examples.databinding/.project b/examples/org.eclipse.jface.examples.databinding/.project
deleted file mode 100644
index 0ccc228..0000000
--- a/examples/org.eclipse.jface.examples.databinding/.project
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jface.examples.databinding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2b83041..0000000
--- a/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,71 +0,0 @@
-#Wed Jan 17 09:10:34 EST 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.jdt.ui.prefs b/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 846d8bf..0000000
--- a/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Thu Aug 24 15:24:48 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.javadoc=true
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) ${year} IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * IBM Corporation - initial API and implementation\n ******************************************************************************/\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @since 3.2\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template></templates>
diff --git a/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.pde.prefs b/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 9ad123f..0000000
--- a/examples/org.eclipse.jface.examples.databinding/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Tue Oct 18 13:46:33 EDT 2005
-compilers.p.deprecated=0
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/examples/org.eclipse.jface.examples.databinding/META-INF/MANIFEST.MF b/examples/org.eclipse.jface.examples.databinding/META-INF/MANIFEST.MF
deleted file mode 100644
index 842cd38..0000000
--- a/examples/org.eclipse.jface.examples.databinding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jface.examples.databinding
-Bundle-Version: 1.0.100.qualifier
-Bundle-ClassPath: .
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jface,
- org.eclipse.core.databinding,
- org.eclipse.core.runtime,
- org.eclipse.core.databinding.beans,
- org.eclipse.jface.databinding
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.jface.examples.databinding;x-internal:=false,
- org.eclipse.jface.examples.databinding.mask;x-internal:=false,
- org.eclipse.jface.examples.databinding.mask.internal;x-internal:=true,
- org.eclipse.jface.examples.databinding.model;x-internal:=false,
- org.eclipse.jface.examples.databinding.radioGroup;x-internal:=false
-Import-Package: com.ibm.icu.text
diff --git a/examples/org.eclipse.jface.examples.databinding/about.html b/examples/org.eclipse.jface.examples.databinding/about.html
deleted file mode 100644
index 4602330..0000000
--- a/examples/org.eclipse.jface.examples.databinding/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/examples/org.eclipse.jface.examples.databinding/build.properties b/examples/org.eclipse.jface.examples.databinding/build.properties
deleted file mode 100644
index 72c23de..0000000
--- a/examples/org.eclipse.jface.examples.databinding/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2006 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = .,\
- META-INF/,\
- plugin.properties,\
- about.html
-output.databindingexamples.jar = bin/
-src.includes = about.html
-source.. = src/
diff --git a/examples/org.eclipse.jface.examples.databinding/plugin.properties b/examples/org.eclipse.jface.examples.databinding/plugin.properties
deleted file mode 100644
index 759e715..0000000
--- a/examples/org.eclipse.jface.examples.databinding/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName = JFace Data Binding Examples
-providerName = Eclipse.org
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ModelObject.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ModelObject.java
deleted file mode 100644
index 3e2acf3..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ModelObject.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-public class ModelObject {
- private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
- this);
- private String id;
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(propertyName,
- listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue,
- newValue);
- }
-
- protected void firePropertyChange(String propertyName, int oldValue,
- int newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue,
- newValue);
- }
-
- protected void firePropertyChange(String propertyName, boolean oldValue,
- boolean newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue,
- newValue);
- }
-
- public void setId(String string) {
- Object oldValue = id;
- id = string;
- firePropertyChange("id", oldValue, id);
- }
-
- protected Object[] append(Object[] array, Object object) {
- List newList = new ArrayList(Arrays.asList(array));
- newList.add(object);
- return newList.toArray((Object[]) Array.newInstance(array.getClass()
- .getComponentType(), newList.size()));
- }
-
- protected Object[] remove(Object[] array, Object object) {
- List newList = new ArrayList(Arrays.asList(array));
- newList.remove(object);
- return newList.toArray((Object[]) Array.newInstance(array.getClass()
- .getComponentType(), newList.size()));
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/AsynchronousTestSet.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/AsynchronousTestSet.java
deleted file mode 100644
index 9669115..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/AsynchronousTestSet.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.contentprovider.test;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Random;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.set.ObservableSet;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Test set that simulates asynchronously computed elements. The elements of the
- * set are randomly generated Integers. Whenever the "recompute" method is
- * called, the set will spin off a job that sleeps for a period of time and then
- * randomly adds and removes elements from the set.
- *
- * <p>
- * This simulates a set that wraps a database query or network communication.
- * These would follow the same pattern (report the set as "stale", perform some
- * slow operation, then make changes to the set).
- * </p>
- *
- * @since 1.0
- */
-public class AsynchronousTestSet extends ObservableSet {
-
- private static Random randomNumberGenerator = new Random();
-
- private Display display;
-
- private boolean stale = false;
-
- /**
- * Average number of elements to add or remove
- */
- private static final int AVERAGE_DELTA = 4;
-
- /**
- * Average "computation" time -- time taken to do the simulated work (ms)
- */
- private static final int AVERAGE_BUSY_TIME = 1000;
-
- /**
- * List of all undisposed AsynchronousTestSet instances. Used for the
- * recomputeAll method.
- */
- private static List allSets = new ArrayList();
-
- public AsynchronousTestSet() {
- super(new HashSet(), Object.class);
- display = Display.getCurrent();
- if (display == null) {
- throw new IllegalStateException(
- "This object can only be created in the UI thread"); //$NON-NLS-1$
- }
- recompute();
- }
-
- protected void firstListenerAdded() {
- super.firstListenerAdded();
- allSets.add(this);
- }
-
- protected void lastListenerRemoved() {
- allSets.remove(this);
- super.lastListenerRemoved();
- }
-
- public static void recomputeAll() {
- for (Iterator iter = allSets.iterator(); iter.hasNext();) {
- AsynchronousTestSet next = (AsynchronousTestSet) iter.next();
-
- next.recompute();
- }
- }
-
- public void remove(Collection toRemove) {
- HashSet removed = new HashSet();
- removed.addAll(toRemove);
- removed.retainAll(wrappedSet);
-
- wrappedSet.removeAll(removed);
- fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, removed));
- }
-
- public boolean isStale() {
- return stale;
- }
-
- public void recompute() {
- if (!isStale()) {
- setStale(true);
- final int sleepTime = (int) (randomNumberGenerator.nextDouble() * (AVERAGE_BUSY_TIME * 2));
- Thread newThread = new Thread(new Runnable() {
- public void run() {
-
- // Simulate work by sleeping
- try {
- Thread.sleep(sleepTime);
- } catch (InterruptedException e) {
- }
-
- // Add and remove some elements -- important: fire all
- // events in the UI thread
- display.asyncExec(new Runnable() {
- public void run() {
- final HashSet toAdd = new HashSet();
- final HashSet toRemove = new HashSet();
-
- // Compute elements to add and remove (basically
- // just fills the toAdd
- // and toRemove sets with random elements)
- int delta = (randomNumberGenerator
- .nextInt(AVERAGE_DELTA * 4) - AVERAGE_DELTA * 2);
- int extraAdds = randomNumberGenerator
- .nextInt(AVERAGE_DELTA);
- int addCount = delta + extraAdds;
- int removeCount = -delta + extraAdds;
-
- if (addCount > 0) {
- for (int i = 0; i < addCount; i++) {
- toAdd.add(new Integer(randomNumberGenerator
- .nextInt(20)));
- }
- }
-
- if (removeCount > 0) {
- Iterator oldElements = wrappedSet.iterator();
- for (int i = 0; i < removeCount
- && oldElements.hasNext(); i++) {
- toRemove.add(oldElements.next());
- }
- }
-
- toAdd.removeAll(wrappedSet);
- wrappedSet.addAll(toAdd);
- wrappedSet.removeAll(toRemove);
-
- setStale(false);
- fireSetChange(Diffs.createSetDiff(toAdd, toRemove));
- }
- });
- }
- });
-
- newThread.start();
- }
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/LabelProviderTest.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/LabelProviderTest.java
deleted file mode 100644
index 736f7b5..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/LabelProviderTest.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.contentprovider.test;
-
-import java.util.Collections;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.set.WritableSet;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ListeningLabelProvider;
-import org.eclipse.jface.databinding.viewers.ObservableSetContentProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.layout.LayoutConstants;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Tests UpdatableTreeContentProvider and DirtyIndicationLabelProvider. Creates
- * a tree containing three randomly-generated sets of integers, and one node
- * that contains the union of the other sets.
- *
- * @since 1.0
- */
-public class LabelProviderTest {
-
- private Shell shell;
-
- private ListViewer list;
-
- private WritableSet setOfRenamables;
-
- private Button addButton;
-
- private Button removeButton;
-
- private Button renameButton;
-
- private SelectionListener buttonSelectionListener = new SelectionAdapter() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- Button pressed = (Button) e.widget;
- if (pressed == addButton) {
- setOfRenamables.add(new RenamableItem());
- } else if (pressed == removeButton) {
- setOfRenamables.remove(getCurrentSelection());
- } else if (pressed == renameButton) {
- rename(getCurrentSelection());
- }
-
- super.widgetSelected(e);
- }
- };
-
- private IObservableValue selectedRenamable;
-
- /**
- *
- */
- public LabelProviderTest() {
-
- // Create shell
- shell = new Shell(Display.getCurrent());
- { // Initialize shell
- setOfRenamables = new WritableSet();
-
- list = new ListViewer(shell);
- ObservableSetContentProvider contentProvider = new ObservableSetContentProvider();
- list.setContentProvider(contentProvider);
- list.setLabelProvider(new ListeningLabelProvider(contentProvider
- .getKnownElements()) {
- RenamableItem.Listener listener = new RenamableItem.Listener() {
- public void handleChanged(RenamableItem item) {
- fireChangeEvent(Collections.singleton(item));
- }
- };
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.databinding.viewers.ViewerLabelProvider#updateLabel(org.eclipse.jface.viewers.ViewerLabel,
- * java.lang.Object)
- */
- public void updateLabel(ViewerLabel label, Object element) {
- if (element instanceof RenamableItem) {
- RenamableItem item = (RenamableItem) element;
-
- label.setText(item.getName());
- }
- }
-
- protected void addListenerTo(Object next) {
- RenamableItem item = (RenamableItem) next;
-
- item.addListener(listener);
- }
-
- protected void removeListenerFrom(Object next) {
- RenamableItem item = (RenamableItem) next;
-
- item.removeListener(listener);
- }
- });
- list.setInput(setOfRenamables);
-
- selectedRenamable = ViewersObservables.observeSingleSelection(list);
-
- Composite buttonBar = new Composite(shell, SWT.NONE);
- { // Initialize buttonBar
- addButton = new Button(buttonBar, SWT.PUSH);
- addButton.setText("Add"); //$NON-NLS-1$
- addButton.addSelectionListener(buttonSelectionListener);
- removeButton = new Button(buttonBar, SWT.PUSH);
- removeButton.addSelectionListener(buttonSelectionListener);
- removeButton.setText("Remove"); //$NON-NLS-1$
- renameButton = new Button(buttonBar, SWT.PUSH);
- renameButton.addSelectionListener(buttonSelectionListener);
- renameButton.setText("Rename"); //$NON-NLS-1$
-
- selectedRenamable
- .addValueChangeListener(new IValueChangeListener() {
- public void handleValueChange(ValueChangeEvent event) {
- boolean shouldEnable = selectedRenamable
- .getValue() != null;
- removeButton.setEnabled(shouldEnable);
- renameButton.setEnabled(shouldEnable);
- }
- });
- removeButton.setEnabled(false);
- renameButton.setEnabled(false);
-
- GridLayoutFactory.fillDefaults().generateLayout(buttonBar);
- }
-
- }
- GridLayoutFactory.fillDefaults().numColumns(2).margins(
- LayoutConstants.getMargins()).generateLayout(shell);
- }
-
- /**
- * @param currentSelection
- */
- protected void rename(final RenamableItem currentSelection) {
- InputDialog inputDialog = new InputDialog(
- shell,
- "Edit name", "Enter the new item name", currentSelection.getName(), null); //$NON-NLS-1$ //$NON-NLS-2$
- if (Window.OK == inputDialog.open()) {
- currentSelection.setName(inputDialog.getValue());
- }
- }
-
- /**
- * @return
- */
- protected RenamableItem getCurrentSelection() {
- return (RenamableItem) selectedRenamable.getValue();
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- final Display display = Display.getDefault();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
-
- public void run() {
- LabelProviderTest test = new LabelProviderTest();
- Shell s = test.getShell();
- s.pack();
- s.setVisible(true);
-
- while (!s.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- }
- });
- display.dispose();
- }
-
- private Shell getShell() {
- return shell;
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/LabelProviderTest2.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/LabelProviderTest2.java
deleted file mode 100644
index 3089982..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/LabelProviderTest2.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.contentprovider.test;
-
-import java.util.Collections;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ListeningLabelProvider;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.layout.LayoutConstants;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Tests UpdatableTreeContentProvider and DirtyIndicationLabelProvider. Creates
- * a tree containing three randomly-generated sets of integers, and one node
- * that contains the union of the other sets.
- *
- * @since 1.0
- */
-public class LabelProviderTest2 {
-
- private Shell shell;
-
- private ListViewer list;
-
- private WritableList listOfRenamables;
-
- private Button addButton;
-
- private Button removeButton;
-
- private Button renameButton;
-
- private SelectionListener buttonSelectionListener = new SelectionAdapter() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- Button pressed = (Button) e.widget;
- if (pressed == addButton) {
- listOfRenamables.add(new RenamableItem());
- } else if (pressed == removeButton) {
- listOfRenamables.remove(getCurrentSelection());
- } else if (pressed == renameButton) {
- rename(getCurrentSelection());
- }
-
- super.widgetSelected(e);
- }
- };
-
- private IObservableValue selectedRenamable;
-
- /**
- *
- */
- public LabelProviderTest2() {
-
- // Create shell
- shell = new Shell(Display.getCurrent());
- { // Initialize shell
- listOfRenamables = new WritableList();
-
- list = new ListViewer(shell);
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
- list.setContentProvider(contentProvider);
- list.setLabelProvider(new ListeningLabelProvider(contentProvider
- .getKnownElements()) {
- RenamableItem.Listener listener = new RenamableItem.Listener() {
- public void handleChanged(RenamableItem item) {
- fireChangeEvent(Collections.singleton(item));
- }
- };
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.databinding.viewers.ViewerLabelProvider#updateLabel(org.eclipse.jface.viewers.ViewerLabel,
- * java.lang.Object)
- */
- public void updateLabel(ViewerLabel label, Object element) {
- if (element instanceof RenamableItem) {
- RenamableItem item = (RenamableItem) element;
-
- label.setText(item.getName());
- }
- }
-
- protected void addListenerTo(Object next) {
- RenamableItem item = (RenamableItem) next;
-
- item.addListener(listener);
- }
-
- protected void removeListenerFrom(Object next) {
- RenamableItem item = (RenamableItem) next;
-
- item.removeListener(listener);
- }
- });
- list.setInput(listOfRenamables);
-
- selectedRenamable = ViewersObservables.observeSingleSelection(list);
-
- Composite buttonBar = new Composite(shell, SWT.NONE);
- { // Initialize buttonBar
- addButton = new Button(buttonBar, SWT.PUSH);
- addButton.setText("Add"); //$NON-NLS-1$
- addButton.addSelectionListener(buttonSelectionListener);
- removeButton = new Button(buttonBar, SWT.PUSH);
- removeButton.addSelectionListener(buttonSelectionListener);
- removeButton.setText("Remove"); //$NON-NLS-1$
- renameButton = new Button(buttonBar, SWT.PUSH);
- renameButton.addSelectionListener(buttonSelectionListener);
- renameButton.setText("Rename"); //$NON-NLS-1$
-
- selectedRenamable
- .addValueChangeListener(new IValueChangeListener() {
- public void handleValueChange(ValueChangeEvent event) {
- boolean shouldEnable = selectedRenamable
- .getValue() != null;
- removeButton.setEnabled(shouldEnable);
- renameButton.setEnabled(shouldEnable);
- }
- });
- removeButton.setEnabled(false);
- renameButton.setEnabled(false);
-
- GridLayoutFactory.fillDefaults().generateLayout(buttonBar);
- }
-
- }
- GridLayoutFactory.fillDefaults().numColumns(2).margins(
- LayoutConstants.getMargins()).generateLayout(shell);
- }
-
- /**
- * @param currentSelection
- */
- protected void rename(final RenamableItem currentSelection) {
- InputDialog inputDialog = new InputDialog(
- shell,
- "Edit name", "Enter the new item name", currentSelection.getName(), null); //$NON-NLS-1$ //$NON-NLS-2$
- if (Window.OK == inputDialog.open()) {
- currentSelection.setName(inputDialog.getValue());
- }
- }
-
- /**
- * @return
- */
- protected RenamableItem getCurrentSelection() {
- return (RenamableItem) selectedRenamable.getValue();
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- final Display display = Display.getDefault();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- LabelProviderTest2 test = new LabelProviderTest2();
- Shell s = test.getShell();
- s.pack();
- s.setVisible(true);
-
- while (!s.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- }
- });
- display.dispose();
- }
-
- private Shell getShell() {
- return shell;
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/RenamableItem.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/RenamableItem.java
deleted file mode 100644
index 970b061..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/RenamableItem.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.contentprovider.test;
-
-import java.util.ArrayList;
-
-/**
- * @since 1.0
- *
- */
-public class RenamableItem {
-
- public static interface Listener {
- public void handleChanged(RenamableItem item);
- }
-
- private String name;
- private ArrayList listeners = new ArrayList();
-
- public RenamableItem() {
- name = "RenamableItem"; //$NON-NLS-1$
- }
-
- public void addListener(Listener listener) {
- listeners.add(listener);
- }
-
- public void removeListener(Listener toRemove) {
- listeners.remove(toRemove);
- }
-
- public void setName(String newName) {
- this.name = newName;
-
- Listener[] l = (Listener[]) listeners.toArray(new Listener[listeners.size()]);
- for (int i = 0; i < l.length; i++) {
- l[i].handleChanged(this);
- }
- }
-
- public String getName() {
- return name;
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/SimpleNode.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/SimpleNode.java
deleted file mode 100644
index 7d34d94..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/SimpleNode.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.contentprovider.test;
-
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-
-
-/**
- * This object will be given randomly-generated children
- *
- * @since 1.0
- */
-public class SimpleNode {
- private String nodeName;
- private IObservableSet children;
-
- public SimpleNode(String nodeName, IObservableSet children) {
- super();
- this.nodeName = nodeName;
- this.children = children;
- }
-
- public String getNodeName() {
- return nodeName;
- }
-
- public IObservableSet getChildren() {
- return children;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/SomeMathFunction.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/SomeMathFunction.java
deleted file mode 100644
index 88ec454..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/SomeMathFunction.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.contentprovider.test;
-
-import java.util.Collections;
-import java.util.Set;
-
-import org.eclipse.core.databinding.observable.map.ComputedObservableMap;
-import org.eclipse.core.databinding.observable.map.MapDiff;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-
-/**
- * Simple function that performs one of three operations on Doubles:
- * <ul>
- * <li>Multiply by two</li>
- * <li>Round to nearest integer</li>
- * <li>Do nothing</li>
- * </ul>
- *
- * @since 1.0
- */
-public class SomeMathFunction extends ComputedObservableMap {
-
- /**
- *
- */
- public static final int OP_IDENTITY = 0;
-
- /**
- *
- */
- public static final int OP_MULTIPLY = 1;
-
- /**
- *
- */
- public static final int OP_ROUND = 2;
-
- private int op = OP_ROUND;
-
- /**
- * @param domain
- */
- public SomeMathFunction(IObservableSet domain) {
- super(domain);
- init();
- }
-
- /**
- * @param operation
- */
- public void setOperation(final int operation) {
- final int oldOp = this.op;
- this.op = operation;
-
- // Fire a change event. Changing the operation is going to affect every
- // answer returned by
- // this function, so include every element in the function domain in the
- // event.
- // If this was a change that would only affect a subset of elements, we
- // would include
- // the subset of affected elements rather than using
- // domain.toCollection()
- fireMapChange(new MapDiff() {
-
- public Set getAddedKeys() {
- return Collections.EMPTY_SET;
- }
-
- public Set getChangedKeys() {
- return keySet();
- }
-
- public Object getNewValue(Object key) {
- return doComputeResult(key, operation);
- }
-
- public Object getOldValue(Object key) {
- return doComputeResult(key, oldOp);
- }
-
- public Set getRemovedKeys() {
- return Collections.EMPTY_SET;
- }
- });
- }
-
- private Object doComputeResult(Object element, int op) {
- switch (op) {
- case OP_IDENTITY:
- return element;
- case OP_MULTIPLY:
- return new Double((((Double) element).doubleValue() * 2.0));
- case OP_ROUND:
- return new Double(Math.floor((((Double) element).doubleValue())));
- }
- return element;
- }
-
- protected Object doGet(Object key) {
- return doComputeResult(key, this.op);
- }
-
- protected Object doPut(Object key, Object value) {
- throw new UnsupportedOperationException();
- }
-
- protected void hookListener(Object addedKey) {
- // ignore, no need to listen to immutable Double objects
- }
-
- protected void unhookListener(Object removedKey) {
- // ignore, no need to listen to immutable Double objects
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/StructuredContentProviderTest.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/StructuredContentProviderTest.java
deleted file mode 100644
index 20efc8e..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/StructuredContentProviderTest.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.contentprovider.test;
-
-import java.util.Iterator;
-import java.util.Random;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.set.MappedSet;
-import org.eclipse.core.databinding.observable.set.WritableSet;
-import org.eclipse.core.databinding.observable.value.ComputedValue;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableSetContentProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.internal.databinding.provisional.swt.ControlUpdater;
-import org.eclipse.jface.internal.databinding.provisional.viewers.ViewerLabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Tests UpdatableSetContentProvider, ComputableValue, ControlUpdator,
- * UpdatableFunction, and ConvertingSet.
- *
- * <p>
- * This test displays a dialog with user-editable list of Doubles. It allows the
- * user to select a math function to apply to the set, and displays the result
- * in a new list. A line of text along the bottom of the dialog displays the sum
- * of the elements from the transformed set. Although this dialog is rather
- * silly, it is a good example of a dialog where a lot of things can change from
- * many directions.
- * </p>
- *
- * <p>
- * An UpdatableSetContentProvider is used to supply the contents each
- * ListViewer. ControlUpdators
- *
- * </p>
- *
- * @since 1.0
- */
-public class StructuredContentProviderTest {
-
- private static Realm realm;
-
- /**
- * Top-level shell for the dialog
- */
- private Shell shell;
-
- /**
- * Random number stream. Used for the "add" button.
- */
- protected Random random = new Random();
-
- // Data model ////////////////////////////////////////////////////////
-
- /**
- * inputSet stores a set of Doubles. The user is allowed to add and remove
- * Doubles from this set.
- */
- private WritableSet inputSet;
-
- /**
- * currentFunction is an Integer, set to one of the SomeMathFunction.OP_*
- * constants. It identifies which function will be applied to inputSet.
- */
- private WritableValue currentFunction;
-
- /**
- * mathFunction is the transformation. It can multiply by 2, round down to
- * the nearest integer, or do nothing (identity)
- */
- private SomeMathFunction mathFunction;
-
- /**
- * Set of Doubles. Holds the result of applying mathFunction to the
- * inputSet.
- */
- private MappedSet outputSet;
-
- /**
- * A Double. Stores the sum of the Doubles in outputSet
- */
- private IObservableValue sumOfOutputSet;
-
- /**
- * Creates the test dialog as a top-level shell.
- */
- public StructuredContentProviderTest() {
-
- // Initialize the data model
- createDataModel();
-
- shell = new Shell(Display.getCurrent(), SWT.SHELL_TRIM);
- { // Initialize shell
- final Label someDoubles = new Label(shell, SWT.NONE);
- someDoubles.setText("A list of random Doubles"); //$NON-NLS-1$
- someDoubles.setLayoutData(new GridData(
- GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL));
-
- Control addRemoveComposite = createInputControl(shell, inputSet);
-
- GridData addRemoveData = new GridData(GridData.FILL_BOTH);
- addRemoveData.minimumHeight = 1;
- addRemoveData.minimumWidth = 1;
-
- addRemoveComposite.setLayoutData(addRemoveData);
-
- Group operation = new Group(shell, SWT.NONE);
- { // Initialize operation group
- operation.setText("Select transformation"); //$NON-NLS-1$
-
- createRadioButton(operation, currentFunction, "f(x) = x", //$NON-NLS-1$
- new Integer(SomeMathFunction.OP_IDENTITY));
- createRadioButton(operation, currentFunction, "f(x) = 2 * x", //$NON-NLS-1$
- new Integer(SomeMathFunction.OP_MULTIPLY));
- createRadioButton(operation, currentFunction,
- "f(x) = floor(x)", new Integer( //$NON-NLS-1$
- SomeMathFunction.OP_ROUND));
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- operation.setLayout(layout);
- }
- operation.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL));
-
- Control outputControl = createOutputComposite(shell);
- GridData outputData = new GridData(GridData.FILL_BOTH);
- outputData.minimumHeight = 1;
- outputData.minimumWidth = 1;
- outputData.widthHint = 300;
- outputData.heightHint = 150;
-
- outputControl.setLayoutData(outputData);
-
- final Label sumLabel = new Label(shell, SWT.NONE);
- new ControlUpdater(sumLabel) {
- protected void updateControl() {
- double sum = ((Double) sumOfOutputSet.getValue())
- .doubleValue();
- int size = outputSet.size();
-
- sumLabel.setText("The sum of the above " + size //$NON-NLS-1$
- + " doubles is " + sum); //$NON-NLS-1$
- }
- };
- sumLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL));
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- shell.setLayout(layout);
- }
-
- }
-
- /**
- * Create the updatables for this dialog
- */
- private void createDataModel() {
- // Initialize data model. We will create a user-editable set of Doubles.
- // The user can run
- // a transformation on this set and view the result in a list viewer.
-
- // inputSet will be a writable set of doubles. The user will add and
- // remove entries from this set
- // through the UI.
- inputSet = new WritableSet(realm);
-
- // currentFunction holds the ID currently selected function to apply to
- // elements in the inputSet.
- // We will allow the user to change the current function through a set
- // of radio buttons
- currentFunction = new WritableValue(realm, new Integer(
- SomeMathFunction.OP_MULTIPLY), null);
-
- // mathFunction implements the selected function
- mathFunction = new SomeMathFunction(inputSet);
- currentFunction.addValueChangeListener(new IValueChangeListener() {
- public void handleValueChange(ValueChangeEvent event) {
- mathFunction
- .setOperation(((Integer) currentFunction.getValue())
- .intValue());
- }
- });
- mathFunction.setOperation(((Integer) currentFunction.getValue())
- .intValue());
-
- // outputSet holds the result. It displays the result of applying the
- // currently-selected
- // function on all the elements in the input set.
- outputSet = new MappedSet(inputSet, mathFunction);
-
- // sumOfOutputSet stores the current sum of the the Doubles in the
- // output set
- sumOfOutputSet = new ComputedValue(realm) {
- protected Object calculate() {
- double sum = 0.0;
- for (Iterator iter = outputSet.iterator(); iter.hasNext();) {
- Double next = (Double) iter.next();
-
- sum += next.doubleValue();
- }
- return new Double(sum);
- }
- };
- }
-
- /**
- * Creates a radio button in the given parent composite. When selected, the
- * button will change the given SettableValue to the given value.
- *
- * @param parent
- * parent composite
- * @param model
- * SettableValue that will hold the value of the
- * currently-selected radio button
- * @param string
- * text to appear in the radio button
- * @param value
- * value of this radio button (SettableValue will hold this value
- * when the radio button is selected)
- */
- private void createRadioButton(Composite parent, final WritableValue model,
- String string, final Object value) {
- final Button button = new Button(parent, SWT.RADIO);
- button.setText(string);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- model.setValue(value);
- super.widgetSelected(e);
- }
- });
- new ControlUpdater(button) {
- protected void updateControl() {
- button.setSelection(model.getValue().equals(value));
- }
- };
- button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL));
- }
-
- private Control createOutputComposite(Composite parent) {
- ListViewer listOfInts = new ListViewer(parent, SWT.BORDER
- | SWT.V_SCROLL | SWT.H_SCROLL);
-
- listOfInts.setContentProvider(new ObservableSetContentProvider());
- listOfInts.setLabelProvider(new ViewerLabelProvider());
- listOfInts.setInput(outputSet);
- return listOfInts.getControl();
- }
-
- /**
- * Creates and returns a control that will allow the user to add and remove
- * Doubles from the given input set.
- *
- * @param parent
- * parent control
- * @param inputSet
- * input set
- * @return a newly created SWT control that displays Doubles from the input
- * set and allows the user to add and remove entries
- */
- private Control createInputControl(Composite parent,
- final WritableSet inputSet) {
- Composite addRemoveComposite = new Composite(parent, SWT.NONE);
- { // Initialize addRemoveComposite
- ListViewer listOfInts = new ListViewer(addRemoveComposite,
- SWT.BORDER);
-
- listOfInts.setContentProvider(new ObservableSetContentProvider());
- listOfInts.setLabelProvider(new ViewerLabelProvider());
- listOfInts.setInput(inputSet);
-
- final IObservableValue selectedInt = ViewersObservables.observeSingleSelection(listOfInts);
-
- GridData listData = new GridData(GridData.FILL_BOTH);
- listData.minimumHeight = 1;
- listData.minimumWidth = 1;
- listData.widthHint = 150;
- listData.heightHint = 150;
- listOfInts.getControl().setLayoutData(listData);
-
- Composite buttonBar = new Composite(addRemoveComposite, SWT.NONE);
- { // Initialize button bar
-
- Button add = new Button(buttonBar, SWT.PUSH);
- add.setText("Add"); //$NON-NLS-1$
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- inputSet.add(new Double(random.nextDouble() * 100.0));
- super.widgetSelected(e);
- }
- });
- add.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL));
-
- final Button remove = new Button(buttonBar, SWT.PUSH);
- remove.setText("Remove"); //$NON-NLS-1$
- // Enable the Remove button if and only if there is currently an
- // element selected.
- new ControlUpdater(remove) {
- protected void updateControl() {
- // This block demonstrates auto-listening.
- // When updateControl is running, the framework
- // remembers each
- // updatable that gets touched. Since we're calling
- // selectedInt.getValue()
- // here, this updator will be flagged as dependant on
- // selectedInt. This
- // means that whenever selectedInt changes, this block
- // of code will re-run
- // itself.
-
- // The result is that the remove button will recompute
- // its enablement
- // whenever the selection in the listbox changes, and it
- // was not necessary
- // to attach any listeners.
- remove.setEnabled(selectedInt.getValue() != null);
- }
- };
-
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- inputSet.remove(selectedInt.getValue());
- super.widgetSelected(e);
- }
- });
- remove.setLayoutData(new GridData(
- GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL));
-
- GridLayout buttonLayout = new GridLayout();
- buttonLayout.numColumns = 1;
- buttonBar.setLayout(buttonLayout);
-
- } // End button bar
- buttonBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_BEGINNING));
-
- GridLayout addRemoveLayout = new GridLayout();
- addRemoveLayout.numColumns = 2;
- addRemoveComposite.setLayout(addRemoveLayout);
- }
- return addRemoveComposite;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display display = Display.getDefault();
- realm = SWTObservables.getRealm(display);
- StructuredContentProviderTest test = new StructuredContentProviderTest();
- Shell s = test.getShell();
- s.pack();
- s.setVisible(true);
-
- while (!s.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
-
- private Shell getShell() {
- return shell;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/TreeContentProviderTest.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/TreeContentProviderTest.java
deleted file mode 100644
index 5f38985..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/TreeContentProviderTest.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.contentprovider.test;
-
-import org.eclipse.core.databinding.observable.Observables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.set.UnionSet;
-import org.eclipse.core.databinding.observable.set.WritableSet;
-import org.eclipse.core.internal.databinding.observable.tree.IUnorderedTreeProvider;
-import org.eclipse.core.internal.databinding.observable.tree.TreePath;
-import org.eclipse.jface.internal.databinding.internal.viewers.UnorderedTreeContentProvider;
-import org.eclipse.jface.internal.databinding.provisional.viewers.ViewerLabelProvider;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.layout.LayoutConstants;
-import org.eclipse.jface.viewers.IViewerLabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Tests UpdatableTreeContentProvider and DirtyIndicationLabelProvider.
- * Creates a tree containing three randomly-generated sets of integers,
- * and one node that contains the union of the other sets.
- *
- * @since 3.2
- */
-public class TreeContentProviderTest {
-
- private Shell shell;
- private TreeViewer tree;
-
- // Three randomly-generated sets of doubles
- private AsynchronousTestSet set1;
- private AsynchronousTestSet set2;
- private AsynchronousTestSet set3;
-
- // The union of the above three sets
- private UnionSet union;
- private Button randomize;
- public TreeContentProviderTest() {
-
- // Create the data model
- set1 = new AsynchronousTestSet();
- set2 = new AsynchronousTestSet();
- set3 = new AsynchronousTestSet();
-
- // A union of the above sets
- union = new UnionSet(new IObservableSet[] {set1, set2, set3});
-
- // Create shell
- shell = new Shell(Display.getCurrent());
-
- createTree();
-
- Composite buttonBar = new Composite(shell, SWT.NONE);
- {
- buttonBar.setLayout(new FillLayout(SWT.HORIZONTAL));
- randomize = new Button(buttonBar, SWT.PUSH);
- randomize.setText("Randomize");
- randomize.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- AsynchronousTestSet.recomputeAll();
- super.widgetSelected(e);
- }
- });
-
- GridLayoutFactory.fillDefaults().generateLayout(buttonBar);
- }
-
- GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()).generateLayout(shell);
-
- shell.addDisposeListener(new DisposeListener() {
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
- */
- public void widgetDisposed(DisposeEvent e) {
- dispose();
- }
- });
- }
-
- /**
- *
- */
- protected void dispose() {
- set1.dispose();
- set2.dispose();
- set3.dispose();
- union.dispose();
- }
-
- private void createTree() {
- // Create the tree provider. This provides the structure of the tree. This tree will
- // have an instance of RootNode as the root (which is really a placeholder), several
- // SimpleNodes as top-level nodes, and sets of randomly generated Doubles below each
- // SimpleNode.
- IUnorderedTreeProvider treeProvider = new IUnorderedTreeProvider() {
- public IObservableSet createChildSet(TreePath treePath) {
- // If the parent is the root node, return the union of some randomly-generated
- // nodes and some hardcoded nodes
- if (treePath.getSegmentCount()==0 || treePath.getLastSegment() == tree.getInput()) {
- // Set of hardcoded nodes
- WritableSet topElements = new WritableSet();
- topElements.add(new SimpleNode("Random Set 1", set1));
- topElements.add(new SimpleNode("Random Set 2", set2));
- topElements.add(new SimpleNode("Random Set 3", set3));
- topElements.add(new SimpleNode("Union of the other sets", union));
- return topElements;
- }
-
- // If the parent is a RandomChildrenNode, return a randomly-generated
- // set of Doubles for its children
- Object element = treePath.getLastSegment();
- if (element instanceof SimpleNode) {
- // We return a new DelegatingObservableSet in order to prevent the
- // original from being disposed.
- return Observables.proxyObservableSet(((SimpleNode)element).getChildren());
- }
-
- // Otherwise the node is a Double, which will have no children
- return null;
- }
-
- public Realm getRealm() {
- // TODO Auto-generated method stub
- return null;
- }
- };
-
- // Label provider for the tree
- IViewerLabelProvider labelProvider = new ViewerLabelProvider() {
- public void updateLabel(ViewerLabel label, Object element) {
- if (element instanceof SimpleNode) {
- SimpleNode node = (SimpleNode) element;
-
- label.setText(node.getNodeName());
- }
-
- if (element instanceof Integer) {
- Integer node = (Integer) element;
-
- label.setText("Integer " + node);
- }
- }
- };
-
- // Create tree viewer
- tree = new TreeViewer(shell, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-
- // UpdatableTreeContentProvider converts an ITreeProvider into a standard JFace content provider
- UnorderedTreeContentProvider contentProvider = new UnorderedTreeContentProvider(treeProvider,
- "pending...");
-
- tree.setContentProvider(contentProvider);
- tree.setLabelProvider(labelProvider);
-
- // For the ITreeProvider above, it doesn't matter what we select as the input.
- tree.setInput(new Object());
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display display = Display.getDefault();
- TreeContentProviderTest test = new TreeContentProviderTest();
- Shell s = test.getShell();
- s.pack();
- s.setVisible(true);
-
- while (!s.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
-
- private Shell getShell() {
- return shell;
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/DuckType.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/DuckType.java
deleted file mode 100644
index 031ac20..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/DuckType.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2005 db4objects Inc. http://www.db4o.com
- *
- * 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:
- * db4objects - Initial API and implementation
- */
-package org.eclipse.jface.examples.databinding.ducks;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-/**
- * DuckType. Implements Duck Typing for Java. ("If it walks like a duck,
- * quacks like a duck, it..."). Essentially allows programs to treat
- * objects from separate hierarchies as if they were designed with common
- * interfaces as long as they adhere to common naming conventions.
- * <p>
- * This version is the strict DuckType. All methods present in
- * interfaceToImplement must be present on the target object.
- *
- * @author djo
- */
-public class DuckType implements InvocationHandler {
-
- /**
- * Interface DuckType#Wrapper. An interface for DuckType proxies that
- * allows clients to access the proxied value. The value returned by
- * calling DuckType#implement always implements this interface.
- */
- public static interface Wrapper {
- /**
- * Method duckType_GetWrappedValue. Returns the proxied value.
- *
- * @return The proxied value.
- */
- public Object duckType_GetWrappedValue();
- }
-
- /**
- * Causes object to implement the interfaceToImplement and returns
- * an instance of the object implementing interfaceToImplement even
- * if interfaceToImplement was not declared in object.getClass()'s
- * implements declaration.<p>
- *
- * This works as long as all methods declared in interfaceToImplement
- * are present on object.
- *
- * @param interfaceToImplement The Java class of the interface to implement
- * @param object The object to force to implement interfaceToImplement
- * @return object, but now implementing interfaceToImplement
- */
- public static Object implement(Class interfaceToImplement, Object object) {
- return Proxy.newProxyInstance(interfaceToImplement.getClassLoader(),
- new Class[] {interfaceToImplement, Wrapper.class}, new DuckType(object));
- }
-
- /**
- * Indicates if object is a (DuckType) instace of intrface. That is,
- * is every method in intrface present on object.
- *
- * @param intrface The interface to implement
- * @param object The object to test
- * @return true if every method in intrface is present on object. false otherwise
- */
- public static boolean instanceOf(Class intrface, Object object) {
- final Method[] methods = intrface.getMethods();
- Class candclass=object.getClass();
- for (int methodidx = 0; methodidx < methods.length; methodidx++) {
- Method method=methods[methodidx];
- try {
- candclass.getMethod(method.getName(), method.getParameterTypes());
- } catch (NoSuchMethodException e) {
- return false;
- }
- }
- return true;
- }
-
- protected DuckType(Object object) {
- this.object = object;
- this.objectClass = object.getClass();
- }
-
- protected Object object;
- protected Class objectClass;
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- if (method.getName().equals("equals") && args != null && args.length == 1) {
- return new Boolean(equals(args[0]));
- }
- if (method.getName().equals("hashCode") && args == null) {
- return new Integer(hashCode());
- }
- if (method.getName().equals("duckType_GetWrappedValue") && args == null) {
- return object;
- }
- Method realMethod = objectClass.getMethod(method.getName(), method.getParameterTypes());
- if (!realMethod.isAccessible()) {
- realMethod.setAccessible(true);
- }
- return realMethod.invoke(object, args);
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof Wrapper) {
- Wrapper proxy = (Wrapper) obj;
- Object wrappedValue = proxy.duckType_GetWrappedValue();
- return wrappedValue.equals(object);
- }
- return obj == this || super.equals(obj) || object.equals(obj);
- }
-
- public int hashCode() {
- return object.hashCode();
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/ReflectedMethod.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/ReflectedMethod.java
deleted file mode 100644
index c3b78ea..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/ReflectedMethod.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2005 db4objects Inc. http://www.db4o.com
- *
- * 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:
- * db4objects - Initial API and implementation
- */
-package org.eclipse.jface.examples.databinding.ducks;
-
-import java.lang.reflect.Method;
-
-/**
- * ReflectedMethod. Encapsulates a method that may or may not exist on
- * some receiver. Invocation policy is that if the method can be invoked,
- * it is. On failure, returns null.
- *
- * @author djo
- */
-public class ReflectedMethod {
-
- private Object subject;
- private Method method;
-
- /**
- * Constructor ReflectedMethod. Create a ReflectedMethod object.
- *
- * @param subject The object on which the method lives.
- * @param methodName The name of the method.
- * @param paramTypes The method's parameter types.
- */
- public ReflectedMethod(Object subject, String methodName, Class[] paramTypes) {
- this.subject = subject;
- method = null;
- try {
- method = subject.getClass().getMethod(methodName, paramTypes);
- } catch (Exception e) {
- System.out.println(e);
- }
- }
-
- /**
- * Method exists. Returns true if the underlying method exists, false
- * otherwise.
- *
- * @return true if the underlying method exists, false otherwise.
- */
- public boolean exists() {
- return method != null;
- }
-
- /**
- * Method invoke. If possible, invoke the encapsulated method with the
- * specified parameters.
- *
- * @param params An Object[] containing the parameters to pass.
- * @return any return value or null if there was no return value or an
- * error occured.
- */
- public Object invoke(Object[] params) {
- if (method == null)
- return null;
- try {
- if (!method.isAccessible()) {
- method.setAccessible(true);
- }
- return method.invoke(subject, params);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Method getType. Returns the return type of the method.
- *
- * @return The return type or null if none.
- */
- public Class getType() {
- return method.getReturnType();
- }
-}
-
-
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/ReflectedProperty.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/ReflectedProperty.java
deleted file mode 100644
index 3ec9a58..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/ReflectedProperty.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef 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:
- * The Pampered Chef - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.ducks;
-
-/**
- * Encapsulates a single JavaBeans-style property
- *
- * @since 3.3
- */
-public class ReflectedProperty {
- private String propertyName;
- private ReflectedMethod getter;
- private ReflectedMethod setter;
-
- /**
- * Construct a ReflectedProperty on some object, given the property name.
- *
- * @param object The object
- * @param propertyName The property name
- */
- public ReflectedProperty(Object object, String propertyName) {
- this.propertyName = propertyName;
- getter = new ReflectedMethod(object, makeGetterName(propertyName), new Class[] {});
- if (!getter.exists()) {
- getter = new ReflectedMethod(object, makeBooleanGetterName(propertyName), new Class[] {});
- if (!getter.exists()) {
- throw new IllegalArgumentException("Cannot find getter for " + propertyName);
- }
- }
- setter = new ReflectedMethod(object, makeSetterName(propertyName), new Class[] {getter.getType()});
- }
-
- private String makeBooleanGetterName(String propertyName) {
- return "is" + capitalize(propertyName);
- }
-
- private String makeSetterName(String propertyName) {
- return "set" + capitalize(propertyName);
- }
-
- private String makeGetterName(String propertyName) {
- return "get" + capitalize(propertyName);
- }
-
- private String capitalize(String string) {
- return string.substring(0, 1).toUpperCase() + string.substring(1);
- }
-
- /**
- * Return the property's type. This is the same as the type returned by
- * the getter.
- *
- * @return The property's data type.
- */
- public Class getType() {
- return getter.getType();
- }
-
- /**
- * Return the property's value.
- *
- * @return The value in the property.
- */
- public Object get() {
- return getter.invoke(new Object[] {});
- }
-
- /**
- * Set the property's value. If the property is read-only, the request
- * is ignored.
- *
- * @param newValue The value to set.
- */
- public void set(Object newValue) {
- setter.invoke(new Object[] {newValue});
- }
-
- /**
- * Returns if the property is read-only.
- *
- * @return false if the property has a setter; true otherwise.
- */
- public boolean isReadOnly() {
- return !setter.exists();
- }
-
- /**
- * Returns the property's name.
- *
- * @return The property name.
- */
- public String getPropertyName() {
- return propertyName;
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/RelaxedDuckType.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/RelaxedDuckType.java
deleted file mode 100644
index fa43397..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/ducks/RelaxedDuckType.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2005 db4objects Inc. http://www.db4o.com
- *
- * 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:
- * db4objects - Initial API and implementation
- */
-package org.eclipse.jface.examples.databinding.ducks;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.HashMap;
-
-/**
- * RelaxedDuckType. Implements Duck Typing for Java. ("If it walks like a duck,
- * quacks like a duck, it..."). Essentially allows programs to treat
- * objects from separate hierarchies as if they were designed with common
- * interfaces as long as they adhere to common naming conventions.
- * <p>
- * This version is the relaxed DuckType. If a method in the interface is
- * not present on the underlying object, the proxy simply returns null.
- *
- * @author djo
- */
-public class RelaxedDuckType extends DuckType implements InvocationHandler {
-
- public static Object implement(Class interfaceToImplement, Object object) {
- return Proxy.newProxyInstance(interfaceToImplement.getClassLoader(),
- new Class[] {interfaceToImplement}, new RelaxedDuckType(object));
- }
-
- public static boolean includes(Object object, String method, Class[] args) {
- try {
- object.getClass().getMethod(method, args);
- } catch (NoSuchMethodException e) {
- return false;
- }
- return true;
- }
-
- private static final HashMap NULL_VALUES = new HashMap(); {
- NULL_VALUES.put(Boolean.TYPE, Boolean.FALSE);
- NULL_VALUES.put(Integer.TYPE, new Integer(0));
- NULL_VALUES.put(Float.TYPE, new Float(0));
- NULL_VALUES.put(Long.TYPE, new Long(0));
- NULL_VALUES.put(Double.TYPE, new Double(0));
- NULL_VALUES.put(Character.TYPE, new Character(' '));
- }
-
- protected RelaxedDuckType(Object object) {
- super(object);
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- try {
- Method realMethod = objectClass.getMethod(method.getName(), method.getParameterTypes());
- return realMethod.invoke(object, args);
- } catch (NoSuchMethodException e) {
- return NULL_VALUES.get(method.getReturnType());
- } catch (Throwable t) {
- throw t;
- }
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMask.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMask.java
deleted file mode 100644
index 484922e..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMask.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef 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:
- * The Pampered Chef - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.mask;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-
-import org.eclipse.jface.examples.databinding.mask.internal.EditMaskParser;
-import org.eclipse.jface.examples.databinding.mask.internal.SWTUtil;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Ensures text widget has the format specified by the edit mask. Edit masks
- * are currently defined as follows:
- *
- * The following characters are reserved words that match specific kinds of
- * characters:
- *
- * # - digits 0-9
- * A - uppercase A-Z
- * a - upper or lowercase a-z, A-Z
- * n - alphanumeric 0-9, a-z, A-Z
- *
- * All other characters are literals. The above characters may be turned into
- * literals by preceeding them with a backslash. Use two backslashes to
- * denote a backslash.
- *
- * Examples:
- *
- * (###) ###-#### U.S. phone number
- * ###-##-#### U.S. Social Security number
- * \\\### A literal backslash followed by a literal pound symbol followed by two digits
- *
- * Ideas for future expansion:
- *
- * Quantifiers as postfix modifiers to a token. ie:
- *
- * #{1, 2}/#{1,2}/#### MM/DD/YYYY date format allowing 1 or 2 digit month or day
- *
- * Literals may only be quantified as {0,1} which means that they only appear
- * if placeholders on both sides of the literal have data. This will be used
- * along with:
- *
- * Right-to-left support for numeric entry. When digits are being entered and
- * a decimal point is present in the mask, digits to the left of the decimal
- * are entered right-to-left but digits to the right of the decimal left-to-right.
- * This might need to be a separate type of edit mask. (NumericMask, maybe?)
- *
- * Example:
- *
- * $#{0,3},{0,1}#{0,3}.#{0,2} ie: $123,456.12 or $12.12 or $1,234.12 or $123.12
- *
- *
- * Here's the basic idea of how the current implementation works (the actual
- * implementation is slightly more abstracted and complicated than this):
- *
- * We always let the verify event pass if the user typed a new character or selected/deleted anything.
- * During the verify event, we post an async runnable.
- * Inside that async runnable, we:
- * - Remember the selection position
- * - getText(), then
- * - Strip out all literal characters from text
- * - Truncate the resulting string to raw length of edit mask without literals
- * - Insert literal characters back in the correct positions
- * - setText() the resulting string
- * - reset the selection to the correct location
- *
- * @since 3.3
- */
-public class EditMask {
-
- public static final String FIELD_TEXT = "text";
- public static final String FIELD_RAW_TEXT = "rawText";
- public static final String FIELD_COMPLETE = "complete";
- protected Text text;
- protected EditMaskParser editMaskParser;
- private boolean fireChangeOnKeystroke = true;
- private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
-
- protected String oldValidRawText = "";
- protected String oldValidText = "";
-
- /**
- * Creates an instance that wraps around a text widget and manages its<br>
- * formatting.
- *
- * @param text
- * @param editMask
- */
- public EditMask(Text text) {
- this.text = text;
- }
-
- /**
- * @return the underlying Text control used by EditMask
- */
- public Text getControl() {
- return this.text;
- }
-
- /**
- * Set the edit mask string on the edit mask control.
- *
- * @param editMask The edit mask string
- */
- public void setMask(String editMask) {
- editMaskParser = new EditMaskParser(editMask);
- text.addVerifyListener(verifyListener);
- text.addFocusListener(focusListener);
- text.addDisposeListener(disposeListener);
- updateTextField.run();
- oldValidText = text.getText();
- oldValidRawText = editMaskParser.getRawResult();
- }
-
- /**
- * @param string Sets the text string in the receiver
- */
- public void setText(String string) {
- String oldValue = text.getText();
- if (editMaskParser != null) {
- editMaskParser.setInput(string);
- String formattedResult = editMaskParser.getFormattedResult();
- text.setText(formattedResult);
- firePropertyChange(FIELD_TEXT, oldValue, formattedResult);
- } else {
- text.setText(string);
- firePropertyChange(FIELD_TEXT, oldValue, string);
- }
- oldValidText = text.getText();
- oldValidRawText = editMaskParser.getRawResult();
- }
-
- /**
- * @return the actual (formatted) text
- */
- public String getText() {
- if (editMaskParser != null) {
- return editMaskParser.getFormattedResult();
- }
- return text.getText();
- }
-
- /**
- * setRawText takes raw text as a parameter but formats it before
- * setting the text in the Text control.
- *
- * @param string the raw (unformatted) text
- */
- public void setRawText(String string) {
- if (string == null) {
- string = "";
- }
- if (editMaskParser != null) {
- String oldValue = editMaskParser.getRawResult();
- editMaskParser.setInput(string);
- text.setText(editMaskParser.getFormattedResult());
- firePropertyChange(FIELD_RAW_TEXT, oldValue, string);
- } else {
- String oldValue = text.getText();
- text.setText(string);
- firePropertyChange(FIELD_RAW_TEXT, oldValue, string);
- }
- oldValidText = text.getText();
- oldValidRawText = editMaskParser.getRawResult();
- }
-
- /**
- * @return The input text with literals removed
- */
- public String getRawText() {
- if (editMaskParser != null) {
- return editMaskParser.getRawResult();
- }
- return text.getText();
- }
-
- /**
- * @return true if the field is complete according to the mask; false otherwise
- */
- public boolean isComplete() {
- if (editMaskParser == null) {
- return true;
- }
- return editMaskParser.isComplete();
- }
-
- /**
- * Returns the placeholder character. The placeholder
- * character must be a different character than any character that is
- * allowed as input anywhere in the edit mask. For example, if the edit
- * mask permits spaces to be used as input anywhere, the placeholder
- * character must be something other than a space character.
- * <p>
- * The space character is the default placeholder character.
- *
- * @return the placeholder character
- */
- public char getPlaceholder() {
- if (editMaskParser == null) {
- throw new IllegalArgumentException("Have to set an edit mask first");
- }
- return editMaskParser.getPlaceholder();
- }
-
- /**
- * Sets the placeholder character for the edit mask. The placeholder
- * character must be a different character than any character that is
- * allowed as input anywhere in the edit mask. For example, if the edit
- * mask permits spaces to be used as input anywhere, the placeholder
- * character must be something other than a space character.
- * <p>
- * The space character is the default placeholder character.
- *
- * @param placeholder The character to use as a placeholder
- */
- public void setPlaceholder(char placeholder) {
- if (editMaskParser == null) {
- throw new IllegalArgumentException("Have to set an edit mask first");
- }
- editMaskParser.setPlaceholder(placeholder);
- updateTextField.run();
- oldValidText = text.getText();
- }
-
- /**
- * Indicates if change notifications will be fired after every keystroke
- * that affects the value of the rawText or only when the value is either
- * complete or empty.
- *
- * @return true if every change (including changes from one invalid state to
- * another) triggers a change event; false if only empty or valid
- * values trigger a change event. Defaults to false.
- */
- public boolean isFireChangeOnKeystroke() {
- return fireChangeOnKeystroke;
- }
-
- /**
- * Sets if change notifications will be fired after every keystroke that
- * affects the value of the rawText or only when the value is either
- * complete or empty.
- *
- * @param fireChangeOnKeystroke
- * true if every change (including changes from one invalid state
- * to another) triggers a change event; false if only empty or
- * valid values trigger a change event. Defaults to false.
- */
- public void setFireChangeOnKeystroke(boolean fireChangeOnKeystroke) {
- this.fireChangeOnKeystroke = fireChangeOnKeystroke;
- }
-
- /**
- * JavaBeans boilerplate code...
- *
- * @param listener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * JavaBeans boilerplate code...
- *
- * @param propertyName
- * @param listener
- */
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
- }
-
- /**
- * JavaBeans boilerplate code...
- *
- * @param listener
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * JavaBeans boilerplate code...
- *
- * @param propertyName
- * @param listener
- */
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(propertyName,
- listener);
- }
-
- private boolean isEitherValueNotNull(Object oldValue, Object newValue) {
- return oldValue != null || newValue != null;
- }
-
- private void firePropertyChange(String propertyName, Object oldValue,
- Object newValue) {
- if (isEitherValueNotNull(oldValue, newValue)) {
- propertyChangeSupport.firePropertyChange(propertyName,
- oldValue, newValue);
- }
- }
-
- protected boolean updating = false;
-
- protected int oldSelection = 0;
- protected int selection = 0;
- protected String oldRawText = "";
- protected boolean replacedSelectedText = false;
-
- private VerifyListener verifyListener = new VerifyListener() {
- public void verifyText(VerifyEvent e) {
- // If the edit mask is already full, don't let the user type
- // any new characters
- if (editMaskParser.isComplete() && // should eventually be .isFull() to account for optional characters
- e.start == e.end &&
- e.text.length() > 0)
- {
- e.doit=false;
- return;
- }
-
- oldSelection = selection;
- Point selectionRange = text.getSelection();
- selection = selectionRange.x;
-
- if (!updating) {
- replacedSelectedText = false;
- if (selectionRange.y - selectionRange.x > 0 && e.text.length() > 0) {
- replacedSelectedText = true;
- }
- // If the machine is loaded down (ie: spyware, malware), we might
- // get another keystroke before asyncExec can process, so we use
- // greedyExec instead.
- SWTUtil.greedyExec(Display.getCurrent(), updateTextField);
-// Display.getCurrent().asyncExec(updateTextField);
- }
- }
- };
-
- private Runnable updateTextField = new Runnable() {
- public void run() {
- updating = true;
- try {
- if (!text.isDisposed()) {
- Boolean oldIsComplete = new Boolean(editMaskParser.isComplete());
-
- editMaskParser.setInput(text.getText());
- text.setText(editMaskParser.getFormattedResult());
- String newRawText = editMaskParser.getRawResult();
-
- updateSelectionPosition(newRawText);
- firePropertyChangeEvents(oldIsComplete, newRawText);
- }
- } finally {
- updating = false;
- }
- }
-
- private void updateSelectionPosition(String newRawText) {
-
- // Adjust the selection
- if (isInsertingNewCharacter(newRawText) || replacedSelectedText) {
- // Find the position after where the new character was actually inserted
- int selectionDelta =
- editMaskParser.getNextInputPosition(oldSelection)
- - oldSelection;
- if (selectionDelta == 0) {
- selectionDelta = editMaskParser.getNextInputPosition(selection)
- - selection;
- }
- selection += selectionDelta;
- }
-
- // Did we just type something that was accepted by the mask?
- if (!newRawText.equals(oldRawText)) { // yep
-
- // If the user hits <end>, bounce them back to the end of their actual input
- int firstIncompletePosition = editMaskParser.getFirstIncompleteInputPosition();
- if (firstIncompletePosition > 0 && selection > firstIncompletePosition)
- selection = firstIncompletePosition;
- text.setSelection(new Point(selection, selection));
-
- } else { // nothing was accepted by the mask
-
- // Either we backspaced over a literal or we typed an illegal character
- if (selection > oldSelection) { // typed an illegal character; backup
- text.setSelection(new Point(selection-1, selection-1));
- } else { // backspaced over a literal; don't interfere with selection position
- text.setSelection(new Point(selection, selection));
- }
- }
- oldRawText = newRawText;
- }
-
- private boolean isInsertingNewCharacter(String newRawText) {
- return newRawText.length() > oldRawText.length();
- }
-
- private void firePropertyChangeEvents(Boolean oldIsComplete, String newRawText) {
- Boolean newIsComplete = new Boolean(editMaskParser.isComplete());
- if (!oldIsComplete.equals(newIsComplete)) {
- firePropertyChange(FIELD_COMPLETE, oldIsComplete, newIsComplete);
- }
- if (!newRawText.equals(oldValidRawText)) {
- if ( newIsComplete.booleanValue() || "".equals(newRawText) || fireChangeOnKeystroke) {
- firePropertyChange(FIELD_RAW_TEXT, oldValidRawText, newRawText);
- firePropertyChange(FIELD_TEXT, oldValidText, text.getText());
- oldValidText = text.getText();
- oldValidRawText = newRawText;
- }
- }
- }
- };
-
- private FocusListener focusListener = new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- selection = editMaskParser.getFirstIncompleteInputPosition();
- text.setSelection(selection, selection);
- }
- };
-
- private DisposeListener disposeListener = new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- text.removeVerifyListener(verifyListener);
- text.removeFocusListener(focusListener);
- text.removeDisposeListener(disposeListener);
- }
- };
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMaskParseException.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMaskParseException.java
deleted file mode 100644
index f2b6aec..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMaskParseException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef 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:
- * The Pampered Chef - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.mask;
-
-/**
- * Indicates a parse error while parsing an edit mask.
- *
- * @since 3.3
- */
-public class EditMaskParseException extends RuntimeException {
-
- private static final long serialVersionUID = 8142999683999681500L;
-
- /**
- * Construct a MaskParseException
- */
- public EditMaskParseException() {
- super();
- }
-
- /**
- * @param message
- * @param cause
- */
- public EditMaskParseException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param message
- */
- public EditMaskParseException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public EditMaskParseException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMaskTest.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMaskTest.java
deleted file mode 100644
index 49c9c1c..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/EditMaskTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.mask;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class EditMaskTest {
-
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
-
- Text text = new Text(shell, SWT.BORDER);
- text.setText("XXXXXXXXXXXXX");// Put some X's in there to pad out the field's default size
-
- Text text2 = new Text(shell, SWT.BORDER);
- text2.setText("630XXXXXXXXXX");
-
- shell.setLayout(new RowLayout(SWT.VERTICAL));
- shell.setSize(800, 600);
-
- new EditMask(text).setMask("(###) ###-####");
- new EditMask(text2).setMask("(###) ###-####");
-
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/EditMaskLexerAndToken.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/EditMaskLexerAndToken.java
deleted file mode 100644
index d9c61b4..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/EditMaskLexerAndToken.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef 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:
- * The Pampered Chef - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.mask.internal;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.examples.databinding.mask.EditMaskParseException;
-
-/**
- * Lexical analyzer and token for an input mask. Since input masks have exactly
- * one token type, we use the same class to be the recognizer and the token
- * itself.
- *
- * @since 3.3
- */
-public class EditMaskLexerAndToken {
-
- /*
- * First the literals that represent the types of characters
- */
- private static ArrayList reservedWords = new ArrayList();{
- reservedWords.add("#");
- reservedWords.add("A");
- reservedWords.add("a");
- reservedWords.add("n");
- }
-
- /*
- * ...and their corresponding regular expressions
- */
- private static ArrayList inputRegexes = new ArrayList();{
- inputRegexes.add("^[0-9]$");
- inputRegexes.add("^[A-Z]$");
- inputRegexes.add("^[a-zA-Z]$");
- inputRegexes.add("^[0-9a-zA-Z]$");
- }
-
- private String charRegex = null; // A regex for matching input characters or null
- private String literal = null; // The literal character if charRegex is null
- private boolean readOnly;
- private String input = null; // The user's input
-
- private boolean recognizeReservedWord(String inputMask, int position) {
- String input = inputMask.substring(position, position+1);
- for (int reservedWord = 0; reservedWord < reservedWords.size(); reservedWord++) {
- if (input.equals(reservedWords.get(reservedWord))) {
- charRegex = (String) inputRegexes.get(reservedWord);
- literal = null;
- input = null;
- readOnly = false;
- return true;
- }
- }
- return false;
- }
-
- private boolean recognizeBackslashLiteral(String inputMask, int position) throws EditMaskParseException {
- String input = inputMask.substring(position, position+1);
- if (input.equals("\\")) {
- try {
- input = inputMask.substring(position+1, position+2);
- charRegex = null;
- this.input = input;
- literal = input;
- readOnly = true;
- return true;
- } catch (Throwable t) {
- throw new EditMaskParseException("Found a \\ without a character after it: " + inputMask);
- }
- }
- return false;
- }
-
- private boolean recognizeLiteral(String inputMask, int position) {
- literal = inputMask.substring(position, position+1);
- this.input = literal;
- charRegex = null;
- readOnly = true;
- return true;
- }
-
- /**
- * Initializes itself based on characters in edit mask starting at position;
- * returns number of chars consumed
- *
- * @param inputMask The entire edit mask
- * @param position The position to begin parsing
- * @return The number of characters consumed
- * @throws EditMaskParseException If it encountered a syntax error during the parse
- */
- public int initializeEditMask(String inputMask, int position) throws EditMaskParseException {
- clear();
- if (recognizeReservedWord(inputMask, position)) {
- return 1;
- }
- if (recognizeBackslashLiteral(inputMask, position)) {
- return 2;
- }
- if (!recognizeLiteral(inputMask, position)) {
- throw new EditMaskParseException("Should never see this error in this implementation!");
- }
- readOnly = true;
- return 1;
- }
-
- /**
- * ignores invalid input; stores valid input
- * @param inputCharacter
- * @return
- */
- public boolean accept(String inputCharacter) {
- if (readOnly) {
- return false;
- }
- if (literal != null) {
- return false;
- }
- if (!canAcceptMoreCharacters()) {
- return false;
- }
- if (inputCharacter.matches(charRegex)) {
- this.input = inputCharacter;
- return true;
- }
- return false;
- }
-
- /**
- * @return Returns the characters it has accepted. In the current implementation,
- * this is exactly one character. Once quantifiers are implemented, this could
- * be many characters. If no characters have been accepted, returns null.
- */
- public String getInput() {
- return input;
- }
-
- /**
- * Clear any accepted input
- */
- public void clear() {
- if (!isReadOnly())
- input = null;
- }
-
- /**
- * @return true if it's a literal; false if it's a placeholder
- */
- public boolean isReadOnly() {
- return readOnly;
- }
-
- /**
- * @return true if it is a literal or if it has accepted the minimum
- * required number of characters
- */
- public boolean isComplete() {
- if (input != null) {
- return true;
- }
- return false;
- }
-
- /**
- * @return A position may be complete and yet able to accept more characters if
- * the position includes optional characters via a quantifier of some type.
- * Not implemented right now.
- */
- public boolean canAcceptMoreCharacters() {
- return !isComplete();
- }
-
- /**
- * @return the minimum number of characters this RegexLexer must accept
- * in order to be complete. Because we don't yet support quantifiers, this
- * is currently always 1.
- */
- public int getMinimumLength() {
- return 1;
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/EditMaskParser.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/EditMaskParser.java
deleted file mode 100644
index fc87f9e..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/EditMaskParser.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef 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:
- * The Pampered Chef - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.mask.internal;
-
-import java.util.LinkedList;
-
-import org.eclipse.jface.examples.databinding.mask.EditMaskParseException;
-
-/**
- * @since 3.3
- */
-public class EditMaskParser {
- private EditMaskLexerAndToken[] expectedTokens;
- private char placeholder = ' ';
-
- /**
- * @param editMask The complete edit mask
- * @throws EditMaskParseException
- */
- public EditMaskParser(String editMask) throws EditMaskParseException {
- LinkedList tokens = new LinkedList();
- int position = 0;
- while (position < editMask.length()) {
- EditMaskLexerAndToken token = new EditMaskLexerAndToken();
- position += token.initializeEditMask(editMask, position);
- tokens.add(token);
- }
- expectedTokens = (EditMaskLexerAndToken[]) tokens.toArray(new EditMaskLexerAndToken[tokens.size()]);
- }
-
- /**
- * @param input the user input which may or may not be in valid format
- */
- public void setInput(String input) {
- for (int i = 0; i < expectedTokens.length; i++) {
- expectedTokens[i].clear();
- }
- int tokenPosition = 0;
- int inputPosition = 0;
- while (inputPosition < input.length() && tokenPosition < expectedTokens.length) {
- while (tokenPosition < expectedTokens.length &&
- (expectedTokens[tokenPosition].isComplete() ||
- expectedTokens[tokenPosition].isReadOnly()))
- {
- ++tokenPosition;
- }
- if (tokenPosition < expectedTokens.length) {
- while (inputPosition < input.length() && !expectedTokens[tokenPosition].isComplete()) {
- String inputChar = input.substring(inputPosition, inputPosition+1);
- expectedTokens[tokenPosition].accept(inputChar);
- ++inputPosition;
- }
- }
- }
- }
-
- /**
- * @return the formatted version of the user input
- */
- public String getFormattedResult() {
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < expectedTokens.length; i++) {
- String outputChar = expectedTokens[i].getInput();
- if (outputChar == null) {
- outputChar = "" + placeholder;
- }
- result.append(outputChar);
- }
- return result.toString();
- }
-
- /**
- * @return the user input with all literals removed
- */
- public String getRawResult() {
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < expectedTokens.length; i++) {
- if (expectedTokens[i].isReadOnly()) {
- continue;
- }
- String outputChar = expectedTokens[i].getInput();
- if (outputChar == null) {
- outputChar = "";
- }
- result.append(outputChar);
- }
- return result.toString();
- }
-
- /**
- * @return true if the current input is a valid input
- */
- public boolean isComplete() {
- for (int i = 0; i < expectedTokens.length; i++) {
- if (!expectedTokens[i].isComplete()) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * @param startingAt The current index within the user input string
- * @return The first non-read-only index greater than or equal to startingAt
- */
- public int getNextInputPosition(int startingAt) {
- while (startingAt < expectedTokens.length-1 && expectedTokens[startingAt].isReadOnly()) {
- ++startingAt;
- }
- return startingAt;
- }
-
- /**
- * @return the first input position whose token is not marked as complete. Returns -1 if all are complete
- */
- public int getFirstIncompleteInputPosition() {
- for (int position = 0; position < expectedTokens.length; position++) {
- if (!expectedTokens[position].isComplete()) {
- return position;
- }
- }
- return -1;
- }
-
- /**
- * @return Returns the placeholder.
- */
- public char getPlaceholder() {
- return placeholder;
- }
-
- /**
- * @param placeholder The placeholder to set.
- */
- public void setPlaceholder(char placeholder) {
- this.placeholder = placeholder;
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/SWTUtil.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/SWTUtil.java
deleted file mode 100644
index 333449c..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/SWTUtil.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jface.examples.databinding.mask.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 1.0
- */
-public class SWTUtil {
- /**
- * Stores a work queue for each display
- */
- private static Map mapDisplayOntoWorkQueue = new HashMap();
-
- private SWTUtil() {
- }
-
- /**
- * Runs the given runnable on the given display as soon as possible. If
- * possible, the runnable will be executed before the next widget is
- * repainted, but this behavior is not guaranteed. Use this method to
- * schedule work will affect the way one or more widgets are drawn.
- *
- * <p>
- * This is threadsafe.
- * </p>
- *
- * @param d
- * display
- * @param r
- * runnable to execute in the UI thread.
- */
- public static void greedyExec(Display d, Runnable r) {
- if (d.isDisposed()) {
- return;
- }
-
- // if (Display.getCurrent() == d) {
- // r.run();
- // } else {
- WorkQueue queue = getQueueFor(d);
- queue.asyncExec(r);
- // }
- }
-
- /**
- * Runs the given runnable on the given display as soon as possible. Unlike
- * greedyExec, this has no effect if the given runnable has already been
- * scheduled for execution. Use this method to schedule work that will
- * affect the way one or more wigdets are drawn, but that should only happen
- * once.
- *
- * <p>
- * This is threadsafe.
- * </p>
- *
- * @param d
- * display
- * @param r
- * runnable to execute in the UI thread. Has no effect if the
- * given runnable has already been scheduled but has not yet run.
- */
- public static void runOnce(Display d, Runnable r) {
- if (d.isDisposed()) {
- return;
- }
- WorkQueue queue = getQueueFor(d);
- queue.runOnce(r);
- }
-
- /**
- * Cancels a greedyExec or runOnce that was previously scheduled on the
- * given display. Has no effect if the given runnable is not in the queue
- * for the given display
- *
- * @param d
- * target display
- * @param r
- * runnable to execute
- */
- public static void cancelExec(Display d, Runnable r) {
- if (d.isDisposed()) {
- return;
- }
- WorkQueue queue = getQueueFor(d);
- queue.cancelExec(r);
- }
-
- /**
- * Returns the work queue for the given display. Creates a work queue if
- * none exists yet.
- *
- * @param d
- * display to return queue for
- * @return a work queue (never null)
- */
- private static WorkQueue getQueueFor(final Display d) {
- WorkQueue result;
- synchronized (mapDisplayOntoWorkQueue) {
- // Look for existing queue
- result = (WorkQueue) mapDisplayOntoWorkQueue.get(d);
-
- if (result == null) {
- // If none, create new queue
- result = new WorkQueue(d);
- final WorkQueue q = result;
- mapDisplayOntoWorkQueue.put(d, result);
- d.asyncExec(new Runnable() {
- public void run() {
- d.disposeExec(new Runnable() {
- public void run() {
- synchronized (mapDisplayOntoWorkQueue) {
- q.cancelAll();
- mapDisplayOntoWorkQueue.remove(d);
- }
- }
- });
- }
- });
- }
- return result;
- }
- }
-
- /**
- * @param rgb1
- * @param rgb2
- * @param ratio
- * @return the RGB object
- */
- public static RGB mix(RGB rgb1, RGB rgb2, double ratio) {
- return new RGB(interp(rgb1.red, rgb2.red, ratio),
- interp(rgb1.green, rgb2.green, ratio),
- interp(rgb1.blue, rgb2.blue, ratio));
- }
-
- private static int interp(int i1, int i2, double ratio) {
- int result = (int)(i1 * ratio + i2 * (1.0d - ratio));
- if (result < 0) result = 0;
- if (result > 255) result = 255;
- return result;
- }
-
- /**
- * Logs an exception as though it was thrown by a SafeRunnable
- * being run with the default ISafeRunnableRunner. Will not
- * open modal dialogs or spin the event loop.
- *
- * @param t throwable to log
- */
- public static void logException(final Exception t) {
- SafeRunnable.run(new SafeRunnable() {
- public void run() throws Exception {
- throw t;
- }
- public void handleException(Throwable e) {
- // IMPORTANT: Do not call the super implementation, since
- // it opens a modal dialog, and may cause *syncExecs to run
- // too early.
- }
- });
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/WorkQueue.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/WorkQueue.java
deleted file mode 100644
index e5eeaea..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/mask/internal/WorkQueue.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jface.examples.databinding.mask.internal;
-
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.Set;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * @since 3.2
- *
- */
-public class WorkQueue {
-
- private boolean updateScheduled = false;
-
- private boolean paintListenerAttached = false;
-
- private LinkedList pendingWork = new LinkedList();
-
- private Display d;
-
- private Set pendingWorkSet = new HashSet();
-
- private Runnable updateJob = new Runnable() {
- public void run() {
- doUpdate();
- updateScheduled = false;
- }
- };
-
- private Listener paintListener = new Listener() {
- public void handleEvent(Event event) {
- paintListenerAttached = false;
- d.removeFilter(SWT.Paint, this);
- doUpdate();
- }
- };
-
- /**
- * @param targetDisplay
- */
- public WorkQueue(Display targetDisplay) {
- d = targetDisplay;
- }
-
- private void doUpdate() {
- for (;;) {
- Runnable next;
- synchronized (pendingWork) {
- if (pendingWork.isEmpty()) {
- break;
- }
- next = (Runnable) pendingWork.removeFirst();
- pendingWorkSet.remove(next);
- }
-
- next.run();
- }
-
- }
-
- /**
- * Schedules some work to happen in the UI thread as soon as possible. If
- * possible, the work will happen before the next control redraws. The given
- * runnable will only be run once. Has no effect if this runnable has
- * already been queued for execution.
- *
- * @param work
- * runnable to execute
- */
- public void runOnce(Runnable work) {
- synchronized (pendingWork) {
- if (pendingWorkSet.contains(work)) {
- return;
- }
-
- pendingWorkSet.add(work);
-
- asyncExec(work);
- }
- }
-
- /**
- * Schedules some work to happen in the UI thread as soon as possible. If
- * possible, the work will happen before the next control redraws. Unlike
- * runOnce, calling asyncExec twice with the same runnable will cause that
- * runnable to run twice.
- *
- * @param work
- * runnable to execute
- */
- public void asyncExec(Runnable work) {
- synchronized (pendingWork) {
- pendingWork.add(work);
- if (!updateScheduled) {
- updateScheduled = true;
- d.asyncExec(updateJob);
- }
-
- // If we're in the UI thread, add an event filter to ensure
- // the work happens ASAP
- if (Display.getCurrent() == d) {
- if (!paintListenerAttached) {
- paintListenerAttached = true;
- d.addFilter(SWT.Paint, paintListener);
- }
- }
- }
- }
-
- /**
- * Cancels a previously-scheduled runnable. Has no effect if the given
- * runnable was not previously scheduled or has already executed.
- *
- * @param toCancel
- * runnable to cancel
- */
- public void cancelExec(Runnable toCancel) {
- synchronized (pendingWork) {
- pendingWork.remove(toCancel);
- pendingWorkSet.remove(toCancel);
- }
- }
-
- /**
- * Cancels all pending work.
- */
- public void cancelAll() {
- synchronized (pendingWork) {
- pendingWork.clear();
- pendingWorkSet.clear();
- }
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Account.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Account.java
deleted file mode 100644
index 7509d64..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Account.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import java.util.Date;
-
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class Account extends ModelObject {
-
- private String country;
- private String firstName;
- private String lastName;
- private String state;
- private String phone;
- private Date expiryDate;
-
- public void setFirstName(String string) {
- String oldValue = firstName;
- firstName = string;
- firePropertyChange("firstName", oldValue, string);
- }
-
- public void setLastName(String string) {
- String oldValue = lastName;
- lastName = string;
- firePropertyChange("lastName", oldValue, string);
- }
-
- public void setState(String string) {
- String oldValue = state;
- state = string;
- firePropertyChange("state", oldValue, string);
- }
-
- public void setPhone(String string) {
- String oldValue = phone;
- phone = string;
- firePropertyChange("phone", oldValue, phone);
- }
-
- public void setCountry(String string) {
- Object oldValue = country;
- country = string;
- firePropertyChange("country", oldValue, string);
- }
-
- public String getCountry() {
- return country;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public String getState() {
- return state;
- }
-
- public String getPhone() {
- return phone;
- }
-
- public Date getExpiryDate() {
- return expiryDate;
- }
-
- public void setExpiryDate(Date expiryDate) {
- firePropertyChange("expiryDate", this.expiryDate,
- this.expiryDate = expiryDate);
- }
-
-}
\ No newline at end of file
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Adventure.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Adventure.java
deleted file mode 100644
index d78eed0..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Adventure.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.databinding.validation.ValidationStatus;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class Adventure extends ModelObject {
-
- private boolean petsAllowed;
-
- private double price;
-
- private Lodging defaultLodging;
-
- private String name;
-
- private String description;
-
- private String location;
-
- private int maxNumberOfPeople;
-
- public String getName() {
- return name;
- }
-
- public void setName(String string) {
- Object oldValue = name;
- name = string;
- firePropertyChange("name", oldValue, name);
- }
-
- public int getMaxNumberOfPeople(){
- return maxNumberOfPeople;
- }
-
- public void setMaxNumberOfPeople(int anInt) {
- int oldValue = maxNumberOfPeople;
- maxNumberOfPeople = anInt;
- firePropertyChange("maxNumberOfPeople", oldValue, maxNumberOfPeople);
- }
-
- public IValidator getMaxNumberOfPeopleDomainValidator() {
- return new IValidator() {
- public IStatus validate(Object value) {
- int intValue = ((Integer)value).intValue();
- if (intValue < 1 || intValue > 20) {
- return ValidationStatus
- .error("Max number of people must be between 1 and 20 inclusive");
- }
- return null;
- }
- };
- }
-
- public Lodging getDefaultLodging() {
- return defaultLodging;
- }
-
- public void setDefaultLodging(Lodging lodging) {
- Object oldValue = defaultLodging;
- defaultLodging = lodging;
- firePropertyChange("defaultLodging", oldValue, defaultLodging);
- }
-
- public void setPrice(double d) {
- double oldValue = price;
- price = d;
- firePropertyChange("price", new Double(oldValue), new Double(price));
- }
-
- public double getPrice() {
- return price;
- }
-
- public void setPetsAllowed(boolean b) {
- boolean oldValue = petsAllowed;
- petsAllowed = b;
- firePropertyChange("petsAllowed", new Boolean(oldValue), new Boolean(
- petsAllowed));
- }
-
- public boolean isPetsAllowed() {
- return petsAllowed;
- }
-
- public void setDescription(String string) {
- Object oldValue = description;
- description = string;
- firePropertyChange("description", oldValue, description);
- }
-
- public void setLocation(String string) {
- Object oldValue = location;
- location = string;
- firePropertyChange("location", oldValue, location);
- }
-
- public String getDescription() {
- return description;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/AdventureFactory.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/AdventureFactory.java
deleted file mode 100644
index 2b95e13..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/AdventureFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-public class AdventureFactory {
-
- public Catalog createCatalog() {
- return new Catalog();
- }
-
- public Category createCategory() {
- return new Category();
- }
-
- public Adventure createAdventure() {
- return new Adventure();
- }
-
- public Lodging createLodging() {
- return new Lodging();
- }
-
- public Transportation createTransportation() {
- return new Transportation();
- }
-
- public Account createAccount() {
- return new Account();
- }
-
- public Cart createCart() {
- return new Cart();
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/AggregateObservableValue.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/AggregateObservableValue.java
deleted file mode 100644
index 0606d43..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/AggregateObservableValue.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-
-/**
- * @since 3.2
- *
- */
-public class AggregateObservableValue extends AbstractObservableValue {
-
- private IObservableValue[] observableValues;
-
- private String delimiter;
-
- private boolean updating = false;
-
- private String currentValue;
-
- private IValueChangeListener listener = new IValueChangeListener() {
- public void handleValueChange(ValueChangeEvent event) {
- if (!updating) {
- fireValueChange(Diffs.createValueDiff(currentValue,
- doGetValue()));
- }
- }
- };
-
- /**
- * @param observableValues
- * @param delimiter
- */
- public AggregateObservableValue(IObservableValue[] observableValues,
- String delimiter) {
- this.observableValues = observableValues;
- this.delimiter = delimiter;
- for (int i = 0; i < observableValues.length; i++) {
- observableValues[i].addValueChangeListener(listener);
- }
- doGetValue();
- }
-
- public void doSetValue(Object value) {
- Object oldValue = doGetValue();
- StringTokenizer tokenizer = new StringTokenizer((String) value,
- delimiter);
- try {
- updating = true;
- for (int i = 0; i < observableValues.length; i++) {
- if (tokenizer.hasMoreElements()) {
- observableValues[i].setValue(tokenizer.nextElement());
- } else {
- observableValues[i].setValue(null);
- }
- }
- } finally {
- updating = false;
- }
- doGetValue();
- fireValueChange(Diffs.createValueDiff(oldValue, value));
- }
-
- public Object doGetValue() {
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < observableValues.length; i++) {
- if (i > 0 & i < observableValues.length) {
- result.append(delimiter);
- }
- result.append(observableValues[i].getValue());
- }
- currentValue = result.toString();
- return currentValue;
- }
-
- public Object getValueType() {
- return String.class;
- }
-
- public void dispose() {
- for (int i = 0; i < observableValues.length; i++) {
- observableValues[i].removeValueChangeListener(listener);
- }
- super.dispose();
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Cart.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Cart.java
deleted file mode 100644
index b82f45e..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Cart.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-public class Cart {
-
- public void setAdventureDays(int i) {
- // TODO Auto-generated method stub
-
- }
-
- public int getLodgingDays() {
- // TODO Auto-generated method stub
- return 0;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Catalog.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Catalog.java
deleted file mode 100644
index edbae49..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Catalog.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class Catalog extends ModelObject {
-
- private Category[] categories = new Category[0];
-
- private Lodging[] lodgings = new Lodging[0];
-
- private Transportation[] transportations = new Transportation[0];
-
- private Account[] accounts = new Account[0];
-
- private List signons = new ArrayList();
-
- public List getSignons(){
- return signons;
- }
-
- public void addSignon(Signon aSignon){
- signons.add(aSignon);
- firePropertyChange("signons",null,null);
- }
-
- public void removeSignon(Signon aSignon){
- signons.remove(aSignon);
- firePropertyChange("signons",null,null);
- }
-
- public Category[] getCategories() {
- return categories;
- }
-
- public void addCategory(Category category) {
- categories = (Category[]) append(categories, category);
- firePropertyChange("categories", null, null);
- }
-
- public void addLodging(Lodging lodging) {
- lodgings = (Lodging[]) append(lodgings, lodging);
- firePropertyChange("lodgings", null, null);
- }
-
- public void addTransportation(Transportation transportation) {
- transportations = (Transportation[]) append(transportations, transportation);
- firePropertyChange("transportations", null, null);
- }
-
- public void addAccount(Account account) {
- accounts = (Account[]) append(accounts, account);
- firePropertyChange("accounts", null, null);
- }
-
- public Lodging[] getLodgings() {
- return lodgings;
- }
-
- public void removeLodging(Lodging lodging) {
- lodgings = (Lodging[]) remove(lodgings, lodging);
- firePropertyChange("lodgings", null, null);
- }
-
- public void removeAccount(Account anAccount) {
- accounts = (Account[]) remove(accounts, anAccount);
- firePropertyChange("accounts", null, null);
- }
-
- public Account[] getAccounts() {
- return accounts;
- }
-
- public Transportation[] getTransporations(){
- return transportations;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Category.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Category.java
deleted file mode 100644
index 778a31c..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Category.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class Category extends ModelObject {
-
- private String name;
-
- private Adventure[] adventures = new Adventure[0];
-
- public void setName(String string) {
- Object oldValue = name;
- name = string;
- firePropertyChange("name", oldValue, name);
- }
-
- public void addAdventure(Adventure adventure) {
- adventures = (Adventure[]) append(adventures, adventure);
- firePropertyChange("adventures", null, null);
- }
-
- public Adventure[] getAdventures() {
- return adventures;
- }
-
- public String getName() {
- return name;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Lodging.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Lodging.java
deleted file mode 100644
index 0b9d081..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Lodging.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class Lodging extends ModelObject {
-
- private String name;
- private String description;
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String string) {
- Object oldValue = description;
- description = string;
- firePropertyChange("description",oldValue,description);
- }
-
- public void setName(String string) {
- Object oldValue = name;
- name = string;
- firePropertyChange("name",oldValue,name);
- }
-
- public String getName() {
- return name;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/PriceModelObject.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/PriceModelObject.java
deleted file mode 100644
index 35e3f5e..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/PriceModelObject.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-
-public class PriceModelObject extends ModelObject {
-
- private double price;
-
- public double getDouble(){
- return price;
- }
- public void setPrice(double aPrice){
- int oldDollars = getDollars();
- int oldCents = getCents();
- double oldValue = price;
- price = aPrice;
- firePropertyChange("dollars",oldDollars,getDollars());
- firePropertyChange("cents",oldCents,getCents());
- firePropertyChange("price",new Double(oldValue), new Double(price));
- }
-
- public double getPrice(){
- return price;
- }
-
- public int getCents(){
- return (int) (100*price - 100*Math.floor(price));
- }
-
- public void setCents(int cents){
- double oldPrice = getPrice();
- int oldCents = getCents();
- price = getDollars() + cents *.01;
- firePropertyChange("cents",oldCents,getCents());
- firePropertyChange("price", new Double(oldPrice), new Double(price));
- }
-
- public int getDollars(){
- return new Double(price).intValue();
- }
-
- public void setDollars(int dollars){
- double oldPrice = getPrice();
- int oldDollars = getDollars();
- price = dollars + getCents() *.01;
- firePropertyChange("dollars",oldDollars,getDollars());
- firePropertyChange("price", new Double(oldPrice), new Double(price));
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SampleData.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SampleData.java
deleted file mode 100644
index f30a159..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SampleData.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-
-public class SampleData {
-
- public static Category WINTER_CATEGORY;
-
- public static Category SUMMER_CATEGORY;
-
- public static Adventure BEACH_HOLIDAY;
-
- public static Adventure RAFTING_HOLIDAY;
-
- public static Adventure WINTER_HOLIDAY;
-
- public static Adventure ICE_FISHING;
-
- public static Lodging FIVE_STAR_HOTEL;
-
- public static Lodging YOUTH_HOSTEL;
-
- public static Lodging CAMP_GROUND;
-
- public static Catalog CATALOG_2005;
-
- public static Transportation GREYHOUND_BUS;
-
- public static Transportation EXECUTIVE_JET;
-
- public static Account PRESIDENT;
-
- public static Account DENTIST;
-
- public static Account SANTA_CLAUS;
-
- public static Cart CART;
-
- public static AdventureFactory FACTORY;
-
- // public static ITree CATALOG_TREE;
- //
- // public static ITree CATEGORY_TREE;
-
- public static Signon SIGNON_ADMINISTRATOR;
-
- public static Signon SIGNON_JOEBLOGGS;
-
- static {
- initializeData();
- }
-
- public static void initializeData() {
-
- FACTORY = new AdventureFactory();
-
- CATALOG_2005 = FACTORY.createCatalog();
-
- // Categories
- WINTER_CATEGORY = FACTORY.createCategory();
- WINTER_CATEGORY.setName("Freeze Adventures");
- WINTER_CATEGORY.setId("100");
- CATALOG_2005.addCategory(WINTER_CATEGORY);
-
- SUMMER_CATEGORY = FACTORY.createCategory();
- SUMMER_CATEGORY.setName("Hot Adventures");
- SUMMER_CATEGORY.setId("200");
- CATALOG_2005.addCategory(SUMMER_CATEGORY);
-
- // Adventures
- WINTER_HOLIDAY = FACTORY.createAdventure();
- WINTER_HOLIDAY.setDescription("Winter holiday in France");
- WINTER_HOLIDAY.setName("Ski Alps");
- WINTER_HOLIDAY.setLocation("Chamonix");
- WINTER_HOLIDAY.setPrice(4000.52d);
- WINTER_HOLIDAY.setId("150");
- WINTER_HOLIDAY.setMaxNumberOfPeople(3);
- WINTER_CATEGORY.addAdventure(WINTER_HOLIDAY);
-
- ICE_FISHING = FACTORY.createAdventure();
- ICE_FISHING.setDescription("Ice Fishing in Helsinki");
- ICE_FISHING.setName("Ice Fishing");
- ICE_FISHING.setLocation("Finland");
- ICE_FISHING.setPrice(375.55d);
- WINTER_CATEGORY.addAdventure(ICE_FISHING);
-
- BEACH_HOLIDAY = FACTORY.createAdventure();
- BEACH_HOLIDAY.setDescription("Beach holiday in Spain");
- BEACH_HOLIDAY.setName("Playa");
- BEACH_HOLIDAY.setLocation("Lloret de Mar");
- BEACH_HOLIDAY.setPrice(2000.52d);
- BEACH_HOLIDAY.setId("250");
- SUMMER_CATEGORY.addAdventure(BEACH_HOLIDAY);
-
- RAFTING_HOLIDAY = FACTORY.createAdventure();
- RAFTING_HOLIDAY
- .setDescription("White water rafting on the Ottawa river");
- RAFTING_HOLIDAY.setName("Whitewater");
- RAFTING_HOLIDAY.setLocation("Ottawa");
- RAFTING_HOLIDAY.setPrice(8000.52d);
- RAFTING_HOLIDAY.setId("270");
- SUMMER_CATEGORY.addAdventure(RAFTING_HOLIDAY);
-
- // Lodgings
- FIVE_STAR_HOTEL = FACTORY.createLodging();
- FIVE_STAR_HOTEL.setDescription("Deluxe palace");
- FIVE_STAR_HOTEL.setName("Flashy");
- YOUTH_HOSTEL = FACTORY.createLodging();
- YOUTH_HOSTEL.setDescription("Youth Hostel");
- YOUTH_HOSTEL.setName("Basic");
- CAMP_GROUND = FACTORY.createLodging();
- CAMP_GROUND.setDescription("Camp ground");
- CAMP_GROUND.setName("WetAndCold");
- CATALOG_2005.addLodging(FIVE_STAR_HOTEL);
- CATALOG_2005.addLodging(YOUTH_HOSTEL);
- CATALOG_2005.addLodging(CAMP_GROUND);
- WINTER_HOLIDAY.setDefaultLodging(YOUTH_HOSTEL);
-
- // Transporation
- GREYHOUND_BUS = FACTORY.createTransportation();
- GREYHOUND_BUS.setArrivalTime("14:30");
- GREYHOUND_BUS.setPrice(25.50);
- CATALOG_2005.addTransportation(GREYHOUND_BUS);
- EXECUTIVE_JET = FACTORY.createTransportation();
- EXECUTIVE_JET.setArrivalTime("11:10");
- EXECUTIVE_JET.setPrice(1500.99);
- CATALOG_2005.addTransportation(EXECUTIVE_JET);
-
- // Accounts
- PRESIDENT = FACTORY.createAccount();
- PRESIDENT.setFirstName("George");
- PRESIDENT.setLastName("Bush");
- PRESIDENT.setState("TX");
- PRESIDENT.setPhone("1112223333");
- PRESIDENT.setCountry("U.S.A");
- DENTIST = FACTORY.createAccount();
- DENTIST.setFirstName("Tooth");
- DENTIST.setLastName("Fairy");
- DENTIST.setState("CA");
- DENTIST.setPhone("4543219876");
- DENTIST.setCountry("PainLand");
- SANTA_CLAUS = FACTORY.createAccount();
- SANTA_CLAUS.setFirstName("Chris");
- SANTA_CLAUS.setLastName("Chringle");
- SANTA_CLAUS.setState("WI");
- SANTA_CLAUS.setPhone("8617429856");
- SANTA_CLAUS.setCountry("NorthPole");
- CATALOG_2005.addAccount(PRESIDENT);
- CATALOG_2005.addAccount(DENTIST);
- CATALOG_2005.addAccount(SANTA_CLAUS);
-
- // Signons
- SIGNON_ADMINISTRATOR = new Signon("Administrator", "Foo123Bar");
- SIGNON_JOEBLOGGS = new Signon("JoeBloggs", "Harry5Potter");
- CATALOG_2005.addSignon(SIGNON_ADMINISTRATOR);
- CATALOG_2005.addSignon(SIGNON_JOEBLOGGS);
-
- CART = FACTORY.createCart();
-
- // initTrees();
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Signon.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Signon.java
deleted file mode 100644
index f6fae9f..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Signon.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class Signon extends ModelObject {
-
- String userId;
- String password;
-
- public Signon(String aUserId, String aPassword) {
- userId = aUserId;
- password = aPassword;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String aPassword) {
- String oldValue = password;
- password = aPassword;
- firePropertyChange("password",oldValue,password);
- }
- public String getUserId() {
- return userId;
- }
- public void setUserId(String aUserId) {
- String oldValue = userId;
- userId = aUserId;
- firePropertyChange("userId",oldValue,userId);
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimpleModel.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimpleModel.java
deleted file mode 100644
index cec1927..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimpleModel.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2005 David Orme <djo@coconut-palm-software.com>
- *
- * 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:
- * David Orme - Initial API and implementation
- */
-package org.eclipse.jface.examples.databinding.model;
-
-import java.util.LinkedList;
-
-
-public class SimpleModel {
- public SimpleModel() {
- // Add some sample data to our personList...
- personList.add(new SimplePerson("John", "1234", "Wheaton", "IL"));
- personList.add(new SimplePerson("Jane", "1234", "Glen Ellyn", "IL"));
- personList.add(new SimplePerson("Frank", "1234", "Lombard", "IL"));
- personList.add(new SimplePerson("Joe", "1234", "Elmhurst", "IL"));
- personList.add(new SimplePerson("Chet", "1234", "Oak Lawn", "IL"));
- personList.add(new SimplePerson("Wilbur", "1234", "Austin", "IL"));
- personList.add(new SimplePerson("Elmo", "1234", "Chicago", "IL"));
- }
-
- // Now a PersonList property...
-
- LinkedList personList = new LinkedList();
-
- public LinkedList getPersonList() {
- return personList;
- }
-
-}
\ No newline at end of file
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimpleOrder.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimpleOrder.java
deleted file mode 100644
index 99a68fc..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimpleOrder.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * The Pampered Chef - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.model;
-
-import java.util.Date;
-
-/**
- * @since 1.0
- *
- */
-public class SimpleOrder {
-
- private int orderNumber;
- private Date date;
-
- /**
- * @return Returns the date.
- */
- public Date getDate() {
- return date;
- }
-
- /**
- * @param date The date to set.
- */
- public void setDate(Date date) {
- this.date = date;
- }
-
- /**
- * @return Returns the orderNumber.
- */
- public int getOrderNumber() {
- return orderNumber;
- }
-
- /**
- * @param orderNumber The orderNumber to set.
- */
- public void setOrderNumber(int orderNumber) {
- this.orderNumber = orderNumber;
- }
-
- /**
- * @param i
- * @param date
- */
- public SimpleOrder(int i, Date date) {
- this.orderNumber = i;
- this.date = date;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimplePerson.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimplePerson.java
deleted file mode 100644
index 63ba02e..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/SimplePerson.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2005 David Orme <djo@coconut-palm-software.com>
- *
- * 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:
- * David Orme - Initial API and implementation
- * Brad Reynolds (bug 139407)
- */
-package org.eclipse.jface.examples.databinding.model;
-
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class SimplePerson extends ModelObject {
-
- private String name = "";
- private String address = "";
- private String city = "";
- private String state = "";
-
- private List orders = new LinkedList();
-
- public SimplePerson(String name, String address, String city, String state) {
- this.name = name;
- this.address = address;
- this.city = city;
- this.state = state;
-
- int numOrders = (int) (Math.random() * 5);
- for (int i=0; i < numOrders; ++i) {
- orders.add(new SimpleOrder(i, new Date()));
- }
- }
-
- public SimplePerson() {}
-
- /**
- * @return Returns the address.
- */
- public String getAddress() {
- return address;
- }
-
- /**
- * @param address The address to set.
- */
- public void setAddress(String address) {
- String old = this.address;
- this.address = address;
- firePropertyChange("address", old, address);
- }
-
- /**
- * @return Returns the city.
- */
- public String getCity() {
- return city;
- }
-
- /**
- * @param city The city to set.
- */
- public void setCity(String city) {
- String old = this.city;
- firePropertyChange("city", old, this.city = city);
- }
-
- /**
- * @return Returns the name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name The name to set.
- */
- public void setName(String name) {
- firePropertyChange("name", this.name, this.name = name);
- }
-
- /**
- * @return Returns the state.
- */
- public String getState() {
- return state;
- }
-
- /**
- * @param state The state to set.
- */
- public void setState(String state) {
- firePropertyChange("state", this.state, this.state = state); //$NON-NLS-1$
- }
-
- /**
- * @return Returns the orders.
- */
- public List getOrders() {
- return orders;
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Transportation.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Transportation.java
deleted file mode 100644
index 39fbc08..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/Transportation.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.model;
-
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class Transportation extends ModelObject {
-
- private String arrivalTime;
- private double price;
-
- public void setArrivalTime(String string) {
- String oldValue = arrivalTime;
- arrivalTime = string;
- firePropertyChange("arrivaltime",oldValue,string);
- }
-
- public String getArrivalTime(){
- return arrivalTime;
- }
-
- public double getPrice() {
- return price;
- }
-
- public void setPrice(double aPrice) {
- double oldPrice = price;
- price = aPrice;
- firePropertyChange("price",new Double(oldPrice),new Double(price));
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/nestedselection/TestMasterDetail.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/nestedselection/TestMasterDetail.java
deleted file mode 100644
index 980c75a..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/nestedselection/TestMasterDetail.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.nestedselection;
-
-import org.eclipse.core.databinding.Binding;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.conversion.IConverter;
-import org.eclipse.core.databinding.observable.IObserving;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.databinding.validation.ValidationStatus;
-import org.eclipse.core.internal.databinding.conversion.ObjectToStringConverter;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.examples.databinding.model.SimpleModel;
-import org.eclipse.jface.examples.databinding.model.SimpleOrder;
-import org.eclipse.jface.examples.databinding.model.SimplePerson;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @since 1.0
- *
- */
-public class TestMasterDetail {
- /**
- * @since 3.2
- *
- */
- private static final class CustomUpdateValueStrategy extends
- UpdateValueStrategy {
- protected IStatus doSet(IObservableValue observableValue, Object value) {
- IStatus result = super.doSet(observableValue, value);
- if (result.isOK()) {
- Object changed = observableValue;
- if (changed instanceof IObserving) {
- changed = ((IObserving) changed).getObserved();
- }
- System.out.println("changed: " + changed);
- }
- return result;
- }
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- new TestMasterDetail().run();
- }
-
- private Shell shell = null; // @jve:decl-index=0:visual-constraint="10,10"
-
- private Table personsTable = null;
-
- private Label label1 = null;
-
- private Text name = null;
-
- private Label label2 = null;
-
- private Text address = null;
-
- private Label label3 = null;
-
- private Text city = null;
-
- private Label label4 = null;
-
- private Text state = null;
-
- private Table ordersTable = null;
-
- private Text validationStatus;
-
- /**
- * This method initializes table
- *
- */
- private void createTable() {
- GridData gridData = new org.eclipse.swt.layout.GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
- gridData.horizontalSpan = 2;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
- personsTable = new Table(shell, SWT.FULL_SELECTION);
- personsTable.setHeaderVisible(true);
- personsTable.setLayoutData(gridData);
- personsTable.setLinesVisible(true);
- TableColumn tableColumn = new TableColumn(personsTable, SWT.NONE);
- tableColumn.setWidth(60);
- tableColumn.setText("Name");
- TableColumn tableColumn1 = new TableColumn(personsTable, SWT.NONE);
- tableColumn1.setWidth(60);
- tableColumn1.setText("State");
- }
-
- /**
- * This method initializes table1
- *
- */
- private void createTable1() {
- GridData gridData5 = new org.eclipse.swt.layout.GridData();
- gridData5.horizontalSpan = 2;
- gridData5.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
- gridData5.grabExcessHorizontalSpace = true;
- gridData5.grabExcessVerticalSpace = true;
- gridData5.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
- ordersTable = new Table(shell, SWT.FULL_SELECTION);
- ordersTable.setHeaderVisible(true);
- ordersTable.setLayoutData(gridData5);
- ordersTable.setLinesVisible(true);
- TableColumn tableColumn2 = new TableColumn(ordersTable, SWT.NONE);
- tableColumn2.setWidth(60);
- tableColumn2.setText("Order No");
- TableColumn tableColumn3 = new TableColumn(ordersTable, SWT.NONE);
- tableColumn3.setWidth(60);
- tableColumn3.setText("Date");
- }
-
- /**
- * This method initializes sShell
- */
- private void createShell() {
- GridData gridData5 = new org.eclipse.swt.layout.GridData();
- gridData5.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
- gridData5.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
- GridData gridData4 = new org.eclipse.swt.layout.GridData();
- gridData4.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
- gridData4.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
- GridData gridData3 = new org.eclipse.swt.layout.GridData();
- gridData3.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
- gridData3.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
- GridData gridData2 = new org.eclipse.swt.layout.GridData();
- gridData2.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
- gridData2.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
- GridData gridData1 = new org.eclipse.swt.layout.GridData();
- gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
- gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- shell = new Shell();
- shell.setText("Shell");
- createTable();
- shell.setLayout(gridLayout);
- shell.setSize(new org.eclipse.swt.graphics.Point(495, 357));
- label1 = new Label(shell, SWT.NONE);
- label1.setText("Name");
- name = new Text(shell, SWT.BORDER);
- name.setLayoutData(gridData1);
- label2 = new Label(shell, SWT.NONE);
- label2.setText("Address");
- address = new Text(shell, SWT.BORDER);
- address.setLayoutData(gridData2);
- label3 = new Label(shell, SWT.NONE);
- label3.setText("City");
- city = new Text(shell, SWT.BORDER);
- city.setLayoutData(gridData4);
- label4 = new Label(shell, SWT.NONE);
- label4.setText("State");
- state = new Text(shell, SWT.BORDER);
- state.setLayoutData(gridData3);
- createTable1();
- validationStatus = new Text(shell, SWT.READ_ONLY | SWT.BORDER);
- }
-
- private void run() {
- final Display display = new Display();
-
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- createShell();
- bind(shell);
-
- shell.setSize(600, 600);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- }
- });
- display.dispose();
- }
-
- SimpleModel model = new SimpleModel();
-
- private void bind(Control parent) {
- Realm realm = SWTObservables.getRealm(parent.getDisplay());
-
- TableViewer peopleViewer = new TableViewer(personsTable);
- ObservableListContentProvider peopleViewerContent = new ObservableListContentProvider();
- peopleViewer.setContentProvider(peopleViewerContent);
-
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- peopleViewerContent.getKnownElements(), SimplePerson.class,
- new String[] { "name", "state" });
- peopleViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMaps));
-
- peopleViewer.setInput(new WritableList(realm, model.getPersonList(),
- SimpleModel.class));
-
- IObservableValue selectedPerson = ViewersObservables
- .observeSingleSelection(peopleViewer);
-
- DataBindingContext dbc = new DataBindingContext(realm) {
- protected UpdateValueStrategy createTargetToModelUpdateValueStrategy(
- IObservableValue fromValue, IObservableValue toValue) {
- return new CustomUpdateValueStrategy();
- }
- };
- IConverter upperCaseConverter = new IConverter() {
- public Object convert(Object fromObject) {
- return ((String) fromObject).toUpperCase();
- }
-
- public Object getFromType() {
- return String.class;
- }
-
- public Object getToType() {
- return String.class;
- }
- };
- IValidator vowelValidator = new IValidator() {
- public IStatus validate(Object value) {
- String s = (String) value;
- if (!s.matches("[aeiouAEIOU]*")) {
- return ValidationStatus.error("only vowels allowed");
- }
- return Status.OK_STATUS;
- }
- };
- Binding b = dbc.bindValue(SWTObservables.observeText(name, SWT.Modify),
- BeansObservables.observeDetailValue(realm, selectedPerson,
- "name", String.class), new CustomUpdateValueStrategy()
- .setConverter(upperCaseConverter).setAfterGetValidator(
- vowelValidator), null);
-
-// AggregateValidationStatus status = new AggregateValidationStatus(dbc
-// .getBindings(), AggregateValidationStatus.MAX_SEVERITY);
- dbc.bindValue(SWTObservables.observeText(validationStatus, SWT.NONE),
- b.getValidationStatus(), null, new UpdateValueStrategy().setConverter(new ObjectToStringConverter()));
-
- dbc.bindValue(SWTObservables.observeText(address, SWT.Modify),
- BeansObservables.observeDetailValue(realm, selectedPerson,
- "address", String.class), null, null);
-
- dbc.bindValue(SWTObservables.observeText(city, SWT.Modify),
- BeansObservables.observeDetailValue(realm, selectedPerson,
- "city", String.class), null, null);
-
- dbc.bindValue(SWTObservables.observeText(state, SWT.Modify),
- BeansObservables.observeDetailValue(realm, selectedPerson,
- "state", String.class), null, null);
-
- TableViewer ordersViewer = new TableViewer(ordersTable);
- ObservableListContentProvider ordersViewerContent = new ObservableListContentProvider();
- ordersViewer.setContentProvider(ordersViewerContent);
- ordersViewer.setLabelProvider(new ObservableMapLabelProvider(
- BeansObservables.observeMaps(ordersViewerContent
- .getKnownElements(), SimpleOrder.class, new String[] {
- "orderNumber", "date" })));
-
- IObservableList orders = BeansObservables.observeDetailList(realm,
- selectedPerson, "orders", SimpleOrder.class);
- ordersViewer.setInput(orders);
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/radioGroup/RadioGroup.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/radioGroup/RadioGroup.java
deleted file mode 100644
index 02e8f5d..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/radioGroup/RadioGroup.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.radioGroup;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.jface.examples.databinding.ducks.DuckType;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-
-/**
- * This object decorates a bunch of SWT.RADIO buttons and provides saner
- * selection semantics than you get by default with those radio buttons.
- * <p>
- * Its API is basically the same API as List, but with unnecessary methods
- * removed.
- */
-public class RadioGroup {
-
- private final IRadioButton[] buttons;
- private final Object[] values;
- IRadioButton oldSelection = null;
- IRadioButton selectedButton = null;
- IRadioButton potentialNewSelection = null;
-
- /** (Non-API)
- * Interface IRadioButton. A duck interface that is used internally by RadioGroup
- * and by RadioGroup's unit tests.
- */
- public static interface IRadioButton {
- void setData(String string, Object object);
- void addSelectionListener(SelectionListener selectionListener);
- void setSelection(boolean b);
- boolean getSelection();
- boolean isFocusControl();
- String getText();
- void setText(String string);
- void notifyListeners(int eventType, Event object);
- }
-
- /**
- * Constructs an instance of this widget given an array of Button objects to wrap.
- * The Button objects must have been created with the SWT.RADIO style bit set,
- * and they must all be in the same Composite.
- *
- * @param radioButtons Object[] an array of radio buttons to wrap.
- * @param values Object[] an array of objects corresponding to the value of each radio button.
- */
- public RadioGroup(Object[] radioButtons, Object[] values) {
- IRadioButton[] buttons = new IRadioButton[radioButtons.length];
- if (buttons.length < 1) {
- throw new IllegalArgumentException("A RadioGroup must manage at least one Button");
- }
- for (int i = 0; i < buttons.length; i++) {
- if (!DuckType.instanceOf(IRadioButton.class, radioButtons[i])) {
- throw new IllegalArgumentException("A radio button was not passed");
- }
- buttons[i] = (IRadioButton) DuckType.implement(IRadioButton.class, radioButtons[i]);
- buttons[i].setData(Integer.toString(i), new Integer(i));
- buttons[i].addSelectionListener(selectionListener);
- }
- this.buttons = buttons;
- this.values = values;
- }
-
- /**
- * Returns the object corresponding to the currently-selected radio button
- * or null if no radio button is selected.
- *
- * @return the object corresponding to the currently-selected radio button
- * or null if no radio button is selected.
- */
- public Object getSelection() {
- int selectionIndex = getSelectionIndex();
- if (selectionIndex < 0)
- return "";
- return values[selectionIndex];
- }
-
- /**
- * Sets the selected radio button to the radio button whose model object
- * equals() the object specified by newSelection. If !newSelection.equals()
- * any model object managed by this radio group, deselects all radio buttons.
- *
- * @param newSelection A model object corresponding to one of the model
- * objects associated with one of the radio buttons.
- */
- public void setSelection(Object newSelection) {
- deselectAll();
- for (int i = 0; i < values.length; i++) {
- if (values[i].equals(newSelection)) {
- setSelection(i);
- return;
- }
- }
- }
-
- private SelectionListener selectionListener = new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- potentialNewSelection = getButton(e);
- if (! potentialNewSelection.getSelection()) {
- return;
- }
- if (potentialNewSelection.equals(selectedButton)) {
- return;
- }
-
- if (fireWidgetChangeSelectionEvent(e)) {
- oldSelection = selectedButton;
- selectedButton = potentialNewSelection;
- if (oldSelection == null) {
- oldSelection = selectedButton;
- }
-
- fireWidgetSelectedEvent(e);
- }
- }
-
- private IRadioButton getButton(SelectionEvent e) {
- // If the actual IRadioButton is a test fixture, then the test fixture can't
- // set e.widget, so the button object will be in e.data instead and a dummy
- // Widget will be in e.widget.
- if (e.data != null) {
- return (IRadioButton) e.data;
- }
- return (IRadioButton) DuckType.implement(IRadioButton.class, e.widget);
- }
- };
-
- private List widgetChangeListeners = new LinkedList();
-
- protected boolean fireWidgetChangeSelectionEvent(SelectionEvent e) {
- for (Iterator listenersIter = widgetChangeListeners.iterator(); listenersIter.hasNext();) {
- VetoableSelectionListener listener = (VetoableSelectionListener) listenersIter.next();
- listener.canWidgetChangeSelection(e);
- if (!e.doit) {
- rollbackSelection();
- return false;
- }
- }
- return true;
- }
-
- private void rollbackSelection() {
- Display.getCurrent().asyncExec(new Runnable() {
- public void run() {
- potentialNewSelection.setSelection(false);
- selectedButton.setSelection(true);
-// selectedButton.notifyListeners(SWT.Selection, null);
- }
- });
- }
-
-
- /**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's selection is about to change, by sending
- * it one of the messages defined in the <code>VetoableSelectionListener</code>
- * interface.
- * <p>
- * <code>widgetSelected</code> is called when the selection changes.
- * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see VetoableSelectionListener
- * @see #removeVetoableSelectionListener
- * @see SelectionEvent
- */
- public void addVetoableSelectionListener(VetoableSelectionListener listener) {
- widgetChangeListeners.add(listener);
- }
-
- /**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's selection is about to change.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see VetoableSelectionListener
- * @see #addVetoableSelectionListener
- */
- public void removeVetoableSelectionListener(VetoableSelectionListener listener) {
- widgetChangeListeners.remove(listener);
- }
-
-
- private List widgetSelectedListeners = new ArrayList();
-
- protected void fireWidgetSelectedEvent(SelectionEvent e) {
- for (Iterator listenersIter = widgetSelectedListeners.iterator(); listenersIter.hasNext();) {
- SelectionListener listener = (SelectionListener) listenersIter.next();
- listener.widgetSelected(e);
- }
- }
-
- protected void fireWidgetDefaultSelectedEvent(SelectionEvent e) {
- fireWidgetSelectedEvent(e);
- }
-
- /**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's selection changes, by sending
- * it one of the messages defined in the <code>SelectionListener</code>
- * interface.
- * <p>
- * <code>widgetSelected</code> is called when the selection changes.
- * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #removeSelectionListener
- * @see SelectionEvent
- */
- public void addSelectionListener(SelectionListener listener) {
- widgetSelectedListeners.add(listener);
- }
-
- /**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's selection changes.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #addSelectionListener
- */
- public void removeSelectionListener(SelectionListener listener) {
- widgetSelectedListeners.remove(listener);
- }
-
- /**
- * Deselects the item at the given zero-relative index in the receiver.
- * If the item at the index was already deselected, it remains
- * deselected. Indices that are out of range are ignored.
- *
- * @param index the index of the item to deselect
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public void deselect (int index) {
- if (index < 0 || index >= buttons.length)
- return;
- buttons[index].setSelection(false);
- }
-
- /**
- * Deselects all selected items in the receiver.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public void deselectAll () {
- for (int i = 0; i < buttons.length; i++)
- buttons[i].setSelection(false);
- }
-
- /**
- * Returns the zero-relative index of the item which currently
- * has the focus in the receiver, or -1 if no item has focus.
- *
- * @return the index of the selected item
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public int getFocusIndex () {
- for (int i = 0; i < buttons.length; i++) {
- if (buttons[i].isFocusControl()) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Returns the item at the given, zero-relative index in the
- * receiver. Throws an exception if the index is out of range.
- *
- * @param index the index of the item to return
- * @return the item at the given index
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * FIXME: tck - this should be renamed to getItemText()
- */
- public String getItem (int index) {
- if (index < 0 || index >= buttons.length)
- SWT.error(SWT.ERROR_INVALID_RANGE, null, "getItem for a nonexistant item");
- return buttons[index].getText();
- }
-
- /**
- * Returns the number of items contained in the receiver.
- *
- * @return the number of items
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public int getItemCount () {
- return buttons.length;
- }
-
- /**
- * Returns a (possibly empty) array of <code>String</code>s which
- * are the items in the receiver.
- * <p>
- * Note: This is not the actual structure used by the receiver
- * to maintain its list of items, so modifying the array will
- * not affect the receiver.
- * </p>
- *
- * @return the items in the receiver's list
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public String [] getItems () {
- List itemStrings = new ArrayList();
- for (int i = 0; i < buttons.length; i++) {
- itemStrings.add(buttons[i].getText());
- }
- return (String[]) itemStrings.toArray(new String[itemStrings.size()]);
- }
-
- public Object[] getButtons() {
- return buttons;
- }
-
- /**
- * Returns the zero-relative index of the item which is currently
- * selected in the receiver, or -1 if no item is selected.
- *
- * @return the index of the selected item or -1
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public int getSelectionIndex () {
- for (int i = 0; i < buttons.length; i++) {
- if (buttons[i].getSelection() == true) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Gets the index of an item.
- * <p>
- * The list is searched starting at 0 until an
- * item is found that is equal to the search item.
- * If no item is found, -1 is returned. Indexing
- * is zero based.
- *
- * @param string the search item
- * @return the index of the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public int indexOf (String string) {
- for (int i = 0; i < buttons.length; i++) {
- if (buttons[i].getText().equals(string)) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Searches the receiver's list starting at the given,
- * zero-relative index until an item is found that is equal
- * to the argument, and returns the index of that item. If
- * no item is found or the starting index is out of range,
- * returns -1.
- *
- * @param string the search item
- * @param start the zero-relative index at which to start the search
- * @return the index of the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public int indexOf (String string, int start) {
- for (int i = start; i < buttons.length; i++) {
- if (buttons[i].getText().equals(string)) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Returns <code>true</code> if the item is selected,
- * and <code>false</code> otherwise. Indices out of
- * range are ignored.
- *
- * @param index the index of the item
- * @return the visibility state of the item at the index
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public boolean isSelected (int index) {
- return buttons[index].getSelection();
- }
-
- /**
- * Selects the item at the given zero-relative index in the receiver's
- * list. If the item at the index was already selected, it remains
- * selected. Indices that are out of range are ignored.
- *
- * @param index the index of the item to select
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public void select (int index) {
- if (index < 0 || index >= buttons.length)
- return;
- buttons[index].setSelection(true);
- }
-
- /**
- * Sets the text of the item in the receiver's list at the given
- * zero-relative index to the string argument. This is equivalent
- * to <code>remove</code>'ing the old item at the index, and then
- * <code>add</code>'ing the new item at that index.
- *
- * @param index the index for the item
- * @param string the new text for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
- public void setItem (int index, String string) {
- if (index < 0 || index >= buttons.length)
- SWT.error(SWT.ERROR_INVALID_RANGE, null, "setItem for a nonexistant item");
- buttons[index].setText(string);
- }
-
- /**
- * Selects the item at the given zero-relative index in the receiver.
- * If the item at the index was already selected, it remains selected.
- * The current selection is first cleared, then the new item is selected.
- * Indices that are out of range are ignored.
- *
- * @param index the index of the item to select
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- * @see List#deselectAll()
- * @see List#select(int)
- */
- public void setSelection (int index) {
- if (index < 0 || index > buttons.length - 1) {
- return;
- }
- buttons[index].setSelection(true);
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/radioGroup/VetoableSelectionListener.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/radioGroup/VetoableSelectionListener.java
deleted file mode 100644
index 86f5d7b..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/radioGroup/VetoableSelectionListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.radioGroup;
-
-import org.eclipse.swt.events.SelectionEvent;
-
-/**
- * Interface VetoableSelectionListener. An interface for SelectionListeners
- * that permit the new selection to be vetoed before widgetSelected or
- * widgetDefaultSelected is called.
- */
-public interface VetoableSelectionListener {
- /**
- * Method widgetCanChangeSelection. Indicates that the selection is
- * about to be changed. Setting e.doit to false will prevent the
- * selection from changing.
- *
- * @param e The SelectionEvent that is being processed.
- */
- public void canWidgetChangeSelection(SelectionEvent e);
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet000HelloWorld.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet000HelloWorld.java
deleted file mode 100644
index 492dcdc..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet000HelloWorld.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef, Inc. 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:
- * The Pampered Chef, Inc. - initial API and implementation
- * Brad Reynolds - bug 116920
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Hello, databinding. Bind changes in a GUI to a Model object but don't worry
- * about propogating changes from the Model to the GUI.
- * <p>
- * Illustrates the basic Model-ViewModel-Binding-View architecture typically
- * used in data binding applications.
- */
-public class Snippet000HelloWorld {
- public static void main(String[] args) {
- Display display = new Display();
- final ViewModel viewModel = new ViewModel();
-
- Realm.runWithDefault(SWTObservables.getRealm(display),
- new Runnable() {
- public void run() {
- final Shell shell = new View(viewModel).createShell();
- // The SWT event loop
- Display display = Display.getCurrent();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
- });
- // Print the results
- System.out.println("person.getName() = "
- + viewModel.getPerson().getName());
- }
-
- // The data model class. This is normally a persistent class of some sort.
- //
- // In this example, we only push changes from the GUI to the model, so we
- // don't worry about implementing JavaBeans bound properties. If we need
- // our GUI to automatically reflect changes in the Person object, the
- // Person object would need to implement the JavaBeans property change
- // listener methods.
- static class Person {
- // A property...
- String name = "HelloWorld";
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
- }
-
- // The View's model--the root of our Model graph for this particular GUI.
- //
- // Typically each View class has a corresponding ViewModel class.
- // The ViewModel is responsible for getting the objects to edit from the
- // DAO. Since this snippet doesn't have any persistent objects to
- // retrieve, this ViewModel just instantiates a model object to edit.
- static class ViewModel {
- // The model to bind
- private Person person = new Person();
-
- public Person getPerson() {
- return person;
- }
- }
-
- // The GUI view
- static class View {
- private ViewModel viewModel;
- private Text name;
-
- public View(ViewModel viewModel) {
- this.viewModel = viewModel;
- }
-
- public Shell createShell() {
- // Build a UI
- Display display = Display.getDefault();
- Shell shell = new Shell(display);
- shell.setLayout(new RowLayout(SWT.VERTICAL));
- name = new Text(shell, SWT.BORDER);
-
- // Bind it
- DataBindingContext bindingContext = new DataBindingContext();
- Person person = viewModel.getPerson();
-
- bindingContext.bindValue(SWTObservables.observeText(name,
- SWT.Modify), BeansObservables.observeValue(person, "name"),
- null, null);
-
- // Open and return the Shell
- shell.pack();
- shell.open();
- return shell;
- }
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet001NestedSelectionWithCombo.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet001NestedSelectionWithCombo.java
deleted file mode 100644
index c701255..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet001NestedSelectionWithCombo.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef, Inc. 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:
- * The Pampered Chef, Inc. - initial API and implementation
- * Brad Reynolds - bug 116920
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.Observables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Demonstrates nested selection.<br>
- * At the first level, user may select a person.<br>
- * At the second level, user may select a city to associate with the selected<br>
- * person or edit the person's name.
- */
-public class Snippet001NestedSelectionWithCombo {
- public static void main(String[] args) {
- ViewModel viewModel = new ViewModel();
- Shell shell = new View(viewModel).createShell();
-
- // The SWT event loop
- Display display = Display.getCurrent();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
-
- // Minimal JavaBeans support
- public static abstract class AbstractModelObject {
- private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
- this);
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(propertyName,
- listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(propertyName,
- listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue,
- newValue);
- }
- }
-
- // The data model class. This is normally a persistent class of some sort.
- //
- // This example implements full JavaBeans bound properties so that changes
- // to instances of this class will automatically be propogated to the UI.
- public static class Person extends AbstractModelObject {
- // Constructor
- public Person(String name, String city) {
- this.name = name;
- this.city = city;
- }
-
- // Some JavaBean bound properties...
- String name;
-
- String city;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- String oldValue = this.name;
- this.name = name;
- firePropertyChange("name", oldValue, name);
- }
-
- public String getCity() {
- return city;
- }
-
- public void setCity(String city) {
- String oldValue = this.city;
- this.city = city;
- firePropertyChange("city", oldValue, city);
- }
- }
-
- // The View's model--the root of our GUI's Model graph
- //
- // Typically each View class has a corresponding ViewModel class.
- // The ViewModel is responsible for getting the objects to edit from the
- // DAO. Since this snippet doesn't have any persistent objects to
- // retrieve, this ViewModel just instantiates some objects to edit.
- //
- // This ViewModel also implements JavaBean bound properties.
- static class ViewModel extends AbstractModelObject {
- // The model to bind
- private ArrayList people = new ArrayList();
- {
- people.add(new Person("Wile E. Coyote", "Tucson"));
- people.add(new Person("Road Runner", "Lost Horse"));
- people.add(new Person("Bugs Bunny", "Forrest"));
- }
-
- // Choice of cities for the Combo
- private ArrayList cities = new ArrayList();
- {
- cities.add("Tucson");
- cities.add("AcmeTown");
- cities.add("Lost Horse");
- cities.add("Forrest");
- cities.add("Lost Mine");
- }
-
- public ArrayList getPeople() {
- return people;
- }
-
- public ArrayList getCities() {
- return cities;
- }
- }
-
- // The GUI view
- static class View {
- private ViewModel viewModel;
-
- public View(ViewModel viewModel) {
- this.viewModel = viewModel;
- }
-
- public Shell createShell() {
- // Build a UI
- Shell shell = new Shell(Display.getCurrent());
- Realm realm = SWTObservables.getRealm(shell.getDisplay());
-
- List peopleList = new List(shell, SWT.BORDER);
- Text name = new Text(shell, SWT.BORDER);
- Combo city = new Combo(shell, SWT.BORDER | SWT.READ_ONLY);
-
- ListViewer peopleListViewer = new ListViewer(peopleList);
- IObservableMap attributeMap = BeansObservables.observeMap(
- Observables.staticObservableSet(realm, new HashSet(
- viewModel.getPeople())), Person.class, "name");
- peopleListViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMap));
- peopleListViewer.setContentProvider(new ArrayContentProvider());
- peopleListViewer.setInput(viewModel.getPeople());
-
- DataBindingContext dbc = new DataBindingContext(realm);
- IObservableValue selectedPerson = ViewersObservables
- .observeSingleSelection(peopleListViewer);
- dbc.bindValue(SWTObservables.observeText(name, SWT.Modify),
- BeansObservables.observeDetailValue(realm, selectedPerson,
- "name", String.class), null, null);
-
- ComboViewer cityViewer = new ComboViewer(city);
- cityViewer.setContentProvider(new ArrayContentProvider());
- cityViewer.setInput(viewModel.getCities());
-
- IObservableValue citySelection = ViewersObservables
- .observeSingleSelection(cityViewer);
- dbc.bindValue(citySelection, BeansObservables.observeDetailValue(
- realm, selectedPerson, "city", String.class), null, null);
-
- GridLayoutFactory.swtDefaults().applyTo(shell);
- // Open and return the Shell
- shell.pack();
- shell.open();
- return shell;
- }
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet002UpdateComboRetainSelection.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet002UpdateComboRetainSelection.java
deleted file mode 100644
index 9ac3dc2..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet002UpdateComboRetainSelection.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef, Inc. 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:
- * The Pampered Chef, Inc. - initial API and implementation
- * Brad Reynolds - bug 116920
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
-import org.eclipse.core.databinding.observable.masterdetail.MasterDetailObservables;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Shows how to bind a Combo so that when update its items, the selection is
- * retained if at all possible.
- *
- * @since 3.2
- */
-public class Snippet002UpdateComboRetainSelection {
- public static void main(String[] args) {
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- ViewModel viewModel = new ViewModel();
- Shell shell = new View(viewModel).createShell();
-
- // The SWT event loop
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
-
- // Print the results
- System.out.println(viewModel.getText());
- }
- });
- display.dispose();
- }
-
- // Minimal JavaBeans support
- public static abstract class AbstractModelObject {
- private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(propertyName, listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
- }
-
- // The View's model--the root of our Model graph for this particular GUI.
- public static class ViewModel extends AbstractModelObject {
- private String text = "beef";
-
- private List choices = new ArrayList();
- {
- choices.add("pork");
- choices.add("beef");
- choices.add("poultry");
- choices.add("vegatables");
- }
-
- public List getChoices() {
- return choices;
- }
-
- public void setChoices(List choices) {
- List old = this.choices;
- this.choices = choices;
- firePropertyChange("choices", old, choices);
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- String oldValue = this.text;
- this.text = text;
- firePropertyChange("test", oldValue, text);
- }
- }
-
- // The GUI view
- static class View {
- private ViewModel viewModel;
- /**
- * used to make a new choices array unique
- */
- static int count;
-
- public View(ViewModel viewModel) {
- this.viewModel = viewModel;
- }
-
- public Shell createShell() {
- // Build a UI
- Shell shell = new Shell(Display.getCurrent());
- shell.setLayout(new RowLayout(SWT.VERTICAL));
-
- Combo combo = new Combo(shell, SWT.BORDER | SWT.READ_ONLY);
- Button reset = new Button(shell, SWT.NULL);
- reset.setText("reset collection");
- reset.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- List newList = new ArrayList();
- newList.add("Chocolate");
- newList.add("Vanilla");
- newList.add("Mango Parfait");
- newList.add("beef");
- newList.add("Cheesecake");
- newList.add(Integer.toString(++count));
- viewModel.setChoices(newList);
- }
- });
-
- // Print value out first
- System.out.println(viewModel.getText());
-
- DataBindingContext dbc = new DataBindingContext();
-
- IObservableList list = MasterDetailObservables.detailList(BeansObservables.observeValue(viewModel, "choices"),
- getListDetailFactory(),
- String.class);
- dbc.bindList(SWTObservables.observeItems(combo), list, null, null);
- dbc.bindValue(SWTObservables.observeText(combo), BeansObservables.observeValue(viewModel, "text"), null, null);
-
- // Open and return the Shell
- shell.pack();
- shell.open();
- return shell;
- }
- }
-
- private static IObservableFactory getListDetailFactory() {
- return new IObservableFactory() {
- public IObservable createObservable(Object target) {
- WritableList list = WritableList.withElementType(String.class);
- list.addAll((Collection) target);
- return list;
- }
- };
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet003UpdateComboBindUsingViewer.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet003UpdateComboBindUsingViewer.java
deleted file mode 100644
index 86b4814..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet003UpdateComboBindUsingViewer.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef, Inc. 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:
- * The Pampered Chef, Inc. - initial API and implementation
- * Brad Reynolds - bug 116920
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
-import org.eclipse.core.databinding.observable.masterdetail.MasterDetailObservables;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Shows how to bind a Combo so that when update its items, the selection is
- * retained if at all possible.
- *
- * @since 3.2
- */
-public class Snippet003UpdateComboBindUsingViewer {
- public static void main(String[] args) {
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- ViewModel viewModel = new ViewModel();
- Shell shell = new View(viewModel).createShell();
-
- // The SWT event loop
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- // Print the results
- System.out.println(viewModel.getText());
- }
- });
- display.dispose();
- }
-
- // Minimal JavaBeans support
- public static abstract class AbstractModelObject {
- private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
- this);
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(propertyName,
- listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(propertyName,
- listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue,
- newValue);
- }
- }
-
- // The View's model--the root of our Model graph for this particular GUI.
- public static class ViewModel extends AbstractModelObject {
- private String text = "beef";
-
- private List choices = new ArrayList();
- {
- choices.add("pork");
- choices.add("beef");
- choices.add("poultry");
- choices.add("vegatables");
- }
-
- public List getChoices() {
- return choices;
- }
-
- public void setChoices(List choices) {
- this.choices = choices;
- firePropertyChange("choices", null, null);
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- String oldValue = this.text;
- this.text = text;
- firePropertyChange("test", oldValue, text);
- }
- }
-
- // The GUI view
- static class View {
- private ViewModel viewModel;
-
- public View(ViewModel viewModel) {
- this.viewModel = viewModel;
- }
-
- public Shell createShell() {
- // Build a UI
- Shell shell = new Shell(Display.getCurrent());
- shell.setLayout(new RowLayout(SWT.VERTICAL));
-
- Combo combo = new Combo(shell, SWT.BORDER | SWT.READ_ONLY);
- ComboViewer viewer = new ComboViewer(combo);
- Button reset = new Button(shell, SWT.NULL);
- reset.setText("reset collection");
- reset.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- List newList = new ArrayList();
- newList.add("Chocolate");
- newList.add("Vanilla");
- newList.add("Mango Parfait");
- newList.add("beef");
- newList.add("Cheesecake");
- viewModel.setChoices(newList);
- }
- });
-
- // Print value out first
- System.out.println(viewModel.getText());
-
- DataBindingContext dbc = new DataBindingContext();
- IObservableList list = MasterDetailObservables.detailList(
- BeansObservables.observeValue(viewModel, "choices"),
- getListDetailFactory(), String.class);
- viewer.setContentProvider(new ObservableListContentProvider());
- viewer.setInput(list);
-
- dbc.bindValue(ViewersObservables.observeSingleSelection(viewer),
- BeansObservables.observeValue(viewModel, "text"), null, null);
-
- // Open and return the Shell
- shell.pack();
- shell.open();
- return shell;
- }
- }
-
- private static IObservableFactory getListDetailFactory() {
- return new IObservableFactory() {
- public IObservable createObservable(Object target) {
- WritableList list = WritableList.withElementType(String.class);
- list.addAll((Collection) target);
- return list;
- }
- };
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet004DataBindingContextErrorLabel.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet004DataBindingContextErrorLabel.java
deleted file mode 100644
index 1350712..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet004DataBindingContextErrorLabel.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 116920, 159768
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import org.eclipse.core.databinding.AggregateValidationStatus;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.databinding.validation.ValidationStatus;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Snippet that displays how to bind the validation error of the
- * {@link DataBindingContext} to a label.
- *
- * @since 3.2
- */
-public class Snippet004DataBindingContextErrorLabel {
- public static void main(String[] args) {
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout(2, false));
-
- new Label(shell, SWT.NONE).setText("Enter '5' to be valid:");
-
- Text text = new Text(shell, SWT.BORDER);
- WritableValue value = WritableValue.withValueType(String.class);
- new Label(shell, SWT.NONE).setText("Error:");
-
- Label errorLabel = new Label(shell, SWT.BORDER);
- errorLabel.setForeground(display.getSystemColor(SWT.COLOR_RED));
- GridDataFactory.swtDefaults().hint(200, SWT.DEFAULT).applyTo(
- errorLabel);
-
- DataBindingContext dbc = new DataBindingContext();
-
- // Bind the text to the value.
- dbc.bindValue(SWTObservables.observeText(text, SWT.Modify),
- value, new UpdateValueStrategy().setAfterConvertValidator(new FiveValidator()), null);
-
- // Bind the error label to the validation error on the dbc.
- dbc.bindValue(SWTObservables.observeText(errorLabel),
- new AggregateValidationStatus(dbc.getBindings(),
- AggregateValidationStatus.MAX_SEVERITY), null, null);
-
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- }
- });
- display.dispose();
- }
-
- /**
- * Validator that returns validation errors for any value other than 5.
- *
- * @since 3.2
- */
- private static class FiveValidator implements IValidator {
- public IStatus validate(Object value) {
- return ("5".equals(value)) ? Status.OK_STATUS : ValidationStatus
- .error("the value was '" + value + "', not '5'");
- }
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet005MenuUpdater.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet005MenuUpdater.java
deleted file mode 100644
index f84b40c..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet005MenuUpdater.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.util.Date;
-import java.util.Iterator;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.internal.databinding.provisional.swt.MenuUpdater;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- */
-public class Snippet005MenuUpdater {
- public static void main(String[] args) {
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- Shell shell = new Shell(display);
-
- final WritableList menuItemStrings = new WritableList();
- display.asyncExec(new Runnable() {
- public void run() {
- System.out.println("adding item");
- menuItemStrings.add(new Date().toString());
- display.timerExec(5000, this);
- }
- });
-
- Menu bar = new Menu(shell, SWT.BAR);
- shell.setMenuBar(bar);
- MenuItem fileItem = new MenuItem(bar, SWT.CASCADE);
- fileItem.setText("&Test Menu");
- final Menu submenu = new Menu(shell, SWT.DROP_DOWN);
- fileItem.setMenu(submenu);
- new MenuUpdater(submenu) {
- protected void updateMenu() {
- System.out.println("updating menu");
- MenuItem[] items = submenu.getItems();
- int itemIndex = 0;
- for (Iterator it = menuItemStrings.iterator(); it
- .hasNext();) {
- MenuItem item;
- if (itemIndex < items.length) {
- item = items[itemIndex++];
- } else {
- item = new MenuItem(submenu, SWT.NONE);
- }
- String string = (String) it.next();
- item.setText(string);
- }
- while (itemIndex < items.length) {
- items[itemIndex++].dispose();
- }
- }
- };
-
- shell.open();
-
- // The SWT event loop
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
- });
- display.dispose();
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet006Spreadsheet.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet006Spreadsheet.java
deleted file mode 100644
index 38f4334..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet006Spreadsheet.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.text.NumberFormat;
-import java.text.ParseException;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.ComputedValue;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.internal.databinding.provisional.swt.TableUpdater;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ControlEditor;
-import org.eclipse.swt.custom.TableCursor;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @since 1.1
- *
- */
-public class Snippet006Spreadsheet {
-
- private static final int COUNTER_UPDATE_DELAY = 1000;
-
- private static final int NUM_COLUMNS = 16;
-
- private static final int NUM_ROWS = 100;
-
- /**
- * 0 for no output, 1 for some, 2 for more
- */
- private static int DEBUG_LEVEL = 0;
-
- /**
- * If true, there will be a automatic counter at B1.
- */
- private static boolean FUNKY_COUNTER = true;
-
- /**
- * // * If true, all formulas (except for row 1 and column A) will be the
- * sum of the values of their left and top neighbouring cells.
- */
- private static boolean FUNKY_FORMULAS = true;
-
- static WritableValue[][] cellFormulas = new WritableValue[NUM_ROWS][NUM_COLUMNS];
-
- static ComputedValue[][] cellValues = new ComputedValue[NUM_ROWS][NUM_COLUMNS];
-
- static class ComputedCellValue extends ComputedValue {
- private final IObservableValue cellFormula;
-
- private boolean calculating;
-
- ComputedCellValue(IObservableValue cellFormula) {
- this.cellFormula = cellFormula;
- }
-
- protected Object calculate() {
- if (calculating) {
- return "#cycle";
- }
- try {
- calculating = true;
- return evaluate(cellFormula.getValue());
- } finally {
- calculating = false;
- }
- }
-
- private Object evaluate(Object value) {
- if (DEBUG_LEVEL >= 2) {
- System.out.println("evaluating " + this + " ...");
- }
- if (value == null) {
- return "";
- }
- try {
- String s = (String) value;
- if (!s.startsWith("=")) {
- return s;
- }
- String addition = s.substring(1);
- int indexOfPlus = addition.indexOf('+');
- String operand1 = addition.substring(0, indexOfPlus);
- double value1 = eval(operand1);
- String operand2 = addition.substring(indexOfPlus + 1);
- double value2 = eval(operand2);
- return NumberFormat.getNumberInstance().format(value1 + value2);
- } catch (Exception ex) {
- return ex.getMessage();
- }
- }
-
- /**
- * @param s
- * @return
- * @throws ParseException
- */
- private double eval(String s) throws ParseException {
- if (s.length() == 0) {
- return 0;
- }
- char character = s.charAt(0);
- if (Character.isLetter(character)) {
- character = Character.toLowerCase(character);
- // reference to other cell
- int columnIndex = character - 'a';
- int rowIndex = 0;
- rowIndex = NumberFormat.getNumberInstance().parse(
- s.substring(1)).intValue() - 1;
- String value = (String) cellValues[rowIndex][columnIndex]
- .getValue();
- return value.length() == 0 ? 0 : NumberFormat
- .getNumberInstance().parse(value).doubleValue();
- }
- return NumberFormat.getNumberInstance().parse(s).doubleValue();
- }
- }
-
- protected static int counter;
-
- public static void main(String[] args) {
-
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- Shell shell = new Shell(display);
-
- final Table table = new Table(shell, SWT.BORDER | SWT.MULTI
- | SWT.FULL_SELECTION | SWT.VIRTUAL);
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
-
- for (int i = 0; i < NUM_COLUMNS; i++) {
- TableColumn tableColumn = new TableColumn(table, SWT.NONE);
- tableColumn.setText(Character.toString((char) ('A' + i)));
- tableColumn.setWidth(40);
- }
- for (int i = 0; i < NUM_ROWS; i++) {
- new TableItem(table, SWT.NONE);
- for (int j = 0; j < NUM_COLUMNS; j++) {
- cellFormulas[i][j] = new WritableValue();
- cellValues[i][j] = new ComputedCellValue(
- cellFormulas[i][j]);
- if (!FUNKY_FORMULAS || i == 0 || j == 0) {
- cellFormulas[i][j].setValue("");
- } else {
- cellFormulas[i][j].setValue("="
- + cellReference(i - 1, j) + "+"
- + cellReference(i, j - 1));
- }
- }
- }
-
- new TableUpdater(table) {
- protected void updateItem(TableItem item) {
- int rowIndex = item.getParent().indexOf(item);
- if (DEBUG_LEVEL >= 1) {
- System.out.println("updating row " + rowIndex);
- }
- for (int j = 0; j < NUM_COLUMNS; j++) {
- item.setText(j, (String) cellValues[rowIndex][j]
- .getValue());
- }
- }
- };
-
- if (FUNKY_COUNTER) {
- // counter in A1
- display.asyncExec(new Runnable() {
- public void run() {
- cellFormulas[0][1].setValue("" + counter++);
- display.timerExec(COUNTER_UPDATE_DELAY, this);
- }
- });
- }
-
- // create a TableCursor to navigate around the table
- final TableCursor cursor = new TableCursor(table, SWT.NONE);
- // create an editor to edit the cell when the user hits "ENTER"
- // while over a cell in the table
- final ControlEditor editor = new ControlEditor(cursor);
- editor.grabHorizontal = true;
- editor.grabVertical = true;
-
- cursor.addSelectionListener(new SelectionAdapter() {
- // when the TableEditor is over a cell, select the
- // corresponding row
- // in
- // the table
- public void widgetSelected(SelectionEvent e) {
- table.setSelection(new TableItem[] { cursor.getRow() });
- }
-
- // when the user hits "ENTER" in the TableCursor, pop up a
- // text
- // editor so that
- // they can change the text of the cell
- public void widgetDefaultSelected(SelectionEvent e) {
- final Text text = new Text(cursor, SWT.NONE);
- TableItem row = cursor.getRow();
- int rowIndex = table.indexOf(row);
- int columnIndex = cursor.getColumn();
- text
- .setText((String) cellFormulas[rowIndex][columnIndex]
- .getValue());
- text.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- // close the text editor and copy the data over
- // when the user hits "ENTER"
- if (e.character == SWT.CR) {
- TableItem row = cursor.getRow();
- int rowIndex = table.indexOf(row);
- int columnIndex = cursor.getColumn();
- cellFormulas[rowIndex][columnIndex]
- .setValue(text.getText());
- text.dispose();
- }
- // close the text editor when the user hits
- // "ESC"
- if (e.character == SWT.ESC) {
- text.dispose();
- }
- }
- });
- editor.setEditor(text);
- text.setFocus();
- }
- });
- // Hide the TableCursor when the user hits the "MOD1" or "MOD2"
- // key.
- // This alows the user to select multiple items in the table.
- cursor.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.keyCode == SWT.MOD1 || e.keyCode == SWT.MOD2
- || (e.stateMask & SWT.MOD1) != 0
- || (e.stateMask & SWT.MOD2) != 0) {
- cursor.setVisible(false);
- }
- }
- });
- // Show the TableCursor when the user releases the "MOD2" or
- // "MOD1" key.
- // This signals the end of the multiple selection task.
- table.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- if (e.keyCode == SWT.MOD1
- && (e.stateMask & SWT.MOD2) != 0)
- return;
- if (e.keyCode == SWT.MOD2
- && (e.stateMask & SWT.MOD1) != 0)
- return;
- if (e.keyCode != SWT.MOD1
- && (e.stateMask & SWT.MOD1) != 0)
- return;
- if (e.keyCode != SWT.MOD2
- && (e.stateMask & SWT.MOD2) != 0)
- return;
-
- TableItem[] selection = table.getSelection();
- TableItem row = (selection.length == 0) ? table
- .getItem(table.getTopIndex()) : selection[0];
- table.showItem(row);
- cursor.setSelection(row, 0);
- cursor.setVisible(true);
- cursor.setFocus();
- }
- });
-
- GridLayoutFactory.fillDefaults().generateLayout(shell);
- shell.setSize(400, 300);
- shell.open();
-
- // The SWT event loop
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
- });
- display.dispose();
- }
-
- private static String cellReference(int rowIndex, int columnIndex) {
- String cellReference = "" + ((char) ('A' + columnIndex))
- + (rowIndex + 1);
- return cellReference;
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet007ColorLabelProvider.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet007ColorLabelProvider.java
deleted file mode 100644
index aac19d2..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet007ColorLabelProvider.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * IBM Corporation - see bug 137934
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.Observables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITableColorProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-/**
- * An example showing how to create a {@link ILabelProvider label provider} that
- * to provide colors.
- *
- * @since 3.2
- */
-public class Snippet007ColorLabelProvider {
- /**
- * @param args
- */
- public static void main(String[] args) {
- final List persons = new ArrayList();
- persons.add(new Person("Fiona Apple", Person.FEMALE));
- persons.add(new Person("Elliot Smith", Person.MALE));
- persons.add(new Person("Diana Krall", Person.FEMALE));
- persons.add(new Person("David Gilmour", Person.MALE));
-
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- Shell shell = new Shell(display);
- shell.setText("Gender Bender");
- shell.setLayout(new GridLayout());
-
- Table table = new Table(shell, SWT.SINGLE | SWT.H_SCROLL
- | SWT.V_SCROLL | SWT.BORDER);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- table.setLayoutData(gridData);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- TableColumn column = new TableColumn(table, SWT.NONE);
- column.setText("No");
- column.setWidth(20);
- column = new TableColumn(table, SWT.NONE);
- column.setText("Name");
- column.setWidth(100);
- final TableViewer viewer = new TableViewer(table);
-
- IObservableList observableList = Observables
- .staticObservableList(persons);
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
-
- viewer.setContentProvider(contentProvider);
-
- // this does not have to correspond to the columns in the table,
- // we just list all attributes that affect the table content.
- IObservableMap[] attributes = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Person.class,
- new String[] { "name", "gender" });
-
- class ColorLabelProvider extends ObservableMapLabelProvider
- implements ITableColorProvider {
- Color male = display.getSystemColor(SWT.COLOR_BLUE);
-
- Color female = new Color(display, 255, 192, 203);
-
- ColorLabelProvider(IObservableMap[] attributes) {
- super(attributes);
- }
-
- // to drive home the point that attributes does not have to
- // match
- // the columns
- // in the table, we change the column text as follows:
- public String getColumnText(Object element, int index) {
- if (index == 0) {
- return Integer
- .toString(persons.indexOf(element) + 1);
- }
- return ((Person) element).getName();
- }
-
- public Color getBackground(Object element, int index) {
- return null;
- }
-
- public Color getForeground(Object element, int index) {
- if (index == 0)
- return null;
- Person person = (Person) element;
- return (person.getGender() == Person.MALE) ? male
- : female;
- }
-
- public void dispose() {
- super.dispose();
- female.dispose();
- }
- }
- viewer.setLabelProvider(new ColorLabelProvider(attributes));
-
- viewer.setInput(observableList);
-
- table.getColumn(0).pack();
-
- Button button = new Button(shell, SWT.PUSH);
- button.setText("Toggle Gender");
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent arg0) {
- StructuredSelection selection = (StructuredSelection) viewer
- .getSelection();
- if (selection != null && !selection.isEmpty()) {
- Person person = (Person) selection
- .getFirstElement();
- person
- .setGender((person.getGender() == Person.MALE) ? Person.FEMALE
- : Person.MALE);
- }
- }
- });
-
- shell.setSize(300, 400);
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- }
- });
- display.dispose();
- }
-
- private static class Person {
- static final int MALE = 0;
-
- static final int FEMALE = 1;
-
- private String name;
-
- private int gender;
-
- private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
- this);
-
- Person(String name, int gender) {
- this.name = name;
- this.gender = gender;
- }
-
- /**
- * Returns the name. Method declared public to satisfy Java bean
- * conventions
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param listener
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Returns the gender. Method declared public to satisfy Java bean
- * conventions
- *
- * @return the gender
- */
- public int getGender() {
- return gender;
- }
-
- void setGender(int gender) {
- changeSupport.firePropertyChange("gender", this.gender,
- this.gender = gender);
- }
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet008ComputedValue.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet008ComputedValue.java
deleted file mode 100644
index 38433d9..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet008ComputedValue.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.observable.ObservableTracker;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.ComputedValue;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Snippet that demostrates a simple use case using ComputedValue to format a
- * name as the user enters first and last name.
- *
- * @since 3.2
- */
-public class Snippet008ComputedValue {
- /**
- * @param args
- */
- public static void main(String[] args) {
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
-
- final UI ui = new UI(shell);
- final Data data = new Data();
-
- // Bind the UI to the Data.
- DataBindingContext dbc = new DataBindingContext();
- dbc.bindValue(SWTObservables.observeText(ui.firstName,
- SWT.Modify), data.firstName, null, null);
- dbc.bindValue(SWTObservables.observeText(ui.lastName,
- SWT.Modify), data.lastName, null, null);
-
- // Construct the formatted name observable.
- FormattedName formattedName = new FormattedName(data.firstName,
- data.lastName);
-
- // Bind the formatted name Text to the formatted name
- // observable.
- dbc.bindValue(SWTObservables.observeText(ui.formattedName,
- SWT.None), formattedName, new UpdateValueStrategy(false, UpdateValueStrategy.POLICY_NEVER), null);
-
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- }
- });
- display.dispose();
- }
-
- /**
- * Creates the formatted name on change of the first or last name
- * observables.
- * <p>
- * The key to understanding ComputedValue is understanding that it knows of
- * the observables that are queried without being told. This is done with
- * {@link ObservableTracker} voodoo. When calculate() is invoked
- * <code>ObservableTracker</code> records the observables that are
- * queried. It then exposes those observables and <code>ComputedValue</code>
- * can listen to changes in those objects and react accordingly.
- * </p>
- *
- * @since 3.2
- */
- static class FormattedName extends ComputedValue {
- private IObservableValue firstName;
-
- private IObservableValue lastName;
-
- FormattedName(IObservableValue firstName, IObservableValue lastName) {
- this.firstName = firstName;
- this.lastName = lastName;
- }
-
- protected Object calculate() {
- String lastName = (String) this.lastName.getValue();
- String firstName = (String) this.firstName.getValue();
- lastName = (lastName != null && lastName.length() > 0) ? lastName
- : "[Last Name]";
- firstName = (firstName != null && firstName.length() > 0) ? firstName
- : "[First Name]";
-
- StringBuffer buffer = new StringBuffer();
- buffer.append(lastName).append(", ").append(firstName);
-
- return buffer.toString();
- }
- }
-
- static class Data {
- final WritableValue firstName;
-
- final WritableValue lastName;
-
- Data() {
- firstName = new WritableValue("", String.class);
- lastName = new WritableValue("", String.class);
- }
- }
-
- /**
- * Composite that creates the UI.
- *
- * @since 3.2
- */
- static class UI extends Composite {
- final Text firstName;
-
- final Text lastName;
-
- final Text formattedName;
-
- UI(Composite parent) {
- super(parent, SWT.NONE);
-
- GridLayoutFactory.swtDefaults().numColumns(2).applyTo(this);
-
- new Label(this, SWT.NONE).setText("First Name:");
- new Label(this, SWT.NONE).setText("Last Name");
-
- GridDataFactory gdf = GridDataFactory.swtDefaults().align(SWT.FILL,
- SWT.FILL).grab(true, false);
- firstName = new Text(this, SWT.BORDER);
- gdf.applyTo(firstName);
-
- lastName = new Text(this, SWT.BORDER);
- gdf.applyTo(lastName);
-
- gdf = GridDataFactory.swtDefaults().span(2, 1).grab(true, false)
- .align(SWT.FILL, SWT.BEGINNING);
- Label label = new Label(this, SWT.NONE);
- label.setText("Formatted Name:");
- gdf.applyTo(label);
-
- formattedName = new Text(this, SWT.BORDER);
- formattedName.setEditable(false);
- gdf.applyTo(formattedName);
- }
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet009TableViewer.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet009TableViewer.java
deleted file mode 100644
index a96d5ec..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet009TableViewer.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef, Inc. 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:
- * Coconut Palm Software, Inc. - Initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-
-/**
- * Demonstrates binding a TableViewer to a collection.
- */
-public class Snippet009TableViewer {
- public static void main(String[] args) {
- ViewModel viewModel = new ViewModel();
- Shell shell = new View(viewModel).createShell();
-
- // The SWT event loop
- Display display = Display.getCurrent();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
-
- // Minimal JavaBeans support
- public static abstract class AbstractModelObject {
- private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
- this);
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(propertyName,
- listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(propertyName,
- listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue,
- newValue);
- }
- }
-
- // The data model class. This is normally a persistent class of some sort.
- static class Person extends AbstractModelObject {
- // A property...
- String name = "John Smith";
-
- public Person(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- String oldValue = this.name;
- this.name = name;
- firePropertyChange("name", oldValue, name);
- }
- }
-
- // The View's model--the root of our Model graph for this particular GUI.
- //
- // Typically each View class has a corresponding ViewModel class.
- // The ViewModel is responsible for getting the objects to edit from the
- // data access tier. Since this snippet doesn't have any persistent objects
- // ro retrieve, this ViewModel just instantiates a model object to edit.
- static class ViewModel {
- // The model to bind
- private List people = new LinkedList(); {
- people.add(new Person("Steve Northover"));
- people.add(new Person("Grant Gayed"));
- people.add(new Person("Veronika Irvine"));
- people.add(new Person("Mike Wilson"));
- people.add(new Person("Christophe Cornu"));
- people.add(new Person("Lynne Kues"));
- people.add(new Person("Silenio Quarti"));
- }
-
- public List getPeople() {
- return people;
- }
- }
-
- // The GUI view
- static class View {
- private ViewModel viewModel;
- private Table committers;
-
- public View(ViewModel viewModel) {
- this.viewModel = viewModel;
- }
-
- public Shell createShell() {
- // Build a UI
- Display display = Display.getDefault();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
- committers = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION);
- committers.setLinesVisible(true);
-
- // Set up data binding. In an RCP application, the threading Realm
- // will be set for you automatically by the Workbench. In an SWT
- // application, you can do this once, wrpping your binding
- // method call.
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- DataBindingContext bindingContext = new DataBindingContext();
- bindGUI(bindingContext);
- }
- });
-
- // Open and return the Shell
- shell.setSize(100, 300);
- shell.open();
- return shell;
- }
-
- protected void bindGUI(DataBindingContext bindingContext) {
- // Since we're using a JFace Viewer, we do first wrap our Table...
- TableViewer peopleViewer = new TableViewer(committers);
-
- // Create a standard content provider
- ObservableListContentProvider peopleViewerContentProvider =
- new ObservableListContentProvider();
- peopleViewer.setContentProvider(peopleViewerContentProvider);
-
- // And a standard label provider that maps columns
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- peopleViewerContentProvider.getKnownElements(), Person.class,
- new String[] { "name" });
- peopleViewer.setLabelProvider(new ObservableMapLabelProvider(attributeMaps));
-
- // Now set the Viewer's input
- peopleViewer.setInput(new WritableList(viewModel.getPeople(), Person.class));
- }
- }
-
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet010MasterDetail.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet010MasterDetail.java
deleted file mode 100644
index b4cb426..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet010MasterDetail.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Snippet that displays a simple master detail use case. A list of persons is
- * displayed in a list and upon selection the name of the selected person will
- * be displayed in a Text widget.
- */
-public class Snippet010MasterDetail {
- public static void main(String[] args) {
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
-
- Person[] persons = new Person[] { new Person("Me"),
- new Person("Myself"), new Person("I") };
-
- ListViewer viewer = new ListViewer(shell);
- viewer.setContentProvider(new ArrayContentProvider());
- viewer.setInput(persons);
-
- Text name = new Text(shell, SWT.BORDER | SWT.READ_ONLY);
-
- // 1. Observe changes in selection.
- IObservableValue selection = ViewersObservables
- .observeSingleSelection(viewer);
-
- // 2. Observe the name property of the current selection.
- IObservableValue detailObservable = BeansObservables
- .observeDetailValue(Realm.getDefault(), selection,
- "name", String.class);
-
- // 3. Bind the Text widget to the name detail (selection's
- // name).
- new DataBindingContext().bindValue(SWTObservables.observeText(
- name, SWT.None), detailObservable,
- new UpdateValueStrategy(false,
- UpdateValueStrategy.POLICY_NEVER), null);
-
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- }
- });
- display.dispose();
- }
-
- public static class Person {
- private String name;
- private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
-
- Person(String name) {
- this.name = name;
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * @return Returns the name.
- */
- public String getName() {
- return name;
- }
-
- public String toString() {
- return name;
- }
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet011ValidateMultipleBindingsSnippet.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet011ValidateMultipleBindingsSnippet.java
deleted file mode 100644
index 44b9839..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet011ValidateMultipleBindingsSnippet.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.databinding.validation.ValidationStatus;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Snippet that validates values across multiple bindings on change of each
- * observable. If the values of the target observables are not equal the model
- * is not updated. When the values are equal they will be written to sysout.
- *
- * @author Brad Reynolds
- */
-public class Snippet011ValidateMultipleBindingsSnippet {
- public static void main(String[] args) {
- Realm.runWithDefault(SWTObservables.getRealm(Display.getDefault()),
- new Runnable() {
- public void run() {
- Snippet011ValidateMultipleBindingsSnippet.run();
- }
- });
- }
-
- private static void run() {
- Shell shell = new Shell();
-
- View view = new View(shell);
- final Model model = new Model();
-
- DataBindingContext dbc = new DataBindingContext();
- dbc.bindValue(SWTObservables.observeText(view.text1, SWT.Modify),
- model.value1, new UpdateValueStrategy()
- .setAfterConvertValidator(new CrossFieldValidator(
- model.value2)), null);
- dbc.bindValue(SWTObservables.observeText(view.text2, SWT.Modify),
- model.value2, new UpdateValueStrategy()
- .setAfterConvertValidator(new CrossFieldValidator(
- model.value1)), null);
-
- // DEBUG - print to show value change
- model.value1.addValueChangeListener(new IValueChangeListener() {
- public void handleValueChange(ValueChangeEvent event) {
- System.out.println("Value 1: " + model.value1.getValue());
- }
- });
-
- // DEBUG - print to show value change
- model.value2.addValueChangeListener(new IValueChangeListener() {
- public void handleValueChange(ValueChangeEvent event) {
- System.out.println("Value 2: " + model.value2.getValue());
- }
- });
-
- shell.pack();
- shell.open();
- Display display = shell.getDisplay();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
-
- /**
- * @since 3.2
- *
- */
- private static final class CrossFieldValidator implements IValidator {
- /**
- *
- */
- private final IObservableValue other;
-
- /**
- * @param model
- */
- private CrossFieldValidator(IObservableValue other) {
- this.other = other;
- }
-
- public IStatus validate(Object value) {
- if (!value.equals(other.getValue())) {
- return ValidationStatus.ok();
- }
- return ValidationStatus.error("values cannot be the same");
- }
- }
-
- static class Model {
- WritableValue value1 = new WritableValue();
- WritableValue value2 = new WritableValue();
- }
-
- static class View {
- Text text1;
- Text text2;
-
- View(Composite composite) {
- composite.setLayout(new GridLayout(2, true));
- text1 = new Text(composite, SWT.BORDER);
- text2 = new Text(composite, SWT.BORDER);
- }
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet012CompositeUpdater.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet012CompositeUpdater.java
deleted file mode 100644
index 64756bb..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet012CompositeUpdater.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.internal.databinding.provisional.swt.CompositeUpdater;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * @since 3.2
- *
- */
-public class Snippet012CompositeUpdater {
-
- public static void main(String[] args) {
- final Display display = new Display();
- Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
- public void run() {
- Shell shell = new Shell(display);
-
- final WritableList list = new WritableList();
-
- Button button = new Button(shell, SWT.PUSH);
- button.setText("add");
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(
- org.eclipse.swt.events.SelectionEvent e) {
- list.add(new Counter());
- }
- });
-
- final Composite composite = new Composite(shell, SWT.None);
- composite.setLayout(new FillLayout(SWT.VERTICAL));
-
- new CompositeUpdater(composite, list) {
- protected Widget createWidget(int index) {
- return new Label(composite, SWT.BORDER);
- }
-
- protected void updateWidget(Widget widget, Object element) {
- ((Label) widget).setText(((Counter) element).getValue()
- + "");
- }
- };
-
- GridDataFactory.fillDefaults().grab(true, true).applyTo(
- composite);
-
- GridLayoutFactory.fillDefaults().generateLayout(shell);
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- }
- });
- display.dispose();
- }
-
- static Timer timer = new Timer(true);
-
- static class Counter extends WritableValue {
- Counter() {
- super(new Integer(0), Integer.class);
- scheduleIncrementTask();
- }
-
- private void scheduleIncrementTask() {
- timer.schedule(new TimerTask() {
- public void run() {
- // we have to get onto the realm (UI thread) to perform the
- // increment
- getRealm().asyncExec(new Runnable() {
- public void run() {
- Integer currentVal = (Integer) getValue();
- setValue(new Integer(currentVal.intValue() + 1));
- }
- });
- scheduleIncrementTask();
- }
- }, 1000);
- }
- }
-}
diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet0xffffffff.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet0xffffffff.java
deleted file mode 100644
index 8b44163..0000000
--- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet0xffffffff.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 The Pampered Chef, Inc. 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:
- * The Pampered Chef, Inc. - initial API and implementation
- * Brad Reynolds - bug 116920
- ******************************************************************************/
-
-package org.eclipse.jface.examples.databinding.snippets;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Snippet -1.
- *
- * Hello, no databinding. Bind changes in a GUI to a Model object but don't
- * worry about propogating changes from the Model to the GUI -- using *manual*
- * code. (0xffffffff is -1 in 32-bit two's complement binary arithmatic)
- */
-public class Snippet0xffffffff {
- public static void main(String[] args) {
- ViewModel viewModel = new ViewModel();
- Shell shell = new View(viewModel).createShell();
-
- // The SWT event loop
- Display display = Display.getCurrent();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
-
- // Print the results
- System.out.println("person.getName() = "
- + viewModel.getPerson().getName());
- }
-
- // Minimal JavaBeans support
- public static abstract class AbstractModelObject {
- private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
- this);
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(propertyName,
- listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(propertyName,
- listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue,
- newValue);
- }
- }
-
- // The data model class. This is normally a persistent class of some sort.
- //
- // In this example, we only push changes from the GUI to the model, so we
- // don't worry about implementing JavaBeans bound properties. If we need
- // our GUI to automatically reflect changes in the Person object, the
- // Person object would need to implement the JavaBeans property change
- // listener methods.
- static class Person extends AbstractModelObject {
- // A property...
- String name = "John Smith";
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- }
-
- // The View's model--the root of our Model graph for this particular GUI.
- //
- // Typically each View class has a corresponding ViewModel class.
- //
- // The ViewModel is responsible for getting the objects to edit from the
- // data access tier. Since this snippet doesn't have any persistent objects
- // to
- // retrieve, this ViewModel just instantiates a model object to edit.
- static class ViewModel {
- // The model to bind
- private Person person = new Person();
-
- public Person getPerson() {
- return person;
- }
- }
-
- // The GUI view
- static class View {
- private ViewModel viewModel;
-
- public View(ViewModel viewModel) {
- this.viewModel = viewModel;
- }
-
- public Shell createShell() {
- // Build a UI
- final Display display = Display.getCurrent();
- Shell shell = new Shell(display);
- shell.setLayout(new RowLayout(SWT.VERTICAL));
-
- final Text name = new Text(shell, SWT.BORDER);
-
- // Bind it (manually)
- name.setText(viewModel.getPerson().getName());
- name.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- final String text = name.getText();
- // validation
- // conversion
- viewModel.getPerson().setName(text);
- }
- });
- viewModel.person.addPropertyChangeListener("name",
- new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent evt) {
- display.asyncExec(new Runnable() {
- public void run() {
- final String newName = viewModel.person.getName();
- // conversion
- name.setText(newName);
- }
- });
- }
- });
-
- // Open and return the Shell
- shell.pack();
- shell.open();
- return shell;
- }
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/.classpath b/tests/org.eclipse.jface.tests.databinding/.classpath
deleted file mode 100644
index d512f63..0000000
--- a/tests/org.eclipse.jface.tests.databinding/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/executionEnvironments/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.jface.tests.databinding/.cvsignore b/tests/org.eclipse.jface.tests.databinding/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/tests/org.eclipse.jface.tests.databinding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tests/org.eclipse.jface.tests.databinding/.project b/tests/org.eclipse.jface.tests.databinding/.project
deleted file mode 100644
index 815de41..0000000
--- a/tests/org.eclipse.jface.tests.databinding/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jface.tests.databinding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3268699..0000000
--- a/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,71 +0,0 @@
-#Mon Aug 28 10:09:27 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 846d8bf..0000000
--- a/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Thu Aug 24 15:24:48 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.javadoc=true
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) ${year} IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * IBM Corporation - initial API and implementation\n ******************************************************************************/\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @since 3.2\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template></templates>
diff --git a/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.pde.prefs b/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 630927b..0000000
--- a/tests/org.eclipse.jface.tests.databinding/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Tue Oct 18 11:35:02 EDT 2005
-compilers.p.deprecated=0
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/tests/org.eclipse.jface.tests.databinding/JFace-Data Binding Test Suite.launch b/tests/org.eclipse.jface.tests.databinding/JFace-Data Binding Test Suite.launch
deleted file mode 100644
index b11e2d7..0000000
--- a/tests/org.eclipse.jface.tests.databinding/JFace-Data Binding Test Suite.launch
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jface.tests.databinding.BindingTestSuite"/>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jface.tests.databinding"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<booleanAttribute key="askclear" value="false"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
-<booleanAttribute key="clearConfig" value="true"/>
-<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="useProduct" value="false"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="checked" value="[NONE]"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.jface.tests.databinding"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<stringAttribute key="templateConfig" value=""/>
-<stringAttribute key="pde.version" value="3.3"/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<booleanAttribute key="default" value="true"/>
-</launchConfiguration>
diff --git a/tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF b/tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF
deleted file mode 100644
index 6c0f8bf..0000000
--- a/tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jface.tests.databinding
-Bundle-Version: 1.0.100.qualifier
-Bundle-ClassPath: jfacebindingtests.jar
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
-Require-Bundle: org.eclipse.core.databinding,
- org.junit,
- org.eclipse.swt,
- org.eclipse.jface,
- org.eclipse.core.runtime,
- org.eclipse.jface.examples.databinding,
- org.eclipse.core.databinding.beans,
- org.eclipse.jface.databinding
-Import-Package: com.ibm.icu.text
-
diff --git a/tests/org.eclipse.jface.tests.databinding/about.html b/tests/org.eclipse.jface.tests.databinding/about.html
deleted file mode 100644
index 4602330..0000000
--- a/tests/org.eclipse.jface.tests.databinding/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/tests/org.eclipse.jface.tests.databinding/build.properties b/tests/org.eclipse.jface.tests.databinding/build.properties
deleted file mode 100644
index e671f5a..0000000
--- a/tests/org.eclipse.jface.tests.databinding/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-source.jfacebindingtests.jar = src/
-
-src.includes = about.html
-output.jfacebindingtests.jar = bin/
-bin.includes = META-INF/,\
- about.html,\
- test.xml,\
- *.html,\
- jfacebindingtests.jar,\
- plugin.properties
diff --git a/tests/org.eclipse.jface.tests.databinding/plugin.properties b/tests/org.eclipse.jface.tests.databinding/plugin.properties
deleted file mode 100644
index 6f8acfc..0000000
--- a/tests/org.eclipse.jface.tests.databinding/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName = JFace Data Binding Tests
-providerName = Eclipse.org
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateStrategyTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateStrategyTest.java
deleted file mode 100644
index 231a1d8..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateStrategyTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.databinding;
-
-import java.math.BigInteger;
-import java.util.Date;
-
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.conversion.IConverter;
-import org.eclipse.core.databinding.conversion.NumberToStringConverter;
-import org.eclipse.core.databinding.conversion.StringToNumberConverter;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.internal.databinding.conversion.DateToStringConverter;
-import org.eclipse.core.internal.databinding.conversion.StringToBooleanConverter;
-import org.eclipse.core.internal.databinding.conversion.StringToBooleanPrimitiveConverter;
-import org.eclipse.core.internal.databinding.conversion.StringToByteConverter;
-import org.eclipse.core.internal.databinding.conversion.StringToBytePrimitiveConverter;
-import org.eclipse.core.internal.databinding.conversion.StringToCharacterConverter;
-import org.eclipse.core.internal.databinding.conversion.StringToDateConverter;
-import org.eclipse.core.internal.databinding.conversion.StringToShortConverter;
-import org.eclipse.core.internal.databinding.conversion.StringToShortPrimitiveConverter;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 1.1
- */
-public class UpdateStrategyTest extends AbstractDefaultRealmTestCase {
- public void testDefaultConverterForStringToInteger() throws Exception {
- assertDefaultConverter(String.class, Integer.class, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForStringToIntegerPrimitive() throws Exception {
- assertDefaultConverter(String.class, Integer.TYPE, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForStringToLong() throws Exception {
- assertDefaultConverter(String.class, Long.class, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForStringToLongPrimitive() throws Exception {
- assertDefaultConverter(String.class, Long.TYPE, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForStringToDouble() throws Exception {
- assertDefaultConverter(String.class, Double.class, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForStringToDoublePrimitive() throws Exception {
- assertDefaultConverter(String.class, Double.TYPE, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForStringToFloat() throws Exception {
- assertDefaultConverter(String.class, Float.class, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForStringToFloatPrimitive() throws Exception {
- assertDefaultConverter(String.class, Float.TYPE, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForStringToBigInteger() throws Exception {
- assertDefaultConverter(String.class, BigInteger.class, StringToNumberConverter.class);
- }
-
- public void testDefaultConverterForIntegerToString() throws Exception {
- assertDefaultConverter(Integer.class, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForIntegerPrimitiveToString() throws Exception {
- assertDefaultConverter(Integer.TYPE, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForLongToString() throws Exception {
- assertDefaultConverter(Long.class, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForLongPrimitiveToString() throws Exception {
- assertDefaultConverter(Long.TYPE, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForDoubleToString() throws Exception {
- assertDefaultConverter(Double.class, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForDoublePrimitiveToString() throws Exception {
- assertDefaultConverter(Double.TYPE, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForFloatToString() throws Exception {
- assertDefaultConverter(Float.class, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForFloatPrimitiveToString() throws Exception {
- assertDefaultConverter(Float.TYPE, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForBigIntegerToString() throws Exception {
- assertDefaultConverter(BigInteger.class, String.class, NumberToStringConverter.class);
- }
-
- public void testDefaultConverterForDateToString() throws Exception {
- assertDefaultConverter(Date.class, String.class, DateToStringConverter.class);
- }
-
- public void testDefaultConverterForStringToBoolean() throws Exception {
- assertDefaultConverter(String.class, Boolean.class, StringToBooleanConverter.class);
- }
-
- public void testDefaultConverterForStringToBooleanPrimitive() throws Exception {
- assertDefaultConverter(String.class, Boolean.TYPE, StringToBooleanPrimitiveConverter.class);
- }
-
- public void testDefaultConverterForStringToByte() throws Exception {
- assertDefaultConverter(String.class, Byte.class, StringToByteConverter.class);
- }
-
- public void testDefaultConverterForStringToBytePrimitive() throws Exception {
- assertDefaultConverter(String.class, Byte.TYPE, StringToBytePrimitiveConverter.class);
- }
-
- public void testDefaultConverterForStringToCharacter() throws Exception {
- assertDefaultConverter(String.class, Character.class, StringToCharacterConverter.class);
- }
-
- public void testDefaultConverterForStringToDate() throws Exception {
- assertDefaultConverter(String.class, Date.class, StringToDateConverter.class);
- }
-
- public void testDefaultConverterForStringToShort() throws Exception {
- assertDefaultConverter(String.class, Short.class, StringToShortConverter.class);
- }
-
- public void testDefaultConverterForStringToShortPrimitive() throws Exception {
- assertDefaultConverter(String.class, Short.TYPE, StringToShortPrimitiveConverter.class);
- }
-
- private void assertDefaultConverter(Class fromType, Class toType, Class converterType) {
- WritableValue source = WritableValue.withValueType(fromType);
- WritableValue destination = WritableValue.withValueType(toType);
-
- UpdateStrategyStub strategy = new UpdateStrategyStub();
- strategy.fillDefaults(source, destination);
-
- IConverter converter = strategy.converter;
- assertNotNull("converter not null", converter);
- assertEquals("fromType [" + fromType + "]" , fromType, converter.getFromType());
- assertEquals("toType [" + toType + "]", toType, converter.getToType());
- assertTrue("converter instanceof " + converterType, converterType.isInstance(converter));
- }
-
- class UpdateStrategyStub extends UpdateValueStrategy {
- IConverter converter;
-
- protected void fillDefaults(IObservableValue source,
- IObservableValue destination) {
- super.fillDefaults(source, destination);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.UpdateValueStrategy#setConverter(org.eclipse.core.databinding.conversion.IConverter)
- */
- public UpdateValueStrategy setConverter(IConverter converter) {
- this.converter = converter;
- return super.setConverter(converter);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateValueStrategyTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateValueStrategyTest.java
deleted file mode 100644
index 2e89ffb..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateValueStrategyTest.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.databinding;
-
-import java.util.Date;
-
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.internal.databinding.validation.StringToByteValidator;
-import org.eclipse.core.internal.databinding.validation.StringToDateValidator;
-import org.eclipse.core.internal.databinding.validation.StringToDoubleValidator;
-import org.eclipse.core.internal.databinding.validation.StringToFloatValidator;
-import org.eclipse.core.internal.databinding.validation.StringToIntegerValidator;
-import org.eclipse.core.internal.databinding.validation.StringToLongValidator;
-import org.eclipse.core.internal.databinding.validation.StringToShortValidator;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 1.1
- */
-public class UpdateValueStrategyTest extends AbstractDefaultRealmTestCase {
- public void testDefaultValidatorForStringToInteger() throws Exception {
- assertDefaultValidator(String.class, Integer.class, StringToIntegerValidator.class);
- }
-
- public void testDefaultValidatorForStringToIntegerPrimitive() throws Exception {
- assertDefaultValidator(String.class, Integer.TYPE, StringToIntegerValidator.class);
- }
-
- public void testDefaultValidatorForStringToLong() throws Exception {
- assertDefaultValidator(String.class, Long.class, StringToLongValidator.class);
- }
-
- public void testDefaultValidatorForStringToLongPrimitive() throws Exception {
- assertDefaultValidator(String.class, Long.TYPE, StringToLongValidator.class);
- }
-
- public void testDefaultValidatorForStringToFloat() throws Exception {
- assertDefaultValidator(String.class, Float.class, StringToFloatValidator.class);
- }
-
- public void testDefaultValidatorForStringToFloatPrimitive() throws Exception {
- assertDefaultValidator(String.class, Float.TYPE, StringToFloatValidator.class);
- }
-
- public void testDefaultValidatorForStringToDouble() throws Exception {
- assertDefaultValidator(String.class, Double.class, StringToDoubleValidator.class);
- }
-
- public void testDefaultValidatorForStringToDoublePrimitive() throws Exception {
- assertDefaultValidator(String.class, Double.TYPE, StringToDoubleValidator.class);
- }
-
- public void testDefaultValidatorForStringToByte() throws Exception {
- assertDefaultValidator(String.class, Byte.class, StringToByteValidator.class);
- }
-
- public void testDefaultValidatorForStringToBytePrimitive() throws Exception {
- assertDefaultValidator(String.class, Byte.TYPE, StringToByteValidator.class);
- }
-
- public void testDefaultValidatorForStringToShort() throws Exception {
- assertDefaultValidator(String.class, Short.class, StringToShortValidator.class);
- }
-
- public void testDefaultValidatorForStringToShortPrimitive() throws Exception {
- assertDefaultValidator(String.class, Short.TYPE, StringToShortValidator.class);
- }
-
- public void testDefaultValidatorForStringToDate() throws Exception {
- assertDefaultValidator(String.class, Date.class, StringToDateValidator.class);
- }
-
- public void testCachesDefaultedValidators() throws Exception {
- WritableValue source = WritableValue.withValueType(String.class);
- WritableValue destination = WritableValue.withValueType(Integer.class);
-
- UpdateValueStrategyStub strategy = new UpdateValueStrategyStub();
- strategy.fillDefaults(source, destination);
-
- IValidator validator = strategy.validator;
- assertNotNull(validator);
-
- strategy = new UpdateValueStrategyStub();
- strategy.fillDefaults(source, destination);
-
- assertSame(validator,strategy.validator);
- }
-
- private void assertDefaultValidator(Class fromType, Class toType, Class validatorType) {
- WritableValue source = WritableValue.withValueType(fromType);
- WritableValue destination = WritableValue.withValueType(toType);
-
- UpdateValueStrategyStub strategy = new UpdateValueStrategyStub();
- strategy.fillDefaults(source, destination);
-
- IValidator validator = strategy.validator;
- assertNotNull("validator not null", validator);
- assertTrue("converter instanceof " + validatorType, validatorType.isInstance(validator));
- }
-
- class UpdateValueStrategyStub extends UpdateValueStrategy {
- IValidator validator;
-
- protected void fillDefaults(IObservableValue source,
- IObservableValue destination) {
- super.fillDefaults(source, destination);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.UpdateValueStrategy#createValidator(java.lang.Object, java.lang.Object)
- */
- protected IValidator createValidator(Object fromType, Object toType) {
- validator = super.createValidator(fromType, toType);
- return validator;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/beans/BeansObservablesTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/beans/BeansObservablesTest.java
deleted file mode 100644
index 1c6dea2..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/beans/BeansObservablesTest.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164268, 171616
- *******************************************************************************/
-
-package org.eclipse.core.tests.databinding.beans;
-
-import java.util.Arrays;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.beans.IBeanObservable;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableListDecorator;
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableSetDecorator;
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableValueDecorator;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.Bean;
-
-/**
- * @since 3.2
- */
-public class BeansObservablesTest extends AbstractDefaultRealmTestCase {
- Bean[] elements = null;
- Bean model = null;
- Class elementType = null;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- elements = new Bean[] { new Bean("1"), new Bean("2"), new Bean("3") };
- model = new Bean(Arrays.asList(elements));
- elementType = Bean.class;
- }
-
- public void testObserveListArrayInferredElementType() throws Exception {
- IObservableList list = BeansObservables.observeList(Realm.getDefault(),
- model, "listArray", null);
- assertEquals("element type", elementType, list.getElementType());
- }
-
- public void testObserveListNonInferredElementType() throws Exception {
- elementType = Object.class;
- IObservableList list = BeansObservables.observeList(Realm.getDefault(),
- model, "list", null);
- assertEquals("element type", elementType, list.getElementType());
- }
-
- public void testListFactory() throws Exception {
- IObservableFactory factory = BeansObservables.listFactory(Realm
- .getDefault(), "list", elementType);
- IObservableList list = (IObservableList) factory
- .createObservable(model);
-
- assertTrue("elements of the list", Arrays.equals(elements, list
- .toArray(new Bean[list.size()])));
- assertEquals("element type", elementType, list.getElementType());
- }
-
- public void testObserveDetailListElementType() throws Exception {
- WritableValue parent = WritableValue.withValueType(Bean.class);
- parent.setValue(model);
- IObservableList list = BeansObservables.observeDetailList(Realm
- .getDefault(), parent, "list", elementType);
-
- assertEquals("element type", elementType, list.getElementType());
- assertTrue("elements of list", Arrays.equals(elements, list
- .toArray(new Bean[list.size()])));
- }
-
- public void testObserveDetailValueIBeanObservable() throws Exception {
- WritableValue parent = WritableValue.withValueType(Bean.class);
- parent.setValue(new Bean());
-
- IObservableValue detailValue = BeansObservables.observeDetailValue(
- Realm.getDefault(), parent, "value", String.class);
- assertTrue(detailValue instanceof IBeanObservable);
-
- BeanObservableValueDecorator beanObservable = (BeanObservableValueDecorator) detailValue;
- assertEquals("property descriptor", Bean.class.getMethod("getValue",
- null), beanObservable.getPropertyDescriptor().getReadMethod());
- assertEquals("observed", parent.getValue(), beanObservable.getObserved());
- assertTrue("delegate", beanObservable.getDelegate().getClass()
- .getName().endsWith("DetailObservableValue"));
- }
-
- public void testObserveDetailValueNullOuterElementType() throws Exception {
- WritableValue parent = new WritableValue(new Bean(), null);
-
- IObservableValue detailValue = BeansObservables.observeDetailValue(
- Realm.getDefault(), parent, "value", String.class);
-
- assertNull("property descriptor", ((IBeanObservable) detailValue)
- .getPropertyDescriptor());
- }
-
- public void testObservableDetailListIBeanObservable() throws Exception {
- WritableValue parent = WritableValue.withValueType(Bean.class);
- parent.setValue(new Bean());
-
- IObservableList detailList = BeansObservables.observeDetailList(Realm
- .getDefault(), parent, "list", Bean.class);
- assertTrue("detail is not an IBeanObservable",
- detailList instanceof IBeanObservable);
-
- BeanObservableListDecorator beanObservable = (BeanObservableListDecorator) detailList;
- assertEquals("property descriptor", Bean.class.getMethod("getList",
- null), beanObservable.getPropertyDescriptor().getReadMethod());
- assertEquals("observed", parent, beanObservable.getObserved());
-
- // DetailObservableList is package level we can do a straight instanceof
- // check
- assertTrue("delegate is the observed", beanObservable.getDelegate()
- .equals(detailList));
- }
-
- public void testObservableDetailListNullOuterElementType() throws Exception {
- WritableValue parent = new WritableValue(new Bean(), null);
-
- IObservableList detailList = BeansObservables.observeDetailList(Realm
- .getDefault(), parent, "list", Bean.class);
-
- assertNull("property descriptor", ((IBeanObservable) detailList)
- .getPropertyDescriptor());
- }
-
- public void testObservableDetailSetIBeanObservable() throws Exception {
- WritableValue parent = WritableValue.withValueType(Bean.class);
- parent.setValue(new Bean());
-
- IObservableSet detailSet = BeansObservables.observeDetailSet(Realm
- .getDefault(), parent, "set", Bean.class);
- assertTrue("detail is not an IBeanObservable",
- detailSet instanceof IBeanObservable);
-
- BeanObservableSetDecorator beanObservable = (BeanObservableSetDecorator) detailSet;
- assertEquals("property descriptor", Bean.class
- .getMethod("getSet", null), beanObservable
- .getPropertyDescriptor().getReadMethod());
- assertEquals("observed", parent, beanObservable.getObserved());
-
- // DetailObservableSet is package level we can't do a straight
- // instanceof check
- assertTrue("delegate is the observed", beanObservable.getDelegate()
- .equals(detailSet));
- }
-
- public void testObservableDetailSetNullOuterElementType() throws Exception {
- WritableValue parent = new WritableValue(new Bean(), null);
-
- IObservableSet detailSet = BeansObservables.observeDetailSet(Realm
- .getDefault(), parent, "set", Bean.class);
-
- assertNull("property descriptor", ((IBeanObservable) detailSet)
- .getPropertyDescriptor());
- }
-
- public void testObserveSetElementType() throws Exception {
- Bean bean = new Bean();
- IObservableSet observableSet = BeansObservables.observeSet(Realm
- .getDefault(), bean, "set", Bean.class);
- assertEquals(Bean.class, observableSet.getElementType());
- }
-
- public void testObserveSetNonInferredElementType() throws Exception {
- Bean bean = new Bean();
- IObservableSet observableSet = BeansObservables.observeSet(Realm
- .getDefault(), bean, "set");
- assertEquals(Object.class, observableSet.getElementType());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java
deleted file mode 100644
index 4b2f4c3..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.databinding.conversion;
-
-import java.math.BigInteger;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.conversion.NumberToStringConverter;
-
-import com.ibm.icu.text.NumberFormat;
-
-/**
- * @since 1.1
- */
-public class NumberToStringConverterTest extends TestCase {
- private NumberFormat numberFormat;
- private NumberFormat integerFormat;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- numberFormat = NumberFormat.getInstance();
- integerFormat = NumberFormat.getIntegerInstance();
- }
-
- public void testFromTypes() throws Exception {
- assertEquals("Integer.class", Integer.class, NumberToStringConverter
- .fromInteger(false).getFromType());
- assertEquals("Integer.TYPE", Integer.TYPE, NumberToStringConverter
- .fromInteger(true).getFromType());
- assertEquals("Double.class", Double.class, NumberToStringConverter
- .fromDouble(false).getFromType());
- assertEquals("Double.TYPE", Double.TYPE, NumberToStringConverter
- .fromDouble(true).getFromType());
- assertEquals("Long.class", Long.class, NumberToStringConverter
- .fromLong(false).getFromType());
- assertEquals("Long.TYPE", Long.TYPE, NumberToStringConverter.fromLong(
- true).getFromType());
- assertEquals("Float.class", Float.class, NumberToStringConverter
- .fromFloat(false).getFromType());
- assertEquals("Float.TYPE", Float.TYPE, NumberToStringConverter
- .fromFloat(true).getFromType());
- assertEquals("BigInteger.class", BigInteger.class,
- NumberToStringConverter.fromBigInteger().getFromType());
- }
-
- public void testToTypeIsStringClass() throws Exception {
- assertEquals(String.class, NumberToStringConverter.fromInteger(false)
- .getToType());
- }
-
- public void testConvertIntegerToString() throws Exception {
- Integer input = new Integer(1000);
- String expected = integerFormat.format(input.longValue());
-
- NumberToStringConverter converter = NumberToStringConverter
- .fromInteger(false);
- String result = (String) converter.convert(input);
- assertEquals(expected, result);
- }
-
- public void testConvertDoubleToString() throws Exception {
- Double input = new Double(1000.1d);
- String expected = numberFormat.format(input.doubleValue());
-
- NumberToStringConverter converter = NumberToStringConverter
- .fromDouble(false);
- String result = (String) converter.convert(input);
- assertEquals(expected, result);
- }
-
- public void testConvertFloatToString() throws Exception {
- Float input = new Float(1000.1f);
- String expected = numberFormat.format(input.floatValue());
-
- NumberToStringConverter converter = NumberToStringConverter
- .fromFloat(false);
- String result = (String) converter.convert(input);
- assertEquals(expected, result);
- }
-
- public void testConvertLongToString() throws Exception {
- Long input = new Long(1000l);
- String expected = integerFormat.format(input.longValue());
-
- NumberToStringConverter converter = NumberToStringConverter
- .fromLong(false);
- String result = (String) converter.convert(input);
- assertEquals(expected, result);
- }
-
- public void testConvertBigIntegerToString() throws Exception {
- BigInteger input = BigInteger.valueOf(1000);
- String expected = integerFormat.format(input);
-
- NumberToStringConverter converter = NumberToStringConverter.fromBigInteger();
- String result = (String) converter.convert(input);
- assertEquals(expected, result);
- }
-
- public void testNullSourceConvertsToEmptyString() throws Exception {
- NumberToStringConverter converter = NumberToStringConverter
- .fromInteger(false);
- assertEquals("", converter.convert(null));
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java
deleted file mode 100644
index 5eb1f1a..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.databinding.conversion;
-
-import java.math.BigInteger;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.conversion.StringToNumberConverter;
-
-import com.ibm.icu.text.NumberFormat;
-
-/**
- * @since 1.1
- */
-public class StringToNumberConverterTest extends TestCase {
- private NumberFormat numberFormat;
- private NumberFormat numberIntegerFormat;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- numberFormat = NumberFormat.getInstance();
- numberIntegerFormat = NumberFormat.getIntegerInstance();
- }
-
- public void testToTypes() throws Exception {
- assertEquals("Integer.class", Integer.class, StringToNumberConverter.toInteger(false).getToType());
- assertEquals("Integer.TYPE", Integer.TYPE, StringToNumberConverter.toInteger(true).getToType());
- assertEquals("Double.class", Double.class, StringToNumberConverter.toDouble(false).getToType());
- assertEquals("Double.TYPE", Double.TYPE, StringToNumberConverter.toDouble(true).getToType());
- assertEquals("Long.class", Long.class, StringToNumberConverter.toLong(false).getToType());
- assertEquals("Long.TYPE", Long.TYPE, StringToNumberConverter.toLong(true).getToType());
- assertEquals("Float.class", Float.class, StringToNumberConverter.toFloat(false).getToType());
- assertEquals("Float.TYPE", Float.TYPE, StringToNumberConverter.toFloat(true).getToType());
- assertEquals("BigInteger.TYPE", BigInteger.class, StringToNumberConverter.toBigInteger().getToType());
- }
-
- public void testFromTypeIsString() throws Exception {
- assertEquals(String.class, StringToNumberConverter.toInteger(false)
- .getFromType());
- }
-
- public void testConvertsToBigInteger() throws Exception {
- BigInteger input = BigInteger.valueOf(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toBigInteger();
- BigInteger result = (BigInteger) converter.convert(numberFormat.format(input));
-
- assertEquals(input, result);
- }
-
- public void testConvertsToInteger() throws Exception {
- Integer input = new Integer(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toInteger(false);
- Integer result = (Integer) converter.convert(numberIntegerFormat.format(input
- .longValue()));
- assertEquals(input, result);
- }
-
- public void testConvertsToDouble() throws Exception {
- Double input = new Double(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toDouble(false);
- Double result = (Double) converter.convert(numberFormat.format(input
- .doubleValue()));
-
- assertEquals(input, result);
- }
-
- public void testConvertsToLong() throws Exception {
- Long input = new Long(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toLong(false);
- Long result = (Long) converter.convert(numberIntegerFormat.format(input
- .longValue()));
-
- assertEquals(input, result);
- }
-
- public void testConvertsToFloat() throws Exception {
- Float input = new Float(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toFloat(false);
- Float result = (Float) converter.convert(numberFormat.format(input
- .floatValue()));
-
- assertEquals(input, result);
- }
-
- public void testConvertedToIntegerPrimitive() throws Exception {
- Integer input = new Integer(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toInteger(true);
- Integer result = (Integer) converter.convert(numberIntegerFormat.format(input
- .longValue()));
- assertEquals(input, result);
- }
-
- public void testConvertsToDoublePrimitive() throws Exception {
- Double input = new Double(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toDouble(true);
- Double result = (Double) converter.convert(numberFormat.format(input
- .doubleValue()));
-
- assertEquals(input, result);
- }
-
- public void testConvertsToLongPrimitive() throws Exception {
- Long input = new Long(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toLong(true);
- Long result = (Long) converter.convert(numberIntegerFormat.format(input
- .longValue()));
-
- assertEquals(input, result);
- }
-
- public void testConvertsToFloatPrimitive() throws Exception {
- Float input = new Float(1000);
-
- StringToNumberConverter converter = StringToNumberConverter.toFloat(true);
- Float result = (Float) converter.convert(numberFormat.format(input
- .floatValue()));
-
- assertEquals(input, result);
- }
-
- public void testReturnsNullBoxedTypeForEmptyString() throws Exception {
- StringToNumberConverter converter = StringToNumberConverter.toInteger(false);
- try {
- assertNull(converter.convert(""));
- } catch (Exception e) {
- fail("exception should not have been thrown");
- }
- }
-
- public void testThrowsIllegalArgumentExceptionIfAskedToConvertNonString()
- throws Exception {
- StringToNumberConverter converter = StringToNumberConverter.toInteger(false);
- try {
- converter.convert(new Integer(1));
- fail("exception should have been thrown");
- } catch (IllegalArgumentException e) {
- }
- }
-
- /**
- * Asserts a use case where the integer starts with a valid value but ends
- * in an unparsable format.
- *
- * @throws Exception
- */
- public void testInvalidInteger() throws Exception {
- StringToNumberConverter converter = StringToNumberConverter
- .toInteger(false);
-
- try {
- converter.convert("1 1 1");
- fail("exception should have been thrown");
- } catch (IllegalArgumentException e) {
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/RealmTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/RealmTest.java
deleted file mode 100644
index aac78b3..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/RealmTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.databinding.observable;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * @since 3.2
- */
-public class RealmTest extends TestCase {
- public void testSetDefaultWithRunnable() throws Exception {
- Realm oldRealm = new CurrentRealm(true);
- final Realm newRealm = new CurrentRealm(true);
-
- RealmTester.setDefault(oldRealm);
- Realm.runWithDefault(newRealm, new Runnable() {
- public void run() {
- assertEquals("new realm should be default", newRealm, Realm.getDefault());
- }
- });
-
- assertEquals("old realm should have been restored", oldRealm, Realm.getDefault());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/AbstractObservableMapTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/AbstractObservableMapTest.java
deleted file mode 100644
index 9e3d404..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/AbstractObservableMapTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.databinding.observable.map;
-
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.map.AbstractObservableMap;
-import org.eclipse.core.databinding.observable.map.MapDiff;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * @since 3.2
- */
-public class AbstractObservableMapTest extends TestCase {
- private AbstractObservableMapStub map;
-
- protected void setUp() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
- map = new AbstractObservableMapStub();
- }
-
- protected void tearDown() throws Exception {
- RealmTester.setDefault(null);
- }
-
- public void testIsStaleRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- map.isStale();
- }
- });
- }
-
- public void testSetStaleRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- map.setStale(true);
- }
- });
- }
-
- public void testFireStaleRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- map.fireStale();
- }
- });
- }
-
- public void testFireChangeRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- map.fireChange();
- }
- });
- }
-
- public void testFireMapChangeRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- map.fireMapChange(null);
- }
- });
- }
-
- static class AbstractObservableMapStub extends AbstractObservableMap {
- public Set entrySet() {
- return null;
- }
-
- protected void fireChange() {
- super.fireChange();
- }
-
- protected void fireMapChange(MapDiff diff) {
- super.fireMapChange(diff);
- }
-
- protected void fireStale() {
- super.fireStale();
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/ObservableMapTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/ObservableMapTest.java
deleted file mode 100644
index 7d1e56c..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/ObservableMapTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.core.tests.databinding.observable.map;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.map.IMapChangeListener;
-import org.eclipse.core.databinding.observable.map.MapChangeEvent;
-import org.eclipse.core.databinding.observable.map.MapDiff;
-import org.eclipse.core.databinding.observable.map.ObservableMap;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * @since 3.2
- *
- */
-public class ObservableMapTest extends TestCase {
- ObservableMapStub map;
-
- protected void setUp() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
- map = new ObservableMapStub(new HashMap());
- }
-
- protected void tearDown() throws Exception {
- RealmTester.setDefault(null);
- }
-
- public void testDisposeMapChangeListeners() throws Exception {
- class MapChangeListener implements IMapChangeListener {
- int count;
-
- public void handleMapChange(MapChangeEvent event) {
- count++;
- }
- }
-
- MapChangeListener listener = new MapChangeListener();
- map.addMapChangeListener(listener);
-
- assertEquals(0, listener.count);
- map.fireMapChange(null);
- assertEquals(1, listener.count);
-
- map.dispose();
- try {
- map.fireMapChange(null);
- } catch (Exception e) {
- // do nothing
- }
-
- assertEquals("listener should not have been notified", 1,
- listener.count);
- }
-
- public void testIsStaleRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- map.isStale();
- }
- });
- }
-
- public void testSetStaleRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- map.setStale(true);
- }
- });
- }
-
- public void testFireMapChangeRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- map.fireMapChange(null);
- }
- });
- }
-
- static class ObservableMapStub extends ObservableMap {
- /**
- * @param wrappedMap
- */
- public ObservableMapStub(Map wrappedMap) {
- super(wrappedMap);
- }
-
- protected void fireMapChange(MapDiff diff) {
- super.fireMapChange(diff);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/WritableMapTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/WritableMapTest.java
deleted file mode 100644
index d7d22aa..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/WritableMapTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.databinding.observable.map;
-
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.map.WritableMap;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * @since 3.2
- *
- */
-public class WritableMapTest extends TestCase {
- protected void setUp() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
- }
-
- protected void tearDown() throws Exception {
- RealmTester.setDefault(null);
- }
-
- public void testPutRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableMap map = new WritableMap();
- map.put("", "");
- }
- });
- }
-
- public void testRemoveRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableMap map = new WritableMap();
- CurrentRealm realm = (CurrentRealm) Realm.getDefault();
- boolean current = realm.isCurrent();
- realm.setCurrent(true);
- map.put("", "");
- realm.setCurrent(current);
-
- map.remove("");
- }
- });
- }
-
- public void testClearRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableMap map = new WritableMap();
- map.clear();
- }
- });
- }
-
- public void testPutAllRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableMap map = new WritableMap();
- map.putAll(Collections.EMPTY_MAP);
- }
- });
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableListTest.java
deleted file mode 100644
index 20c4102..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableListTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.internal.databinding.observable.masterdetail;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableList;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 3.2
- */
-public class DetailObservableListTest extends AbstractDefaultRealmTestCase {
- /**
- * Asserts the use case of specifying null on construction for the detail
- * type of the detail list.
- *
- * @throws Exception
- */
- public void testElementTypeNull() throws Exception {
- WritableValue observableValue = new WritableValue(new WritableList(new ArrayList(), Object.class), null);
-
- class Factory implements IObservableFactory {
- Object type = Object.class;
-
- public IObservable createObservable(Object target) {
- return new WritableList(new ArrayList(), type);
- }
- }
-
- Factory factory = new Factory();
- DetailObservableList detailObservable = new DetailObservableList(
- factory, observableValue, null);
- assertNull(detailObservable.getElementType());
-
- //change the type returned from the factory
- factory.type = String.class;
- observableValue.setValue(new WritableList(new ArrayList(), String.class));
- assertNull("element type not null", detailObservable.getElementType());
- }
-
- /**
- * Asserts that you can't change the type across multiple inner observables.
- *
- * @throws Exception
- */
- public void testElementTypeNotNull() throws Exception {
- WritableValue observableValue = new WritableValue(new WritableList(new ArrayList(), Object.class),
- null);
-
- class Factory implements IObservableFactory {
- Object type = Object.class;
-
- public IObservable createObservable(Object target) {
- return new WritableList(new ArrayList(), type);
- }
- }
-
- Factory factory = new Factory();
- DetailObservableList detailObservable = new DetailObservableList(factory,
- observableValue, Object.class);
- assertEquals(factory.type, detailObservable.getElementType());
-
- try {
- factory.type = String.class;
- observableValue.setValue(new WritableList(Arrays
- .asList(new Object[] { new Object() }), String.class));
- fail("if an element type is set this cannot be changed");
- } catch (AssertionFailedException e) {
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableSetTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableSetTest.java
deleted file mode 100644
index 0ed4988..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableSetTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.internal.databinding.observable.masterdetail;
-
-import java.util.Arrays;
-import java.util.HashSet;
-
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
-import org.eclipse.core.databinding.observable.set.WritableSet;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableSet;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 3.2
- *
- */
-public class DetailObservableSetTest extends AbstractDefaultRealmTestCase {
- /**
- * Asserts the use case of specifying null on construction for the detail
- * type of the detail list.
- *
- * @throws Exception
- */
- public void testElementTypeNull() throws Exception {
- WritableValue observableValue = new WritableValue(new WritableSet(new HashSet(), Object.class),
- null);
-
- class Factory implements IObservableFactory {
- Object type;
-
- public IObservable createObservable(Object target) {
- return new WritableSet(new HashSet(), type);
- }
- }
-
- Factory factory = new Factory();
- DetailObservableSet detailObservable = new DetailObservableSet(factory,
- observableValue, null);
- assertNull(detailObservable.getElementType());
-
- factory.type = Object.class;
- observableValue.setValue(new WritableSet(Arrays
- .asList(new Object[] { new Object() }), String.class));
- assertNull("element type not null", detailObservable.getElementType());
-
- factory.type = String.class;
- // set the value again to ensure that the observable doesn't update the
- // element type with that of the new element type
- observableValue.setValue(new WritableSet(Arrays
- .asList(new String[] { "1" }), Object.class));
- assertNull("element type not null", detailObservable.getElementType());
- }
-
- /**
- * Asserts that you can't change the type across multiple inner observables.
- *
- * @throws Exception
- */
- public void testElementTypeNotNull() throws Exception {
- WritableValue observableValue = new WritableValue(new WritableSet(new HashSet(), Object.class),
- null);
-
- class Factory implements IObservableFactory {
- Object type = Object.class;
-
- public IObservable createObservable(Object target) {
- return new WritableSet(new HashSet(), type);
- }
- }
-
- Factory factory = new Factory();
- DetailObservableSet detailObservable = new DetailObservableSet(factory,
- observableValue, Object.class);
- assertEquals(factory.type, detailObservable.getElementType());
-
- try {
- factory.type = String.class;
- observableValue.setValue(new WritableSet(Arrays
- .asList(new Object[] { new Object() }), String.class));
- fail("if an element type is set this cannot be changed");
- } catch (AssertionFailedException e) {
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableValueTest.java
deleted file mode 100755
index 471666b..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/masterdetail/DetailObservableValueTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 147515
- ******************************************************************************/
-
-package org.eclipse.core.tests.internal.databinding.observable.masterdetail;
-
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
-import org.eclipse.core.databinding.observable.masterdetail.MasterDetailObservables;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableValue;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 3.2
- */
-public class DetailObservableValueTest extends AbstractDefaultRealmTestCase {
- private WritableValue outerObservable;
-
- protected void setUp() throws Exception {
- super.setUp();
- outerObservable = new WritableValue();
- }
-
- public void testSetValue() throws Exception {
- WritableValueFactory factory = new WritableValueFactory();
- outerObservable.setValue("");
-
- IObservableValue detailObservable = MasterDetailObservables
- .detailValue(outerObservable, factory, null);
- WritableValue innerObservable = factory.innerObservable;
- Object value = new Object();
-
- assertFalse(value.equals(innerObservable.getValue()));
- detailObservable.setValue(value);
- assertEquals("inner value", value, innerObservable.getValue());
- }
-
- public void testGetValueType() throws Exception {
- DetailObservableValue detailObservable = new DetailObservableValue(outerObservable, null, String.class);
- assertEquals(String.class, detailObservable.getValueType());
- }
-
- /**
- * Asserts that when a null value type is set for the detail observable no
- * type checking is performed and the value type is always <code>null</code>.
- */
- public void testGetValueTypeNullValueType() throws Exception {
- WritableValueFactory factory = new WritableValueFactory();
- DetailObservableValue detailObservable = new DetailObservableValue(
- outerObservable, factory, null);
- assertNull(detailObservable.getValueType());
- factory.type = String.class;
-
- // force the inner observable to be recreated
- outerObservable.setValue("1");
- assertNull("value type should be ignored", detailObservable.getValueType());
-
- factory.type = Object.class;
-
- // force the inner observable to be recreated
- outerObservable.setValue("2");
- assertNull("value type should be ignored", detailObservable.getValueType());
- }
-
- /**
- * Factory that creates WritableValues with the target as the value.
- */
- static class WritableValueFactory implements IObservableFactory {
- WritableValue innerObservable;
- Object type;
-
- public IObservable createObservable(Object target) {
- return innerObservable = new WritableValue(target, type);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/WrappedConverterValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/WrappedConverterValidatorTest.java
deleted file mode 100644
index 203eb17..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/WrappedConverterValidatorTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.core.tests.internal.databinding.validation;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.conversion.IConverter;
-import org.eclipse.core.databinding.conversion.StringToNumberConverter;
-import org.eclipse.core.internal.databinding.validation.WrappedConverterValidator;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * @since 1.1
- */
-public class WrappedConverterValidatorTest extends TestCase {
- StringToNumberConverter converter;
- ValidatorStub validator;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- converter = StringToNumberConverter.toInteger(false);
- validator = new ValidatorStub(converter);
- }
-
- public void testValidReturnsOK() throws Exception {
- IStatus status = validator.validate("1");
- assertTrue(status.isOK());
- }
-
- public void testInvalidReturnsFailure() throws Exception {
- IStatus status = validator.validate("a");
- assertEquals(IStatus.ERROR, status.getSeverity());
- }
-
- public void testInvalidReturnMessage() throws Exception {
- String message = "error message";
- validator.message = message;
- IStatus status = validator.validate("a");
- assertEquals(message, status.getMessage());
- }
-
- static class ValidatorStub extends WrappedConverterValidator {
- String message = "";
-
- ValidatorStub(IConverter converter) {
- super(converter);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.internal.databinding.validation.WrappedConverterValidator#getErrorMessage()
- */
- protected String getErrorMessage() {
- return message;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/conversion/IdentityConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/conversion/IdentityConverterTest.java
deleted file mode 100644
index 5bd6de8..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/conversion/IdentityConverterTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- ******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.conversion;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.BindingException;
-import org.eclipse.core.internal.databinding.conversion.IdentityConverter;
-
-/**
- * @since 3.2
- *
- */
-public class IdentityConverterTest extends TestCase {
-
- private IdentityConverter c;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- c = new IdentityConverter(Integer.TYPE, Integer.TYPE);
- }
-
- public void testIsPrimitiveTypeMatchedWithBoxed() throws Exception {
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Integer.class, Integer.TYPE));
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Integer.TYPE, Integer.class));
-
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Byte.class, Byte.TYPE));
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Byte.TYPE, Byte.class));
-
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Short.class, Short.TYPE));
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Short.TYPE, Short.class));
-
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Long.class, Long.TYPE));
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Long.TYPE, Long.class));
-
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Float.class, Float.TYPE));
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Float.TYPE, Float.class));
-
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Double.class, Double.TYPE));
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Double.TYPE, Double.class));
-
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Boolean.class, Boolean.TYPE));
- assertTrue(c.isPrimitiveTypeMatchedWithBoxed(Boolean.TYPE, Boolean.class));
-
- assertFalse(c.isPrimitiveTypeMatchedWithBoxed(Boolean.class, Integer.TYPE));
- }
-
- public void testConvert_NullToPrimitive() {
- IdentityConverter p2b = new IdentityConverter(Float.TYPE, Float.TYPE);
- try {
- p2b.convert(null);
- fail("Should have thrown an exception");
- } catch (BindingException b) {
- // success
- }
- }
-
- public void testConvert_PrimitiveToBoxed() throws Exception {
- IdentityConverter p2b = new IdentityConverter(Float.class, Float.TYPE);
- assertEquals("4.2", new Float(4.2), p2b.convert(new Float(4.2)));
- }
-
- public void testConvert_BoxedToPrimitive() throws Exception {
- IdentityConverter p2b = new IdentityConverter(Float.TYPE, Float.class);
- assertEquals("4.2", new Float(4.2), p2b.convert(new Float(4.2)));
- }
-
- public void testConvert_PrimitiveToPrimitive() throws Exception {
- IdentityConverter p2b = new IdentityConverter(Float.TYPE, Float.TYPE);
- assertEquals("4.2", new Float(4.2), p2b.convert(new Float(4.2)));
- }
-
- public void testConvert_BoxedToBoxed() throws Exception {
- IdentityConverter p2b = new IdentityConverter(Float.class, Float.class);
- assertEquals("4.2", new Float(4.2), p2b.convert(new Float(4.2)));
- }
-
- public static class Person {
- public String foo = "blah";
- }
-
- public static class Animal {
- public String name="fido";
- }
-
- public void test_Convert_ValidAssignment() throws Exception {
- IdentityConverter pc = new IdentityConverter(Object.class, Person.class);
- Person orig = new Person();
- Object person = pc.convert(orig);
- assertTrue("Person class", person.getClass().equals(Person.class));
- assertTrue("Need correct Person", person.equals(orig));
- }
-
- public void test_Convert_ValidAssignment2() throws Exception {
- IdentityConverter pc = new IdentityConverter(Person.class, Object.class);
- Person orig = new Person();
- Object person = pc.convert(orig);
- assertTrue("Person class", person.getClass().equals(Person.class));
- assertTrue("Need correct Person", person.equals(orig));
- }
-
- public void testConvert_InvalidAssignment() throws Exception {
- IdentityConverter pc = new IdentityConverter(Object.class, Person.class);
- try {
- pc.convert(new Animal());
- fail("Should have gotten an exception");
- } catch (Exception e) {
- // success
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/AbstractBindSupportFactoryTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/AbstractBindSupportFactoryTest.java
deleted file mode 100644
index ef80485..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/AbstractBindSupportFactoryTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.AggregateValidationStatus;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 3.2
- *
- */
-public class AbstractBindSupportFactoryTest extends AbstractDefaultRealmTestCase {
-
- protected DataBindingContext ctx;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- ctx = new DataBindingContext();
- }
-
- protected void assertNoErrorsFound() {
- IStatus status = AggregateValidationStatus.getStatusMaxSeverity(ctx.getBindings());
- assertTrue("No errors should be found, but found " + status , status.isOK());
- }
-
- protected void assertErrorsFound() {
- IStatus status = AggregateValidationStatus.getStatusMaxSeverity(ctx.getBindings());
- assertFalse("Errors should be found, but found none.", status.isOK());
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBooleanPrimitiveTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBooleanPrimitiveTest.java
deleted file mode 100644
index 39f43f9..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBooleanPrimitiveTest.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class DefaultBindSupportFactoryBooleanPrimitiveTest extends AbstractBindSupportFactoryTest {
- private TestDataObject dataObject;
-
- public void setUp() throws Exception {
- super.setUp();
-
- dataObject = new TestDataObject();
- dataObject.setStringVal("0");
- dataObject.setBooleanPrimitiveVal(false);
- dataObject.setBooleanVal(new Boolean(false));
- }
-
- public void testStringToBooleanPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "stringVal"), BeansObservables.observeValue(dataObject,
- "booleanPrimitiveVal"), null, null);
-
- dataObject.setBooleanPrimitiveVal(true);
- assertEquals("boolean value does not match", true, dataObject.getBooleanPrimitiveVal());
- assertEquals("String value does not match", "true", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("false");
- assertEquals("boolean value does not match", false, dataObject.getBooleanPrimitiveVal());
- assertEquals("String value does not match", "false", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("");
- assertEquals("boolean value does not match", false, dataObject.getBooleanPrimitiveVal());
- assertEquals("String value does not match", "", dataObject.getStringVal());
- assertErrorsFound();
-
- dataObject.setStringVal(null);
- assertEquals("boolean value does not match", false, dataObject.getBooleanPrimitiveVal());
- assertNull("String value does not match", dataObject.getStringVal());
- assertErrorsFound();
- }
-
- public void testBooleanToBooleanPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "booleanVal"),
- BeansObservables.observeValue(dataObject, "booleanPrimitiveVal"),
- null, null);
-
- dataObject.setBooleanPrimitiveVal(true);
- assertEquals("boolean value does not match", true, dataObject.getBooleanPrimitiveVal());
- assertEquals("Boolean value does not match", new Boolean(true), dataObject.getBooleanVal());
- assertNoErrorsFound();
-
- dataObject.setBooleanVal(new Boolean(false));
- assertEquals("boolean value does not match", false, dataObject.getBooleanPrimitiveVal());
- assertEquals("Boolean value does not match", new Boolean(false), dataObject.getBooleanVal());
- assertNoErrorsFound();
-
- dataObject.setBooleanVal(null);
- assertEquals("boolean value does not match", false, dataObject.getBooleanPrimitiveVal());
- assertNull("Boolean value does not match", dataObject.getBooleanVal());
- assertErrorsFound();
- }
-
- public void testObjectToBooleanPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "objectVal"), BeansObservables.observeValue(dataObject,
- "booleanPrimitiveVal"), null, null);
-
- dataObject.setBooleanPrimitiveVal(true);
- assertEquals("boolean value does not match", true, dataObject.getBooleanPrimitiveVal());
- assertEquals("Object value does not match", new Boolean(true), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(new Boolean(false));
- assertEquals("boolean value does not match", false, dataObject.getBooleanPrimitiveVal());
- assertEquals("Object value does not match", new Boolean(false), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(null);
- assertEquals("boolean value does not match", false, dataObject.getBooleanPrimitiveVal());
- assertNull("Object value does not match", dataObject.getObjectVal());
- assertErrorsFound();
-
- Object object = new Object();
- dataObject.setObjectVal(object);
- assertEquals("boolean value does not match", false, dataObject.getBooleanPrimitiveVal());
- assertSame("Object value does not match", object, dataObject.getObjectVal());
- assertErrorsFound();
- }
-
- public class TestDataObject extends ModelObject {
- private boolean booleanPrimitiveValue;
-
- private String stringVal;
-
- private Boolean booleanVal;
-
- private Object objectVal;
-
- public Boolean getBooleanVal() {
- return booleanVal;
- }
-
- public void setBooleanVal(Boolean booleanVal) {
- Object oldVal = this.booleanVal;
- this.booleanVal = booleanVal;
- firePropertyChange("booleanVal", oldVal, this.booleanVal);
- }
-
- public boolean getBooleanPrimitiveVal() {
- return booleanPrimitiveValue;
- }
-
- public void setBooleanPrimitiveVal(boolean booleanPrimitiveValue) {
- boolean oldVal = this.booleanPrimitiveValue;
- this.booleanPrimitiveValue = booleanPrimitiveValue;
- firePropertyChange("booleanPrimitiveVal", new Boolean(oldVal), new Boolean(this.booleanPrimitiveValue));
- }
-
- public String getStringVal() {
- return stringVal;
- }
-
- public void setStringVal(String stringVal) {
- Object oldVal = this.stringVal;
- this.stringVal = stringVal;
- firePropertyChange("stringVal", oldVal, this.stringVal);
- }
-
- public Object getObjectVal() {
- return objectVal;
- }
-
- public void setObjectVal(Object objectVal) {
- Object oldVal = this.objectVal;
- this.objectVal = objectVal;
- firePropertyChange("objectVal", oldVal, this.objectVal);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBytePrimitiveTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBytePrimitiveTest.java
deleted file mode 100644
index 513318d..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBytePrimitiveTest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class DefaultBindSupportFactoryBytePrimitiveTest extends AbstractBindSupportFactoryTest {
- private TestDataObject dataObject;
-
- public void setUp() throws Exception {
- super.setUp();
- dataObject = new TestDataObject();
- dataObject.setStringVal("0");
- dataObject.setBytePrimitiveVal((byte) 0);
- dataObject.setByteVal(new Byte((byte) 0));
- }
-
- public void testStringToBytePrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "stringVal"), BeansObservables.observeValue(dataObject,
- "bytePrimitiveVal"), null, null);
-
- dataObject.setBytePrimitiveVal((byte) 110);
- assertEquals("byte value does not match", 110, dataObject.getBytePrimitiveVal(), .001);
- assertEquals("String value does not match", "110", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("70");
- assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001);
- assertEquals("String value does not match", "70", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("");
- assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001);
- assertEquals("String value does not match", "", dataObject.getStringVal());
- assertErrorsFound();
-
- dataObject.setStringVal(null);
- assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001);
- assertNull("String value does not match", dataObject.getStringVal());
- assertErrorsFound();
- }
-
- public void testByteToBytePrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "byteVal"), BeansObservables.observeValue(dataObject,
- "bytePrimitiveVal"), null, null);
-
- dataObject.setBytePrimitiveVal((byte) 110);
- assertEquals("byte value does not match", 110, dataObject.getBytePrimitiveVal(), .001);
- assertEquals("Byte value does not match", new Byte((byte) 110), dataObject.getByteVal());
- assertNoErrorsFound();
-
- dataObject.setByteVal(new Byte((byte) 70));
- assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001);
- assertEquals("Byte value does not match", new Byte((byte) 70), dataObject.getByteVal());
- assertNoErrorsFound();
-
- dataObject.setByteVal(null);
- assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001);
- assertNull("Byte value does not match", dataObject.getByteVal());
- assertErrorsFound();
- }
-
- public void testObjectToBytePrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "objectVal"), BeansObservables.observeValue(dataObject,
- "bytePrimitiveVal"), null, null);
-
- dataObject.setBytePrimitiveVal((byte) 110);
- assertEquals("byte value does not match", 110, dataObject.getBytePrimitiveVal(), .001);
- assertEquals("Object value does not match", new Byte((byte) 110), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(new Byte((byte) 70));
- assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001);
- assertEquals("Object value does not match", new Byte((byte) 70), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(null);
- assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal());
- assertNull("Object value does not match", dataObject.getObjectVal());
- assertErrorsFound();
-
- Object object = new Object();
- dataObject.setObjectVal(object);
- assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal());
- assertSame("Object value does not match", object, dataObject.getObjectVal());
- assertErrorsFound();
- }
-
- public class TestDataObject extends ModelObject {
- private byte bytePrimitiveValue;
-
- private String stringVal;
-
- private Byte byteVal;
-
- private Object objectVal;
-
- public Byte getByteVal() {
- return byteVal;
- }
-
- public void setByteVal(Byte byteVal) {
- Object oldVal = this.byteVal;
- this.byteVal = byteVal;
- firePropertyChange("byteVal", oldVal, this.byteVal);
- }
-
- public byte getBytePrimitiveVal() {
- return bytePrimitiveValue;
- }
-
- public void setBytePrimitiveVal(byte bytePrimitiveValue) {
- byte oldVal = this.bytePrimitiveValue;
- this.bytePrimitiveValue = bytePrimitiveValue;
- firePropertyChange("bytePrimitiveVal", new Byte(oldVal), new Byte(this.bytePrimitiveValue));
- }
-
- public String getStringVal() {
- return stringVal;
- }
-
- public void setStringVal(String stringVal) {
- Object oldVal = this.stringVal;
- this.stringVal = stringVal;
- firePropertyChange("stringVal", oldVal, this.stringVal);
- }
-
- public Object getObjectVal() {
- return objectVal;
- }
-
- public void setObjectVal(Object objectVal) {
- Object oldVal = this.objectVal;
- this.objectVal = objectVal;
- firePropertyChange("objectVal", oldVal, this.objectVal);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryDoublePrimitiveTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryDoublePrimitiveTest.java
deleted file mode 100644
index 6f91c1d..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryDoublePrimitiveTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class DefaultBindSupportFactoryDoublePrimitiveTest extends AbstractBindSupportFactoryTest {
-
- private TestDataObject dataObject;
-
- public void setUp() throws Exception {
- super.setUp();
- dataObject = new TestDataObject();
- dataObject.setStringVal("0");
- dataObject.setDoublePrimitiveVal(0);
- dataObject.setDoubleVal(new Double(0));
- }
-
- public void testStringToDoublePrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "stringVal"), BeansObservables.observeValue(dataObject,
- "doublePrimitiveVal"), null, null);
-
- dataObject.setDoublePrimitiveVal(789.5);
- assertEquals("double value does not match", 789.5, dataObject.getDoublePrimitiveVal(), .001);
- assertEquals("String value does not match", "789.5", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("910.5");
- assertEquals("double value does not match", 910.5, dataObject.getDoublePrimitiveVal(), .001);
- assertEquals("String value does not match", "910.5", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("");
- assertEquals("double value does not match", 910.5, dataObject.getDoublePrimitiveVal(), .001);
- assertEquals("String value does not match", "", dataObject.getStringVal());
- assertErrorsFound();
-
- dataObject.setStringVal(null);
- assertEquals("double value does not match", 910.5, dataObject.getDoublePrimitiveVal(), .001);
- assertNull("String value does not match", dataObject.getStringVal());
- assertErrorsFound();
- }
-
- public void testDoubleToDoublePrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "doubleVal"), BeansObservables.observeValue(dataObject,
- "doublePrimitiveVal"), null, null);
- // ctx.bind(new Property(dataObject, "doubleVal"), new
- // Property(dataObject, "doublePrimitiveVal"), null);
-
- dataObject.setDoublePrimitiveVal(789.5);
- assertEquals("double value does not match", 789.5, dataObject.getDoublePrimitiveVal(), .001);
- assertEquals("Double value does not match", new Double(789.5), dataObject.getDoubleVal());
- assertNoErrorsFound();
-
- dataObject.setDoubleVal(new Double(910.5));
- assertEquals("double value does not match", 910.5, dataObject.getDoublePrimitiveVal(), .001);
- assertEquals("Double value does not match", new Double(910.5), dataObject.getDoubleVal());
- assertNoErrorsFound();
-
- dataObject.setDoubleVal(null);
- assertEquals("double value does not match", 910.5, dataObject.getDoublePrimitiveVal(), .001);
- assertNull("Double value does not match", dataObject.getDoubleVal());
- assertErrorsFound();
- }
-
- public void testObjectToDoublePrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "objectVal"), BeansObservables.observeValue(dataObject,
- "doublePrimitiveVal"), null, null);
-
- dataObject.setDoublePrimitiveVal(789.5);
- assertEquals("double value does not match", 789.5, dataObject.getDoublePrimitiveVal(), .001);
- assertEquals("Object value does not match", new Double(789.5), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(new Double(910.5));
- assertEquals("double value does not match", 910.5, dataObject.getDoublePrimitiveVal(), .001);
- assertEquals("Object value does not match", new Double(910.5), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(null);
- assertEquals("double value does not match", 910.5, dataObject.getDoublePrimitiveVal(), .001);
- assertNull("Object value does not match", dataObject.getObjectVal());
- assertErrorsFound();
-
- Object object = new Object();
- dataObject.setObjectVal(object);
- assertEquals("double value does not match", 910.5, dataObject.getDoublePrimitiveVal(), .001);
- assertSame("Object value does not match", object, dataObject.getObjectVal());
- assertErrorsFound();
- }
-
- public class TestDataObject extends ModelObject {
- private double doublePrimitiveValue;
-
- private String stringVal;
-
- private Double doubleVal;
-
- private Object objectVal;
-
- public Double getDoubleVal() {
- return doubleVal;
- }
-
- public void setDoubleVal(Double doubleVal) {
- Object oldVal = this.doubleVal;
- this.doubleVal = doubleVal;
- firePropertyChange("doubleVal", oldVal, this.doubleVal);
- }
-
- public double getDoublePrimitiveVal() {
- return doublePrimitiveValue;
- }
-
- public void setDoublePrimitiveVal(double doublePrimitiveValue) {
- double oldVal = this.doublePrimitiveValue;
- this.doublePrimitiveValue = doublePrimitiveValue;
- firePropertyChange("doublePrimitiveVal", new Double(oldVal), new Double(this.doublePrimitiveValue));
- }
-
- public String getStringVal() {
- return stringVal;
- }
-
- public void setStringVal(String stringVal) {
- Object oldVal = this.stringVal;
- this.stringVal = stringVal;
- firePropertyChange("stringVal", oldVal, this.stringVal);
- }
-
- public Object getObjectVal() {
- return objectVal;
- }
-
- public void setObjectVal(Object objectVal) {
- Object oldVal = this.objectVal;
- this.objectVal = objectVal;
- firePropertyChange("objectVal", oldVal, this.objectVal);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryFloatPrimitiveTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryFloatPrimitiveTest.java
deleted file mode 100644
index aaf2748..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryFloatPrimitiveTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class DefaultBindSupportFactoryFloatPrimitiveTest extends AbstractBindSupportFactoryTest {
-
- private TestDataObject dataObject;
-
- public void setUp() throws Exception {
- super.setUp();
- dataObject = new TestDataObject();
- dataObject.setStringVal("0");
- dataObject.setFloatPrimitiveVal(0);
- dataObject.setFloatVal(new Float(0));
- }
-
- public void testStringToFloatPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "stringVal"), BeansObservables.observeValue(dataObject,
- "floatPrimitiveVal"), null, null);
-
- dataObject.setFloatPrimitiveVal((float) 789.5);
- assertEquals("float value does not match", 789.5, dataObject.getFloatPrimitiveVal(), .001);
- assertEquals("String value does not match", "789.5", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("910.5");
- assertEquals("float value does not match", 910.5, dataObject.getFloatPrimitiveVal(), .001);
- assertEquals("String value does not match", "910.5", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("");
- assertEquals("float value does not match", 910.5, dataObject.getFloatPrimitiveVal(), .001);
- assertEquals("String value does not match", "", dataObject.getStringVal());
- assertErrorsFound();
-
- dataObject.setStringVal(null);
- assertEquals("float value does not match", 910.5, dataObject.getFloatPrimitiveVal(), .001);
- assertNull("String value does not match", dataObject.getStringVal());
- assertErrorsFound();
- }
-
- public void testFloatToFloatPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "floatVal"), BeansObservables.observeValue(dataObject,
- "floatPrimitiveVal"), null, null);
-
- dataObject.setFloatPrimitiveVal((float) 789.5);
- assertEquals("float value does not match", 789.5, dataObject.getFloatPrimitiveVal(), .001);
- assertEquals("Float value does not match", new Float(789.5), dataObject.getFloatVal());
- assertNoErrorsFound();
-
- dataObject.setFloatVal(new Float(910.5));
- assertEquals("float value does not match", 910.5, dataObject.getFloatPrimitiveVal(), .001);
- assertEquals("Float value does not match", new Float(910.5), dataObject.getFloatVal());
- assertNoErrorsFound();
-
- dataObject.setFloatVal(null);
- assertEquals("float value does not match", 910.5, dataObject.getFloatPrimitiveVal(), .001);
- assertNull("Float value does not match", dataObject.getFloatVal());
- assertErrorsFound();
- }
-
- public void testObjectToFloatPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "objectVal"), BeansObservables.observeValue(dataObject,
- "floatPrimitiveVal"), null, null);
-
- dataObject.setFloatPrimitiveVal((float) 789.5);
- assertEquals("float value does not match", 789.5, dataObject.getFloatPrimitiveVal(), .001);
- assertEquals("Object value does not match", new Float(789.5), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(new Float(910.5));
- assertEquals("float value does not match", 910.5, dataObject.getFloatPrimitiveVal(), .001);
- assertEquals("Object value does not match", new Float(910.5), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(null);
- assertEquals("float value does not match", 910.5, dataObject.getFloatPrimitiveVal(), .001);
- assertNull("Object value does not match", dataObject.getObjectVal());
- assertErrorsFound();
-
- Object object = new Object();
- dataObject.setObjectVal(object);
- assertEquals("float value does not match", 910.5, dataObject.getFloatPrimitiveVal(), .001);
- assertSame("Object value does not match", object, dataObject.getObjectVal());
- assertErrorsFound();
- }
-
- public class TestDataObject extends ModelObject {
- private float floatPrimitiveValue;
-
- private String stringVal;
-
- private Float floatVal;
-
- private Object objectVal;
-
- public Float getFloatVal() {
- return floatVal;
- }
-
- public void setFloatVal(Float floatVal) {
- Object oldVal = this.floatVal;
- this.floatVal = floatVal;
- firePropertyChange("floatVal", oldVal, this.floatVal);
- }
-
- public float getFloatPrimitiveVal() {
- return floatPrimitiveValue;
- }
-
- public void setFloatPrimitiveVal(float floatPrimitiveValue) {
- float oldVal = this.floatPrimitiveValue;
- this.floatPrimitiveValue = floatPrimitiveValue;
- firePropertyChange("floatPrimitiveVal", new Float(oldVal), new Float(this.floatPrimitiveValue));
- }
-
- public String getStringVal() {
- return stringVal;
- }
-
- public void setStringVal(String stringVal) {
- Object oldVal = this.stringVal;
- this.stringVal = stringVal;
- firePropertyChange("stringVal", oldVal, this.stringVal);
- }
-
- public Object getObjectVal() {
- return objectVal;
- }
-
- public void setObjectVal(Object objectVal) {
- Object oldVal = this.objectVal;
- this.objectVal = objectVal;
- firePropertyChange("objectVal", oldVal, this.objectVal);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryIntTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryIntTest.java
deleted file mode 100644
index 3de7e50..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryIntTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class DefaultBindSupportFactoryIntTest extends AbstractBindSupportFactoryTest {
- private TestDataObject dataObject;
-
- public void setUp() throws Exception {
- super.setUp();
- dataObject = new TestDataObject();
- dataObject.setStringVal("0");
- dataObject.setIntVal(0);
- dataObject.setIntegerVal(new Integer(0));
- }
-
- public void testStringToIntConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "stringVal"), BeansObservables.observeValue(dataObject, "intVal"), null, null);
-
- dataObject.setIntVal(789);
- assertEquals("Int value does not match", 789, dataObject.getIntVal());
- assertEquals("String value does not match", "789", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("910");
- assertEquals("Int value does not match", 910, dataObject.getIntVal());
- assertEquals("String value does not match", "910", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("");
- assertEquals("Int value does not match", 910, dataObject.getIntVal());
- assertEquals("String value does not match", "", dataObject.getStringVal());
- assertErrorsFound();
-
- dataObject.setStringVal(null);
- assertEquals("Int value does not match", 910, dataObject.getIntVal());
- assertNull("String value does not match", dataObject.getStringVal());
- assertErrorsFound();
- }
-
- public void testIntegerToIntConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "integerVal"), BeansObservables.observeValue(dataObject, "intVal"), null, null);
-
- dataObject.setIntVal(789);
- assertEquals("Int value does not match", 789, dataObject.getIntVal());
- assertEquals("Integer value does not match", new Integer(789), dataObject.getIntegerVal());
- assertNoErrorsFound();
-
- dataObject.setIntegerVal(new Integer(910));
- assertEquals("Int value does not match", 910, dataObject.getIntVal());
- assertEquals("Integer value does not match", new Integer(910), dataObject.getIntegerVal());
- assertNoErrorsFound();
-
- dataObject.setIntegerVal(null);
- assertEquals("Int value does not match", 910, dataObject.getIntVal());
- assertNull("Integer value does not match", dataObject.getIntegerVal());
- assertErrorsFound();
- }
-
- public void testObjectToIntegerConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "objectVal"), BeansObservables.observeValue(dataObject, "intVal"), null, null);
-
- dataObject.setIntVal(789);
- assertEquals("Int value does not match", 789, dataObject.getIntVal());
- assertEquals("Object value does not match", new Integer(789), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(new Integer(910));
- assertEquals("Int value does not match", 910, dataObject.getIntVal());
- assertEquals("Object value does not match", new Integer(910), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(null);
- assertEquals("Int value does not match", 910, dataObject.getIntVal());
- assertNull("Object value does not match", dataObject.getObjectVal());
- assertErrorsFound();
-
- Object object = new Object();
- dataObject.setObjectVal(object);
- assertEquals("Int value does not match", 910, dataObject.getIntVal());
- assertSame("Object value does not match", object, dataObject.getObjectVal());
- assertErrorsFound();
- }
-
- public class TestDataObject extends ModelObject {
- private int intVal;
- private String stringVal;
- private Integer integerVal;
- private Object objectVal;
-
- public Integer getIntegerVal() {
- return integerVal;
- }
- public void setIntegerVal(Integer integerVal) {
- Object oldVal = this.integerVal;
- this.integerVal = integerVal;
- firePropertyChange("integerVal", oldVal, this.integerVal);
- }
-
- public int getIntVal() {
- return intVal;
- }
- public void setIntVal(int intVal) {
- int oldVal = this.intVal;
- this.intVal = intVal;
- firePropertyChange("intVal", oldVal, this.intVal);
- }
-
- public String getStringVal() {
- return stringVal;
- }
- public void setStringVal(String stringVal) {
- Object oldVal = this.stringVal;
- this.stringVal = stringVal;
- firePropertyChange("stringVal", oldVal, this.stringVal);
- }
-
- public Object getObjectVal() {
- return objectVal;
- }
- public void setObjectVal(Object objectVal) {
- Object oldVal = this.objectVal;
- this.objectVal = objectVal;
- firePropertyChange("objectVal", oldVal, this.objectVal);
- }
- }
-}
-
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryLongPrimitiveTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryLongPrimitiveTest.java
deleted file mode 100644
index 162680f..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryLongPrimitiveTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class DefaultBindSupportFactoryLongPrimitiveTest extends AbstractBindSupportFactoryTest {
-
- private TestDataObject dataObject;
-
- public void setUp() throws Exception {
- super.setUp();
- dataObject = new TestDataObject();
- dataObject.setStringVal("0");
- dataObject.setLongPrimitiveVal(0);
- dataObject.setLongVal(new Long(0));
- }
-
- public void testStringToLongPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "stringVal"), BeansObservables.observeValue(dataObject,
- "longPrimitiveVal"), null, null);
-
- dataObject.setLongPrimitiveVal(110);
- assertEquals("long value does not match", 110, dataObject.getLongPrimitiveVal(), .001);
- assertEquals("String value does not match", "110", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("70");
- assertEquals("long value does not match", 70, dataObject.getLongPrimitiveVal(), .001);
- assertEquals("String value does not match", "70", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("");
- assertEquals("long value does not match", 70, dataObject.getLongPrimitiveVal(), .001);
- assertEquals("String value does not match", "", dataObject.getStringVal());
- assertErrorsFound();
-
- dataObject.setStringVal(null);
- assertEquals("long value does not match", 70, dataObject.getLongPrimitiveVal(), .001);
- assertNull("String value does not match", dataObject.getStringVal());
- assertErrorsFound();
- }
-
- public void testLongToLongPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "longVal"), BeansObservables.observeValue(dataObject,
- "longPrimitiveVal"), null, null);
-
- dataObject.setLongPrimitiveVal(110);
- assertEquals("long value does not match", 110, dataObject.getLongPrimitiveVal(), .001);
- assertEquals("Long value does not match", new Long(110), dataObject.getLongVal());
- assertNoErrorsFound();
-
- dataObject.setLongVal(new Long(70));
- assertEquals("long value does not match", 70, dataObject.getLongPrimitiveVal(), .001);
- assertEquals("Long value does not match", new Long(70), dataObject.getLongVal());
- assertNoErrorsFound();
-
- dataObject.setLongVal(null);
- assertEquals("long value does not match", 70, dataObject.getLongPrimitiveVal(), .001);
- assertNull("Long value does not match", dataObject.getLongVal());
- assertErrorsFound();
- }
-
- public void testObjectToLongPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "objectVal"), BeansObservables.observeValue(dataObject,
- "longPrimitiveVal"), null, null);
-
- dataObject.setLongPrimitiveVal(110);
- assertEquals("long value does not match", 110, dataObject.getLongPrimitiveVal(), .001);
- assertEquals("Object value does not match", new Long(110), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(new Long(70));
- assertEquals("long value does not match", 70, dataObject.getLongPrimitiveVal(), .001);
- assertEquals("Object value does not match", new Long(70), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(null);
- assertEquals("long value does not match", 70, dataObject.getLongPrimitiveVal(), .001);
- assertNull("Object value does not match", dataObject.getObjectVal());
- assertErrorsFound();
-
- Object object = new Object();
- dataObject.setObjectVal(object);
- assertEquals("long value does not match", 70, dataObject.getLongPrimitiveVal(), .001);
- assertSame("Object value does not match", object, dataObject.getObjectVal());
- assertErrorsFound();
- }
-
- public class TestDataObject extends ModelObject {
- private long longPrimitiveValue;
-
- private String stringVal;
-
- private Long longVal;
-
- private Object objectVal;
-
- public Long getLongVal() {
- return longVal;
- }
-
- public void setLongVal(Long longVal) {
- Object oldVal = this.longVal;
- this.longVal = longVal;
- firePropertyChange("longVal", oldVal, this.longVal);
- }
-
- public long getLongPrimitiveVal() {
- return longPrimitiveValue;
- }
-
- public void setLongPrimitiveVal(long longPrimitiveValue) {
- long oldVal = this.longPrimitiveValue;
- this.longPrimitiveValue = longPrimitiveValue;
- firePropertyChange("longPrimitiveVal", new Long(oldVal), new Long(this.longPrimitiveValue));
- }
-
- public String getStringVal() {
- return stringVal;
- }
-
- public void setStringVal(String stringVal) {
- Object oldVal = this.stringVal;
- this.stringVal = stringVal;
- firePropertyChange("stringVal", oldVal, this.stringVal);
- }
-
- public Object getObjectVal() {
- return objectVal;
- }
-
- public void setObjectVal(Object objectVal) {
- Object oldVal = this.objectVal;
- this.objectVal = objectVal;
- firePropertyChange("objectVal", oldVal, this.objectVal);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryShortPrimitiveTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryShortPrimitiveTest.java
deleted file mode 100644
index cf53c22..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryShortPrimitiveTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-public class DefaultBindSupportFactoryShortPrimitiveTest extends AbstractBindSupportFactoryTest {
-
- private TestDataObject dataObject;
-
- public void setUp() throws Exception {
- super.setUp();
- dataObject = new TestDataObject();
- dataObject.setStringVal("0");
- dataObject.setShortPrimitiveVal((short) 0);
- dataObject.setShortVal(new Short((short) 0));
- }
-
- public void testStringToShortPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "stringVal"), BeansObservables.observeValue(dataObject,
- "shortPrimitiveVal"), null, null);
-
- dataObject.setShortPrimitiveVal((short) 110);
- assertEquals("short value does not match", 110, dataObject.getShortPrimitiveVal());
- assertEquals("String value does not match", "110", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("70");
- assertEquals("short value does not match", 70, dataObject.getShortPrimitiveVal());
- assertEquals("String value does not match", "70", dataObject.getStringVal());
- assertNoErrorsFound();
-
- dataObject.setStringVal("");
- assertEquals("short value does not match", 70, dataObject.getShortPrimitiveVal());
- assertEquals("String value does not match", "", dataObject.getStringVal());
- assertErrorsFound();
-
- dataObject.setStringVal(null);
- assertEquals("short value does not match", 70, dataObject.getShortPrimitiveVal());
- assertNull("String value does not match", dataObject.getStringVal());
- assertErrorsFound();
- }
-
- public void testShortToShortPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "shortVal"), BeansObservables.observeValue(dataObject,
- "shortPrimitiveVal"), null, null);
-
- dataObject.setShortPrimitiveVal((short) 110);
- assertEquals("short value does not match", 110, dataObject.getShortPrimitiveVal());
- assertEquals("Short value does not match", new Short((short) 110), dataObject.getShortVal());
- assertNoErrorsFound();
-
- dataObject.setShortVal(new Short((short) 70));
- assertEquals("short value does not match", 70, dataObject.getShortPrimitiveVal());
- assertEquals("Short value does not match", new Short((short) 70), dataObject.getShortVal());
- assertNoErrorsFound();
-
- dataObject.setShortVal(null);
- assertEquals("short value does not match", 70, dataObject.getShortPrimitiveVal());
- assertNull("Short value does not match", dataObject.getShortVal());
- assertErrorsFound();
- }
-
- public void testObjectToShortPrimitiveConverter() {
- ctx.bindValue(BeansObservables.observeValue(dataObject, "objectVal"), BeansObservables.observeValue(dataObject,
- "shortPrimitiveVal"), null, null);
-
- dataObject.setShortPrimitiveVal((short) 110);
- assertEquals("short value does not match", 110, dataObject.getShortPrimitiveVal());
- assertEquals("Object value does not match", new Short((short) 110), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(new Short((short) 70));
- assertEquals("short value does not match", 70, dataObject.getShortPrimitiveVal());
- assertEquals("Object value does not match", new Short((short) 70), dataObject.getObjectVal());
- assertNoErrorsFound();
-
- dataObject.setObjectVal(null);
- assertEquals("short value does not match", 70, dataObject.getShortPrimitiveVal());
- assertNull("Object value does not match", dataObject.getObjectVal());
- assertErrorsFound();
-
- Object object = new Object();
- dataObject.setObjectVal(object);
- assertEquals("short value does not match", 70, dataObject.getShortPrimitiveVal());
- assertSame("Object value does not match", object, dataObject.getObjectVal());
- assertErrorsFound();
- }
-
- public class TestDataObject extends ModelObject {
- private short shortPrimitiveValue;
-
- private String stringVal;
-
- private Short shortVal;
-
- private Object objectVal;
-
- public Short getShortVal() {
- return shortVal;
- }
-
- public void setShortVal(Short shortVal) {
- Object oldVal = this.shortVal;
- this.shortVal = shortVal;
- firePropertyChange("shortVal", oldVal, this.shortVal);
- }
-
- public short getShortPrimitiveVal() {
- return shortPrimitiveValue;
- }
-
- public void setShortPrimitiveVal(short shortPrimitiveValue) {
- short oldVal = this.shortPrimitiveValue;
- this.shortPrimitiveValue = shortPrimitiveValue;
- firePropertyChange("shortPrimitiveVal", new Short(oldVal), new Short(this.shortPrimitiveValue));
- }
-
- public String getStringVal() {
- return stringVal;
- }
-
- public void setStringVal(String stringVal) {
- Object oldVal = this.stringVal;
- this.stringVal = stringVal;
- firePropertyChange("stringVal", oldVal, this.stringVal);
- }
-
- public Object getObjectVal() {
- return objectVal;
- }
-
- public void setObjectVal(Object objectVal) {
- Object oldVal = this.objectVal;
- this.objectVal = objectVal;
- firePropertyChange("objectVal", oldVal, this.objectVal);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryTest.java
deleted file mode 100644
index 8bc7fb6..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.factories;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.examples.databinding.ModelObject;
-
-/**
- * @since 3.2
- *
- */
-public class DefaultBindSupportFactoryTest extends AbstractBindSupportFactoryTest {
-
- public void testStringToIntegerConverter() {
- TestDataObject dataObject = new TestDataObject();
- dataObject.setIntegerStringVal("123");
- dataObject.setIntStringVal("456");
- ctx.bindValue(BeansObservables.observeValue(dataObject, "intStringVal"),
- BeansObservables.observeValue(dataObject, "intVal"),
- null, null);
-
- ctx.bindValue(BeansObservables.observeValue(dataObject, "integerStringVal"),
- BeansObservables.observeValue(dataObject, "integerVal"),
- null, null);
-
- dataObject.setIntegerStringVal("789");
- assertEquals("Integer value does not match", new Integer(789), dataObject.getIntegerVal());
-
- dataObject.setIntStringVal("789");
- assertEquals("Int value does not match", 789, dataObject.getIntVal());
- assertNoErrorsFound();
-
- dataObject.setIntegerStringVal("");
- assertNull("Integer value not null", dataObject.getIntegerVal());
-
- dataObject.setIntStringVal("");
- assertErrorsFound();
- assertEquals("Int value should not have changed.", 789, dataObject.getIntVal());
- }
-
- public class TestDataObject extends ModelObject {
- private int intVal;
-
- private Integer integerVal;
-
- private String intStringVal;
-
- private String integerStringVal;
-
- public Integer getIntegerVal() {
- return integerVal;
- }
-
- public void setIntegerVal(Integer integerVal) {
- this.integerVal = integerVal;
- }
-
- public int getIntVal() {
- return intVal;
- }
-
- public void setIntVal(int intVal) {
- this.intVal = intVal;
- }
-
- public String getIntegerStringVal() {
- return integerStringVal;
- }
-
- public void setIntegerStringVal(String integerStringVal) {
- Object oldVal = this.integerStringVal;
- this.integerStringVal = integerStringVal;
- firePropertyChange("integerStringVal", oldVal, this.integerStringVal);
- }
-
- public String getIntStringVal() {
- return intStringVal;
- }
-
- public void setIntStringVal(String intStringVal) {
- Object oldVal = this.intStringVal;
- this.intStringVal = intStringVal;
- firePropertyChange("intStringVal", oldVal, this.intStringVal);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/validation/ObjectToPrimitiveValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/validation/ObjectToPrimitiveValidatorTest.java
deleted file mode 100644
index ab51156..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/validation/ObjectToPrimitiveValidatorTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.internal.databinding.provisional.validation;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.internal.databinding.validation.ObjectToPrimitiveValidator;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * @since 3.2
- *
- */
-public class ObjectToPrimitiveValidatorTest extends TestCase {
-
- private ObjectToPrimitiveValidator objectToPrimitiveValidator;
-
- protected void setUp() throws Exception {
- this.objectToPrimitiveValidator = new ObjectToPrimitiveValidator(
- Integer.TYPE);
- }
-
- /**
- * Test method for
- * {@link org.eclipse.jface.internal.databinding.provisional.validation.ObjectToPrimitiveValidator#isValid(java.lang.Object)}.
- */
- public void testIsValid() {
- IStatus result = this.objectToPrimitiveValidator.validate(null);
- assertEquals("The wrong validation error was found.", result
- .getMessage(), this.objectToPrimitiveValidator.getNullHint());
-
- result = this.objectToPrimitiveValidator.validate(new Integer(1));
- assertTrue("No validation error should be found.", result.isOK());
-
- result = this.objectToPrimitiveValidator.validate(new Object());
- assertEquals("The wrong validation error was found.", result
- .getMessage(), this.objectToPrimitiveValidator.getClassHint());
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractDefaultRealmTestCase.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractDefaultRealmTestCase.java
deleted file mode 100644
index 620ea40..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractDefaultRealmTestCase.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Base class that sets the default realm to be the SWT realm.
- *
- * @since 3.3
- */
-public class AbstractDefaultRealmTestCase extends TestCase {
- private Realm previousRealm;
-
- /**
- * Sets the default realm to be the realm for the default display.
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- previousRealm = Realm.getDefault();
-
- Display display = Display.getCurrent() != null
- && !Display.getCurrent().isDisposed() ? Display.getCurrent()
- : Display.getDefault();
- RealmTester.setDefault(SWTObservables.getRealm(display));
- }
-
- /**
- * Removes the default realm.
- */
- protected void tearDown() throws Exception {
- super.tearDown();
-
- RealmTester.setDefault(previousRealm);
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractSWTTestCase.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractSWTTestCase.java
deleted file mode 100644
index bbe4ae5..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractSWTTestCase.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding;
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Abstract test case that handles disposing of the Shell after each test.
- *
- * @since 1.1
- */
-public abstract class AbstractSWTTestCase extends AbstractDefaultRealmTestCase {
- private Shell shell;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
-
- if (shell != null && !shell.isDisposed()) {
- shell.dispose();
- }
- }
-
- /**
- * Returns a Shell to be used in a test.
- *
- * @return shell
- */
- protected Shell getShell() {
- if (shell == null || shell.isDisposed()) {
- shell = new Shell();
- }
-
- return shell;
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java
deleted file mode 100644
index abd2878..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bugs 137877, 152543, 152540
- * Brad Reynolds - bug 116920
- * Brad Reynolds - bug 164247
- * Brad Reynolds - bug 164653, 159768, 170848, 147515
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.tests.databinding.UpdateStrategyTest;
-import org.eclipse.core.tests.databinding.UpdateValueStrategyTest;
-import org.eclipse.core.tests.databinding.beans.BeansObservablesTest;
-import org.eclipse.core.tests.databinding.conversion.NumberToStringConverterTest;
-import org.eclipse.core.tests.databinding.conversion.StringToNumberConverterTest;
-import org.eclipse.core.tests.databinding.observable.RealmTest;
-import org.eclipse.core.tests.databinding.observable.map.AbstractObservableMapTest;
-import org.eclipse.core.tests.databinding.observable.map.ObservableMapTest;
-import org.eclipse.core.tests.databinding.observable.map.WritableMapTest;
-import org.eclipse.core.tests.internal.databinding.observable.masterdetail.DetailObservableListTest;
-import org.eclipse.core.tests.internal.databinding.observable.masterdetail.DetailObservableSetTest;
-import org.eclipse.core.tests.internal.databinding.observable.masterdetail.DetailObservableValueTest;
-import org.eclipse.core.tests.internal.databinding.validation.WrappedConverterValidatorTest;
-import org.eclipse.jface.internal.databinding.provisional.conversion.IdentityConverterTest;
-import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryBooleanPrimitiveTest;
-import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryBytePrimitiveTest;
-import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryDoublePrimitiveTest;
-import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryFloatPrimitiveTest;
-import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryIntTest;
-import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryLongPrimitiveTest;
-import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryShortPrimitiveTest;
-import org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryTest;
-import org.eclipse.jface.internal.databinding.provisional.validation.ObjectToPrimitiveValidatorTest;
-import org.eclipse.jface.tests.databinding.mask.EditMaskLexerAndTokenTest;
-import org.eclipse.jface.tests.databinding.mask.EditMaskParserTest;
-import org.eclipse.jface.tests.databinding.observable.list.AbstractObservableListTest;
-import org.eclipse.jface.tests.databinding.observable.list.ObservableListTest;
-import org.eclipse.jface.tests.databinding.observable.list.WritableListTest;
-import org.eclipse.jface.tests.databinding.observable.set.WritableSetTest;
-import org.eclipse.jface.tests.databinding.observable.value.AbstractObservableValueTest;
-import org.eclipse.jface.tests.databinding.observable.value.AbstractVetoableValueTest;
-import org.eclipse.jface.tests.databinding.observable.value.WritableValueTest;
-import org.eclipse.jface.tests.databinding.scenarios.BindingScenariosTestSuite;
-import org.eclipse.jface.tests.databinding.swt.SWTObservablesTest;
-import org.eclipse.jface.tests.databinding.swt.TextObservableValueTests;
-import org.eclipse.jface.tests.databinding.viewers.ObservableMapLabelProviderTest;
-import org.eclipse.jface.tests.databinding.viewers.ObservableSetContentProviderTest;
-import org.eclipse.jface.tests.examples.model.PersonTests;
-import org.eclipse.jface.tests.internal.databinding.internal.ListBindingTest;
-import org.eclipse.jface.tests.internal.databinding.internal.ValueBindingTest;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.BeanObservableListDecoratorTest;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.BeanObservableSetDecoratorTest;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.BeanObservableValueDecoratorTest;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.JavaBeanObservableListTest;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.JavaBeanObservableMapTest;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.JavaBeanObservableSetTest;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.JavaBeanObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.beans.ListenerSupportTest;
-import org.eclipse.jface.tests.internal.databinding.internal.observable.UnmodifiableObservableListTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.ButtonObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.CComboObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.CLabelObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.ComboObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.ControlObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.LabelObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.ScaleObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.SpinnerObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.TableObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.swt.TextEditableObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.internal.viewers.SelectionProviderSingleSelectionObservableValueTest;
-import org.eclipse.jface.tests.internal.databinding.provisional.observable.AbstractObservableTest;
-import org.eclipse.jface.tests.internal.databinding.provisional.observable.ObservablesTest;
-import org.eclipse.jface.tests.internal.databinding.provisional.viewers.SelectionObservableValueTest;
-
-public class BindingTestSuite extends TestSuite {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite() {
- return new BindingTestSuite();
- }
-
- public BindingTestSuite() {
- //org.eclipse.core.tests.databinding
- addTestSuite(UpdateStrategyTest.class);
- addTestSuite(UpdateValueStrategyTest.class);
-
- // org.eclipse.core.tests.databinding.beans
- addTestSuite(BeansObservablesTest.class);
-
- //org.eclipse.core.tests.databinding.conversion
- addTestSuite(NumberToStringConverterTest.class);
- addTestSuite(StringToNumberConverterTest.class);
-
- // org.eclipse.core.tests.databinding.observable.map
- addTestSuite(AbstractObservableMapTest.class);
- addTestSuite(ObservableMapTest.class);
- addTestSuite(WritableMapTest.class);
-
- // org.eclipse.core.tests.internal.databinding.observable.masterdetail
- addTestSuite(DetailObservableListTest.class);
- addTestSuite(DetailObservableSetTest.class);
- addTestSuite(DetailObservableValueTest.class);
-
- //org.eclipse.core.tests.internal.databinding.validation
- addTestSuite(WrappedConverterValidatorTest.class);
-
- // org.eclipse.core.tests.databinding.observable
- addTestSuite(RealmTest.class);
-
- // org.eclipse.jface.internal.databinding.provisional.conversion
- addTestSuite(IdentityConverterTest.class);
-
- // org.eclipse.jface.internal.databinding.provisional.factories
- addTestSuite(DefaultBindSupportFactoryBooleanPrimitiveTest.class);
- addTestSuite(DefaultBindSupportFactoryBytePrimitiveTest.class);
- addTestSuite(DefaultBindSupportFactoryDoublePrimitiveTest.class);
- addTestSuite(DefaultBindSupportFactoryFloatPrimitiveTest.class);
- addTestSuite(DefaultBindSupportFactoryIntTest.class);
- addTestSuite(DefaultBindSupportFactoryLongPrimitiveTest.class);
- addTestSuite(DefaultBindSupportFactoryShortPrimitiveTest.class);
- addTestSuite(DefaultBindSupportFactoryTest.class);
-
- // org.eclipse.jface.internal.databinding.provisional.validation
- addTestSuite(ObjectToPrimitiveValidatorTest.class);
-
- // org.eclipse.jface.tests.databinding
- addTestSuite(ComputedValueTest.class);
- addTestSuite(DatabindingContextTest.class);
- addTestSuite(IDiffsTest.class);
- addTestSuite(ObservableTest.class);
- addTestSuite(RandomAccessListIteratorTest.class);
-
- // org.eclipse.jface.tests.databinding.mask
- addTestSuite(EditMaskLexerAndTokenTest.class);
- addTestSuite(EditMaskParserTest.class);
-
- // org.eclipse.jface.tests.databinding.observable.list
- addTestSuite(AbstractObservableListTest.class);
- addTestSuite(ObservableListTest.class);
- addTestSuite(WritableListTest.class);
-
- // org.eclipse.jface.tests.databinding.observable.set
- addTestSuite(WritableSetTest.class);
-
- // org.eclipse.jface.tests.databinding.observable.value
- addTestSuite(AbstractObservableValueTest.class);
- addTestSuite(AbstractVetoableValueTest.class);
- addTestSuite(WritableValueTest.class);
-
- // org.eclipse.jface.tests.databinding.scenarios
- addTest(BindingScenariosTestSuite.suite());
- // The files in this package are in the above test suite
-
- // org.eclipse.jface.tests.databinding.swt
- // FIXME
- // addTestSuite(AbstractGetAndSetSelectionObservableCollectionTest.class);
- // FIXME
- // addTestSuite(AutoSelectTableViewerCollectionExtendedTest.class);
- // FIXME addTestSuite(AutoSelectTableViewerCollectionTest.class);
- // FIXME addTestSuite(CComboObservableCollectionTest.class);
- // FIXME addTestSuite(ComboObservableCollectionTest.class);
- // FIXME
- // addTestSuite(CopyOfAutoSelectTableViewerCollectionExtendedTest.class);
- // FIXME addTestSuite(ListObservableCollectionTest.class);
- // FIXME addTestSuite(ObservableCollectionViewerTest.class);
- // FIXME addTestSuite(TableViewerObservableCollectionTest.class);
- addTestSuite(SWTObservablesTest.class);
- addTestSuite(TextObservableValueTests.class);
-
- // org.eclipse.jface.tests.databinding.views
- addTestSuite(ObservableMapLabelProviderTest.class);
- addTestSuite(ObservableSetContentProviderTest.class);
-
- // org.eclipse.jface.tests.examples.model
- addTestSuite(PersonTests.class);
-
- // org.eclipse.jface.tests.internal.databinding.internal
- addTestSuite(ListBindingTest.class);
-
- addTestSuite(ValueBindingTest.class);
-
- // org.eclipse.jface.tests.internal.databinding.internal.beans
- addTestSuite(BeanObservableListDecoratorTest.class);
- addTestSuite(BeanObservableSetDecoratorTest.class);
- addTestSuite(BeanObservableValueDecoratorTest.class);
- addTestSuite(BeanObservableListDecoratorTest.class);
- addTestSuite(JavaBeanObservableMapTest.class);
- addTestSuite(JavaBeanObservableSetTest.class);
- addTestSuite(JavaBeanObservableValueTest.class);
- addTestSuite(JavaBeanObservableListTest.class);
- addTestSuite(ListenerSupportTest.class);
-
- // org.eclipse.jface.tests.internal.databinding.internal.observable
- addTestSuite(UnmodifiableObservableListTest.class);
-
- // org.eclipse.jface.tests.internal.databinding.internal.swt
- addTestSuite(ButtonObservableValueTest.class);
- addTestSuite(CComboObservableValueTest.class);
- addTestSuite(CLabelObservableValueTest.class);
- addTestSuite(ComboObservableValueTest.class);
- addTestSuite(ControlObservableValueTest.class);
- addTestSuite(LabelObservableValueTest.class);
- addTestSuite(ScaleObservableValueTest.class);
- addTestSuite(SpinnerObservableValueTest.class);
- addTestSuite(TableObservableValueTest.class);
- addTestSuite(TextEditableObservableValueTest.class);
-
- // org.eclipse.jface.tests.internal.databinding.internal.viewers
- addTestSuite(SelectionProviderSingleSelectionObservableValueTest.class);
- // FIXME addTestSuite(SVOCWLTest.class);
-
- // org.eclipse.jface.tests.internal.databinding.provisional.observable
- addTestSuite(AbstractObservableTest.class);
- addTestSuite(ObservablesTest.class);
-
- // org.eclipse.jface.tests.internal.databinding.provisional.viewers
- addTestSuite(SelectionObservableValueTest.class);
- }
-
- /**
- * @param testCase
- * TODO
- * @return true if the given test is temporarily disabled
- */
- public static boolean failingTestsDisabled(TestCase testCase) {
- System.out.println("Ignoring disabled test: "
- + testCase.getClass().getName() + "." + testCase.getName());
- return true;
- }
-
- /**
- * @param testSuite
- * TODO
- * @return true if the given test is temporarily disabled
- */
- public static boolean failingTestsDisabled(TestSuite testSuite) {
- System.out.println("Ignoring disabled test: "
- + testSuite.getClass().getName() + "." + testSuite.getName());
- return true;
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/ComputedValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/ComputedValueTest.java
deleted file mode 100644
index a9b005e..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/ComputedValueTest.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-
-package org.eclipse.jface.tests.databinding;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.databinding.observable.value.ComputedValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-
-/**
- * @since 1.0
- *
- */
-public class ComputedValueTest extends AbstractDefaultRealmTestCase {
- public void testValueType() throws Exception {
- ComputedValue cv = new ComputedValue(Integer.TYPE) {
- protected Object calculate() {
- return new Integer(42);
- }
- };
- assertEquals("value type should be the type that was set", Integer.TYPE, cv.getValueType());
-
- cv = new ComputedValue() {
- protected Object calculate() {
- // TODO Auto-generated method stub
- return null;
- }
- };
-
- assertNull(cv.getValueType());
- }
-
- public void test_getValue() throws Exception {
- ComputedValue cv = new ComputedValue() {
- protected Object calculate() {
- return new Integer(42);
- }
- };
- assertEquals("Calculated value should be 42", new Integer(42), cv.getValue());
- }
-
- public void testDependencyValueChange() throws Exception {
- final WritableValue value = new WritableValue(new Integer(42), Integer.TYPE);
-
- ComputedValue cv = new ComputedValue() {
- protected Object calculate() {
- return value.getValue();
- }
- };
-
- assertEquals("calculated value should have been that of the writable value", value.getValue(), cv.getValue());
-
- value.setValue(new Integer(44));
-
- assertEquals("calculated value should have been that of the writable value", value.getValue(), cv.getValue());
- }
-
- private static class WritableValueExt extends WritableValue {
- public WritableValueExt(Object valueType, Object initialValue) {
- super(initialValue, valueType);
- }
-
- public boolean hasListeners() {
- return super.hasListeners();
- }
- }
-
- public void testHookAndUnhookDependantObservables() throws Exception {
- final List values = new ArrayList();
-
- ComputedValue cv = new ComputedValue() {
- protected Object calculate() {
- int sum = 0;
- for (Iterator it = values.iterator(); it.hasNext();) {
- WritableValue value = (WritableValue) it.next();
- sum += ((Integer) value.getValue()).intValue();
-
- }
-
- return new Integer(sum);
- }
- };
-
- WritableValueExt value1 = new WritableValueExt(Integer.TYPE, new Integer(1));
- WritableValueExt value2 = new WritableValueExt(Integer.TYPE, new Integer(1));
- values.add(value1);
- values.add(value2);
-
- assertFalse(value1.hasListeners());
- assertFalse(value2.hasListeners());
- cv.getValue();
- assertTrue(value1.hasListeners());
- assertTrue(value2.hasListeners());
-
- //force the computed value to be stale
- value2.setValue(new Integer(2));
- //remove value2 from the values that are used to compute the value
- values.remove(value2);
-
- //force the value to be computed
- cv.getValue();
- assertEquals(new Integer(1), cv.getValue());
- assertTrue(value1.hasListeners());
- assertFalse("because value2 is not a part of the calculation the listeners should have been removed", value2.hasListeners());
- }
-
- public void testSetValueUnsupportedOperationException() throws Exception {
- ComputedValue cv = new ComputedValue() {
- protected Object calculate() {
- return null;
- }
- };
-
- try {
- cv.setValue(new Object());
- fail("exception should have been thrown");
- } catch (UnsupportedOperationException e) {
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/DatabindingContextTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/DatabindingContextTest.java
deleted file mode 100644
index 51ab692..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/DatabindingContextTest.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 159539
- * Brad Reynolds - bug 140644
- * Brad Reynolds - bug 159940
- * Brad Reynolds - bug 116920, 159768
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.databinding.AggregateValidationStatus;
-import org.eclipse.core.databinding.Binding;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateListStrategy;
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.databinding.validation.ValidationStatus;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.tests.databinding.util.EventTrackers.ChangeEventTracker;
-import org.eclipse.jface.tests.databinding.util.EventTrackers.ValueChangeEventTracker;
-
-public class DatabindingContextTest extends AbstractDefaultRealmTestCase {
- private DataBindingContext dbc;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- dbc = new DataBindingContext();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- if (dbc != null) {
- dbc.dispose();
- }
- super.tearDown();
- }
-
- public void testDisposeBindings() throws Exception {
- Binding binding = new BindingStub();
- binding.init(dbc);
-
- assertFalse(binding.isDisposed());
- dbc.dispose();
- assertTrue("binding should be diposed when dbc is disposed", binding
- .isDisposed());
- }
-
- public void testBindValue() throws Exception {
- IObservableValue target = WritableValue.withValueType(String.class);
- IObservableValue model = WritableValue.withValueType(String.class);
-
- Binding binding = dbc.bindValue(target, model, null, null);
- assertTrue("binding is of the incorrect type",
- binding.getClass().getName().endsWith("ValueBinding"));
- }
-
- public void testBindList() throws Exception {
- IObservableList target = WritableList.withElementType(Object.class);
- IObservableList model = WritableList.withElementType(Object.class);
-
- Binding binding = dbc.bindList(target, model, null, null);
- assertTrue("binding is of the incorrect type",
- binding.getClass().getName().endsWith("ListBinding"));
- }
-
- /**
- * Asserts that IStatus is populated and change events are fired when a
- * Binding that is associated with a context is in error.
- *
- * @throws Exception
- */
- public void testValidationError() throws Exception {
- WritableValue targetObservable = WritableValue.withValueType(String.class);
- WritableValue modelObservable = WritableValue.withValueType(String.class);
-
- final String errorMessage = "error";
- ValueChangeEventTracker errorCounter = new ValueChangeEventTracker();
- ChangeEventTracker errorsCounter = new ChangeEventTracker();
-
- IObservableValue error = new AggregateValidationStatus(dbc
- .getBindings(), AggregateValidationStatus.MAX_SEVERITY);
- error.addValueChangeListener(errorCounter);
- assertTrue(((IStatus) error.getValue()).isOK());
-
- IObservableMap errors = dbc.getValidationStatusMap();
- errors.addChangeListener(errorsCounter);
- assertEquals(0, errors.size());
-
- IValidator validator = new IValidator() {
- public IStatus validate(Object value) {
- return ValidationStatus.error(errorMessage);
- }
- };
-
- dbc
- .bindValue(targetObservable, modelObservable,
- new UpdateValueStrategy().setAfterGetValidator(validator), null);
-
- targetObservable.setValue("");
- assertFalse(((IStatus) error.getValue()).isOK());
- assertEquals(errorMessage, ((IStatus) error.getValue()).getMessage());
- assertEquals(1, errors.size());
- assertEquals(1, errorsCounter.count);
- assertEquals(1, errorCounter.count);
- error.dispose();
- }
-
- /**
- * Asserts that then
- * {@link DataBindingContext#bindValue(IObservableValue, IObservableValue, org.eclipse.jface.databinding.DefaultBindSpec, BindSpec)}
- * if invoked the created binding is added to the internal list of bindings.
- *
- * @throws Exception
- */
- public void testBindValueAddBinding() throws Exception {
- WritableValue targetValue = WritableValue.withValueType(String.class);
- WritableValue modelValue = WritableValue.withValueType(String.class);
-
- assertNotNull(dbc.getBindings());
- assertEquals(0, dbc.getBindings().size());
-
- Binding binding = dbc.bindValue(targetValue, modelValue, null, null);
- assertNotNull(binding);
- assertNotNull(dbc.getBindings());
- assertEquals(1, dbc.getBindings().size());
- assertEquals(binding, dbc.getBindings().get(0));
- }
-
- /**
- * Asserts that when
- * {@link DataBindingContext#bindList(IObservableList, IObservableList, org.eclipse.jface.databinding.DefaultBindSpec, UpdateListStrategy)}
- * is invoked the created binding is added to the intenal list of bindings.
- *
- * @throws Exception
- */
- public void testBindListAddBinding() throws Exception {
- WritableList targetList = new WritableList(new ArrayList(),
- Object.class);
- WritableList modelList = new WritableList(new ArrayList(), Object.class);
-
- assertNotNull(dbc.getBindings());
- assertEquals(0, dbc.getBindings().size());
-
- Binding binding = dbc.bindList(targetList, modelList, null, null);
- assertNotNull(binding);
- assertNotNull(dbc.getBindings());
- assertEquals(1, dbc.getBindings().size());
- assertEquals(binding, dbc.getBindings().get(0));
- }
-
- public void testGetBindingsImmutability() throws Exception {
- BindingStub binding = new BindingStub();
- binding.init(dbc);
-
- try {
- dbc.getBindings().remove(0);
- fail("exception should have been thrown");
- } catch (UnsupportedOperationException e) {
- }
- }
-
- public void testRemoveBinding() throws Exception {
- BindingStub binding = new BindingStub();
- binding.init(dbc);
-
- assertTrue("context should contain the binding", dbc.getBindings()
- .contains(binding));
- binding.dispose();
- assertFalse("binding should have been removed", dbc.getBindings()
- .contains(binding));
- }
-
- /**
- * Asserts that when a ValueBinding is created validation is ran to ensure
- * that the validation status of the Binding reflects the validity of the
- * value in the target.
- *
- * @throws Exception
- */
- public void testValidateTargetAfterValueBindingCreation() throws Exception {
- WritableValue target = new WritableValue("", String.class);
- WritableValue model = new WritableValue("2", String.class);
- class Validator implements IValidator {
- public IStatus validate(Object value) {
- return ValidationStatus.error("error");
- }
- }
-
- Binding binding = dbc.bindValue(target, model,
- new UpdateValueStrategy().setAfterConvertValidator(new Validator()), null);
-
- assertEquals(IStatus.ERROR, ((IStatus) binding.getValidationStatus()
- .getValue()).getSeverity());
- }
-
- private static class BindingStub extends Binding {
- DataBindingContext context;
-
- public BindingStub() {
- super(new WritableValue(), new WritableValue());
- }
-
- public IObservableValue getPartialValidationStatus() {
- return null;
- }
-
- public IObservableValue getValidationStatus() {
- return null;
- }
-
- public void updateTargetToModel() {
- }
-
- public void updateModelToTarget() {
- }
-
- public void updateTargetFromModel(int phase) {
- }
-
- public void updateModelFromTarget(int phase) {
- }
-
- protected void postInit() {
- }
-
- protected void preInit() {
- }
-
- public void validateModelToTarget() {
- }
-
- public void validateTargetToModel() {
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/IDiffsTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/IDiffsTest.java
deleted file mode 100644
index 97c2ed8..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/IDiffsTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding;
-
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.list.ListDiff;
-import org.eclipse.core.databinding.observable.list.ListDiffEntry;
-import org.eclipse.core.databinding.observable.set.SetDiff;
-import org.eclipse.core.databinding.observable.value.ValueDiff;
-
-/**
- * @since 3.2
- *
- */
-public class IDiffsTest extends TestCase {
- /**
- * Asserts that the {@link SetDiff#toString()} implementation doesn't throw a NPE if any of its properties are <code>null</code>.
- */
- public void test_SetDiff() {
- SetDiff diff = new SetDiff() {
- public Set getAdditions() {
- return null;
- }
-
- public Set getRemovals() {
- return null;
- }
- };
-
- try {
- diff.toString();
- assertTrue(true);
- } catch (NullPointerException e) {
- fail("NPE was thrown.");
- }
- }
-
- /**
- * Asserts that the {@link LinkDiffEntry#toString()} implementation doesn't throw a NPE if any of its properties are <code>null</code>.
- */
- public void test_ListDiffEntry() {
- ListDiffEntry entry = new ListDiffEntry() {
- public Object getElement() {
- return null;
- }
-
- public int getPosition() {
- return 0;
- }
-
- public boolean isAddition() {
- return false;
- }
- };
-
- try {
- entry.toString();
- assertTrue(true);
- } catch (NullPointerException e) {
- fail("NPE was thrown.");
- }
- }
-
- /**
- * Asserts that the {@link ListDiff#toString()} implementation doesn't throw a NPE if any of its properties are <code>null</code>.
- *
- */
- public void test_ListDiff() {
- ListDiff diff = new ListDiff() {
- public ListDiffEntry[] getDifferences() {
- return null;
- }
- };
-
- try {
- diff.toString();
- assertTrue(true);
- } catch (NullPointerException e) {
- fail("NPE was thrown.");
- }
- }
-
- /**
- * Asserts that if the {@link ListDiff#toString()} implementation doesn't throw a NEP if the differences contains a <code>null</code> item.
- */
- public void test_ListDiff2() {
- ListDiff diff = new ListDiff() {
- public ListDiffEntry[] getDifferences() {
- return new ListDiffEntry[1];
- }
- };
-
- try {
- diff.toString();
- assertTrue(true);
- } catch (NullPointerException e) {
- fail("NPE was thrown.");
- }
- }
-
- /**
- * Asserts that if the {@link ValueDiff#toString()} implementation doesn't throw a NPE if any of its properties are <code>null</code>.
- *
- */
- public void test_ValueDiff() {
- ValueDiff diff = new ValueDiff() {
- public Object getNewValue() {
- return null;
- }
-
- public Object getOldValue() {
- return null;
- }
- };
-
- try {
- diff.toString();
- assertTrue(true);
- } catch (NullPointerException e) {
- fail("NPE was thrown.");
- }
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/ObservableTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/ObservableTest.java
deleted file mode 100644
index 4642214..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/ObservableTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-
-public class ObservableTest extends AbstractDefaultRealmTestCase {
-
- private static class MyObservable extends WritableValue {
- /**
- * @param initialValue
- */
- public MyObservable(Object initialValue) {
- super(initialValue, null);
- }
-
- public void fireChange(Object oldValue, Object newValue) {
- fireValueChange(Diffs.createValueDiff(oldValue, newValue));
- }
- }
-
- private MyObservable observable;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- observable = new MyObservable(null);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- if (observable != null) {
- try {
- observable.dispose();
- } catch (Exception ex) {
- // ignore
- }
- }
- observable = null;
- }
-
- private static class ChangeListener implements IChangeListener {
- int count;
- IObservable source;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.databinding.observable.IChangeListener#handleChange(org.eclipse.jface.databinding.observable.IObservable)
- */
- public void handleChange(ChangeEvent event) {
- count++;
- this.source = event.getObservable();
- }
- }
-
- /*
- * Test method for
- * 'org.eclipse.jface.databinding.Observable.addChangeListener(IChangeListener)'
- */
- public void testFireChangeListener() {
- ChangeListener listener = new ChangeListener();
- observable.addChangeListener(listener);
- assertEquals("listener should not have been invoked", 0, listener.count);
-
- observable.fireChange(null, null);
- assertEquals("listener should have been invoked", 1, listener.count);
- }
-
- /*
- * Test method for
- * 'org.eclipse.jface.databinding.Observable.removeChangeListener(IChangeListener)'
- */
- public void testRemoveChangeListener() {
- ChangeListener listener = new ChangeListener();
- observable.addChangeListener(listener);
-
- observable.removeChangeListener(listener);
- observable.fireChange(null, null);
- assertEquals("the listener should have been removed", 0, listener.count);
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/RandomAccessListIteratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/RandomAccessListIteratorTest.java
deleted file mode 100644
index 1b2aae6..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/RandomAccessListIteratorTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.internal.databinding.RandomAccessListIterator;
-
-public class RandomAccessListIteratorTest extends TestCase {
-
- private List emptyList = new LinkedList();
- private RandomAccessListIterator rali0 = new RandomAccessListIterator(emptyList);
- private List listWithOne;
- private RandomAccessListIterator rali1;
- private List list;
- private RandomAccessListIterator raliN;
-
- protected void setUp() throws Exception {
- listWithOne = new LinkedList();
- listWithOne.add("Uno");
- rali1 = new RandomAccessListIterator(listWithOne);
- list = new LinkedList();
- list.add("One");
- list.add("Two");
- list.add("three");
- list.add("four");
- raliN = new RandomAccessListIterator(list);
- }
-
- public void testGet_emptyList() {
- try {
- rali0.get(0);
- fail("Should have thrown exception");
- } catch (IndexOutOfBoundsException e) {
- // success
- }
- }
-
- public void testGet_withOne() {
- try {
- assertEquals("Uno", "Uno", rali1.get(0));
-
- rali1.get(1);
- fail("Should have thrown IndexOutOfBoundsException");
- } catch (Exception e) {
- // success
- }
- }
-
- public void testGet_alreadyAtItem() {
- assertEquals("one", "One", raliN.get(0));
- }
-
- public void testGet_moveForward() throws Exception {
- assertEquals("three", "three", raliN.get(2));
- }
-
- public void testGet_moveBackward() throws Exception {
- raliN.next();
- raliN.next();
- assertEquals("one", "One", raliN.get(0));
- }
-
- public void testGet_getLast() throws Exception {
- assertEquals("four", "four", raliN.get(3));
- }
-
- public void testGet_indexTooHigh() throws Exception {
- try {
- raliN.get(4);
- fail("Should have thrown exception");
- } catch (IndexOutOfBoundsException e) {
- // success
- }
- }
-
- public void testGet_indexTooLow() throws Exception {
- try {
- raliN.get(-100);
- fail("Should have thrown exception");
- } catch (IndexOutOfBoundsException e) {
- // success
- }
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/SelectionAwareObservableCollectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/SelectionAwareObservableCollectionTest.java
deleted file mode 100644
index a6b8247..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/SelectionAwareObservableCollectionTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding;
-
-import junit.framework.TestCase;
-
-public class SelectionAwareObservableCollectionTest extends TestCase {
-
- /*
- * FIXME: Rewrite to the new java.util.List API
- */
- public void testGetElementsAndSetElements() {
-// TestSelectionObservableCollection collection = new TestSelectionObservableCollection();
-// String string1 = "string1";
-// String string2 = "string2";
-// String string3 = "string3";
-// String string4 = "string4";
-// String string5 = "string5";
-//
-// collection.addElement(string1, 0);
-// collection.addElement(string2, 1);
-// collection.setSelectedObject(string1);
-//
-// List elementsToUpdate = new ArrayList();
-// elementsToUpdate.add(string3);
-// elementsToUpdate.add(string4);
-// elementsToUpdate.add(string5);
-//
-// collection.setElements(elementsToUpdate);
-//
-// assertEquals("The collection was not updated to the right size.", 3, collection.getSize());
-// assertEquals("The wrong element was found in position 0", string3, collection.getElement(0));
-// assertEquals("The wrong element was found in position 1", string4, collection.getElement(1));
-// assertEquals("The wrong element was found in position 2", string5, collection.getElement(2));
-// assertNull("The selected object was not reset as expected", collection.getSelectedObject());
-//
-// assertNotSame("The all elements list instance should not be the one provided in the set.", elementsToUpdate, collection.getElements());
-//
-// List returnedList = collection.getElements();
-// assertEquals("The wrong element was found in position 0 of the returned list", string3, returnedList.get(0));
-// assertEquals("The wrong element was found in position 1 of the returned list", string4, returnedList.get(1));
-// assertEquals("The wrong element was found in position 2 of the returned list", string5, returnedList.get(2));
-//
-// collection.setSelectedObject(string3);
-//
-// elementsToUpdate = new ArrayList();
-// elementsToUpdate.add(string1);
-// elementsToUpdate.add(string2);
-// elementsToUpdate.add(string3);
-//
-// collection.setElements(elementsToUpdate);
-//
-// assertSame("The selected element was not retained.", string3, collection.getSelectedObject());
- }
-
-// private class TestSelectionObservableCollection extends SelectionAwareObservableCollection {
-// private List elements = new ArrayList();
-// private Object selected;
-//
-// public int addElement(Object value, int index) {
-// elements.add(index, value);
-// return index;
-// }
-//
-// public Object computeElement(int index) {
-// return elements.get(index);
-// }
-//
-// public Class getElementType() {
-// return Object.class;
-// }
-//
-// public int computeSize() {
-// return elements.size();
-// }
-//
-// public void removeElement(int index) {
-// elements.remove(index);
-// }
-//
-// public void setElement(int index, Object value) {
-// elements.set(index, value);
-// }
-//
-// public Object getSelectedObject() {
-// return selected;
-// }
-//
-// public void setSelectedObject(Object object) {
-// this.selected = object;
-// }
-//
-//
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/mask/EditMaskLexerAndTokenTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/mask/EditMaskLexerAndTokenTest.java
deleted file mode 100644
index 1c80015..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/mask/EditMaskLexerAndTokenTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.mask;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.examples.databinding.mask.internal.EditMaskLexerAndToken;
-
-public class EditMaskLexerAndTokenTest extends TestCase {
-
- private EditMaskLexerAndToken token;
-
- protected void setUp() throws Exception {
- token = new EditMaskLexerAndToken();
- }
-
- public void testInitWithNumeric() throws Exception {
- token.initializeEditMask("#", 0);
- assertTrue("Should accept a digit", token.accept("0"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("1"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("2"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("3"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("4"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("5"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("6"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("7"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("8"));
- token.clear();
- assertTrue("Should accept a digit", token.accept("9"));
- token.clear();
- assertFalse("Should not accept an alpha", token.accept("A"));
- token.clear();
- assertFalse("Should not accept an alpha", token.accept("z"));
- assertFalse("Placeholders are not read-only", token.isReadOnly());
- }
-
- public void testInitWithLiteral() throws Exception {
- token.initializeEditMask("(", 0);
- assertEquals("Literals automatically set their input", "(", token.getInput());
- assertFalse("Literals don't accept anything", token.accept("("));
- assertTrue("literals are read-only", token.isReadOnly());
- assertTrue("Literals are complete", token.isComplete());
- assertFalse("Literals cannot accept characters", token.canAcceptMoreCharacters());
- }
-
- public void testInitWithBackslashLiteral() throws Exception {
- token.initializeEditMask("\\#", 0);
- assertEquals("Should get backslash literal", "#", token.getInput());
- }
-
- public void testAcceptWithValidInputAndEmpty() throws Exception {
- token.initializeEditMask("#", 0);
- assertTrue("Should accept a 0", token.accept("0"));
- }
-
- public void testAcceptWhenParserCannotAcceptMoreCharacters() throws Exception {
- token.initializeEditMask("#", 0);
- assertTrue("Should accept a 0", token.accept("0"));
- assertFalse("Should not accept a 0 -- input full", token.accept("0"));
- }
-
- public void testGetInput() throws Exception {
- token.initializeEditMask("#", 0);
- assertTrue("Should accept a #", token.accept("0"));
- assertEquals(token.getInput(), "0");
- }
-
- public void testClear_withNonLiteral() throws Exception {
- token.initializeEditMask("#", 0);
- assertTrue("Should accept a 0", token.accept("0"));
- assertNotNull("Input should not be null", token.getInput());
- token.clear();
- assertNull("Input should be null after clear", token.getInput());
- }
-
- public void testClear_withLiteral() throws Exception {
- token.initializeEditMask("(", 0);
- assertNotNull("Input should not be null", token.getInput());
- token.clear();
- assertNotNull("Input should still not be null after clear of read-only literal", token.getInput());
- }
-
- public void testIsComplete_withNonLiteral() throws Exception {
- token.initializeEditMask("#", 0);
- assertFalse("should not be complete", token.isComplete());
- token.accept("1");
- assertTrue("should be complete", token.isComplete());
- token.clear();
- assertFalse("should not be complete", token.isComplete());
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/mask/EditMaskParserTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/mask/EditMaskParserTest.java
deleted file mode 100644
index a7f8abe..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/mask/EditMaskParserTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.mask;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.examples.databinding.mask.EditMaskParseException;
-import org.eclipse.jface.examples.databinding.mask.internal.EditMaskParser;
-
-/**
- * @since 3.2
- *
- */
-public class EditMaskParserTest extends TestCase {
-
- private EditMaskParser parser;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- parser = new EditMaskParser("(###) ###-####");
- }
-
- /**
- * Test method for {@link org.eclipse.jface.examples.databinding.mask.internal.EditMaskParser#EditMaskParser(java.lang.String)}.
- */
- public void testEditMaskParser_validMask() {
- new EditMaskParser("(###) ###-####");
- }
-
- /**
- * Test method for {@link org.eclipse.jface.examples.databinding.mask.internal.EditMaskParser#EditMaskParser(java.lang.String)}.
- */
- public void testEditMaskParser_invalidMask() {
- try {
- new EditMaskParser("(###) ###-####\\");
- fail("Should have thrown exception");
- } catch (EditMaskParseException e) {
- // success
- }
- }
-
- /**
- * Test method for {@link org.eclipse.jface.examples.databinding.mask.internal.EditMaskParser#setInput(java.lang.String)}.
- */
- public void testSetInput() {
- parser.setInput("63a0) 5*55-1\\212abc9");
- assertEquals("Unformatted input", "6305551212", parser.getRawResult());
- assertEquals("Formatted input", "(630) 555-1212", parser.getFormattedResult());
- }
-
- /**
- * Test method for {@link org.eclipse.jface.examples.databinding.mask.internal.EditMaskParser#setInput(java.lang.String)}.
- */
- public void testSetInput_incomplete() {
- parser.setInput("6a0) 5*5-1\\12");
- assertEquals("Unformatted input", "6055112", parser.getRawResult());
- assertEquals("Formatted input", "(605) 511-2 ", parser.getFormattedResult());
- }
-
- /**
- * Test method for {@link org.eclipse.jface.examples.databinding.mask.internal.EditMaskParser#isComplete()}.
- */
- public void testIsComplete() {
- parser.setInput("63a0) 5*55-1\\212");
- assertTrue("complete", parser.isComplete());
- parser.setInput("6a0) 5*5-1\\12");
- assertFalse("incomplete", parser.isComplete());
- }
-
- public void testSetPlaceholder() throws Exception {
- parser.setInput("6a0) 5*5-1\\12");
- assertEquals("Formatted input", "(605) 511-2 ", parser.getFormattedResult());
- parser.setPlaceholder('_');
- assertEquals("Formatted input", "(605) 511-2___", parser.getFormattedResult());
- }
-
- /**
- * Test method for {@link org.eclipse.jface.examples.databinding.mask.internal.EditMaskParser#getNextInputPosition(int)}.
- */
- public void testGetNextInputPosition() {
- assertEquals("Skip leading (", 1, parser.getNextInputPosition(0));
- assertEquals("Position 1 is good", 1, parser.getNextInputPosition(1));
- assertEquals("Skip )<space>", 6, parser.getNextInputPosition(4));
- }
-
- public void testGetFirstIncompleteInputPosition() throws Exception {
- assertEquals("1st position incomplete", 1, parser.getFirstIncompleteInputPosition());
- parser.setInput("6a0) 5*5-1\\12");
- assertEquals("11th position incomplete", 11, parser.getFirstIncompleteInputPosition());
- parser.setInput("63a0) 5*55-1\\212");
- assertEquals("all complete", -1, parser.getFirstIncompleteInputPosition());
- }
-}
-
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/LockRealm.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/LockRealm.java
deleted file mode 100644
index 6c4f2be..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/LockRealm.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.observable;
-
-import java.util.LinkedList;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-
-/**
- * @since 3.2
- *
- */
-public class LockRealm extends Realm {
-
- private LinkedList queue;
- private ILock lock;
- private Job job;
- private boolean lockAcquired;
-
- public LockRealm() {
- queue = new LinkedList();
- lock = Job.getJobManager().newLock();
- job = new Job("Lock Realm Job") {
- protected IStatus run(IProgressMonitor monitor) {
- for (Runnable runnable; (runnable = dequeue()) != null;) {
- acquireLock();
- try {
- safeRun(runnable);
- } finally {
- releaseLock();
- }
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- }
-
- protected void syncExec(Runnable runnable) {
- acquireLock();
- try {
- safeRun(runnable);
- } finally {
- releaseLock();
- }
- }
-
- public void asyncExec(Runnable runnable) {
- enqueue(runnable);
- job.schedule();
- }
-
- /**
- * @param runnable
- */
- private void enqueue(Runnable runnable) {
- synchronized (queue) {
- queue.addLast(runnable);
- }
- }
-
- private Runnable dequeue() {
- synchronized (queue) {
- if (queue.isEmpty()) {
- return null;
- }
- return (Runnable) queue.getFirst();
- }
- }
-
- public boolean isCurrent() {
- return lockAcquired;
- }
-
- private void acquireLock() {
- lock.acquire();
- lockAcquired = true;
- }
-
- private void releaseLock() {
- lockAcquired = false;
- lock.release();
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/ThreadRealm.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/ThreadRealm.java
deleted file mode 100644
index 0fb950e..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/ThreadRealm.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.observable;
-
-import java.util.LinkedList;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.jface.util.Assert;
-
-/**
- * {@link Realm} that enforces execution to be within a specific
- * {@link Thread}.
- *
- * @since 3.2
- */
-public class ThreadRealm extends Realm {
- private Thread thread;
-
- private final LinkedList queue = new LinkedList();
-
- private volatile boolean block;
-
- /**
- * Initializes the realm.
- *
- * @param thread
- */
- public synchronized void init(Thread thread) {
- if (thread == null) {
- throw new IllegalArgumentException("Parameter thread was null."); //$NON-NLS-1$
- }
- Assert.isTrue(this.thread == null, "Realm can only be initialized once.");
-
- this.thread = thread;
- }
-
- /**
- * @return <code>true</code> if the current thread is the thread for
- * the realm
- */
- public boolean isCurrent() {
- return Thread.currentThread() == thread;
- }
-
- /**
- * @return thread, <code>null</code> if not
- * {@link #init(Thread) initialized}
- */
- public Thread getThread() {
- return thread;
- }
-
- /**
- * Queues the provided <code>runnable</code>.
- *
- * @param runnable
- */
- public void asyncExec(Runnable runnable) {
- synchronized (queue) {
- queue.add(runnable);
- queue.notifyAll();
- }
- }
-
- public boolean isBlocking() {
- return block;
- }
-
- /**
- * Blocks the current thread invoking runnables.
- */
- public void block() {
- if (block) {
- throw new IllegalStateException("Realm is already blocking.");
- }
-
- if (Thread.currentThread() != thread) {
- throw new IllegalStateException("The current thread is not the correct thread.");
- }
-
- try {
- block = true;
- while (block) {
- Runnable runnable = null;
- synchronized (queue) {
- while (queue.isEmpty()) {
- queue.wait();
- }
-
- // Check the size in case the thread is being awoken by
- // unblock().
- if (!queue.isEmpty()) {
- runnable = (Runnable) queue.removeFirst();
- }
- }
-
- if (runnable != null) {
- safeRun(runnable);
- runnable = null;
- }
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- } finally {
- block = false;
- }
- }
-
- /**
- * Unblocks the thread.
- */
- public void unblock() {
- block = false;
-
- // Awaken the thread if waiting.
- synchronized (queue) {
- queue.notifyAll();
- }
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/AbstractObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/AbstractObservableListTest.java
deleted file mode 100644
index 1ed6e66..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/AbstractObservableListTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 167204
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.observable.list;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.ObservableTracker;
-import org.eclipse.core.databinding.observable.list.AbstractObservableList;
-import org.eclipse.core.databinding.observable.list.ListDiff;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * @since 3.2
- */
-public class AbstractObservableListTest extends TestCase {
- private AbstractObservableListStub list;
-
- protected void setUp() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
- list = new AbstractObservableListStub();
- }
-
- protected void tearDown() throws Exception {
- RealmTester.setDefault(null);
- }
-
- public void testFireChangeRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- list.fireChange();
- }
- });
- }
-
- public void testFireStaleRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- list.fireStale();
- }
- });
- }
-
- public void testFireListChangeRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- list.fireListChange(null);
- }
- });
- }
-
- public void testIteratorGetterCalled() throws Exception {
- final AbstractObservableListStub list = new AbstractObservableListStub();
-
- IObservable[] observables = ObservableTracker.runAndMonitor(
- new Runnable() {
- public void run() {
- list.iterator();
- }
- }, null, null);
-
- assertEquals("length", 1, observables.length);
- assertEquals("observable", list, observables[0]);
- }
-
- public void testListIteratorGetterCalled() throws Exception {
- final AbstractObservableListStub list = new AbstractObservableListStub();
-
- IObservable[] observables = ObservableTracker.runAndMonitor(
- new Runnable() {
- public void run() {
- list.listIterator();
- }
- }, null, null);
-
- assertEquals("length", 1, observables.length);
- assertEquals("observable", list, observables[0]);
- }
-
- static class AbstractObservableListStub extends AbstractObservableList {
- protected int doGetSize() {
- return 0;
- }
-
- public Object get(int arg0) {
- return null;
- }
-
- public Object getElementType() {
- return null;
- }
-
- protected void fireChange() {
- super.fireChange();
- }
-
- protected void fireStale() {
- super.fireStale();
- }
-
- protected void fireListChange(ListDiff diff) {
- super.fireListChange(diff);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/ObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/ObservableListTest.java
deleted file mode 100644
index 9036ba1..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/ObservableListTest.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 167204
- *******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.observable.list;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.ObservableTracker;
-import org.eclipse.core.databinding.observable.list.ObservableList;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * @since 3.2
- */
-public class ObservableListTest extends TestCase {
- private ObservableListStub list;
-
- protected void setUp() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
-
- list = new ObservableListStub(new ArrayList(0), Object.class);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- RealmTester.setDefault(null);
- }
-
- public void testIsStaleRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- list.isStale();
- }
- });
- }
-
- public void testSetStaleRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- list.setStale(false);
- }
- });
- }
-
- public void testIteratorGetterCalled() throws Exception {
- final ObservableListStub list = new ObservableListStub(
- new ArrayList(0), Object.class);
-
- IObservable[] observables = ObservableTracker.runAndMonitor(
- new Runnable() {
- public void run() {
- list.iterator();
- }
- }, null, null);
-
- assertEquals("length", 1, observables.length);
- assertEquals("observable", list, observables[0]);
- }
-
- public void testListIteratorGetterCalled() throws Exception {
- ArrayList arrayList = new ArrayList();
- arrayList.add("");
- final ObservableListStub list = new ObservableListStub(arrayList,
- Object.class);
-
- IObservable[] observables = ObservableTracker.runAndMonitor(
- new Runnable() {
- public void run() {
- list.listIterator();
- }
- }, null, null);
-
- assertEquals("length", 1, observables.length);
- assertEquals("observable", list, observables[0]);
- }
-
- public void testListIteratorByIndexGetterCalled() throws Exception {
- ArrayList arrayList = new ArrayList();
- arrayList.add("");
- final ObservableListStub list = new ObservableListStub(arrayList,
- Object.class);
-
- IObservable[] observables = ObservableTracker.runAndMonitor(
- new Runnable() {
- public void run() {
- list.listIterator(1);
- }
- }, null, null);
-
- assertEquals("length", 1, observables.length);
- assertEquals("observable", list, observables[0]);
- }
-
- static class ObservableListStub extends ObservableList {
- protected ObservableListStub(List wrappedList, Object elementType) {
- super(wrappedList, elementType);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/WritableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/WritableListTest.java
deleted file mode 100644
index 669c147..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/list/WritableListTest.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 164653, 147515
- *******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.observable.list;
-
-import java.util.Arrays;
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IListChangeListener;
-import org.eclipse.core.databinding.observable.list.ListChangeEvent;
-import org.eclipse.core.databinding.observable.list.ListDiffEntry;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.tests.databinding.observable.ThreadRealm;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.2
- */
-public class WritableListTest extends TestCase {
- protected void tearDown() throws Exception {
- RealmTester.setDefault(null);
- }
-
- public void testClear() {
- ThreadRealm realm = new ThreadRealm();
- realm.init(Thread.currentThread());
-
- WritableList writableList = new WritableList(realm);
- writableList.add("hello");
- writableList.add("world");
- assertEquals(2, writableList.size());
- writableList.clear();
- assertEquals(0, writableList.size());
- }
-
- public void testRemoveAllChangeEvent() throws Exception {
- CurrentRealm realm = new CurrentRealm(true);
-
- WritableList list = new WritableList(realm);
- String element = "element";
-
- list.add(element);
-
- class ListChangeListener implements IListChangeListener {
- int count;
- ListChangeEvent event;
-
- /* (non-Javadoc)
- * @see org.eclipse.core.databinding.observable.list.IListChangeListener#handleListChange(org.eclipse.core.databinding.observable.list.ListChangeEvent)
- */
- public void handleListChange(ListChangeEvent event) {
- count++;
- this.event = event;
- }
- }
-
- ListChangeListener listener = new ListChangeListener();
- list.addListChangeListener(listener);
- assertEquals(0, listener.count);
-
- list.removeAll(Arrays.asList(new String[] {element}));
- assertEquals(1, listener.count);
-
- assertEquals(1, listener.event.diff.getDifferences().length);
- ListDiffEntry diffEntry = listener.event.diff.getDifferences()[0];
- assertFalse("addition", diffEntry.isAddition());
- assertEquals("element", element, diffEntry.getElement());
- assertEquals("position", 0, diffEntry.getPosition());
- assertFalse(list.contains(element));
- }
-
- public void testSetRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableList list = new WritableList();
- list.add("");
- list.set(0, "");
- }
- });
- }
-
- public void testAddRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableList list = new WritableList();
- list.add("");
- }
- });
- }
-
- public void testAddByIndexRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableList list = new WritableList();
- list.add(0, "");
- }
- });
- }
-
- public void testAddAllRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableList list = new WritableList();
- list.addAll(Collections.EMPTY_LIST);
- }
- });
- }
-
- public void testAddAllByIndexRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableList list = new WritableList();
- list.addAll(0, Collections.EMPTY_LIST);
- }
- });
- }
-
- public void testRemoveRealmChecks() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
- final WritableList list = new WritableList();
- list.add("");
- list.add("");
-
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- list.remove("");
- }
- });
- RealmTester.setDefault(null);
- }
-
- public void testRemoveByIndexRealmChecks() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
- final WritableList list = new WritableList();
- list.add("");
- list.add("");
-
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- list.remove(list.size() - 1);
- }
- });
-
- RealmTester.setDefault(null);
- }
-
- public void testRemoveAllRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableList list = new WritableList();
- list.removeAll(Collections.EMPTY_LIST);
- }
- });
- }
-
- public void testRetainAllRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableList list = new WritableList();
- list.retainAll(Collections.EMPTY_LIST);
- }
- });
- }
-
- public void testClearRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- WritableList list = new WritableList();
- list.clear();
- }
- });
- }
-
- public void testNullElementType() throws Exception {
- RealmTester.setDefault(SWTObservables.getRealm(Display.getDefault()));
- WritableList writableList = new WritableList();
- assertNull(writableList.getElementType());
-
- writableList = new WritableList(Realm.getDefault());
- assertNull(writableList.getElementType());
- }
-
- public void testWithElementType() throws Exception {
- RealmTester.setDefault(SWTObservables.getRealm(Display.getDefault()));
-
- Object elementType = String.class;
- WritableList list = WritableList.withElementType(elementType);
- assertNotNull(list);
- assertEquals(Realm.getDefault(), list.getRealm());
- assertEquals(elementType, list.getElementType());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/set/WritableSetTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/set/WritableSetTest.java
deleted file mode 100644
index 1d80c43..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/set/WritableSetTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jface.tests.databinding.observable.set;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.set.WritableSet;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 3.3
- */
-public class WritableSetTest extends AbstractDefaultRealmTestCase {
- public void testWithElementType() throws Exception {
- Object elementType = String.class;
- WritableSet set = WritableSet.withElementType(elementType);
- assertNotNull(set);
- assertEquals(Realm.getDefault(), set.getRealm());
- assertEquals(elementType, set.getElementType());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/AbstractObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/AbstractObservableValueTest.java
deleted file mode 100644
index 811ff85..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/AbstractObservableValueTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.observable.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
-import org.eclipse.core.databinding.observable.value.ValueDiff;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * @since 3.2
- */
-public class AbstractObservableValueTest extends TestCase {
- public void testSetValueRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- ObservableValueStub observable = new ObservableValueStub();
- try {
- observable.setValue(null);
- } catch (UnsupportedOperationException e) {
- // do nothing
- }
- }
- });
- }
-
- public void testSetValueInvokesDoSetValue() throws Exception {
- class ValueStub extends ObservableValueStub {
- int doSetValue;
-
- ValueStub(Realm realm) {
- super(realm);
- }
-
- protected void doSetValue(Object value) {
- doSetValue++;
- }
- }
-
- Realm realm = new CurrentRealm(true);
- ValueStub stub = new ValueStub(realm);
- assertEquals(0, stub.doSetValue);
- stub.setValue(new Object());
- assertEquals("doSetValue should have been invoked", 1, stub.doSetValue);
- }
-
- public void testFireValueChangeRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- ObservableValueStub observable = new ObservableValueStub();
- observable.fireValueChange(null);
- }
- });
- }
-
- private static class ObservableValueStub extends AbstractObservableValue {
- ObservableValueStub() {
- super(Realm.getDefault());
- }
-
- private ObservableValueStub(Realm realm) {
- super(realm);
- }
-
- protected Object doGetValue() {
- return null;
- }
-
- public Object getValueType() {
- return null;
- }
-
- protected void fireValueChange(ValueDiff diff) {
- super.fireValueChange(diff);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/AbstractVetoableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/AbstractVetoableValueTest.java
deleted file mode 100644
index ce85bcb..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/AbstractVetoableValueTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.observable.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.AbstractVetoableValue;
-import org.eclipse.core.databinding.observable.value.ValueDiff;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * @since 3.2
- */
-public class AbstractVetoableValueTest extends TestCase {
- public void testSetValueInvokesDoSetApprovedValue() throws Exception {
- class VetoableValue extends VetoableValueStub {
- int count;
- Object value;
-
- VetoableValue(Realm realm) {
- super(realm);
- }
-
- protected void doSetApprovedValue(Object value) {
- count++;
- this.value = value;
- }
- }
-
- Realm realm = new CurrentRealm(true);
- VetoableValue vetoableValue = new VetoableValue(realm);
- assertEquals(0, vetoableValue.count);
- assertEquals(null, vetoableValue.value);
-
- Object value = new Object();
- vetoableValue.setValue(value);
- assertEquals(1, vetoableValue.count);
- assertEquals(value, vetoableValue.value);
- }
-
- public void testFireValueChangeRealmChecks() throws Exception {
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- VetoableValueStub observable = new VetoableValueStub();
- observable.fireValueChanging(null);
- }
- });
- }
-
- private static class VetoableValueStub extends AbstractVetoableValue {
- VetoableValueStub() {
- this(Realm.getDefault());
- }
-
- VetoableValueStub(Realm realm) {
- super(realm);
- }
-
- protected void doSetApprovedValue(Object value) {
- }
-
- protected Object doGetValue() {
- return null;
- }
-
-
- public Object getValueType() {
- return null;
- }
-
- protected boolean fireValueChanging(ValueDiff diff) {
- return super.fireValueChanging(diff);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/WritableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/WritableValueTest.java
deleted file mode 100644
index bfc3528..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/observable/value/WritableValueTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds
- * 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:
- * Brad Reynolds - bug 158687
- * Brad Reynolds - bug 164653
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.observable.value;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-import org.eclipse.jface.tests.databinding.util.EventTrackers.ValueChangeEventTracker;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.2
- */
-public class WritableValueTest extends AbstractDefaultRealmTestCase {
- /**
- * Asserts that ValueChange events are only fired when the value changes.
- *
- * @throws Exception
- */
- public void testValueChangeOnlyFiresOnChange() throws Exception {
- WritableValue writableValue = new WritableValue();
- ValueChangeEventTracker counter = new ValueChangeEventTracker();
- writableValue.addValueChangeListener(counter);
-
- assertEquals(0, counter.count);
- // set same
- writableValue.setValue(null);
- assertEquals(0, counter.count);
-
- // set different
- writableValue.setValue("value");
- assertEquals(1, counter.count);
-
- // set same
- writableValue.setValue("value");
- assertEquals(1, counter.count);
-
- // set different
- writableValue.setValue(null);
- assertEquals(2, counter.count);
- }
-
- public void testDoSetValue() throws Exception {
- WritableValue writableValue = new WritableValue(SWTObservables
- .getRealm(Display.getDefault()));
- Object value = new Object();
- writableValue.setValue(value);
- assertEquals(value, writableValue.getValue());
- }
-
- /**
- * All constructors delegate to the 3 arg constructor.
- *
- * @throws Exception
- */
- public void testConstructor() throws Exception {
- WritableValue value = new WritableValue(SWTObservables.getRealm(Display
- .getDefault()));
- assertNull(value.getValue());
- assertNull(value.getValueType());
- }
-
- public void testWithValueType() throws Exception {
- Object elementType = String.class;
- WritableValue value = WritableValue.withValueType(elementType);
- assertNotNull(value);
- assertEquals(Realm.getDefault(), value.getRealm());
- assertEquals(elementType, value.getValueType());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/AutomationUtil.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/AutomationUtil.java
deleted file mode 100644
index 9e881ae..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/AutomationUtil.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-
-/**
- * COPIED FROM org.eclipse.ui.tests
- * <code>AutomationUtil</code> contains utility methods to mimic key events.
- * Mouse event methods can be added if needed to complete this class.
- */
-
-public class AutomationUtil {
-
- /**
- * Method to mimic a key code event on a display.
- *
- * @param display
- * The display.
- * @param eventType
- * The event type.
- * @param keyCode
- * The key code.
- */
- public static void performKeyCodeEvent(Display display, int eventType,
- int keyCode) {
- Event event = new Event();
- event.type = eventType;
- event.keyCode = keyCode;
- display.post(event);
- }
-
- /**
- * Method to mimic a character event on a display.
- *
- * @param display
- * The display.
- * @param eventType
- * The event type.
- * @param character
- * The character to mimic.
- */
- public static void performCharacterEvent(Display display, int eventType,
- char character) {
- Event event = new Event();
- event.type = eventType;
- event.character = character;
- display.post(event);
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/BindingScenariosTestSuite.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/BindingScenariosTestSuite.java
deleted file mode 100644
index 93fb3cb..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/BindingScenariosTestSuite.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * To run this test suite, right-click and select "Run As JUnit Plug-in Test".
- * This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run. You can also run this class as an SWT
- * application.
- */
-public class BindingScenariosTestSuite extends TestSuite {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- private static Display display;
-
- private static Shell shell;
-
- public static Test suite() {
- return new TestSetup(new BindingScenariosTestSuite()) {
- protected void setUp() throws Exception {
- Display d = Display.getDefault();
- shell = new Shell(d, SWT.SHELL_TRIM);
- shell.setLayout(new FillLayout());
- }
-
- protected void tearDown() throws Exception {
- shell.close();
- shell.dispose();
- if (display != null) {
- display.dispose();
- }
- }
- };
- }
-
- public BindingScenariosTestSuite() {
- addTestSuite(ButtonControlScenario.class);
- addTestSuite(ComboScenarios.class);
- addTestSuite(ComboUpdatingTest.class);
- addTestSuite(ComboViewerScenario.class);
- addTestSuite(CustomConverterScenarios.class);
- addTestSuite(CustomScenarios.class);
- addTestSuite(ListViewerScenario.class);
- addTestSuite(MasterDetailScenarios.class);
- addTestSuite(NewTableScenarios.class);
- addTestSuite(NPETestScenario.class);
- addTestSuite(PropertyScenarios.class);
- addTestSuite(SpinnerControlScenario.class);
- addTestSuite(TableScenarios.class);
- addTestSuite(TextControlScenario.class);
- }
-
- public static Shell getShell() {
- return shell;
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ButtonControlScenario.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ButtonControlScenario.java
deleted file mode 100644
index 5f1ac5a..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ButtonControlScenario.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class ButtonControlScenario extends ScenariosTestCase {
-
- private Adventure adventure;
-
- private Button button;
-
- protected void setUp() throws Exception {
- super.setUp();
- // do any setup work here
- button = new Button(getComposite(), SWT.CHECK);
- adventure = SampleData.WINTER_HOLIDAY;
- }
-
- protected void tearDown() throws Exception {
- button.dispose();
- super.tearDown();
- }
-
- public void testScenario01() {
- // Bind the button's selection to the adventure "isPetsAllowed"
- getDbc().bindValue(SWTObservables.observeSelection(button),
- BeansObservables.observeValue(adventure, "petsAllowed"),
- null, null);
-
- // Check the model and GUI are in the same state
- assertEquals(button.getSelection(), adventure.isPetsAllowed());
- // Change the model and check the GUI is updated
- boolean newBoolean = !adventure.isPetsAllowed();
- adventure.setPetsAllowed(newBoolean);
- assertEquals(newBoolean, adventure.isPetsAllowed());
- assertEquals(button.getSelection(), newBoolean);
- // Change the GUI and check the model
- newBoolean = !newBoolean;
- button.setSelection(newBoolean);
- button.notifyListeners(SWT.Selection, null);
- assertEquals(newBoolean, adventure.isPetsAllowed());
- newBoolean = !newBoolean;
- final boolean finalNewBoolean = newBoolean;
- adventure.setPetsAllowed(finalNewBoolean);
- spinEventLoop(0);
- assertEquals(newBoolean, button.getSelection());
-
- }
-
- public void testScenario02() {
- // Test with an SWT.Toggle button
- button.dispose();
- button = new Button(getComposite(), SWT.TOGGLE);
- // Bind the button's selection to the adventure "isPetsAllowed"
- getDbc().bindValue(SWTObservables.observeSelection(button),
- BeansObservables.observeValue(adventure, "petsAllowed"),
- null, null);
-
- // Check the model and GUI are in the same state
- assertEquals(button.getSelection(), adventure.isPetsAllowed());
- // Change the model and check the GUI is updated
- boolean newBoolean = !adventure.isPetsAllowed();
- adventure.setPetsAllowed(newBoolean);
- assertEquals(newBoolean, adventure.isPetsAllowed());
- assertEquals(button.getSelection(), newBoolean);
- // Change the GUI and check the model
- newBoolean = !newBoolean;
- button.setSelection(newBoolean);
- button.notifyListeners(SWT.Selection, null);
- assertEquals(newBoolean, adventure.isPetsAllowed());
- }
-
- public void testScenario03() {
- // Test with an SWT.Radio button
- button.dispose();
- button = new Button(getComposite(), SWT.RADIO);
-
- // Bind the button's selection to the adventure "isPetsAllowed"
- getDbc().bindValue(SWTObservables.observeSelection(button),
- BeansObservables.observeValue(adventure, "petsAllowed"),
- null, null);
-
- // Check the model and GUI are in the same state
- assertEquals(button.getSelection(), adventure.isPetsAllowed());
- // Change the model and check the GUI is updated
- boolean newBoolean = !adventure.isPetsAllowed();
- adventure.setPetsAllowed(newBoolean);
- assertEquals(newBoolean, adventure.isPetsAllowed());
- assertEquals(button.getSelection(), newBoolean);
- // Change the GUI and check the model
- newBoolean = !newBoolean;
- button.setSelection(newBoolean);
- button.notifyListeners(SWT.Selection, null);
- assertEquals(newBoolean, adventure.isPetsAllowed());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboScenarios.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboScenarios.java
deleted file mode 100644
index aefc9e2..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboScenarios.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- * Brad Reynolds - bug 160000
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.examples.databinding.model.Account;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.Catalog;
-import org.eclipse.jface.examples.databinding.model.Lodging;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Combo;
-
-public class ComboScenarios extends ScenariosTestCase {
-
- protected ComboViewer cviewer = null;
-
- protected Combo combo = null;
-
- protected Catalog catalog = null;
-
- ILabelProvider lodgingLabelProvider = new LabelProvider() {
- public String getText(Object element) {
- return ((Lodging) element).getName();
- }
- };
-
- ILabelProvider accountLabelProvider = new LabelProvider() {
- public String getText(Object element) {
- return ((Account) element).getCountry();
- }
- };
-
- protected void setUp() throws Exception {
- super.setUp();
- getComposite().setLayout(new FillLayout());
-
- combo = new Combo(getComposite(), SWT.READ_ONLY | SWT.DROP_DOWN);
- cviewer = new ComboViewer(combo);
-
- catalog = SampleData.CATALOG_2005; // Lodging source
- }
-
- protected void tearDown() throws Exception {
- combo.dispose();
- combo = null;
- cviewer = null;
- super.tearDown();
- }
-
- protected Object getViewerSelection() {
- return ((IStructuredSelection) cviewer.getSelection())
- .getFirstElement();
- }
-
- /**
- * @return the ComboViewer's domain object list
- */
- protected List getViewerContent(ComboViewer cviewer) {
- Object[] elements = ((IStructuredContentProvider) cviewer
- .getContentProvider()).getElements(null);
- if (elements != null)
- return Arrays.asList(elements);
- return null;
- }
-
- /**
- *
- * @return the combo's items (String[]), which is the same thing as the
- * Viewer's labels
- *
- */
- protected List getComboContent() {
- String[] elements = combo.getItems();
- if (elements != null)
- return Arrays.asList(elements);
- return null;
- }
-
- protected List getColumn(Object[] list, String feature) {
- List result = new ArrayList();
- if (list == null || list.length == 0)
- return result;
- String getterName = "get"
- + feature.substring(0, 1).toUpperCase(Locale.ENGLISH)
- + feature.substring(1);
- try {
- Method getter = list[0].getClass().getMethod(getterName,
- new Class[0]);
- try {
- for (int i = 0; i < list.length; i++) {
- result.add(getter.invoke(list[i], new Object[0]));
- }
- } catch (IllegalArgumentException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- } catch (SecurityException e) {
- } catch (NoSuchMethodException e) {
- }
- return result;
- }
-
- /**
- * This test case deal with the 3rd scenario, using vanilla bindings: Ensure
- * a valid content and selection are bounded correctly Bind a collection of
- * Lodgings to a ComboViewer Bind the ComboViewer's selection to the
- * defaultLodging of an Adventure
- *
- * This test does not deal with null values, empty content, changed content,
- * property change of content elements, etc.
- *
- */
- public void test_ROCombo_Scenario03_vanilla() {
- IObservableList lodgings = BeansObservables.observeList(Realm
- .getDefault(), catalog, "lodgings");
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
-
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Lodging.class,
- new String[] { "name" });
-
- // Bind the ComboViewer's content to the available lodging
- cviewer.setContentProvider(contentProvider);
- cviewer.setLabelProvider(new ObservableMapLabelProvider(attributeMaps));
- cviewer.setInput(lodgings);
-
- Adventure skiAdventure = SampleData.WINTER_HOLIDAY; // selection will
-
- // Ensure that cv's content now has the catalog's lodgings
- assertArrayEquals(catalog.getLodgings(), getViewerContent(cviewer)
- .toArray());
-
- // Ensure that the cv's labels are the same as the lodging descriptions
- assertEquals(getColumn(catalog.getLodgings(), "name"),
- getComboContent());
-
- getDbc().bindValue(ViewersObservables.observeSingleSelection(cviewer),
- BeansObservables.observeValue(skiAdventure, "defaultLodging"),
- null, null);
-
- // Check to see that the initial selection is the currentDefault Lodging
- assertEquals(getViewerSelection(), skiAdventure.getDefaultLodging());
-
- // Change the selection of the ComboViewer to all possible lodgings, and
- // verify that skiAdventure's default lodging was changed accordingly
- for (int i = 0; i < catalog.getLodgings().length; i++) {
- Object selection = catalog.getLodgings()[i];
- cviewer.setSelection(new StructuredSelection(selection));
- assertEquals(selection, skiAdventure.getDefaultLodging());
- assertEquals(getViewerSelection(), skiAdventure.getDefaultLodging());
- }
-
- }
-
- /**
- * This test case deal with the 3rd scenario, and focuses on the collection
- * binding to the combo. It will bind a collection, add/remove/change
- * elements in the collection, and change element's properties to ensure
- * that the combo's labels were updated appropriatly.
- *
- * it also induce null values in properties, and elments.
- *
- * This test does not deal with the combo's selection.
- */
- public void test_ROCombo_Scenario03_collectionBindings() {
- // column binding
- // Bind the ComboViewer's content to the available lodging
- IObservableList lodgings = BeansObservables.observeList(Realm
- .getDefault(), catalog, "lodgings");
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
-
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Lodging.class,
- new String[] { "name" });
-
- cviewer.setContentProvider(contentProvider);
- cviewer.setLabelProvider(new ObservableMapLabelProvider(attributeMaps));
- cviewer.setInput(lodgings);
-
- // Ensure that cv's content now has the catalog's lodgings
- assertArrayEquals(catalog.getLodgings(), getViewerContent(cviewer)
- .toArray());
-
- // Ensure that the cv's labels are the same as the lodging descriptions
- assertEquals(getColumn(catalog.getLodgings(), "name"),
- getComboContent());
-
- // Add a lodging in the middle (not supported by the model right now)
- // Lodging lodging = SampleData.FACTORY.createLodging();
- // lodging.setName("Middle Lodging");
- // catalog.addLodging(lodging);
- // assertEquals(getViewerContent(cviewer).get(2), lodging);
-
- // Add a lodging at the end
- Lodging lodging = SampleData.FACTORY.createLodging();
- lodging.setName("End Lodging");
- catalog.addLodging(lodging);
- int index = getComboContent().size() - 1;
- assertEquals(getViewerContent(cviewer).get(index), lodging);
-
- // Delete the first Lodging
- catalog.removeLodging(catalog.getLodgings()[0]);
- // Ensure that the cv's labels are the same as the lodging descriptions
- assertEquals(getColumn(catalog.getLodgings(), "name"),
- getComboContent());
-
- // Delete middle Lodging
- catalog.removeLodging(catalog.getLodgings()[2]);
- // Ensure that the cv's labels are the same as the lodging descriptions
- assertEquals(getColumn(catalog.getLodgings(), "name"),
- getComboContent());
-
- // Change the names of all Lodging
- for (int i = 0; i < catalog.getLodgings().length; i++) {
- Lodging l = catalog.getLodgings()[i];
- l.setName("Changed: " + l.getName());
- }
- spinEventLoop(0); // force Async. efforts
- assertEquals(getColumn(catalog.getLodgings(), "name"),
- getComboContent());
-
- // Set to null value
- Lodging l = catalog.getLodgings()[0];
- assertEquals(combo.getItem(0), l.getName());
- l.setName(null);
- assertEquals("", combo.getItem(0));
-
- // set to empty list
- while (catalog.getLodgings().length > 0) {
- catalog.removeLodging(catalog.getLodgings()[0]);
- assertEquals(getColumn(catalog.getLodgings(), "name"),
- getComboContent());
- }
- }
-
- /**
- * This scenario tests a simple SWT combo with a set item list where the
- * selection is bouded to a String property
- */
- // public void test_ROCombo_Scenario01() {
- //
- // // Read-Only Combo will not change its text property on a call to
- // // setText()
- //
- // String[] items = new String[] { "FairyLand", "TuneLand", "NoWereLand",
- // "TinkerLand", "DreamLand" };
- // combo.setItems(items);
- // Account account = catalog.getAccounts()[0];
- //
- // // simple Combo's selection bound to the Account's country property
- // getDbc().bind(new Property(combo, SWTProperties.SELECTION),
- // new Property(account, "country"), null);
- //
- // // Drive the combo selection
- // int index = 3;
- // combo.setText(items[index]); // this should drive the selection
- // assertEquals(account.getCountry(), items[index]);
- //
- // // Set the country, and ensure selection is set property
- // index = 1;
- // account.setCountry(items[index]);
- // assertEquals(index, combo.getSelectionIndex());
- // assertEquals(combo.getText(), items[index]);
- //
- // index = combo.getSelectionIndex();
- // String txt = combo.getText();
- // // Set the country to something that is not in the Combo's list
- // account.setCountry("FooBar");
- // // Combo's selection will not Change
- // assertEquals(combo.getSelectionIndex(), index);
- // assertEquals(combo.getText(), txt);
- //
- // }
- /**
- * This scenario tests a simple SWT combo that is bound to a list of Country
- * objects. The Country object's name property is listed in the Combo.
- *
- * The Combo's selection is bounded to the Country property of an Account.
- */
- // public void test_ROCombo_Scenario02_SWTCombo() {
- //
- // // Create a list of Strings for the countries
- // IObservableList list = new WritableList();
- // for (int i = 0; i < catalog.getAccounts().length; i++)
- // list.add(catalog.getAccounts()[i].getCountry());
- //
- // // Bind the combo's content to that of the String based list
- // getDbc().bind(combo, list, null);
- // assertEquals(Arrays.asList(combo.getItems()), list);
- //
- // Account account = catalog.getAccounts()[0];
- //
- // // simple Combo's selection bound to the Account's country property
- // getDbc().bind(new Property(combo, SWTProperties.SELECTION),
- // new Property(account, "country"), null);
- //
- // // Drive the combo selection
- // String selection = (String) list.get(2);
- // combo.setText(selection); // this should drive the selection
- // assertEquals(account.getCountry(), selection);
- //
- // }
- /**
- * This scenario tests a simple SWT combo that is bound to a list of Country
- * objects. The Country object's name property is listed in the Combo.
- *
- * The Combo's selection is bounded to the Country property of an Account.
- */
- // public void test_ROCombo_Scenario02_ComboViewer() {
- //
- // // Account label provider will fill the combo with the country
- // cviewer.setLabelProvider(accountLabelProvider);
- // // Bind the ComboViewer's content to the available accounts
- // getDbc().bind(
- // cviewer,
- // new ListModelDescription(new Property(catalog, "accounts"),
- // "country"), null);
- //
- // // Ensure that cv's content now has the catalog's accounts
- // assertArrayEquals(catalog.getAccounts(), getViewerContent(cviewer)
- // .toArray());
- // // Ensure that the cv's labels are the same as the account countries
- // assertEquals(getColumn(catalog.getAccounts(), "country"),
- // getComboContent());
- //
- // Account account = SampleData.FACTORY.createAccount();
- //
- // // Use the Viewers visual Combo (Strings) to set the account's country
- // getDbc().bind(new Property(combo, SWTProperties.SELECTION),
- // new Property(account, "country"), null);
- //
- // // Change the selection of the ComboViewer to all possible accounts, and
- // // verify that the account's Country is being changed correctly.
- // for (int i = 0; i < catalog.getAccounts().length; i++) {
- // Account selection = catalog.getAccounts()[i];
- // cviewer.setSelection(new StructuredSelection(selection));
- // assertEquals(selection.getCountry(), account.getCountry());
- // }
- //
- // }
- /**
- * This test ensure that multiple combos can be bound to the same deomain
- * model
- */
- public void test_ROCombo_multipleBindings() {
- Adventure skiAdventure = SampleData.WINTER_HOLIDAY; // for selection
-
- // Bind the ComboViewer's content to the available lodging
- IObservableList lodgings = BeansObservables.observeList(Realm
- .getDefault(), catalog, "lodgings");
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
-
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Lodging.class,
- new String[] { "name" });
-
- cviewer.setContentProvider(contentProvider);
- cviewer.setLabelProvider(new ObservableMapLabelProvider(attributeMaps));
- cviewer.setInput(lodgings);
-
- // Ensure that cv's content now has the catalog's lodgings
- assertArrayEquals(catalog.getLodgings(), getViewerContent(cviewer)
- .toArray());
-
- // Ensure that the cv's labels are the same as the lodging descriptions
- assertEquals(getColumn(catalog.getLodgings(), "name"),
- getComboContent());
-
- ComboViewer otherViewer = new ComboViewer(getComposite(), SWT.NONE);
- lodgings = BeansObservables.observeList(Realm.getDefault(), catalog,
- "lodgings");
- contentProvider = new ObservableListContentProvider();
-
- attributeMaps = BeansObservables.observeMaps(contentProvider
- .getKnownElements(), Lodging.class, new String[] { "name" });
-
- otherViewer.setContentProvider(contentProvider);
- otherViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMaps));
- otherViewer.setInput(lodgings);
-
- // Ensure that cv's content now has the catalog's lodgings
- assertArrayEquals(catalog.getLodgings(), getViewerContent(otherViewer)
- .toArray());
-
- // Bind both selections to the same thing
- IObservableValue selection = ViewersObservables
- .observeSingleSelection(cviewer);
- getDbc().bindValue(selection,
- BeansObservables.observeValue(skiAdventure, "defaultLodging"),
- null, null);
-
- IObservableValue otherSelection = ViewersObservables
- .observeSingleSelection(otherViewer);
- getDbc().bindValue(otherSelection,
- BeansObservables.observeValue(skiAdventure, "defaultLodging"),
- null, null);
-
- Lodging lodging = catalog.getLodgings()[0];
-
- // Ensure that setting the selection is driven forward to the other
- // combo
- cviewer.setSelection(new StructuredSelection(lodging));
- assertEquals(((IStructuredSelection) cviewer.getSelection())
- .getFirstElement(), ((IStructuredSelection) otherViewer
- .getSelection()).getFirstElement());
-
- // Change the list of one combo, and ensure it updates the other combo
- catalog.removeLodging(lodging);
- assertEquals(getViewerContent(cviewer), getViewerContent(otherViewer));
-
- }
-
- /**
- * This scenario tests a simple SWT CCombo that is bound to a list of
- * Country objects. The Country object's name property is listed in the
- * Combo.
- *
- * The Combo's selection is bounded to the Country property of an Account.
- */
- public void test_ROCombo_SWTCCombo() {
-
- // Create a list of Strings for the countries
- IObservableList list = new WritableList();
- for (int i = 0; i < catalog.getAccounts().length; i++)
- list.add(catalog.getAccounts()[i].getCountry());
-
- CCombo ccombo = new CCombo(getComposite(), SWT.READ_ONLY
- | SWT.DROP_DOWN);
-
- // Bind the combo's content to that of the String based list
- getDbc().bindList(SWTObservables.observeItems(ccombo), list, null, null);
- assertEquals(Arrays.asList(ccombo.getItems()), list);
-
- Account account = catalog.getAccounts()[0];
-
- // simple Combo's selection bound to the Account's country property
- IObservableValue comboSelection = SWTObservables.observeSelection(ccombo);
- getDbc().bindValue(comboSelection,
- BeansObservables.observeValue(account, "country"), null, null);
-
- // Drive the combo selection
- String selection = (String) list.get(2);
- ccombo.setText(selection); // this should drive the selection
- assertEquals(account.getCountry(), selection);
-
- }
-
- /**
- * This scenario tests a simple SWT CCombo that is bound to a list of
- * Country objects. The Country object's name property is listed in the
- * Combo.
- *
- * The Combo's selection is bounded to the Country property of an Account.
- */
- public void test_WCombo_SWTCCombo() {
-
- // Create a list of Strings for the countries
- IObservableList list = new WritableList();
- for (int i = 0; i < catalog.getAccounts().length; i++)
- list.add(catalog.getAccounts()[i].getCountry());
-
- CCombo ccombo = new CCombo(getComposite(), SWT.READ_ONLY
- | SWT.DROP_DOWN);
-
- // Bind the combo's content to that of the String based list
- getDbc().bindList(SWTObservables.observeItems(ccombo), list, null, null);
- assertEquals(Arrays.asList(ccombo.getItems()), list);
-
- Account account = catalog.getAccounts()[0];
-
- // simple Combo's selection bound to the Account's country property
- IObservableValue comboSelection = SWTObservables.observeSelection(ccombo);
- getDbc().bindValue(comboSelection,
- BeansObservables.observeValue(account, "country"), null, null);
-
- // Drive the combo selection
- String selection = (String) list.get(2);
- ccombo.setText(selection); // this should drive the selection
- assertEquals(account.getCountry(), selection);
-
- selection = (String) list.get(1);
- account.setCountry(selection);
- assertEquals(selection, ccombo.getItem(ccombo.getSelectionIndex()));
- assertEquals(selection, ccombo.getText());
-
- selection = "country not in list";
- account.setCountry(selection);
- assertEquals(-1, ccombo.getSelectionIndex());
- assertEquals(selection, ccombo.getText());
- }
-
- /**
- * This scenario tests a simple SWT CCombo that is bound to a list of
- * Country objects. The Country object's name property is listed in the
- * Combo.
- *
- * The Combo's selection is bounded to the Country property of an Account.
- */
- public void test_ROCombo_SWTList() {
-
- // Create a list of Strings for the countries
- IObservableList list = new WritableList();
- for (int i = 0; i < catalog.getAccounts().length; i++)
- list.add(catalog.getAccounts()[i].getCountry());
-
- org.eclipse.swt.widgets.List swtlist = new org.eclipse.swt.widgets.List(
- getComposite(), SWT.READ_ONLY | SWT.SINGLE);
-
- // Bind the combo's content to that of the String based list
- getDbc().bindList(SWTObservables.observeItems(swtlist), list, null, null);
- assertEquals(Arrays.asList(swtlist.getItems()), list);
-
- Account account = catalog.getAccounts()[0];
-
- // simple Combo's selection bound to the Account's country property
- IObservableValue listSelection = SWTObservables.observeSelection(swtlist);
- getDbc().bindValue(listSelection,
- BeansObservables.observeValue(account, "country"), null, null);
-
- String selection = (String) list.get(2);
- swtlist.select(2); // this should drive the selection
- swtlist.notifyListeners(SWT.Selection, null); // Force notification
- assertEquals(account.getCountry(), selection);
-
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboUpdatingTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboUpdatingTest.java
deleted file mode 100644
index 31c683b..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboUpdatingTest.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.tests.databinding.BindingTestSuite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Combo;
-
-/**
- * @since 3.2
- */
-public class ComboUpdatingTest extends ScenariosTestCase {
-
- private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
- this);
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyChangeSupport.removePropertyChangeListener(propertyName,
- listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue,
- Object newValue) {
- propertyChangeSupport.firePropertyChange(propertyName, oldValue,
- newValue);
- }
-
-
- private Combo comboEditable;
- //private Combo comboReadOnly;
-
- private static final String PROP_TEXT = "text";
- private String text = "Hello, world";
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- private static final String PROP_CHOICES = "choices";
- private List choices = new ArrayList();
- {
- choices.add("Banana");
- choices.add("Apple");
- choices.add("Mango");
- }
-
- public List getChoices() {
- return choices;
- }
-
- public void setChoices(List choices) {
- this.choices = choices;
- firePropertyChange(PROP_CHOICES, null, null);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- getComposite().setLayout(new FillLayout());
- comboEditable = new Combo(getComposite(), SWT.DROP_DOWN);
-// comboReadOnly = new Combo(getComposite(), SWT.DROP_DOWN | SWT.READ_ONLY);
- }
-
- //-------------------------------------------------------------------------
-
- private static final String NEXT = "Next";
- public void testBindText() throws Exception {
- getDbc().bindValue(SWTObservables.observeText(comboEditable), BeansObservables.observeValue(this, "text"), null, null);
- spinEventLoop(0);
- assertEquals("Should find value of text", text, comboEditable.getText());
- comboEditable.setText(NEXT);
- spinEventLoop(0);
- assertEquals("Should find new value in text", NEXT, text);
- }
-
- public void testBindItems_listHasSameItems_editable() throws Exception {
- if (BindingTestSuite.failingTestsDisabled(this)) {
- return;
- }
- text = "Apple";
-
- getDbc().bindValue(SWTObservables.observeText(comboEditable), BeansObservables.observeValue(this, PROP_TEXT), null, null);
-
- spinEventLoop(0);
- assertEquals("Should find value of text", text, comboEditable.getText());
-
- IObservableList list = new WritableList(getChoices(), null);
- getDbc().bindList(SWTObservables.observeItems(comboEditable), list, null, null);
-
- spinEventLoop(0);
- int position = 0;
- for (Iterator choicesIter = choices.iterator(); choicesIter.hasNext();) {
- String element = (String) choicesIter.next();
- assertEquals(element, comboEditable.getItem(position));
- ++position;
- }
-// assertEquals("Should find value of text", "Apple", text);
- assertEquals("Should find value of combo.getText()", "", comboEditable.getText());
- comboEditable.setText("Banana");
- spinEventLoop(0);
- assertEquals("Should find value of text", "Banana", text);
- }
-
-// public void testBindItems_listHasSameItems_readOnly() throws Exception {
-// text = "Apple";
-// ComboObservableValue value = (ComboObservableValue) getDbc().createObservable(new Property(comboReadOnly, PROP_TEXT));
-// getDbc().bind(value.getItems(), new Property(this, PROP_CHOICES), null);
-//// getDbc().bind(combo, new Property(this, PROP_CHOICES, String.class, Boolean.TRUE), null);
-// spinEventLoop(0);
-// assertEquals("Should find value of text", "Apple", text);
-// getDbc().bind(value, new Property(this, PROP_TEXT), null);
-// spinEventLoop(0);
-// assertEquals("Should find value of text", "Apple", text);
-// assertEquals("Should find value of combo.getText()", "Apple", comboReadOnly.getText());
-// int position = 0;
-// for (Iterator choicesIter = choices.iterator(); choicesIter.hasNext();) {
-// String element = (String) choicesIter.next();
-// assertEquals(element, comboReadOnly.getItem(position));
-// ++position;
-// }
-// assertEquals("Should find value of text", "Apple", text);
-// assertEquals("Should find value of combo.getText()", "Apple", comboReadOnly.getText());
-// comboReadOnly.setText("Banana");
-// spinEventLoop(0);
-// assertEquals("Should find value of text", "Banana", text);
-// }
-
- public void testBindItems_listHasDifferentItems_editable() throws Exception {
- if (BindingTestSuite.failingTestsDisabled(this)) {
- return;
- }
-
- getDbc().bindValue(SWTObservables.observeText(comboEditable), BeansObservables.observeValue(this, PROP_TEXT), null, null);
-
- spinEventLoop(0);
- assertEquals("Should find value of text", text, comboEditable.getText());
-
- IObservableList list = new WritableList(new ArrayList(), String.class);
- list.addAll(getChoices());
- getDbc().bindList(SWTObservables.observeItems(comboEditable), list, null, null);
-
- spinEventLoop(0);
- int position = 0;
- for (Iterator choicesIter = choices.iterator(); choicesIter.hasNext();) {
- String element = (String) choicesIter.next();
- assertEquals(element, comboEditable.getItem(position));
- ++position;
- }
-// assertEquals("Should find value of text", "Hello, world", text);
- assertEquals("Should find value of combo.getText()", "", comboEditable.getText());
- comboEditable.setText("Banana");
- spinEventLoop(0);
- assertEquals("Should find value of text", "Banana", text);
- }
-
-// public void testBindItems_listHasDifferentItems_readOnly() throws Exception {
-// ComboObservableValue value = (ComboObservableValue) getDbc().createObservable(new Property(comboReadOnly, PROP_TEXT));
-// getDbc().bind(value, new Property(this, PROP_TEXT), null);
-// spinEventLoop(0);
-// getDbc().bind(value.getItems(), new Property(this, PROP_CHOICES), null);
-//// getDbc().bind(combo, new Property(this, PROP_CHOICES, String.class, Boolean.TRUE), null);
-// spinEventLoop(0);
-// int position = 0;
-// for (Iterator choicesIter = choices.iterator(); choicesIter.hasNext();) {
-// String element = (String) choicesIter.next();
-// assertEquals(element, comboReadOnly.getItem(position));
-// ++position;
-// }
-//// assertEquals("Should find value of text", "Hello, world", text);
-// assertEquals("Should find value of combo.getText()", "", comboReadOnly.getText());
-// comboReadOnly.setText("Banana");
-// spinEventLoop(0);
-// assertEquals("Should find value of text", "Banana", text);
-// }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboViewerScenario.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboViewerScenario.java
deleted file mode 100644
index 4cf8176..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboViewerScenario.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- * Brad Reynolds - bug 160000
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.Catalog;
-import org.eclipse.jface.examples.databinding.model.Lodging;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Combo;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class ComboViewerScenario extends ScenariosTestCase {
-
- private Catalog catalog;
-
- private Combo combo;
-
- private ComboViewer comboViewer;
-
- protected void setUp() throws Exception {
- super.setUp();
- // do any setup work here
- combo = new Combo(getComposite(), SWT.READ_ONLY | SWT.DROP_DOWN);
- comboViewer = new ComboViewer(combo);
- catalog = SampleData.CATALOG_2005; // Lodging source
- }
-
- protected void tearDown() throws Exception {
- combo.dispose();
- combo = null;
- comboViewer = null;
- super.tearDown();
- }
-
- public void testScenario01() {
- // Bind the catalog's lodgings to the combo
- IObservableList lodgings = BeansObservables.observeList(realm, catalog,
- "lodgings");
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
-
- IObservableMap attributeMap = BeansObservables.observeMap(
- contentProvider.getKnownElements(), Lodging.class, "name");
- comboViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMap));
- comboViewer.setContentProvider(contentProvider);
- comboViewer.setInput(lodgings);
-
- // Verify that the combo's items are the lodgings
- for (int i = 0; i < catalog.getLodgings().length; i++) {
- assertEquals(catalog.getLodgings()[i], comboViewer.getElementAt(i));
- }
- // Verify that the String being shown in the combo viewer is the
- // "toString" of the combo viewer
- String[] lodgingStrings = new String[catalog.getLodgings().length];
- for (int i = 0; i < catalog.getLodgings().length; i++) {
- lodgingStrings[i] = catalog.getLodgings()[i].getName();
- }
- assertArrayEquals(lodgingStrings, combo.getItems());
-
- // Verify that the combo has no selected item
- assertEquals(null, ((IStructuredSelection) comboViewer.getSelection())
- .getFirstElement());
-
- // Now bind the selection of the combo to the "defaultLodging" property
- // of an adventure
- final Adventure adventure = SampleData.WINTER_HOLIDAY;
- IObservableValue selection = ViewersObservables
- .observeSingleSelection(comboViewer);
- getDbc().bindValue(selection,
- BeansObservables.observeValue(adventure, "defaultLodging"),
- null, null);
-
- // Verify that the combo selection is the default lodging
- assertEquals(((IStructuredSelection) comboViewer.getSelection())
- .getFirstElement(), adventure.getDefaultLodging());
-
- // Change the model and verify that the combo selection changes
- adventure.setDefaultLodging(SampleData.CAMP_GROUND);
- assertEquals(adventure.getDefaultLodging(), SampleData.CAMP_GROUND);
- assertEquals(((IStructuredSelection) comboViewer.getSelection())
- .getFirstElement(), adventure.getDefaultLodging());
-
- // Change the combo selection and verify that the model changes
- comboViewer.getCombo().select(3);
- assertEquals(((IStructuredSelection) comboViewer.getSelection())
- .getFirstElement(), adventure.getDefaultLodging());
-
- adventure.setDefaultLodging(SampleData.YOUTH_HOSTEL);
- spinEventLoop(0);
- assertEquals(((IStructuredSelection) comboViewer.getSelection())
- .getFirstElement(), adventure.getDefaultLodging());
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomBeanModelType.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomBeanModelType.java
deleted file mode 100644
index f8af853..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomBeanModelType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.scenarios;
-
-/**
- * @since 3.2
- *
- */
-public class CustomBeanModelType {
-
- private String propertyName;
-
- private Object object;
-
- private Class type;
-
- /**
- * @param object
- * @param propertyName
- * @param type
- */
- public CustomBeanModelType(Object object, String propertyName, Class type) {
- this.object = object;
- this.propertyName = propertyName;
- this.type = type;
- }
-
- /**
- * @return
- */
- public String getPropertyName() {
- return propertyName;
- }
-
- /**
- * @return
- */
- public Object getObject() {
- return object;
- }
-
- /**
- * @return
- */
- public Class getType() {
- return type;
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomBeanUpdateValueStrategy.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomBeanUpdateValueStrategy.java
deleted file mode 100644
index e244710..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomBeanUpdateValueStrategy.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920, 159768
- *******************************************************************************/
-// TODO djo: copyright
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.conversion.IConverter;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.validation.IValidator;
-
-/**
- * A BindSpec that will automatically grab validators from an object's
- * properties, if a get<PropertyName>Validator method is defined. Makes it
- * easy to associate validators with the properties that they are responsible
- * for validating.
- *
- */
-public class CustomBeanUpdateValueStrategy extends UpdateValueStrategy {
-
- public IConverter createConverter(Object fromType, Object toType) {
- if (fromType instanceof CustomBeanModelType) {
- CustomBeanModelType customBeanModelType = (CustomBeanModelType) fromType;
- fromType = customBeanModelType.getType();
- }
- if (toType instanceof CustomBeanModelType) {
- CustomBeanModelType customBeanModelType = (CustomBeanModelType) toType;
- toType = customBeanModelType.getType();
- }
- return super.createConverter(fromType, toType);
- }
-
- protected void fillDefaults(IObservableValue source,
- IObservableValue destination) {
- if (destination.getValueType() instanceof CustomBeanModelType) {
- if (beforeSetValidator==null) {
- CustomBeanModelType property = (CustomBeanModelType) destination.getValueType();
- String propertyName = property.getPropertyName();
- String getValidatorMethodName = "get" + upperCaseFirstLetter(propertyName) + "Validator"; //$NON-NLS-1$ //$NON-NLS-2$
-
- Class objectClass = property.getObject().getClass();
-
- Method getValidator;
- try {
- getValidator = objectClass.getMethod(getValidatorMethodName,
- new Class[] { Class.class });
- beforeSetValidator= (IValidator) getValidator.invoke(property
- .getObject(), new Object[0]);
- } catch (Exception e) {
- // ignore
- }
-
- }
- }
- super.fillDefaults(source, destination);
- }
-
- private String upperCaseFirstLetter(String name) {
- String result = name.substring(0, 1).toUpperCase() + name.substring(1);
- return result;
- }
-
- public Boolean isAssignableFromTo(Object fromType, Object toType) {
- if (fromType instanceof CustomBeanModelType) {
- fromType = ((CustomBeanModelType) fromType).getType();
- }
- if (toType instanceof CustomBeanModelType) {
- toType = ((CustomBeanModelType) toType).getType();
- }
- return super.isAssignableFromTo(fromType, toType);
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomConverterScenarios.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomConverterScenarios.java
deleted file mode 100644
index d350778..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomConverterScenarios.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.PriceModelObject;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Spinner;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class CustomConverterScenarios extends ScenariosTestCase {
-
- private Adventure skiTrip;
-
- protected void setUp() throws Exception {
- super.setUp();
- skiTrip = SampleData.WINTER_HOLIDAY;
- }
-
- protected void tearDown() throws Exception {
- // do any teardown work here
- super.tearDown();
- }
-
- public void testScenario01() {
- DataBindingContext dbc = getDbc();
- Spinner spinner_dollars = new Spinner(getComposite(), SWT.NONE);
- spinner_dollars.setMaximum(10000);
- Spinner spinner_cents = new Spinner(getComposite(), SWT.NONE);
-
- // The price object is a double which contains both the dollars and
- // cents
- // To allow this to be worked on with two separate spinner controls
- // (which get and set int values)
- // an intermediate object is used
- PriceModelObject priceModel = new PriceModelObject();
-
- dbc.bindValue(BeansObservables.observeValue(priceModel, "price"), BeansObservables.observeValue(skiTrip,
- "price"), null, null);
-
- dbc.bindValue(SWTObservables.observeSelection(spinner_dollars),
- BeansObservables.observeValue(priceModel, "dollars"),
- null, null);
-
- dbc.bindValue(SWTObservables.observeSelection(spinner_cents),
- BeansObservables.observeValue(priceModel, "cents"),
- null, null);
-
- // spinEventLoop(1);
- // Make sure that the selection on the spinner_dollars matches the
- // dollars of the price
- assertEquals(spinner_dollars.getSelection(), new Double(skiTrip.getPrice()).intValue());
- // Make sure that the selection on the spinner_cents matches the dollars
- // of the price
- Double doublePrice = new Double(skiTrip.getPrice());
- double cents = 100 * doublePrice.doubleValue() - 100 * doublePrice.intValue();
- assertEquals(spinner_cents.getSelection(), (int) cents);
-
- // Change the selection on the spinner_dollars to be $50 and make sure
- // the model is updated with the cents included
- spinner_dollars.setSelection(50);
- double expectedPrice = 50 + cents / 100;
- assertEquals(expectedPrice, skiTrip.getPrice(), 0.01);
-
- // Change the selection on the spinner_cents to be 27 and make sure the
- // model is updated with the dollars included
- spinner_cents.setSelection(27);
- assertEquals(50.27, skiTrip.getPrice(), 0.01);
-
- // Change the model to be $60.99 dollars and make sure the
- // spinner_dollars is 60 and spinner_cents is 99
- skiTrip.setPrice(60.99);
- assertEquals(60, spinner_dollars.getSelection());
- assertEquals(99, spinner_cents.getSelection());
-
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomScenarios.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomScenarios.java
deleted file mode 100644
index c6eb678..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/CustomScenarios.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.AggregateObservableValue;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class CustomScenarios extends ScenariosTestCase {
-
- protected void setUp() throws Exception {
- super.setUp();
- // do any setup work here
- }
-
- protected void tearDown() throws Exception {
- // do any teardown work here
- super.tearDown();
- }
-
- public void testScenario01() {
-
- // Binding the name property of an Adventure object to the contents of
- // Text controls, no conversion, no validation.
-
- Adventure adventure = SampleData.WINTER_HOLIDAY;
- Text text = new Text(getComposite(), SWT.BORDER);
-
- IObservableValue descriptionObservable = BeansObservables.observeValue(adventure, "description");
- IObservableValue nameObservable = BeansObservables.observeValue(adventure, "name");
- AggregateObservableValue customObservable_comma = new AggregateObservableValue(new IObservableValue[] {
- descriptionObservable, nameObservable }, ",");
-
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify), customObservable_comma, null, null);
- // spinEventLoop(1);
- // Make sure that the description on the model match the widget
- assertEquals(adventure.getDescription() + "," + adventure.getName(), text.getText());
-
- // Change the widget to newDescription,newName and ensure the model is
- // updated
- text.setText("newDescription,newName");
- assertEquals("newDescription", adventure.getDescription());
- assertEquals("newName", adventure.getName());
-
- // Change the model to newDescription_0 and newName_0 and ensure the GUI
- // is updated
- adventure.setDescription("newDescription_0");
- adventure.setName("newName_0");
- assertEquals("newDescription_0,newName_0", text.getText());
-
- // Change text to newDescription_1 with no comma and ensure the model is
- // updated correctly with no name
- text.setText("newDescription_1");
- assertEquals("newDescription_1", adventure.getDescription());
- assertEquals(null, adventure.getName());
-
- // Change text to newName with a preceeding comma and ensure the model
- // is updated correctly with no description
- // TODO - Get this test working + Add the one where we have two
- // aggregates and update one and
- // check that the other is updated - currently this fails on the GUI -
- // JRW
- // text.setText(",newName_1");
- // assertEquals(null, adventure.getDescription());
- // assertEquals("newName_1", adventure.getName());
-
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/LabelControlScenario.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/LabelControlScenario.java
deleted file mode 100644
index ad234a6..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/LabelControlScenario.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class LabelControlScenario extends ScenariosTestCase {
-
- private Adventure adventure;
-
- private Label label;
-
- protected void setUp() throws Exception {
- super.setUp();
- // do any setup work here
- label = new Label(getComposite(), SWT.NONE);
- adventure = SampleData.WINTER_HOLIDAY;
- }
-
- protected void tearDown() throws Exception {
- // do any teardown work here
- super.tearDown();
- label.dispose();
- label = null;
- }
-
- public void testScenario01() {
- // Bind the adventure "name" property to a label control
- // Change the UI and verify the model and UI are the same value
- // Change the model and verify the UI changes
- getDbc().bindValue(SWTObservables.observeText(label), BeansObservables.observeValue(adventure, "name"), null, null);
-
- assertEquals(adventure.getName(), label.getText());
- adventure.setName("France");
- assertEquals("France", label.getText());
- adventure.setName("Climb Everest");
- spinEventLoop(0);
- assertEquals("Climb Everest", label.getText());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ListViewerScenario.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ListViewerScenario.java
deleted file mode 100644
index 0fe7dda..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ListViewerScenario.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- * Brad Reynolds - bug 160000
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.Catalog;
-import org.eclipse.jface.examples.databinding.model.Lodging;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.List;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class ListViewerScenario extends ScenariosTestCase {
-
- private Catalog catalog;
-
- private List list;
-
- private ListViewer listViewer;
-
- protected void setUp() throws Exception {
- super.setUp();
- // do any setup work here
- list = new List(getComposite(), SWT.READ_ONLY | SWT.SINGLE);
- listViewer = new ListViewer(list);
- catalog = SampleData.CATALOG_2005; // Lodging source
- }
-
- protected void tearDown() throws Exception {
- list.dispose();
- list = null;
- listViewer = null;
- super.tearDown();
- }
-
- public void testScenario01() {
- // Bind the catalog's lodgings to the combo
- IObservableList lodgings = BeansObservables.observeList(Realm
- .getDefault(), catalog, "lodgings");
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
-
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Lodging.class,
- new String[] { "name" });
- listViewer.setContentProvider(contentProvider);
- listViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMaps));
- listViewer.setInput(lodgings);
-
- // Verify that the combo's items are the lodgings
- for (int i = 0; i < catalog.getLodgings().length; i++) {
- assertEquals(catalog.getLodgings()[i], listViewer.getElementAt(i));
- }
- // Verify that the String being shown in the list viewer is the
- // "toString" of the combo viewer
- String[] lodgingStrings = new String[catalog.getLodgings().length];
- for (int i = 0; i < catalog.getLodgings().length; i++) {
- lodgingStrings[i] = catalog.getLodgings()[i].getName();
- }
- assertArrayEquals(lodgingStrings, list.getItems());
-
- // Verify that the list has no selected item
- assertEquals(null, ((IStructuredSelection) listViewer.getSelection())
- .getFirstElement());
-
- // Now bind the selection of the combo to the "defaultLodging" property
- // of an adventure
- final Adventure adventure = SampleData.WINTER_HOLIDAY;
-
- IObservableValue selection = ViewersObservables
- .observeSingleSelection(listViewer);
- getDbc().bindValue(selection,
- BeansObservables.observeValue(adventure, "defaultLodging"),
- null, null);
-
- // Verify that the list selection is the default lodging
- assertEquals(((IStructuredSelection) listViewer.getSelection())
- .getFirstElement(), adventure.getDefaultLodging());
-
- // Change the model and verify that the list selection changes
- adventure.setDefaultLodging(SampleData.CAMP_GROUND);
- assertEquals(adventure.getDefaultLodging(), SampleData.CAMP_GROUND);
- assertEquals(((IStructuredSelection) listViewer.getSelection())
- .getFirstElement(), adventure.getDefaultLodging());
-
- // Change the list selection and verify that the model changes
- listViewer.getList().select(3);
- assertEquals(((IStructuredSelection) listViewer.getSelection())
- .getFirstElement(), adventure.getDefaultLodging());
-
- adventure.setDefaultLodging(SampleData.YOUTH_HOSTEL);
- spinEventLoop(0);
- assertEquals(((IStructuredSelection) listViewer.getSelection())
- .getFirstElement(), adventure.getDefaultLodging());
-
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/MasterDetailScenarios.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/MasterDetailScenarios.java
deleted file mode 100644
index d8b8b76..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/MasterDetailScenarios.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 160000
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.masterdetail.MasterDetailObservables;
-import org.eclipse.core.databinding.observable.value.ComputedValue;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.Catalog;
-import org.eclipse.jface.examples.databinding.model.Category;
-import org.eclipse.jface.examples.databinding.model.Lodging;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.jface.viewers.ContentViewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class MasterDetailScenarios extends ScenariosTestCase {
-
- protected Object getViewerSelection(ContentViewer contentViewer) {
- return ((IStructuredSelection) contentViewer.getSelection())
- .getFirstElement();
- }
-
- /**
- * @return the ComboViewer's domain object list
- */
- protected List getViewerContent(ContentViewer contentViewer) {
- Object[] elements = ((IStructuredContentProvider) contentViewer
- .getContentProvider()).getElements(null);
- if (elements != null)
- return Arrays.asList(elements);
- return null;
- }
-
- public void testScenario01() {
- // Displaying the catalog's list of Lodging objects in a list viewer,
- // using their names. The name of the currently selected Lodging can
- // be edited in a text widget. There is always a selected Lodging
- // object.
- ListViewer listViewer = new ListViewer(getComposite(), SWT.BORDER);
- Realm realm = SWTObservables.getRealm(listViewer.getControl()
- .getDisplay());
- listViewer.getList().setLayoutData(
- new GridData(SWT.FILL, SWT.FILL, false, false));
- Catalog catalog = SampleData.CATALOG_2005;
-
- IObservableList lodgings = BeansObservables.observeList(realm, catalog,
- "lodgings");
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Lodging.class,
- new String[] { "name" });
- listViewer.setContentProvider(contentProvider);
- listViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMaps));
- listViewer.setInput(lodgings);
-
- assertArrayEquals(catalog.getLodgings(), getViewerContent(listViewer)
- .toArray());
-
- IObservableValue selectedLodging = ViewersObservables
- .observeSingleSelection(listViewer);
-
- selectedLodging.setValue(SampleData.CAMP_GROUND);
-
- assertEquals(SampleData.CAMP_GROUND, getViewerSelection(listViewer));
- Text txtName = new Text(getComposite(), SWT.BORDER);
-
- getDbc().bindValue(
- SWTObservables.observeText(txtName, SWT.Modify),
- BeansObservables.observeDetailValue(realm, selectedLodging,
- "name", String.class), null, null);
-
- assertEquals(txtName.getText(), SampleData.CAMP_GROUND.getName());
- enterText(txtName, "foobar");
- assertEquals("foobar", SampleData.CAMP_GROUND.getName());
- listViewer.setSelection(new StructuredSelection(
- SampleData.FIVE_STAR_HOTEL));
- assertEquals(SampleData.FIVE_STAR_HOTEL, selectedLodging.getValue());
- assertEquals(SampleData.FIVE_STAR_HOTEL.getName(), txtName.getText());
- SampleData.FIVE_STAR_HOTEL.setName("barfoo");
- assertEquals("barfoo", txtName.getText());
-
- // Now make sure that the event listeners get removed on dispose()
- // Values should no longer be updated
- selectedLodging.dispose();
-
- // selectedLodging.setValue(SampleData.CAMP_GROUND);
- // assertNotSame(SampleData.CAMP_GROUND,
- // getViewerSelection(listViewer));
- // assertNotSame(txtName.getText(), SampleData.CAMP_GROUND.getName());
- // enterText(txtName, "foobar");
- // assertNotSame("foobar", SampleData.CAMP_GROUND.getName());
- // listViewer.setSelection(new StructuredSelection(
- // SampleData.FIVE_STAR_HOTEL));
- // assertNotSame(SampleData.FIVE_STAR_HOTEL,
- // selectedLodging.getValue());
- // assertNotSame(SampleData.FIVE_STAR_HOTEL.getName(),
- // txtName.getText());
- // SampleData.FIVE_STAR_HOTEL.setName("barfoo");
- // assertNotSame("barfoo", txtName.getText());
- }
-
- public void testScenario02() {
- // Selecting from the list of lodgings for an adventure and editing the
- // properties of the selected lodging in text widgets. If no lodging is
- // selected the input controls for name and adventure are disabled.
- // There are two buttons "Add" and "Remove"; clicking on "Add" creates a
- // new lodging and selects it so it can be edited, clicking on "Remove"
- // removes the currently selected lodging from the list.
- final ListViewer listViewer = new ListViewer(getComposite(), SWT.BORDER);
- listViewer.getList().setLayoutData(
- new GridData(SWT.FILL, SWT.FILL, false, false));
- final Catalog catalog = SampleData.CATALOG_2005;
-
- IObservableList lodgings = BeansObservables.observeList(realm, catalog,
- "lodgings");
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Lodging.class,
- new String[] { "name" });
- listViewer.setContentProvider(contentProvider);
- listViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMaps));
- listViewer.setInput(lodgings);
-
- assertArrayEquals(catalog.getLodgings(), getViewerContent(listViewer)
- .toArray());
-
- final IObservableValue selectedLodgingObservable = ViewersObservables
- .observeSingleSelection(listViewer);
-
- selectedLodgingObservable.setValue(null);
- assertTrue(listViewer.getSelection().isEmpty());
-
- ComputedValue selectionExistsObservable = new ComputedValue(
- boolean.class) {
- protected Object calculate() {
- return new Boolean(selectedLodgingObservable.getValue() != null);
- }
- };
-
- assertFalse(((Boolean) selectionExistsObservable.getValue())
- .booleanValue());
-
- final Text txtName = new Text(getComposite(), SWT.BORDER);
-
- getDbc().bindValue(SWTObservables.observeEnabled(txtName),
- selectionExistsObservable, null, null);
- getDbc().bindValue(
- SWTObservables.observeText(txtName, SWT.Modify),
- BeansObservables.observeDetailValue(realm,
- selectedLodgingObservable, "name", String.class), null, null);
-
- assertEquals(txtName.getText(), "");
- assertFalse(txtName.getEnabled());
-
- final Text txtDescription = new Text(getComposite(), SWT.BORDER);
-
- getDbc().bindValue(SWTObservables.observeEnabled(txtDescription),
- selectionExistsObservable, null, null);
- getDbc().bindValue(
- SWTObservables.observeText(txtDescription, SWT.Modify),
- MasterDetailObservables.detailValue(
- selectedLodgingObservable, BeansObservables
- .valueFactory(realm, "description"),
- String.class), null, null);
-
- assertEquals(txtDescription.getText(), "");
- assertFalse(txtDescription.getEnabled());
-
- Button addButton = new Button(getComposite(), SWT.PUSH);
- addButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- Lodging selectedLodging = (Lodging) selectedLodgingObservable
- .getValue();
- int insertionIndex = 0;
- if (selectedLodging != null) {
- insertionIndex = Arrays.asList(catalog.getLodgings())
- .indexOf(selectedLodging);
- assertTrue(insertionIndex >= 0);
- }
- Lodging newLodging = SampleData.FACTORY.createLodging();
- int itemCount = listViewer.getList().getItemCount();
- newLodging.setName("new lodging name " + itemCount);
- newLodging.setDescription("new lodging description "
- + itemCount);
- catalog.addLodging(newLodging);
- assertEquals(itemCount + 1, listViewer.getList().getItemCount());
- listViewer.setSelection(new StructuredSelection(newLodging));
- assertSame(newLodging, selectedLodgingObservable.getValue());
- assertTrue(txtName.getEnabled());
- assertTrue(txtDescription.getEnabled());
- assertEquals(newLodging.getName(), txtName.getText());
- assertEquals(newLodging.getDescription(), txtDescription
- .getText());
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Button removeButton = new Button(getComposite(), SWT.PUSH);
- removeButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- Lodging selectedLodging = (Lodging) selectedLodgingObservable
- .getValue();
- assertNotNull(selectedLodging);
- int deletionIndex = Arrays.asList(catalog.getLodgings())
- .indexOf(selectedLodging);
- assertTrue(deletionIndex >= 0);
- int itemCount = listViewer.getList().getItemCount();
- catalog.removeLodging(selectedLodging);
- assertEquals(itemCount - 1, listViewer.getList().getItemCount());
- assertNull(selectedLodgingObservable.getValue());
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- pushButtonWithEvents(addButton);
- pushButtonWithEvents(removeButton);
- pushButtonWithEvents(addButton);
- pushButtonWithEvents(addButton);
- pushButtonWithEvents(removeButton);
- }
-
- public void testScenario03() {
- // List adventures and for the selected adventure allow its default
- // lodging�s name and description to be changed in text controls. If
- // there is no selected adventure or the default lodging is null the
- // text controls are disabled. This is a nested property. The default
- // lodging can be changed elsewhere, and the list
- final Catalog catalog = SampleData.CATALOG_2005;
-
- final ListViewer categoryListViewer = new ListViewer(getComposite(),
- SWT.BORDER);
- categoryListViewer.getList().setLayoutData(
- new GridData(SWT.FILL, SWT.FILL, false, false));
-
- IObservableList categories = BeansObservables.observeList(realm,
- catalog, "categories");
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Category.class,
- new String[] { "name" });
- categoryListViewer.setContentProvider(contentProvider);
- categoryListViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMaps));
- categoryListViewer.setInput(categories);
-
- assertArrayEquals(catalog.getCategories(), getViewerContent(
- categoryListViewer).toArray());
-
- final IObservableValue selectedCategoryObservable = ViewersObservables
- .observeSingleSelection(categoryListViewer);
-
- final ListViewer adventureListViewer = new ListViewer(getComposite(),
- SWT.BORDER);
- adventureListViewer.getList().setLayoutData(
- new GridData(SWT.FILL, SWT.FILL, false, false));
-
- IObservableList adventures = BeansObservables.observeDetailList(realm,
- selectedCategoryObservable, "adventures", Adventure.class);
- contentProvider = new ObservableListContentProvider();
- attributeMaps = BeansObservables.observeMaps(contentProvider
- .getKnownElements(), Adventure.class, new String[] { "name" });
- adventureListViewer.setContentProvider(contentProvider);
- adventureListViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMaps));
- adventureListViewer.setInput(adventures);
-
- ComputedValue categorySelectionExistsObservable = new ComputedValue() {
- protected Object calculate() {
- return new Boolean(
- selectedCategoryObservable.getValue() != null);
- }
- };
-
- getDbc().bindValue(
- SWTObservables.observeEnabled(adventureListViewer.getList()),
- categorySelectionExistsObservable, null, null);
-
- final IObservableValue selectedAdventureObservable = ViewersObservables
- .observeSingleSelection(adventureListViewer);
-
- ComputedValue adventureSelectionExistsObservable = new ComputedValue() {
- protected Object calculate() {
- return new Boolean(
- selectedAdventureObservable.getValue() != null);
- }
- };
-
- final Text txtName = new Text(getComposite(), SWT.BORDER);
-
- getDbc().bindValue(SWTObservables.observeEnabled(txtName),
- adventureSelectionExistsObservable, null, null);
- getDbc().bindValue(
- SWTObservables.observeText(txtName, SWT.Modify),
- BeansObservables.observeDetailValue(realm,
- selectedAdventureObservable, "name", String.class),
- null, null);
-
- assertEquals(txtName.getText(), "");
- assertFalse(txtName.getEnabled());
-
- final Text txtDescription = new Text(getComposite(), SWT.BORDER);
-
- getDbc().bindValue(SWTObservables.observeEnabled(txtDescription),
- adventureSelectionExistsObservable, null, null);
- getDbc().bindValue(
- SWTObservables.observeText(txtDescription, SWT.Modify),
- BeansObservables.observeDetailValue(realm,
- selectedAdventureObservable, "description",
- String.class), null, null);
-
- assertFalse(adventureListViewer.getList().isEnabled());
- categoryListViewer.setSelection(new StructuredSelection(
- SampleData.SUMMER_CATEGORY));
- assertTrue(adventureListViewer.getList().isEnabled());
- assertFalse(txtName.getEnabled());
- adventureListViewer.setSelection(new StructuredSelection(
- SampleData.RAFTING_HOLIDAY));
- assertEquals(Boolean.TRUE, adventureSelectionExistsObservable
- .getValue());
- assertTrue(txtName.getEnabled());
- assertEquals(SampleData.RAFTING_HOLIDAY.getName(), txtName.getText());
- categoryListViewer.setSelection(new StructuredSelection(
- SampleData.WINTER_CATEGORY));
- assertTrue(adventureListViewer.getList().isEnabled());
- assertFalse(txtName.getEnabled());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/NPETestScenario.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/NPETestScenario.java
deleted file mode 100644
index b7e4aed..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/NPETestScenario.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @since 3.2
- *
- */
-public class NPETestScenario extends ScenariosTestCase {
- private Text text;
-
- Person person;
-
- protected void setUp() throws Exception {
- super.setUp();
- person = new Person();
- text = new Text(getComposite(), SWT.BORDER);
- }
-
- /**
- * Asserts the ability to have an initial value of <code>null</code> on
- * the model and to update the value by changing the value of the view.
- */
- public void test_InitialNullValue() {
- Person person = new Person();
- assertNull(person.getName());
-
- System.out.println("Expecting message about not being able to attach a listener");
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(person, "name"),
- null, null);
-
- text.setText("Brad");
- text.notifyListeners(SWT.FocusOut, null);
- assertEquals("Brad", person.getName());
- }
-
- private static class Person {
- private String name;
-
- /**
- * @return Returns the name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name
- * The name to set.
- */
- public void setName(String name) {
- this.name = name;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/NewTableScenarios.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/NewTableScenarios.java
deleted file mode 100644
index 6a32325..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/NewTableScenarios.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.jface.examples.databinding.model.Catalog;
-import org.eclipse.jface.examples.databinding.model.Category;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.TableColumn;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class NewTableScenarios extends ScenariosTestCase {
-
- private TableViewer tableViewer;
-
- Catalog catalog;
-
- Category category;
-
- private TableColumn firstNameColumn;
-
- private TableColumn lastNameColumn;
-
- private TableColumn stateColumn;
-
- Image[] images;
-
- private TableColumn fancyColumn;
-
- protected void setUp() throws Exception {
- super.setUp();
- getComposite().setLayout(new FillLayout());
- tableViewer = new TableViewer(getComposite());
- tableViewer.getTable().setLinesVisible(true);
- tableViewer.getTable().setHeaderVisible(true);
- firstNameColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
- firstNameColumn.setWidth(50);
- lastNameColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
- lastNameColumn.setWidth(50);
- stateColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
- stateColumn.setWidth(50);
- fancyColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
- fancyColumn.setWidth(250);
-
- catalog = SampleData.CATALOG_2005; // Lodging source
- category = SampleData.WINTER_CATEGORY;
-
- images = new Image[] {
- getShell().getDisplay().getSystemImage(SWT.ICON_ERROR),
- getShell().getDisplay().getSystemImage(SWT.ICON_WARNING),
- getShell().getDisplay().getSystemImage(SWT.ICON_INFORMATION), };
- }
-
- protected void tearDown() throws Exception {
- // do any teardown work here
- super.tearDown();
- tableViewer.getTable().dispose();
- tableViewer = null;
- firstNameColumn = null;
- lastNameColumn = null;
- stateColumn = null;
- }
-
- String getValue(String text) {
- if (text == null)
- return "";
- return text;
- }
-
- public void testScenario01() {
-// // Factory for directly creating IObservables for beans
-// JavaBeans javaBeans = new JavaBeans();
-//
-// // Wrap the TableViewer in an IObservableCollectionWithLabels
-// IObservableCollectionWithLabels accountTable = new TableViewerObservableTable(
-// tableViewer);
-//
-// // Create a readable set to track the catalog's accounts
-// IReadableSet accountSet = javaBeans.createReadableSet(catalog,
-// new PropertyDescriptor("accounts", Catalog.class, "getAccounts", null),
-// Account.class);
-//
-// // Create an observable cell provider to track the given accounts' properties.
-// IObservableCellProvider accountCellProvider = javaBeans.createObservableCellProvider(
-// accountSet, new String[] { "firstName", "lastName", "state" });
-//
-// // bind
-// getDbc().bind(accountTable, accountCellProvider, null);
-//
-// // uncomment next line to see result interactively
-// // interact();
-//
-// // Verify the data in the table columns matches the accounts
-// Account[] accounts = catalog.getAccounts();
-// for (int i = 0; i < accounts.length; i++) {
-// Account account = accounts[i];
-// String col_0 = ((ITableLabelProvider) tableViewer
-// .getLabelProvider()).getColumnText(account, 0);
-// assertEquals(getValue(account.getFirstName()), col_0);
-// String col_1 = ((ITableLabelProvider) tableViewer
-// .getLabelProvider()).getColumnText(account, 1);
-// assertEquals(getValue(account.getLastName()), col_1);
-// String col_2 = ((ITableLabelProvider) tableViewer
-// .getLabelProvider()).getColumnText(account, 2);
-// assertEquals(getValue(account.getState()), col_2);
-//
-// }
- }
-
- public void testScenario02() throws SecurityException,
- IllegalArgumentException {
-// // Show that a TableViewer with three columns can be used to update
-// // columns
-// Account[] accounts = catalog.getAccounts();
-//
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addEditableColumn("firstName");
-// tableViewerDescription.addEditableColumn("lastName", null, null,
-// new PhoneConverter());
-// tableViewerDescription.addEditableColumn("state", null, null,
-// new StateConverter());
-// getDbc().bind(tableViewerDescription,
-// new Property(catalog, "accounts"), null);
-//
-// Account account = accounts[0];
-// // Select the first item in the table
-// tableViewer.editElement(account, 0);
-// // Set the text property of the cell editor which is now active over the
-// // "firstName" column
-// CellEditor[] cellEditors = tableViewer.getCellEditors();
-// TextCellEditor firstNameEditor = (TextCellEditor) cellEditors[0];
-// // Change the firstName and test it goes to the model
-// enterText((Text) firstNameEditor.getControl(), "Bill");
-// // Check whether the model has changed
-// assertEquals("Bill", account.getFirstName());
- }
-
- public void testScenario04() {
-// // Show that when an item is added to a collection the table gets an
-// // extra item
-// Account[] accounts = catalog.getAccounts();
-//
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addColumn("firstName");
-// tableViewerDescription.addColumn("lastName");
-// tableViewerDescription.addColumn("state");
-// tableViewerDescription.addColumn(null, new IConverter() {
-//
-// public Class getModelType() {
-// return Account.class;
-// }
-//
-// public Class getTargetType() {
-// return ViewerLabel.class;
-// }
-//
-// public Object convertTargetToModel(Object targetObject) {
-// return null;
-// }
-//
-// public Object convertModelToTarget(Object modelObject) {
-// Account account = (Account) modelObject;
-// return new ViewerLabel(account.toString(), images[new Random()
-// .nextInt(images.length)]);
-// }
-// });
-// getDbc().bind(tableViewerDescription,
-// new Property(catalog, "accounts"), null);
-//
-// // interact();
-//
-// // Verify the number of accounts matches the number of items in the
-// // table
-// assertEquals(tableViewer.getTable().getItemCount(), accounts.length);
-// // Add a new account and verify that the number of items in the table
-// // increases
-// Account newAccount = new Account();
-// newAccount.setFirstName("Finbar");
-// newAccount.setLastName("McGoo");
-// newAccount.setLastName("NC");
-// catalog.addAccount(newAccount);
-// // The number of items should have gone up by one
-// assertEquals(tableViewer.getTable().getItemCount(), accounts.length + 1);
-// // The number of items should still match the number of accounts (i.e.
-// // test the model)
-// assertEquals(tableViewer.getTable().getItemCount(), catalog
-// .getAccounts().length);
-// // Remove the account that was just added
-// catalog.removeAccount(newAccount);
-// // The number of items should match the original
-// assertEquals(tableViewer.getTable().getItemCount(), accounts.length);
-// // The number of items should still match the number of accounts (i.e.
-// // test the model is reset)
-// assertEquals(tableViewer.getTable().getItemCount(), catalog
-// .getAccounts().length);
-//
-// // Test adding and removing to the model on a non UI thread
-// int numberOfAccounts = catalog.getAccounts().length;
-// final Account barney = new Account();
-// barney.setFirstName("Barney");
-// barney.setLastName("Smith");
-// barney.setLastName("CA");
-// invokeNonUI(new Runnable() {
-// public void run() {
-// catalog.addAccount(barney);
-// }
-// });
-// spinEventLoop(0);
-// // The number of items should have gone up by one
-// assertEquals(tableViewer.getTable().getItemCount(),
-// numberOfAccounts + 1);
-//
-// invokeNonUI(new Runnable() {
-// public void run() {
-// catalog.removeAccount(barney);
-// }
-// });
-// spinEventLoop(0);
-// // The number of items should have reverted to the original number
-// // before barney was added and removed
-// assertEquals(tableViewer.getTable().getItemCount(), numberOfAccounts);
-//
- }
-
- public void testScenario03() {
-// // Show that converters work for table columns
-// Account[] accounts = catalog.getAccounts();
-//
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addEditableColumn("lastName");
-// tableViewerDescription.addEditableColumn("phone", null, null,
-// new PhoneConverter());
-// tableViewerDescription.addEditableColumn("state", null, null,
-// new StateConverter());
-// getDbc().bind(tableViewerDescription,
-// new Property(catalog, "accounts"), null);
-//
-// // Verify that the data in the the table columns matches the expected
-// // What we are looking for is that the phone numbers are converterted to
-// // nnn-nnn-nnnn and that
-// // the state letters are converted to state names
-// // Verify the data in the table columns matches the accounts
-// PhoneConverter phoneConverter = new PhoneConverter();
-// StateConverter stateConverter = new StateConverter();
-// for (int i = 0; i < accounts.length; i++) {
-// Account account = catalog.getAccounts()[i];
-// // Check the phone number
-// String col_phone = ((ITableLabelProvider) tableViewer
-// .getLabelProvider()).getColumnText(account, 1);
-// assertEquals(getValue((String) phoneConverter
-// .convertModelToTarget(account.getPhone())), col_phone);
-// String col_state = ((ITableLabelProvider) tableViewer
-// .getLabelProvider()).getColumnText(account, 2);
-// assertEquals(getValue((String) stateConverter
-// .convertModelToTarget(account.getState())), col_state);
-// }
- }
-
- public void testScenario05() {
-// // Show that when the model changes then the UI refreshes to reflect
-// // this
-//
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addColumn("lastName");
-// tableViewerDescription.addColumn("phone", new PhoneConverter());
-// tableViewerDescription.addColumn("state", new StateConverter());
-// getDbc().bind(tableViewerDescription,
-// new Property(catalog, "accounts"), null);
-//
-// final Account account = catalog.getAccounts()[0];
-// String lastName = tableViewer.getTable().getItem(0).getText(0);
-// // Check the firstName in the TableItem is the same as the model
-// assertEquals(lastName, account.getLastName());
-// // Now change the model and check again
-// account.setLastName("Gershwin");
-// lastName = tableViewer.getTable().getItem(0).getText(0);
-// assertEquals(lastName, account.getLastName());
-//
-// // Test the model update on a non UI thread
-// invokeNonUI(new Runnable() {
-// public void run() {
-// account.setLastName("Mozart");
-// }
-// });
-// spinEventLoop(0);
-// lastName = tableViewer.getTable().getItem(0).getText(0);
-// assertEquals(lastName, account.getLastName());
-//
- }
-
- public void testScenario06() {
-// // Check that explicit type means that defaulting of converters works
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addEditableColumn("price");
-// tableViewerDescription.getColumn(0).setPropertyType(Double.TYPE);
-// getDbc().bind(tableViewerDescription,
-// new Property(catalog, "transporations"), null);
-// Transportation transporation = catalog.getTransporations()[0];
-// tableViewer.editElement(transporation, 0);
-// // Set the text property of the cell editor which is now active over the
-// // "firstName" column
-// CellEditor[] cellEditors = tableViewer.getCellEditors();
-// TextCellEditor priceEditor = (TextCellEditor) cellEditors[0];
-// // Change the firstName and test it goes to the model
-// enterText((Text) priceEditor.getControl(), "123.45");
-// // Verify the model is updated
-// assertEquals(transporation.getPrice(), 123.45, 0);
-
- }
-
- public void testScenario07() {
-// // Verify that even when a column's property type is not set, that it is
-// // worked out lazily from the target type
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addEditableColumn("price");
-// // The column's type is not set to be Double.TYPE. This will be inferred
-// // once the first Transportation object is set
-// // into the ObservableCollection
-// getDbc().bind(tableViewerDescription,
-// new Property(catalog, "transporations"), null);
-// Transportation transporation = catalog.getTransporations()[0];
-// tableViewer.editElement(transporation, 0);
-// // Set the text property of the cell editor which is now active over the
-// // "firstName" column
-// CellEditor[] cellEditors = tableViewer.getCellEditors();
-// TextCellEditor priceEditor = (TextCellEditor) cellEditors[0];
-// // Change the firstName and test it goes to the model
-// enterText((Text) priceEditor.getControl(), "123.45");
-// // Verify the model is updated
-// assertEquals(transporation.getPrice(), 123.45, 0);
-//
- }
-
- public void testScenario08_00() {
-// // Verify that binding to a Collection property (rather than an array)
-// // works when specifying data type
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addEditableColumn("userId");
-// tableViewerDescription.addEditableColumn("password");
-// getDbc().bind(tableViewerDescription,
-// new Property(catalog, "signons", Signon.class, null), null);
-// Signon firstSignon = (Signon) catalog.getSignons().get(0);
-// // Verify the UI matches the model
-// TableItem firstTableItem = tableViewer.getTable().getItem(0);
-// assertEquals(firstTableItem.getText(1), firstSignon.getPassword());
-// // Change the model and ensure the UI refreshes
-// firstSignon.setPassword("Eclipse123Rocks");
-// assertEquals("Eclipse123Rocks", firstSignon.getPassword());
-// assertEquals(firstTableItem.getText(1), firstSignon.getPassword());
-// // Change the GUI and ensure the model refreshes
-// tableViewer.editElement(firstSignon, 1);
-// CellEditor[] cellEditors = tableViewer.getCellEditors();
-// TextCellEditor passwordEditor = (TextCellEditor) cellEditors[1];
-// enterText((Text) passwordEditor.getControl(), "Cricket11Players");
-// assertEquals("Cricket11Players", firstSignon.getPassword());
-//
- }
-
- public void testScenario08_01() {
-// // Verify that binding to a Collection property (rather than an array)
-// // works without specifying data type
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addEditableColumn("userId");
-// tableViewerDescription.addEditableColumn("password");
-// getDbc().bind(tableViewerDescription, new Property(catalog, "signons"),
-// null);
-// Signon firstSignon = (Signon) catalog.getSignons().get(0);
-// // Verify the UI matches the model
-// TableItem firstTableItem = tableViewer.getTable().getItem(0);
-// assertEquals(firstTableItem.getText(1), firstSignon.getPassword());
-// // Change the model and ensure the UI refreshes
-// firstSignon.setPassword("Eclipse123Rocks");
-// assertEquals("Eclipse123Rocks", firstSignon.getPassword());
-// assertEquals(firstTableItem.getText(1), firstSignon.getPassword());
-// // Change the GUI and ensure the model refreshes
-// tableViewer.editElement(firstSignon, 1);
-// CellEditor[] cellEditors = tableViewer.getCellEditors();
-// TextCellEditor passwordEditor = (TextCellEditor) cellEditors[1];
-// enterText((Text) passwordEditor.getControl(), "Cricket11Players");
-// assertEquals("Cricket11Players", firstSignon.getPassword());
-//
- }
-
- public void testScenario09() {
-// // Verify that nested properties work. Catalog has adventures. Adventure
-// // has defaultLodging. Loding has name.
-// TableViewerDescription tableViewerDescription = new TableViewerDescription(
-// tableViewer);
-// tableViewerDescription.addColumn("name");
-// tableViewerDescription.addColumn("defaultLodging.name");
-// getDbc().bind(tableViewerDescription,
-// new Property(category, "adventures"), null);
- }
- /**
- * public void testScenario10(){ // Verify that for TIME_EARLY updating
- * occurs on a per key basic for a TextCellEditor // Show that converters
- * work for table columns Account[] accounts = catalog.getAccounts();
- * Account firstAccount = accounts[0];
- * SampleData.getSWTObservableFactory().setUpdateTime(DataBindingContext.TIME_EARLY);
- * TableViewerDescription tableViewerDescription = new
- * TableViewerDescription(tableViewer);
- * tableViewerDescription.addEditableColumn("lastName");
- * tableViewerDescription.addColumn("lastName");
- * getDbc().bind(tableViewerDescription,new Property(catalog, "accounts"),
- * null); // Verify that the first account is shown in the first row with
- * the last name correctly
- * assertEquals(tableViewer.getTable().getItem(0).getData(),firstAccount);
- * assertEquals(tableViewer.getTable().getItem(0).getText(0),firstAccount.getLastName());
- * assertEquals(tableViewer.getTable().getItem(0).getText(1),firstAccount.getLastName()); //
- * Create a cell editor over the first column
- * tableViewer.editElement(firstAccount, 0); // Set the text property of the
- * cell editor which is now active over the "firstName" column CellEditor[]
- * cellEditors = tableViewer.getCellEditors(); TextCellEditor
- * lastNameCellEditor = (TextCellEditor) cellEditors[0];
- * ((Text)lastNameCellEditor.getControl()).setText("E"); // Verify that the
- * key press goes to the model assertEquals(firstAccount.getLastName(),"E"); }
- */
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/PropertyScenarios.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/PropertyScenarios.java
deleted file mode 100644
index 719ceed..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/PropertyScenarios.java
+++ /dev/null
@@ -1,579 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920, 159768
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import java.text.ParseException;
-import java.util.Date;
-import java.util.Locale;
-
-import org.eclipse.core.databinding.AggregateValidationStatus;
-import org.eclipse.core.databinding.Binding;
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.conversion.Converter;
-import org.eclipse.core.databinding.conversion.IConverter;
-import org.eclipse.core.databinding.conversion.NumberToStringConverter;
-import org.eclipse.core.databinding.conversion.StringToNumberConverter;
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.databinding.validation.ValidationStatus;
-import org.eclipse.core.internal.databinding.conversion.IdentityConverter;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.examples.databinding.model.Account;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.Cart;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Text;
-
-import com.ibm.icu.text.NumberFormat;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class PropertyScenarios extends ScenariosTestCase {
-
- private Adventure adventure;
-
- protected void setUp() throws Exception {
- super.setUp();
- // do any setup work here
- adventure = SampleData.WINTER_HOLIDAY;
- }
-
- protected void tearDown() throws Exception {
- // do any teardown work here
- super.tearDown();
- }
-
- public void testEnterText() {
- // just to make sure enterText() generates a FocusOut event.
- Text text = new Text(getComposite(), SWT.BORDER);
- final boolean[] focusLostHolder = { false };
- text.addFocusListener(new FocusListener() {
-
- public void focusGained(FocusEvent e) {
- // only interested in focus lost events
- }
-
- public void focusLost(FocusEvent e) {
- focusLostHolder[0] = true;
- }
- });
- enterText(text, "hallo");
- assertTrue(focusLostHolder[0]);
- }
-
- public void testScenario01() {
- Text text = new Text(getComposite(), SWT.BORDER);
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(adventure, "name"),
- null, null);
-
- // getDbc().bind(text, new Property(adventure, "name"), null);
- // uncomment the following line to see what's happening
- // spinEventLoop(1);
- assertEquals(adventure.getName(), text.getText());
- enterText(text, "foobar");
- // uncomment the following line to see what's happening
- // spinEventLoop(1);
- assertEquals("foobar", adventure.getName());
- adventure.setName("barfoo");
- // uncomment the following line to see what's happening
- // spinEventLoop(1);
- assertEquals("barfoo", text.getText());
- }
-
- public void testScenario02() {
- // Binding the name property of an Adventure object to the contents of
- // Text controls, no conversion, no validation. The Text widget editable
- // is set to false.by the developer (can not change the name)
- Text text = new Text(getComposite(), SWT.READ_ONLY);
-
- getDbc().bindValue(SWTObservables.observeText(text, SWT.None),
- BeansObservables.observeValue(adventure, "name"),
- null, null);
- assertEquals(adventure.getName(), text.getText());
- }
-
- public void testScenario03() {
- // Binding of a read-only property of an Adventure object to the
- // contents of Text controls, no conversion, no validation. Text control
- // is not editable as a side effect of binding to a read-only property..
- Cart cart = SampleData.CART;
- cart.setAdventureDays(42);
- // bind to the lodgingDays feature, which is read-only and always one
- // less than the number of adventure days.
- Text text = new Text(getComposite(), SWT.BORDER);
-
- System.out.println("Expecting message about not being able to attach a listener");
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(cart, "lodgingDays"),
- null, null);
-
- assertEquals(new Integer(cart.getLodgingDays()).toString(), text.getText());
- }
-
- public void testScenario04() {
- // Binding a nested property of an Adventure object to the content of a
- // Text control, no conversion, no validation.
- Text text = new Text(getComposite(), SWT.BORDER);
- // TODO Scenario needs to be more specific - I'm binding to the default
- // lodging's description of an adventure. What do we expect to happen
- // when the default lodging changes? If we expect no change, then this
- // scenario does not introduce anything new. If we expect the binding to
- // be to the new default lodging's description, shouldn't we move this
- // scenario to the master/detail section? I'm assuming the latter for
- // now.
-
- IObservableValue defaultLodging =BeansObservables.observeDetailValue(realm, BeansObservables.observeValue(adventure,
- "defaultLodging"), "description", String.class);
-
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify), defaultLodging, null, null);
-
- // test changing the description
- assertEquals(adventure.getDefaultLodging().getDescription(), text.getText());
- enterText(text, "foobar");
- assertEquals("foobar", adventure.getDefaultLodging().getDescription());
- adventure.getDefaultLodging().setDescription("barfoo");
- assertEquals(adventure.getDefaultLodging().getDescription(), text.getText());
-
- // test changing the default lodging
- adventure.setDefaultLodging(SampleData.CAMP_GROUND);
- assertEquals(adventure.getDefaultLodging().getDescription(), text.getText());
- adventure.getDefaultLodging().setDescription("barfo");
- assertEquals(adventure.getDefaultLodging().getDescription(), text.getText());
-
- adventure.setDefaultLodging(null);
- assertEquals("", text.getText());
-
- adventure.setDefaultLodging(SampleData.FIVE_STAR_HOTEL);
- assertEquals(adventure.getDefaultLodging().getDescription(), text.getText());
- adventure.getDefaultLodging().setDescription("barf");
- assertEquals(adventure.getDefaultLodging().getDescription(), text.getText());
-
- }
-
- public void testScenario05() {
- // Binding the name property of an Adventure object to the contents of
- // Text controls where conversion occurs � the model data is held all
- // in
- // uppercase and displayed in lowercase with the first letter
- // capitalized.
- Text text = new Text(getComposite(), SWT.BORDER);
- adventure.setName("UPPERCASE");
-
- IConverter converter1 = new IConverter() {
- public Object getFromType() {
- return String.class;
- }
-
- public Object getToType() {
- return String.class;
- }
-
- public Object convert(Object toObject) {
- String modelValue = (String) toObject;
- if (modelValue == null || modelValue.equals("")) {
- return modelValue;
- }
- String firstChar = modelValue.substring(0, 1);
- String remainingChars = modelValue.substring(1);
- return firstChar.toUpperCase() + remainingChars.toLowerCase();
- }
- };
- IConverter converter2 = new IConverter() {
- public Object getFromType() {
- return String.class;
- }
-
- public Object getToType() {
- return String.class;
- }
-
- public Object convert(Object fromObject) {
- return ((String) fromObject).toUpperCase();
- }
- };
-
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(adventure, "name"),
- new UpdateValueStrategy().setConverter(converter2), new UpdateValueStrategy().setConverter(converter1));
-
- // spinEventLoop(1);
- assertEquals("Uppercase", text.getText());
- enterText(text, "lowercase");
- // spinEventLoop(1);
- // TODO If we wanted to "canonicalize" the value in the text field, how
- // could we do that?
- assertEquals("LOWERCASE", adventure.getName());
- }
-
- public void testScenario06() {
- // Binding the name property of an Adventure object to the contents of
- // Text controls where validation occurs and the name cannot be longer
- // than 15 characters and cannot contain spaces
- Text text = new Text(getComposite(), SWT.BORDER);
- final String noSpacesMessage = "Name must not contain spaces.";
- final String max15CharactersMessage = "Maximum length for name is 15 characters.";
- adventure.setName("ValidValue");
-
- IValidator validator = new IValidator() {
- public IStatus validate(Object value) {
- String stringValue = (String) value;
- if (stringValue.length() > 15) {
- return ValidationStatus.error(max15CharactersMessage);
- } else if (stringValue.indexOf(' ') != -1) {
- return ValidationStatus.cancel(noSpacesMessage);
- } else {
- return Status.OK_STATUS;
- }
- }
- };
-
-// BindSpec bindSpec = new DefaultBindSpec().setModelToTargetConverter(new IdentityConverter(String.class))
-// .setTargetToModelConverter(new IdentityConverter(String.class))
-// .addTargetValidator(BindingEvent.PIPELINE_VALUE_CHANGING, validator);
-
- Binding binding = getDbc().bindValue(
- SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(adventure, "name"),
- new UpdateValueStrategy().setConverter(new IdentityConverter(
- String.class)).setAfterGetValidator(validator),
- new UpdateValueStrategy().setConverter(new IdentityConverter(
- String.class)));
-
- // no validation message
- assertTrue(((IStatus)binding.getValidationStatus().getValue()).isOK());
- enterText(text, "Invalid Value");
- assertEquals(noSpacesMessage, ((IStatus) binding.getValidationStatus().getValue()).getMessage());
- assertEquals("ValidValue", adventure.getName());
- text.setText("InvalidValueBecauseTooLong");
- assertEquals(max15CharactersMessage,
- ((IStatus) binding.getValidationStatus().getValue()).getMessage());
- assertEquals("ValidValue", adventure.getName());
- enterText(text, "anothervalid");
- assertTrue(((IStatus)binding.getValidationStatus().getValue()).isOK());
- assertEquals("anothervalid", adventure.getName());
- }
-
- public void testScenario07() {
- // Binding the price property of an Adventure to a Text control. Price
- // is a double and Text accepts String so conversion will have to occur.
- // Validation ensure that the value is positive
- Text text = new Text(getComposite(), SWT.BORDER);
- adventure.setPrice(5.0);
- final String cannotBeNegativeMessage = "Price cannot be negative.";
- final String mustBeCurrencyMessage = "Price must be a currency.";
-
- IValidator validator = new IValidator() {
- public IStatus validate(Object value) {
- String stringValue = (String) value;
- try {
- double doubleValue = new Double(stringValue).doubleValue();
- if (doubleValue < 0.0) {
- return ValidationStatus.error(cannotBeNegativeMessage);
- }
- return Status.OK_STATUS;
- } catch (NumberFormatException ex) {
- return ValidationStatus.error(mustBeCurrencyMessage);
- }
- }
- };
-
- //Create a number formatter that will display one decimal position.
- NumberFormat numberFormat = NumberFormat.getInstance();
- numberFormat.setMinimumFractionDigits(1);
-
- IConverter targetToModelConverter = StringToNumberConverter.toDouble(
- numberFormat, true);
- IConverter modelToTargetConverter = NumberToStringConverter.fromDouble(
- numberFormat, true);
-
- getDbc().bindValue(
- SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(adventure, "price"),
- new UpdateValueStrategy().setAfterGetValidator(validator)
- .setConverter(targetToModelConverter),
- new UpdateValueStrategy().setConverter(modelToTargetConverter));
-
- String expected = numberFormat.format(adventure.getPrice());
- assertEquals(expected, text.getText());
- assertTrue(AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).isOK());
-
- String toEnter = numberFormat.format(0.65);
- enterText(text, toEnter);
- assertTrue(AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).isOK());
- assertEquals(0.65, adventure.getPrice(), 0.0001);
-
- adventure.setPrice(42.24);
- expected = numberFormat.format(adventure.getPrice());
- assertEquals(expected, text.getText());
- assertTrue(AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).isOK());
-
- enterText(text, "jygt");
- assertEquals(mustBeCurrencyMessage, AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).getMessage());
-
- toEnter = numberFormat.format(-23.9);
- enterText(text, toEnter);
- assertEquals(cannotBeNegativeMessage, AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).getMessage());
- assertEquals(42.24, adventure.getPrice(), 0.0001);
-
- adventure.setPrice(0.0);
- assertTrue(AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).isOK());
- }
-
- public void testScenario08() {
- // Binding the price property of an Adventure to a Text control but with
- // custom conversion � the double will be validated to only have two
- // decimal places and displayed with a leading currency symbol, and can
- // be entered with or without the currency symbol.
- Text text = new Text(getComposite(), SWT.BORDER);
- adventure.setPrice(5.0);
- final String cannotBeNegativeMessage = "Price cannot be negative.";
- final String mustBeCurrencyMessage = "Price must be a currency.";
- final NumberFormat currencyFormat = NumberFormat.getCurrencyInstance(Locale.CANADA);
-
- IConverter toCurrency = new Converter(double.class, String.class) {
- public Object convert(Object toObject) {
- return currencyFormat.format(((Double) toObject).doubleValue());
- }
- };
-
- IConverter toDouble = new Converter(String.class, double.class) {
- public Object convert(Object fromObject) {
- try {
- return new Double(currencyFormat.parse((String) fromObject).doubleValue());
- } catch (ParseException e) {
- // TODO throw something like
- // IllegalConversionException?
- return new Double(0);
- }
- }
- };
-
- IValidator validator = new IValidator() {
- public IStatus validate(Object value) {
- String stringValue = (String) value;
- try {
- double doubleValue = currencyFormat.parse(stringValue).doubleValue();
- if (doubleValue < 0.0) {
- return ValidationStatus.error(cannotBeNegativeMessage);
- }
- return Status.OK_STATUS;
- } catch (ParseException e) {
- return ValidationStatus.error(mustBeCurrencyMessage);
- }
- }
- };
-
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(adventure, "price"),
-new UpdateValueStrategy().setConverter(toDouble).setAfterGetValidator(validator),new UpdateValueStrategy().setConverter(toCurrency));
-
- String expected = currencyFormat.format(5);
- assertEquals(expected, text.getText());
- assertTrue(AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).isOK());
-
- String toEnter = currencyFormat.format(0.65);
- enterText(text, toEnter);
- assertTrue(AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).isOK());
- assertEquals(0.65, adventure.getPrice(), 0.0001);
-
- adventure.setPrice(42.24);
- expected = currencyFormat.format(adventure.getPrice());
- assertEquals(expected, text.getText());
-
- assertTrue(AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).isOK());
- enterText(text, "jygt");
- assertEquals(mustBeCurrencyMessage, AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).getMessage());
-
- toEnter = currencyFormat.format(-23.9);
- enterText(text, toEnter);
-
- assertEquals(cannotBeNegativeMessage, AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).getMessage());
- assertEquals(42.24, adventure.getPrice(), 0.0001);
- adventure.setPrice(0.0);
- assertTrue(AggregateValidationStatus.getStatusMaxSeverity(getDbc().getBindings()).isOK());
- }
-
- public void testScenario09() {
- // Binding a boolean property to a CheckBox. Adventure will have a
- // Boolean property �petsAllowed�
- Button checkbox = new Button(getComposite(), SWT.CHECK);
- // checkbox.setText("Pets allowed");
- // checkbox.setLayoutData(new GridData(SWT.LEFT,SWT.TOP, false,false));
- adventure.setPetsAllowed(true);
-
- getDbc().bindValue(SWTObservables.observeSelection(checkbox),
- BeansObservables.observeValue(adventure, "petsAllowed"),
- null, null);
-
- assertEquals(true, checkbox.getSelection());
- setButtonSelectionWithEvents(checkbox, false);
- assertEquals(false, adventure.isPetsAllowed());
- adventure.setPetsAllowed(true);
- assertEquals(true, checkbox.getSelection());
- }
-
- public void testScenario10() {
- // Binding a Transportation departure time to a Text control that
- // formats and validates the time to and from a String. There are
- // property bindings that bind elements of the GUI to elements to GUI
- // and also elements of the domain to elements of the domain
- // TODO fail("not implemented");
- }
-
- public void testScenario11() {
- // Binding the max value of a spinner to another spinner.
- Spinner spinner1 = new Spinner(getComposite(), SWT.NONE);
- spinner1.setSelection(10);
- spinner1.setMinimum(1);
- spinner1.setMaximum(100);
- Spinner spinner2 = new Spinner(getComposite(), SWT.NONE);
- spinner2.setMaximum(1);
-
- getDbc().bindValue(SWTObservables.observeSelection(spinner1), SWTObservables.observeMax(spinner2), null, null);
-
- assertEquals(1, spinner1.getSelection());
- spinner1.setSelection(10);
- spinner1.notifyListeners(SWT.Modify, new Event());
- assertEquals(10, spinner2.getMaximum());
- }
-
- public void testScenario12() {
- // Binding the enabled state of several Text controls to a check box.
- // There will be two check boxes, so as each is enabled/disabled the
- // other one follows as do the states of the Text controls.
- Button checkbox1 = new Button(getComposite(), SWT.CHECK);
- checkbox1.setSelection(false);
- Button checkbox2 = new Button(getComposite(), SWT.CHECK);
- checkbox2.setSelection(false);
- Text text1 = new Text(getComposite(), SWT.NONE);
- Text text2 = new Text(getComposite(), SWT.NONE);
-
- IObservableValue checkbox1Selected = SWTObservables.observeSelection(checkbox1);
- IObservableValue checkbox2Selected = SWTObservables.observeSelection(checkbox2);
-
- // bind the two checkboxes so that if one is checked, the other is not
- // and vice versa.
- Converter negatingConverter = new Converter(boolean.class, boolean.class) {
- private Boolean negated(Boolean booleanObject) {
- return new Boolean(!booleanObject.booleanValue());
- }
-
- public Object convert(Object targetObject) {
- return negated((Boolean) targetObject);
- }
- };
-
- getDbc().bindValue(checkbox1Selected,
- checkbox2Selected,new UpdateValueStrategy().setConverter(negatingConverter),
- new UpdateValueStrategy().setConverter(negatingConverter));
-
- // bind the enabled state of the two text widgets to one of the
- // checkboxes each.
-
- getDbc().bindValue(SWTObservables.observeEnabled(text1), checkbox1Selected, null, null);
- getDbc().bindValue(SWTObservables.observeEnabled(text2), checkbox2Selected, null, null);
-
- assertEquals(true, text1.getEnabled());
- assertEquals(false, text2.getEnabled());
- assertEquals(true, checkbox1.getSelection());
- setButtonSelectionWithEvents(checkbox1, false);
- assertEquals(false, text1.getEnabled());
- assertEquals(true, text2.getEnabled());
- assertEquals(true, checkbox2.getSelection());
- setButtonSelectionWithEvents(checkbox2, false);
- assertEquals(true, text1.getEnabled());
- assertEquals(false, text2.getEnabled());
- assertEquals(true, checkbox1.getSelection());
- }
-
- public void testScenario13() {
- Text text = new Text(getComposite(), SWT.BORDER);
-
- getDbc().bindValue(SWTObservables.observeText(text, SWT.FocusOut), BeansObservables.observeValue(adventure, "name"), null, null);
-
- // uncomment the following line to see what's happening
- // happening
- // spinEventLoop(1);
- String adventureName = adventure.getName();
- assertEquals(adventureName, text.getText());
- enterText(text, "foobar");
- // uncomment the following line to see what's happening
- // spinEventLoop(1);
- assertEquals("foobar", adventure.getName());
- adventure.setName("barfoo");
- // uncomment the following line to see what's happening
- // spinEventLoop(1);
- assertEquals("barfoo", text.getText());
- }
-
- public void testScenario14() {
- Text t1 = new Text(getComposite(), SWT.BORDER);
- Text t2 = new Text(getComposite(), SWT.BORDER);
-
- getDbc().bindValue(SWTObservables.observeText(t1, SWT.Modify), BeansObservables.observeValue(adventure, "name"), null, null);
- getDbc().bindValue(SWTObservables.observeText(t2, SWT.Modify), BeansObservables.observeValue(adventure, "name"), null, null);
-
- final int[] counter = { 0 };
-
- IObservableValue uv = BeansObservables.observeValue(adventure, "name");
-
- uv.addChangeListener(new IChangeListener() {
- public void handleChange(ChangeEvent event) {
- // Count how many times adventure has changed
- counter[0]++;
- }
- });
-
- String name = adventure.getName() + "Foo";
- enterText(t1, name);
- assertEquals(name, adventure.getName());
- assertEquals(name, t2.getText());
- assertTrue(counter[0] == 1);
-
- name = name + "Bar";
- uv.setValue(name);
- assertEquals(t1.getText(), adventure.getName());
- assertEquals(2, counter[0]);
-
- }
-
- public void testScenario15() {
- Text text = new Text(getComposite(), SWT.NONE);
- Account account = new Account();
- account.setExpiryDate(new Date());
-
- Binding b = getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify), BeansObservables.observeValue(account, "expiryDate"), null, null);
- Text errorText = new Text(getComposite(), SWT.NONE);
-
- getDbc().bindValue(SWTObservables.observeText(errorText, SWT.Modify), b.getValidationStatus(), new UpdateValueStrategy(false, UpdateValueStrategy.POLICY_NEVER), null);
- assertTrue(((IStatus)b.getValidationStatus().getValue()).isOK());
- enterText(text, "foo");
- assertFalse(((IStatus)b.getValidationStatus().getValue()).isOK());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ScenariosTestCase.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ScenariosTestCase.java
deleted file mode 100644
index 9b3bc3e..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ScenariosTestCase.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Abstract base class of the JFace binding scenario test classes.
- */
-abstract public class ScenariosTestCase extends TestCase {
-
- private Composite composite;
- private DataBindingContext dbc;
- protected Display display;
- private boolean disposeDisplay = false;
- protected Shell shell;
- protected Text dummyText;
- protected Realm realm;
-
- protected Composite getComposite() {
- return composite;
- }
-
- protected DataBindingContext getDbc() {
- return dbc;
- }
-
- public Shell getShell() {
- if (shell != null) {
- return shell;
- }
- Shell result = BindingScenariosTestSuite.getShell();
- if (result == null) {
- display = Display.getDefault();
- if (Display.getDefault() == null) {
- display = new Display();
- disposeDisplay = true;
- }
- shell = new Shell(display, SWT.SHELL_TRIM);
- shell.setLayout(new FillLayout());
- result = shell;
- }
- result.setText(getName()); // In the case that the shell() becomes
- // visible.
- return result;
- }
-
- protected void spinEventLoop(int secondsToWaitWithNoEvents) {
- if (!composite.isVisible() && secondsToWaitWithNoEvents > 0) {
- composite.getShell().open();
- }
- while (composite.getDisplay().readAndDispatch()) {
- // do nothing, just process events
- }
- try {
- Thread.sleep(secondsToWaitWithNoEvents * 1000);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- }
- }
-
- protected void interact() {
- if (!getShell().isVisible()) {
- getShell().open();
- }
- while (!getShell().isDisposed()) {
- if (!getShell().getDisplay().readAndDispatch()) {
- getShell().getDisplay().sleep();
- }
- }
- }
-
- protected void setButtonSelectionWithEvents(Button button, boolean value) {
- if (button.getSelection() == value) {
- return;
- }
- button.setSelection(value);
- pushButtonWithEvents(button);
- }
-
- protected void pushButtonWithEvents(Button button) {
- button.notifyListeners(SWT.Selection, null);
- }
-
- protected void setUp() throws Exception {
- realm = SWTObservables.getRealm(Display.getDefault());
- RealmTester.setDefault(realm);
-
- composite = new Composite(getShell(), SWT.NONE);
- composite.setLayout(new FillLayout());
- SampleData.initializeData(); // test may manipulate the data... let
- // all start from fresh
- dbc = new DataBindingContext();
- dummyText = new Text(getComposite(), SWT.NONE);
- dummyText.setText("dummy");
- }
-
- protected void tearDown() throws Exception {
- realm = null;
- getShell().setVisible(false); // same Shell may be reUsed across tests
- composite.dispose();
- composite = null;
- if (shell != null) {
- shell.close();
- shell.dispose();
- } else
- dbc.dispose();
- if (display != null && disposeDisplay) {
- display.dispose();
- }
- }
-
- protected void enterText(Text text, String string) {
- text.notifyListeners(SWT.FocusIn, null);
- text.setText(string);
- text.notifyListeners(SWT.FocusOut, null);
- }
-
- protected void assertArrayEquals(Object[] expected, Object[] actual) {
- assertEquals(Arrays.asList(expected), Arrays.asList(actual));
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/SpinnerControlScenario.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/SpinnerControlScenario.java
deleted file mode 100644
index b1d2ad2..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/SpinnerControlScenario.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Spinner;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class SpinnerControlScenario extends ScenariosTestCase {
-
- private Adventure adventure;
-
- protected void setUp() throws Exception {
- super.setUp();
- // do any setup work here
- adventure = SampleData.WINTER_HOLIDAY;
- }
-
- protected void tearDown() throws Exception {
- // do any teardown work here
- super.tearDown();
- }
-
- public void testScenario01() {
- // Bind the adventure "maxNumberOfPeople" property to a spinner
- // Change the UI and verify the model changes
- // Change the model and verify the UI changes
- Spinner spinner = new Spinner(getComposite(), SWT.BORDER);
- getDbc().bindValue(SWTObservables.observeSelection(spinner),
- BeansObservables.observeValue(adventure, "maxNumberOfPeople"),
- null, null);
-
- assertEquals(adventure.getMaxNumberOfPeople(), spinner.getSelection());
- // Verify the model is updated when the GUI is changed
- spinner.setSelection(5);
- assertEquals(5, adventure.getMaxNumberOfPeople());
- // Verify the GUI is updated when the model changes
- adventure.setMaxNumberOfPeople(7);
- assertEquals(7, spinner.getSelection());
- adventure.setMaxNumberOfPeople(11);
- spinEventLoop(0);
- assertEquals(11, spinner.getSelection());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TableScenarios.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TableScenarios.java
deleted file mode 100644
index 70c38ac..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TableScenarios.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- * Brad Reynolds - bug 160000
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.examples.databinding.model.Account;
-import org.eclipse.jface.examples.databinding.model.Catalog;
-import org.eclipse.jface.examples.databinding.model.Category;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class TableScenarios extends ScenariosTestCase {
-
- private TableViewer tableViewer;
-
- private Catalog catalog;
-
- Category category;
-
- private TableColumn firstNameColumn;
-
- private TableColumn lastNameColumn;
-
- private TableColumn stateColumn;
-
- Image[] images;
-
- private TableColumn fancyColumn;
-
- protected void setUp() throws Exception {
- super.setUp();
- getComposite().setLayout(new FillLayout());
- tableViewer = new TableViewer(getComposite());
- tableViewer.getTable().setLinesVisible(true);
- tableViewer.getTable().setHeaderVisible(true);
- firstNameColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
- firstNameColumn.setWidth(50);
- lastNameColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
- lastNameColumn.setWidth(50);
- stateColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
- stateColumn.setWidth(50);
- fancyColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
- fancyColumn.setWidth(250);
-
- catalog = SampleData.CATALOG_2005; // Lodging source
- category = SampleData.WINTER_CATEGORY;
-
- images = new Image[] {
- getShell().getDisplay().getSystemImage(SWT.ICON_ERROR),
- getShell().getDisplay().getSystemImage(SWT.ICON_WARNING),
- getShell().getDisplay().getSystemImage(SWT.ICON_INFORMATION), };
- }
-
- protected void tearDown() throws Exception {
- // do any teardown work here
- super.tearDown();
- tableViewer.getTable().dispose();
- tableViewer = null;
- firstNameColumn = null;
- lastNameColumn = null;
- stateColumn = null;
- }
-
- public void testScenario01() {
- // Show that a TableViewer with three columns renders the accounts
- Account[] accounts = catalog.getAccounts();
-
- IObservableList list = new WritableList(new ArrayList(), Account.class);
- list.addAll(Arrays.asList(accounts));
-
- ObservableListContentProvider contentProvider = new ObservableListContentProvider();
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- contentProvider.getKnownElements(), Account.class,
- new String[] { "firstName", "lastName", "state" });
-
- tableViewer.setContentProvider(contentProvider);
- tableViewer.setLabelProvider(new ObservableMapLabelProvider(
- attributeMaps));
- tableViewer.setInput(list);
-
- Table table = tableViewer.getTable();
-
- // Verify the data in the table columns matches the accounts
- for (int i = 0; i < accounts.length; i++) {
- Account account = catalog.getAccounts()[i];
- TableItem item = table.getItem(i);
-
- assertEquals(account.getFirstName(), item.getText(0));
- assertEquals(account.getLastName(), item.getText(1));
- assertEquals(account.getState(), item.getText(2));
- }
- }
-
- public void testScenario02() throws SecurityException,
- IllegalArgumentException {
- // Show that a TableViewer with three columns can be used to update
- // columns
- // Account[] accounts = catalog.getAccounts();
- //
- // TableModelDescription tableModelDescription = new
- // TableModelDescription(new Property(catalog, "accounts"), new
- // String[]{"firstName","lastName","state"});
- // // tableViewerDescription.addEditableColumn("firstName");
- // // tableViewerDescription.addEditableColumn("lastName", null, null,
- // new PhoneConverter());
- // // tableViewerDescription.addEditableColumn("state", null, null, new
- // StateConverter());
- // getDbc().bind(tableViewer,
- // tableModelDescription, null);
- //
- // Account account = accounts[0];
- // // Select the first item in the table
- // tableViewer.editElement(account, 0);
- // // Set the text property of the cell editor which is now active over
- // the "firstName" column
- // CellEditor[] cellEditors = tableViewer.getCellEditors();
- // TextCellEditor firstNameEditor = (TextCellEditor) cellEditors[0];
- // // Change the firstName and test it goes to the model
- // enterText((Text) firstNameEditor.getControl(), "Bill");
- // // Check whether the model has changed
- // assertEquals("Bill",account.getFirstName());
- }
-
- public void testScenario04() {
- // // Show that when an item is added to a collection the table gets an
- // extra item
- // Account[] accounts = catalog.getAccounts();
- //
- // TableViewerDescription tableViewerDescription = new
- // TableViewerDescription(
- // tableViewer);
- // tableViewerDescription.addColumn("firstName");
- // tableViewerDescription.addColumn("lastName");
- // tableViewerDescription.addColumn("state");
- // tableViewerDescription.addColumn(null,new IConverter(){
- //
- // public Class getModelType() {
- // return Account.class;
- // }
- //
- // public Class getTargetType() {
- // return ViewerLabel.class;
- // }
- //
- // public Object convertTargetToModel(Object targetObject) {
- // return null;
- // }
- //
- // public Object convertModelToTarget(Object modelObject) {
- // Account account = (Account) modelObject;
- // return new ViewerLabel(account.toString(), images[new
- // Random().nextInt(images.length)]);
- // }});
- // getDbc().bind(tableViewerDescription,
- // new Property(catalog, "accounts"), null);
- //
- // //interact();
- //
- // // Verify the number of accounts matches the number of items in the
- // table
- // assertEquals(tableViewer.getTable().getItemCount(),accounts.length);
- // // Add a new account and verify that the number of items in the table
- // increases
- // Account newAccount = new Account();
- // newAccount.setFirstName("Finbar");
- // newAccount.setLastName("McGoo");
- // newAccount.setLastName("NC");
- // catalog.addAccount(newAccount);
- // // The number of items should have gone up by one
- // assertEquals(tableViewer.getTable().getItemCount(),accounts.length +
- // 1);
- // // The number of items should still match the number of accounts
- // (i.e. test the model)
- // assertEquals(tableViewer.getTable().getItemCount(),catalog.getAccounts().length);
- // // Remove the account that was just added
- // catalog.removeAccount(newAccount);
- // // The number of items should match the original
- // assertEquals(tableViewer.getTable().getItemCount(),accounts.length);
- // // The number of items should still match the number of accounts
- // (i.e. test the model is reset)
- // assertEquals(tableViewer.getTable().getItemCount(),catalog.getAccounts().length);
- //
- // // Test adding and removing to the model on a non UI thread
- // int numberOfAccounts = catalog.getAccounts().length;
- // final Account barney = new Account();
- // barney.setFirstName("Barney");
- // barney.setLastName("Smith");
- // barney.setLastName("CA");
- // invokeNonUI(new Runnable(){
- // public void run(){
- // catalog.addAccount(barney);
- // }
- // });
- // spinEventLoop(0);
- // // The number of items should have gone up by one
- // assertEquals(tableViewer.getTable().getItemCount(),numberOfAccounts +
- // 1);
- //
- // invokeNonUI(new Runnable(){
- // public void run(){
- // catalog.removeAccount(barney);
- // }
- // });
- // spinEventLoop(0);
- // // The number of items should have reverted to the original number
- // before barney was added and removed
- // assertEquals(tableViewer.getTable().getItemCount(),numberOfAccounts);
- //
- }
-
- public void testScenario03() {
- // // Show that converters work for table columns
- // Account[] accounts = catalog.getAccounts();
- //
- // TableViewerDescription tableViewerDescription = new
- // TableViewerDescription(
- // tableViewer);
- // tableViewerDescription.addEditableColumn("lastName");
- // tableViewerDescription.addEditableColumn("phone", null, null ,
- // new PhoneConverter());
- // tableViewerDescription.addEditableColumn("state", null, null ,
- // new StateConverter());
- // getDbc().bind(tableViewerDescription,
- // new Property(catalog, "accounts"), null);
- //
- // // Verify that the data in the the table columns matches the expected
- // // What we are looking for is that the phone numbers are converterted
- // to
- // // nnn-nnn-nnnn and that
- // // the state letters are converted to state names
- // // Verify the data in the table columns matches the accounts
- // PhoneConverter phoneConverter = new PhoneConverter();
- // StateConverter stateConverter = new StateConverter();
- // for (int i = 0; i < accounts.length; i++) {
- // Account account = catalog.getAccounts()[i];
- // // Check the phone number
- // String col_phone = ((ITableLabelProvider) tableViewer
- // .getLabelProvider()).getColumnText(account, 1);
- // assertEquals(getValue((String)phoneConverter
- // .convertModelToTarget(account.getPhone())), col_phone);
- // String col_state = ((ITableLabelProvider) tableViewer
- // .getLabelProvider()).getColumnText(account, 2);
- // assertEquals(getValue((String)stateConverter
- // .convertModelToTarget(account.getState())), col_state);
- // }
- }
-
- public void testScenario05() {
- // // Show that when the model changes then the UI refreshes to reflect
- // this
- //
- // TableViewerDescription tableViewerDescription = new
- // TableViewerDescription(
- // tableViewer);
- // tableViewerDescription.addColumn("lastName");
- // tableViewerDescription.addColumn("phone",
- // new PhoneConverter());
- // tableViewerDescription.addColumn("state",
- // new StateConverter());
- // getDbc().bind(tableViewerDescription,
- // new Property(catalog, "accounts"), null);
- //
- // final Account account = catalog.getAccounts()[0];
- // String lastName = tableViewer.getTable().getItem(0).getText(0);
- // // Check the firstName in the TableItem is the same as the model
- // assertEquals(lastName,account.getLastName());
- // // Now change the model and check again
- // account.setLastName("Gershwin");
- // lastName = tableViewer.getTable().getItem(0).getText(0);
- // assertEquals(lastName,account.getLastName());
- //
- // // Test the model update on a non UI thread
- // invokeNonUI(new Runnable(){
- // public void run(){
- // account.setLastName("Mozart");
- // }
- // });
- // spinEventLoop(0);
- // lastName = tableViewer.getTable().getItem(0).getText(0);
- // assertEquals(lastName,account.getLastName());
- //
- }
-
- public void testScenario06() {
- // // Check that explicit type means that defaulting of converters works
- // TableViewerDescription tableViewerDescription = new
- // TableViewerDescription(
- // tableViewer);
- // tableViewerDescription.addEditableColumn("price");
- // tableViewerDescription.getColumn(0).setPropertyType(Double.TYPE);
- // getDbc().bind(tableViewerDescription,
- // new Property(catalog, "transporations"), null);
- // Transportation transporation = catalog.getTransporations()[0];
- // tableViewer.editElement(transporation, 0);
- // // Set the text property of the cell editor which is now active over
- // the "firstName" column
- // CellEditor[] cellEditors = tableViewer.getCellEditors();
- // TextCellEditor priceEditor = (TextCellEditor) cellEditors[0];
- // // Change the firstName and test it goes to the model
- // enterText((Text) priceEditor.getControl(), "123.45");
- // // Verify the model is updated
- // assertEquals(transporation.getPrice(),123.45,0);
-
- }
-
- public void testScenario07() {
- // // Verify that even when a column's property type is not set, that it
- // is worked out lazily from the target type
- // TableViewerDescription tableViewerDescription = new
- // TableViewerDescription(
- // tableViewer);
- // tableViewerDescription.addEditableColumn("price");
- // // The column's type is not set to be Double.TYPE. This will be
- // inferred once the first Transportation object is set
- // // into the ObservableCollection
- // getDbc().bind(tableViewerDescription,
- // new Property(catalog, "transporations"), null);
- // Transportation transporation = catalog.getTransporations()[0];
- // tableViewer.editElement(transporation, 0);
- // // Set the text property of the cell editor which is now active over
- // the "firstName" column
- // CellEditor[] cellEditors = tableViewer.getCellEditors();
- // TextCellEditor priceEditor = (TextCellEditor) cellEditors[0];
- // // Change the firstName and test it goes to the model
- // enterText((Text) priceEditor.getControl(), "123.45");
- // // Verify the model is updated
- // assertEquals(transporation.getPrice(),123.45,0);
- //
- }
-
- public void testScenario08_00() {
- // // Verify that binding to a Collection property (rather than an
- // array) works when specifying data type
- // TableViewerDescription tableViewerDescription = new
- // TableViewerDescription(
- // tableViewer);
- // tableViewerDescription.addEditableColumn("userId");
- // tableViewerDescription.addEditableColumn("password");
- // getDbc().bind(tableViewerDescription,
- // new Property(catalog, "signons", Signon.class, null), null);
- // Signon firstSignon = (Signon) catalog.getSignons().get(0);
- // // Verify the UI matches the model
- // TableItem firstTableItem = tableViewer.getTable().getItem(0);
- // assertEquals(firstTableItem.getText(1),firstSignon.getPassword());
- // // Change the model and ensure the UI refreshes
- // firstSignon.setPassword("Eclipse123Rocks");
- // assertEquals("Eclipse123Rocks",firstSignon.getPassword());
- // assertEquals(firstTableItem.getText(1),firstSignon.getPassword());
- // // Change the GUI and ensure the model refreshes
- // tableViewer.editElement(firstSignon, 1);
- // CellEditor[] cellEditors = tableViewer.getCellEditors();
- // TextCellEditor passwordEditor = (TextCellEditor) cellEditors[1];
- // enterText((Text) passwordEditor.getControl(), "Cricket11Players");
- // assertEquals("Cricket11Players",firstSignon.getPassword());
- //
- }
-
- public void testScenario08_01() {
- // // Verify that binding to a Collection property (rather than an
- // array) works without specifying data type
- // TableViewerDescription tableViewerDescription = new
- // TableViewerDescription(
- // tableViewer);
- // tableViewerDescription.addEditableColumn("userId");
- // tableViewerDescription.addEditableColumn("password");
- // getDbc().bind(tableViewerDescription,
- // new Property(catalog, "signons"), null);
- // Signon firstSignon = (Signon) catalog.getSignons().get(0);
- // // Verify the UI matches the model
- // TableItem firstTableItem = tableViewer.getTable().getItem(0);
- // assertEquals(firstTableItem.getText(1),firstSignon.getPassword());
- // // Change the model and ensure the UI refreshes
- // firstSignon.setPassword("Eclipse123Rocks");
- // assertEquals("Eclipse123Rocks",firstSignon.getPassword());
- // assertEquals(firstTableItem.getText(1),firstSignon.getPassword());
- // // Change the GUI and ensure the model refreshes
- // tableViewer.editElement(firstSignon, 1);
- // CellEditor[] cellEditors = tableViewer.getCellEditors();
- // TextCellEditor passwordEditor = (TextCellEditor) cellEditors[1];
- // enterText((Text) passwordEditor.getControl(), "Cricket11Players");
- // assertEquals("Cricket11Players",firstSignon.getPassword());
- //
- }
-
- public void testScenario09() {
- // // Verify that nested properties work. Catalog has adventures.
- // Adventure has defaultLodging. Loding has name.
- // TableViewerDescription tableViewerDescription = new
- // TableViewerDescription(tableViewer);
- // tableViewerDescription.addColumn("name");
- // tableViewerDescription.addColumn("defaultLodging.name");
- // getDbc().bind(tableViewerDescription,new Property(category,
- // "adventures"),null);
- //
- }
- /**
- * public void testScenario10(){ // Verify that for TIME_EARLY updating
- * occurs on a per key basic for a TextCellEditor // Show that converters
- * work for table columns Account[] accounts = catalog.getAccounts();
- * Account firstAccount = accounts[0];
- * SampleData.getSWTObservableFactory().setUpdateTime(DataBindingContext.TIME_EARLY);
- * TableViewerDescription tableViewerDescription = new
- * TableViewerDescription(tableViewer);
- * tableViewerDescription.addEditableColumn("lastName");
- * tableViewerDescription.addColumn("lastName");
- * getDbc().bind(tableViewerDescription,new Property(catalog, "accounts"),
- * null); // Verify that the first account is shown in the first row with
- * the last name correctly
- * assertEquals(tableViewer.getTable().getItem(0).getData(),firstAccount);
- * assertEquals(tableViewer.getTable().getItem(0).getText(0),firstAccount.getLastName());
- * assertEquals(tableViewer.getTable().getItem(0).getText(1),firstAccount.getLastName()); //
- * Create a cell editor over the first column
- * tableViewer.editElement(firstAccount, 0); // Set the text property of the
- * cell editor which is now active over the "firstName" column CellEditor[]
- * cellEditors = tableViewer.getCellEditors(); TextCellEditor
- * lastNameCellEditor = (TextCellEditor) cellEditors[0];
- * ((Text)lastNameCellEditor.getControl()).setText("E"); // Verify that the
- * key press goes to the model assertEquals(firstAccount.getLastName(),"E"); }
- */
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TextControlScenario.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TextControlScenario.java
deleted file mode 100644
index 72a0646..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TextControlScenario.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.databinding.scenarios;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.examples.databinding.model.Account;
-import org.eclipse.jface.examples.databinding.model.Adventure;
-import org.eclipse.jface.examples.databinding.model.SampleData;
-import org.eclipse.jface.examples.databinding.model.Transportation;
-import org.eclipse.jface.tests.databinding.BindingTestSuite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-import com.ibm.icu.text.NumberFormat;
-
-/**
- * To run the tests in this class, right-click and select "Run As JUnit Plug-in
- * Test". This will also start an Eclipse instance. To clean up the launch
- * configuration, open up its "Main" tab and select "[No Application] - Headless
- * Mode" as the application to run.
- */
-
-public class TextControlScenario extends ScenariosTestCase {
-
- private Text text;
-
- private Adventure adventure;
-
- private Transportation transportation;
-
- Account account;
-
- protected void setUp() throws Exception {
- super.setUp();
- // do any setup work here
- adventure = SampleData.WINTER_HOLIDAY;
- transportation = SampleData.EXECUTIVE_JET;
- account = SampleData.PRESIDENT;
- text = new Text(getComposite(), SWT.BORDER);
- }
-
- protected void tearDown() throws Exception {
- text.dispose();
- text = null;
- super.tearDown();
- }
-
- public void testScenario01() {
- // Bind the adventure "name" property to a text field
- // Change the UI and verify the model changes
- // Change the model and verify the UI changes
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(adventure, "name"),
- null, null);
-
- assertEquals(adventure.getName(), text.getText());
- text.setText("England");
- text.notifyListeners(SWT.FocusOut, null);
- assertEquals("England", adventure.getName());
- adventure.setName("France");
- assertEquals("France", text.getText());
- adventure.setName("Germany");
- spinEventLoop(0);
- assertEquals("Germany", text.getText());
- }
-
- public void testScenario02() {
-
- // Bind the transportation "price" property to a text field
- // This is a Double.TYPE so we check that conversion and validation
- // occurs
- // Change the UI and verify the model changes
- // Change the model and verify the UI changes
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(transportation, "price"),
- null, null);
-
- NumberFormat numberFormat = NumberFormat.getInstance();
-
- assertEquals(numberFormat.format(transportation.getPrice()), text.getText());
- text.setText("9876.54");
- text.notifyListeners(SWT.FocusOut, null);
- assertEquals(9876.54, transportation.getPrice(), 0);
-
- transportation.setPrice(1234.56);
- assertEquals(numberFormat.format(transportation.getPrice()), text.getText());
- }
-
- public void testScenario03() {
- // Show that the Escape key can be pressed in the middle of editing and
- // the value will revert
- // the updatePolicy for this test is TIME_LATE so it occurs when focus
- // is lost from the Text control
- getDbc().bindValue(SWTObservables.observeText(text, SWT.FocusOut),
- BeansObservables.observeValue(adventure, "name"),
- null, null);
-
- String currentText = text.getText();
- text.setText("Switzerland");
- // We do not notify FocusOut
- // Verify that the model hasn't changed
- assertEquals(currentText, adventure.getName());
- Event event = new Event();
- event.character = SWT.ESC;
- event.keyCode = 27;
- text.notifyListeners(SWT.KeyDown, event);
- // Verify that the text has reverted
- assertEquals(currentText, text.getText());
- // And that the model didn't change
- assertEquals(adventure.getName(), currentText);
- // Now change the GUI and commit this change
- currentText = "Austria";
- text.setText(currentText);
- text.notifyListeners(SWT.FocusOut, null);
- assertEquals(text.getText(), adventure.getName());
- // Now change the text again and press escape a second time
- text.setText("Turkey");
- // Send escape
- text.notifyListeners(SWT.KeyDown, event);
- // Verify it has reverted to "Austria" and not any other value, i.e. the
- // last value it displayed
- assertEquals(currentText, text.getText());
-
- }
-
- public void testScenario04() {
- // Show that the Escape key can be pressed in the middle of editing and
- // the value will revert
- // the updatePolicy for this test is TIME_EARLY so it occurs when each
- // keystroke occurs
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(adventure, "name"),
- null, null);
-
- String originalName = adventure.getName();
- // Change the text field character by character and ensure that the
- // model changes
- String newName = "Switzerland";
- for (int i = 0; i < newName.length(); i++) {
- text.setText(newName.substring(0, i + 1));
- // Verify the model has changed
- assertEquals(newName.substring(0, i + 1), adventure.getName());
- }
- // Now send an escape key and verify that the model reverts
- Event event = new Event();
- event.character = SWT.ESC;
- event.keyCode = 27;
- text.notifyListeners(SWT.KeyDown, event);
- assertEquals(adventure.getName(), originalName);
- // Now send "Austria" key by key
- newName = "Austria";
- for (int i = 0; i < newName.length(); i++) {
- text.setText(newName.substring(0, i + 1));
- // Verify the model has changed
- assertEquals(newName.substring(0, i + 1), adventure.getName());
- }
- // Send a focus lost event to commit the change
- text.notifyListeners(SWT.FocusOut, null);
- // Send an escape key
- text.notifyListeners(SWT.KeyDown, event);
- // Verify that the model has changed and has not reverted
- assertEquals(newName, adventure.getName());
- }
-
- /**
- * public void testScenario05(){ // Show that nesting of properties works.
- * Adventure has defaultLodging and Lodging has name getDbc().bind(text,new
- * Property(adventure,"defaultLodging.name"),null); // Verify the GUI is
- * showing the model value
- * assertEquals(text.getText(),adventure.getDefaultLodging().getName()); }
- */
- public void testScenario06() {
- // // Show that partial validation works for TIME_EARLY
- // // We are using TIME_EARLY to verify that invalid states are not sent
- // to the model
- // getSWTObservableFactory().setUpdateTime(DataBindingContext.TIME_EARLY);
- // getDbc().bind(text, new Property(account, "phone"), new BindSpec(new
- // PhoneConverter(),new PhoneValidator()));
- // // Verify we have no error message for partial validation or full
- // validation yet
- // assertTrue(((String)getDbc().getPartialValidationMessage().getValue()).length()
- // == 0);
- // assertTrue(((String)getDbc().getValidationMessage().getValue()).length()
- // == 0);
- // // Update some of the phone number
- // String originalPhoneNumber = account.getPhone();
- // text.setText("999");
- // // Verify that the phone number is partially invalid and there is no
- // validation message
- // assertTrue(((String)getDbc().getPartialValidationMessage().getValue()).length()
- // > 0);
- // assertTrue(((String)getDbc().getValidationMessage().getValue()).length()
- // == 0);
- // // And that the model has not changed
- // assertEquals(account.getPhone(),originalPhoneNumber);
- // // Verify that fixing the phone removes the error and the model is
- // updated too
- // text.setText("999-888-7777");
- // assertTrue(((String)getDbc().getPartialValidationMessage().getValue()).length()
- // == 0);
- // assertEquals(account.getPhone(),"9998887777");
- }
-
- public void testScenario07() {
- // // Show that partial validation works for TIME_LATE
- // getSWTObservableFactory().setUpdateTime(DataBindingContext.TIME_LATE);
- // getDbc().bind(text, new Property(account, "phone"), new BindSpec(new
- // PhoneConverter(),new PhoneValidator()));
- // // Update some of the phone number
- // String originalPhoneNumber = account.getPhone();
- // text.setText("222");
- // // Verify that we have no completion validation message and a partial
- // one
- // assertTrue(((String)getDbc().getPartialValidationMessage().getValue()).length()
- // > 0);
- // assertTrue(((String)getDbc().getValidationMessage().getValue()).length()
- // == 0);
- // // Fix the error
- // text.setText("222-333-4444");
- // // Verify that the errors are both fixed
- // assertTrue(((String)getDbc().getPartialValidationMessage().getValue()).length()
- // == 0);
- // assertTrue(((String)getDbc().getValidationMessage().getValue()).length()
- // == 0);
- // // The model should not be changed
- // assertEquals(originalPhoneNumber,account.getPhone());
- // // Lose focus and verify that the complete validation message is
- // fixed
- // text.notifyListeners(SWT.FocusOut,null);
- // assertTrue(((String)getDbc().getValidationMessage().getValue()).length()
- // == 0);
- // // The model should be changed
- // assertEquals("2223334444",account.getPhone());
- }
-
- public void testScenario08() {
-
- if (BindingTestSuite.failingTestsDisabled(this)) {
- return;
- }
-
- // Show that the CustomBeanBindSupportFactory will automatically pick up
- // the
- // validator on the MaxNumberOfPeople property
-
- DataBindingContext dbc = getDbc();
-
- dbc.bindValue(SWTObservables.observeText(text, SWT.Modify),
- BeansObservables.observeValue(adventure, "maxNumberOfPeople"),
- new CustomBeanUpdateValueStrategy(), null);
-
- // make sure we can set a value inside the validator's range
- text.setText("4");
- assertEquals(4, adventure.getMaxNumberOfPeople());
- // Now try to set a value outside the validator's range
- text.setText("999");
- assertEquals(4, adventure.getMaxNumberOfPeople());
- dbc.dispose();
- }
-
- public void testScenario09() {
- // Verify direct binding between a Text and Label following bugzilla
- // 118696
- Label label = new Label(getComposite(), SWT.NONE);
- getDbc().bindValue(SWTObservables.observeText(text, SWT.FocusOut), SWTObservables.observeText(label), null, null);
-
- // Change the text
- text.setText("Frog");
- // Verify the label does not change
- assertTrue(label.getText().length() == 0);
- // Lose focus from the text field
- text.notifyListeners(SWT.FocusOut, null);
- assertEquals(label.getText(), "Frog");
-
- }
-
- public void testScenario10() {
- // Verify direct binding between a Text and Label following bugzilla
- // 118696 with TIME_EARLY
- Label label = new Label(getComposite(), SWT.NONE);
- getDbc().bindValue(SWTObservables.observeText(text, SWT.Modify), SWTObservables.observeText(label), null, null);
-
- // Change the text
- String newTextValue = "Frog";
- for (int i = 0; i < newTextValue.length(); i++) {
- text.setText(newTextValue.substring(0, i + 1));
- // Verify the label has changed key by key
- assertEquals(text.getText(), label.getText());
- }
- // Lose focus
- text.notifyListeners(SWT.FocusOut, null);
- // Verify the text and label are the same following a lose focus
- assertEquals(text.getText(), label.getText());
- }
-
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/smoketest/swt.xswt b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/smoketest/swt.xswt
deleted file mode 100644
index 0097d63..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/smoketest/swt.xswt
+++ /dev/null
@@ -1,301 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xswt xmlns:x="http://sweet_swt.sf.net/xswt">
- <import xmlns="http://sweet_swt.sf.net/xswt">
- <package name="java.lang"/>
- <package name="org.eclipse.swt.widgets"/>
- <package name="org.eclipse.swt.custom"/>
- <package name="org.eclipse.swt.layout"/>
- </import>
-
- <!-- An XSWT example that uses nearly every SWT control and uses the new
- syntax wherever possible.
-
- Get XSWT at:
-
- http://xswt.sourceforge.net/updates
-
- then choose Window | Show View | Other... | XSWT Views | XSWT Preview -->
-
- <layout x:class="gridLayout"/>
-
- <label text="SWT Controls:"/>
- <tabFolder>
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" horizontalAlignment="GridData.FILL" verticalAlignment="GridData.FILL"/>
-
- <composite x:id="Text">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <composite x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" verticalAlignment="GridData.FILL" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <label text="Integer:"/><text x:style="BORDER" x:id="intText" text="1"/>
- <label text="Float:"/><text x:style="BORDER" x:id="floatText" text="1.0"/>
- <label text="String:"/><text x:style="BORDER" x:id="stringText" text="The quick brown fox jumped over the lazy dog."/>
- <label text="RegexValidated String:"/><text x:style="BORDER" x:id="regexStringText" text="The quick brown fox jumped over the lazy dog."/>
- <label text="Masked String:"/><text x:style="BORDER" x:id="maskedStringText" background="208 128 128"/>
- </composite>
- <slider x:style="VERTICAL" x:id="buttonScroller">
- <layoutData x:class="gridData" verticalAlignment="GridData.FILL"/>
- </slider>
- </composite>
- <tabItem text="Text" control="Text"/>
-
- <composite x:id="Labels">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <composite x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" verticalAlignment="GridData.FILL" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <label text="Label with text"/>
- <label text="Label with image"/>
- <label text="Label with text and image"/>
- <label x:style="SEPARATOR | HORIZONTAL"><layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/></label>
- <cLabel text="CLabel with text"/>
- <cLabel text="CLabel with image"/>
- <cLabel text="CLabel with text and image"/>
- </composite>
- <slider x:style="VERTICAL" x:id="textScroller"/>
- </composite>
- <tabItem text="Label / CLabel" control="Labels"/>
-
- <composite x:id="Button">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <composite x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" verticalAlignment="GridData.FILL" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <label text="Push:"/><button x:id="pushButton" text="PushButton"/>
- <label text="Arrow:"/><button x:id="arrowButton" x:style="ARROW" text="ArrowButton"/>
- <label text="Toggle:"/><button x:id="toggleButton" x:style="TOGGLE" text="ToggleButton"/>
- <label text="Check:"/><button x:style="CHECK" x:id="checkButton" text="CheckBox"/>
- <label text="Radio Group 1:"/>
- <composite x:style="BORDER" x:id="radioGroup1">
- <layoutData x:class="gridData" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <button x:style="RADIO" x:id="radioButton0.1" text="Radio"/>
- <button x:style="RADIO" x:id="radioButton0.2" text="Radio2" selection="true"/>
- <button x:style="RADIO" x:id="radioButton0.3" text="Radio3"/>
- </composite>
- <label text="Radio Group 2:"/>
- <composite x:style="BORDER" x:id="radioGroup2">
- <layoutData x:class="gridData" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <button x:style="RADIO" x:id="radioButton1.1" text="Radio"/>
- <button x:style="RADIO" x:id="radioButton1.2" text="Radio2"/>
- <button x:style="RADIO" x:id="radioButton1.3" text="Radio3"/>
- </composite>
- </composite>
- <slider x:style="VERTICAL" x:id="1buttonScroller">
- <layoutData x:class="gridData" verticalAlignment="GridData.FILL"/>
- </slider>
- </composite>
- <tabItem text="Button" control="Button"/>
-
- <composite x:id="List">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <composite>
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL" grabExcessVerticalSpace="true" verticalAlignment="GridData.FILL"/>
- <layout x:class="fillLayout" type="VERTICAL"/>
-
- <list x:style="BORDER | V_SCROLL | MULTI"/>
- <list x:style="BORDER | V_SCROLL"/>
- </composite>
- </composite>
- <tabItem text="List" control="List"/>
-
- <composite x:id="Combos">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <composite x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" verticalAlignment="GridData.FILL" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <combo>
- <add x:p0="item1"/>
- <add x:p0="item2"/>
- <add x:p0="item3"/>
- </combo>
- <combo x:style="SIMPLE">
- <add x:p0="item1"/>
- <add x:p0="item2"/>
- <add x:p0="item3"/>
- </combo>
- <combo x:style="READ_ONLY">
- <add x:p0="item1"/>
- <add x:p0="item2"/>
- <add x:p0="item3"/>
- </combo>
- <label x:style="SEPARATOR | HORIZONTAL"><layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/></label>
- <cCombo>
- <add x:p0="item1"/>
- <add x:p0="item2"/>
- <add x:p0="item3"/>
- </cCombo>
- <cCombo x:style="READ_ONLY" background="255 255 255">
- <add x:p0="item1"/>
- <add x:p0="item2"/>
- <add x:p0="item3"/>
- </cCombo>
- </composite>
- <slider x:style="VERTICAL" x:id="2buttonScroller">
- <layoutData x:class="gridData" verticalAlignment="GridData.FILL"/>
- </slider>
- </composite>
- <tabItem text="Combo / CCombo" control="Combos"/>
-
- <composite x:id="Table">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <composite x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" horizontalAlignment="GridData.FILL" verticalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <table x:style="BORDER" linesVisible="true" headerVisible="true">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" horizontalAlignment="GridData.FILL" verticalAlignment="GridData.FILL"/>
-
- <tableColumn width="50" text="Done"/>
- <tableColumn width="200" text="Description"/>
- <tableColumn width="60" text="Planned"/>
- <tableColumn width="60" text="Revised"/>
- <tableColumn width="60" text="Actual"/>
- <!--<tableItem/>-->
- </table>
- </composite>
- </composite>
- <tabItem text="Table" control="Table"/>
-
- <composite x:id="Tree">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <composite x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" horizontalAlignment="GridData.FILL" verticalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <tree x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" horizontalAlignment="GridData.FILL" verticalAlignment="GridData.FILL"/>
-
- <treeItem text="item">
- <x:children>
- <treeItem text="item"/>
- <treeItem text="item"/>
- <treeItem text="item">
- <x:children>
- <treeItem text="item"/>
- <treeItem text="item"/>
- <treeItem text="item"/>
- <treeItem text="item"/>
- <treeItem text="item"/>
- </x:children>
- </treeItem>
- <treeItem text="item"/>
- </x:children>
- </treeItem>
- <treeItem text="item with Image (or at least needs one)">
- <x:children>
- <treeItem text="item"/>
- <treeItem text="item"/>
- </x:children>
- </treeItem>
- <treeItem text="Another item">
- <x:children>
- <treeItem text="item"/>
- <treeItem text="item"/>
- <treeItem text="item"/>
- <treeItem text="item"/>
- <treeItem text="item"/>
- </x:children>
- </treeItem>
- </tree>
- </composite>
- </composite>
- <tabItem text="Tree" control="Tree"/>
-
- <composite x:id="TableTree">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <composite x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" horizontalAlignment="GridData.FILL" verticalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <tableTree x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" horizontalAlignment="GridData.FILL" verticalAlignment="GridData.FILL"/>
-
- <tableTreeItem text="item">
- <x:children>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- </x:children>
- </tableTreeItem>
- <tableTreeItem text="item">
- <x:children>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- </x:children>
- </tableTreeItem>
- <tableTreeItem text="item">
- <x:children>
- <tableTreeItem text="item">
- <x:children>
- <tableTreeItem text="subitem"/>
- </x:children>
- </tableTreeItem>
- <tableTreeItem text="item">
- <x:children>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- </x:children>
- </tableTreeItem>
- <tableTreeItem text="item">
- <x:children>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- <tableTreeItem text="subitem"/>
- </x:children>
- </tableTreeItem>
- </x:children>
- </tableTreeItem>
- </tableTree>
- </composite>
- </composite>
- <tabItem text="TableTree" control="TableTree"/>
-
- <composite x:id="Progress">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="2"/>
-
- <composite x:style="BORDER">
- <layoutData x:class="gridData" grabExcessHorizontalSpace="true" verticalAlignment="GridData.FILL" horizontalAlignment="GridData.FILL"/>
- <layout x:class="gridLayout" numColumns="1"/>
-
- <progressBar x:style="INDETERMINATE"/>
- <progressBar x:style="INDETERMINATE | SMOOTH"/>
- <progressBar x:style="SMOOTH" minimum="0" maximum="100" selection="40"/>
- <progressBar minimum="0" maximum="100" selection="60"/>
- </composite>
- <slider x:style="VERTICAL" x:id="3textScroller"/>
- </composite>
- <tabItem text="ProgressBar" control="Progress"/>
-
- </tabFolder>
-</xswt>
-
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AbstractGetAndSetSelectionObservableCollectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AbstractGetAndSetSelectionObservableCollectionTest.java
deleted file mode 100644
index acac2de..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AbstractGetAndSetSelectionObservableCollectionTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-import junit.framework.TestCase;
-
-/**
- * @since 1.0
- *
- */
-public abstract class AbstractGetAndSetSelectionObservableCollectionTest extends TestCase {
-//
-// public void testGetSelectedObject() {
-// SelectionAwareObservableCollection observable = getSelectionAwareObservable(new String[] {"foo", "bar"});
-// assertEquals("No initial selection should be found.", null, observable.getSelectedObject());
-// setSelectedValueOfControl("bar");
-// assertEquals("bar", observable.getSelectedObject());
-// }
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.setSelectedObject(Object)'
-// */
-// public void testSetSelectedObject() {
-// SelectionAwareObservableCollection observable = getSelectionAwareObservable(new String[] {"foo", "bar"});
-// observable.setSelectedObject("bar");
-// assertEquals("bar", getSelectedObjectOfControl());
-// observable.setSelectedObject("bar1");
-// assertEquals("bar", getSelectedObjectOfControl());
-// observable.setSelectedObject("foo");
-// assertEquals("foo", getSelectedObjectOfControl());
-// observable.setSelectedObject(null);
-// assertEquals(null, getSelectedObjectOfControl());
-// }
-//
-// protected abstract SelectionAwareObservableCollection getSelectionAwareObservable(String[] values);
-//
-// protected abstract Object getSelectedObjectOfControl();
-//
-// protected abstract void setSelectedValueOfControl(String value);
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AutoSelectTableViewerCollectionExtendedTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AutoSelectTableViewerCollectionExtendedTest.java
deleted file mode 100644
index 7ae318b..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AutoSelectTableViewerCollectionExtendedTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-import junit.framework.TestCase;
-
-/**
- * @since 1.0
- *
- */
-public class AutoSelectTableViewerCollectionExtendedTest extends TestCase {
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.getSelectedObject()'
-// */
-// private TableViewer viewer;
-//
-// protected SelectionAwareObservableCollection getSelectionAwareObservable(String[] values) {
-// Shell shell = BindingScenariosTestSuite.getShell();
-// this.viewer = new TableViewer(shell, SWT.NONE);
-// TableViewerDescription description = new TableViewerDescription(viewer);
-// DataBindingContext ctx = DataBinding.createContext(new IObservableFactory[] {new AutoSelectTableViewerFactory()});
-// SelectionAwareObservableCollection observableCollection = (SelectionAwareObservableCollection) ctx.createObservable(description);
-// observableCollection.setElements(Arrays.asList(values));
-// return observableCollection;
-// }
-//
-// protected Object getSelectedObjectOfControl() {
-// StructuredSelection selection = (StructuredSelection) this.viewer.getSelection();
-// if (selection.isEmpty()) {
-// return null;
-// }
-// return selection.getFirstElement();
-// }
-//
-// protected void setSelectedValueOfControl(String value) {
-// this.viewer.setSelection(new StructuredSelection(new String[]{value}));
-// }
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.setSelectedObject(Object)'
-// */
-// public void testAutoSelect() {
-// SelectionAwareObservableCollection observable = getSelectionAwareObservable(new String[] {"foo", "bar"});
-// assertEquals("foo", getSelectedObjectOfControl());
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AutoSelectTableViewerCollectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AutoSelectTableViewerCollectionTest.java
deleted file mode 100644
index 923b7f2..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/AutoSelectTableViewerCollectionTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-import junit.framework.TestCase;
-
-/**
- * @since 1.0
- *
- */
-public class AutoSelectTableViewerCollectionTest extends TestCase {
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.getSelectedObject()'
-// */
-// private TableViewer viewer;
-//
-// protected SelectionAwareObservableCollection getSelectionAwareObservable(String[] values) {
-// Shell shell = BindingScenariosTestSuite.getShell();
-// this.viewer = new TableViewer(shell, SWT.NONE);
-// DataBindingContext ctx = DataBinding.createContext(new IObservableFactory[] {new AutoSelectTableViewerFactory()});
-// SelectionAwareObservableCollection observableCollection = (SelectionAwareObservableCollection) ctx.createObservable(new Property(viewer, ViewersProperties.CONTENT, String.class, new Boolean(true)));
-// observableCollection.setElements(Arrays.asList(values));
-// return observableCollection;
-// }
-//
-// protected Object getSelectedObjectOfControl() {
-// StructuredSelection selection = (StructuredSelection) this.viewer.getSelection();
-// if (selection.isEmpty()) {
-// return null;
-// }
-// return selection.getFirstElement();
-// }
-//
-// protected void setSelectedValueOfControl(String value) {
-// this.viewer.setSelection(new StructuredSelection(new String[]{value}));
-// }
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.setSelectedObject(Object)'
-// */
-// public void testAutoSelect() {
-// SelectionAwareObservableCollection observable = getSelectionAwareObservable(new String[] {"foo", "bar"});
-// assertEquals("foo", getSelectedObjectOfControl());
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/CComboObservableCollectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/CComboObservableCollectionTest.java
deleted file mode 100644
index 9e0f583..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/CComboObservableCollectionTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-
-/**
- * @since 1.0
- *
- */
-public class CComboObservableCollectionTest extends AbstractGetAndSetSelectionObservableCollectionTest {
-
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.getSelectedObject()'
-// */
-// private CCombo ccombo;
-//
-// protected SelectionAwareObservableCollection getSelectionAwareObservable(String[] values) {
-// Shell shell = BindingScenariosTestSuite.getShell();
-// this.ccombo = new CCombo(shell, SWT.NONE);
-// for (int i = 0; i < values.length; i++) {
-// this.ccombo.add(values[i]);
-// }
-// DataBindingContext ctx = DataBinding.createContext(new IObservableFactory[] {new SWTObservableFactory()});
-// return (SelectionAwareObservableCollection) ctx.createObservable(new Property(ccombo, SWTProperties.ITEMS, String.class, new Boolean(true)));
-// }
-//
-// protected Object getSelectedObjectOfControl() {
-// int selectionIndex = this.ccombo.getSelectionIndex();
-// if (selectionIndex != -1) {
-// return this.ccombo.getItem(selectionIndex);
-// }
-// return null;
-// }
-//
-// protected void setSelectedValueOfControl(String value) {
-// this.ccombo.setText(value);
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ComboObservableCollectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ComboObservableCollectionTest.java
deleted file mode 100644
index 0bf4f77..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ComboObservableCollectionTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-
-/**
- * @since 1.0
- *
- */
-public class ComboObservableCollectionTest extends AbstractGetAndSetSelectionObservableCollectionTest {
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.getSelectedObject()'
-// */
-// private Combo combo;
-//
-// protected SelectionAwareObservableCollection getSelectionAwareObservable(String[] values) {
-// Shell shell = BindingScenariosTestSuite.getShell();
-// this.combo = new Combo(shell, SWT.NONE);
-// for (int i = 0; i < values.length; i++) {
-// this.combo.add(values[i]);
-// }
-// DataBindingContext ctx = DataBinding.createContext(new IObservableFactory[] {new SWTObservableFactory()});
-// return (SelectionAwareObservableCollection) ctx.createObservable(new Property(combo, SWTProperties.ITEMS, String.class, new Boolean(true)));
-// }
-//
-// protected Object getSelectedObjectOfControl() {
-// int selectionIndex = this.combo.getSelectionIndex();
-// if (selectionIndex != -1) {
-// return this.combo.getItem(selectionIndex);
-// }
-// return null;
-// }
-//
-// protected void setSelectedValueOfControl(String value) {
-// this.combo.select(this.combo.indexOf(value));
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/CopyOfAutoSelectTableViewerCollectionExtendedTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/CopyOfAutoSelectTableViewerCollectionExtendedTest.java
deleted file mode 100644
index bc36fa7..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/CopyOfAutoSelectTableViewerCollectionExtendedTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-import junit.framework.TestCase;
-
-/**
- * @since 1.0
- *
- */
-public class CopyOfAutoSelectTableViewerCollectionExtendedTest extends TestCase {
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.getSelectedObject()'
-// */
-// private TableViewer viewer;
-//
-// protected SelectionAwareObservableCollection getSelectionAwareObservable(String[] values) {
-// Shell shell = BindingScenariosTestSuite.getShell();
-// this.viewer = new TableViewer(shell, SWT.NONE);
-// DataBindingContext ctx = DataBinding.createContext(new IObservableFactory[] {new AutoSelectTableViewerFactory()});
-// SelectionAwareObservableCollection observableCollection = (SelectionAwareObservableCollection) ctx.createObservable(new Property(viewer, ViewersProperties.CONTENT, String.class, new Boolean(true)));
-// observableCollection.setElements(Arrays.asList(values));
-// return observableCollection;
-// }
-//
-// protected Object getSelectedObjectOfControl() {
-// StructuredSelection selection = (StructuredSelection) this.viewer.getSelection();
-// if (selection.isEmpty()) {
-// return null;
-// }
-// return selection.getFirstElement();
-// }
-//
-// protected void setSelectedValueOfControl(String value) {
-// this.viewer.setSelection(new StructuredSelection(new String[]{value}));
-// }
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.setSelectedObject(Object)'
-// */
-// public void testAutoSelect() {
-// SelectionAwareObservableCollection observable = getSelectionAwareObservable(new String[] {"foo", "bar"});
-// assertEquals("foo", getSelectedObjectOfControl());
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ListObservableCollectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ListObservableCollectionTest.java
deleted file mode 100644
index ba03473..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ListObservableCollectionTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-
-/**
- * @since 1.0
- *
- */
-public class ListObservableCollectionTest extends AbstractGetAndSetSelectionObservableCollectionTest {
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.getSelectedObject()'
-// */
-// private List listControl;
-//
-// protected SelectionAwareObservableCollection getSelectionAwareObservable(String[] values) {
-// Shell shell = BindingScenariosTestSuite.getShell();
-// this.listControl = new List(shell, SWT.NONE);
-// for (int i = 0; i < values.length; i++) {
-// this.listControl.add(values[i]);
-// }
-// DataBindingContext ctx = DataBinding.createContext(new IObservableFactory[] {new SWTObservableFactory()});
-// return (SelectionAwareObservableCollection) ctx.createObservable(new Property(listControl, SWTProperties.ITEMS, String.class, new Boolean(true)));
-// }
-//
-// protected Object getSelectedObjectOfControl() {
-// int selectionIndex = this.listControl.getSelectionIndex();
-// if (selectionIndex != -1) {
-// return this.listControl.getItem(selectionIndex);
-// }
-// return null;
-// }
-//
-// protected void setSelectedValueOfControl(String value) {
-// this.listControl.setSelection(new String[] {value});
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ObservableCollectionViewerTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ObservableCollectionViewerTest.java
deleted file mode 100644
index 8d1a584..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/ObservableCollectionViewerTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-
-/**
- * @since 1.0
- *
- */
-public class ObservableCollectionViewerTest extends AbstractGetAndSetSelectionObservableCollectionTest {
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.getSelectedObject()'
-// */
-// private AbstractListViewer viewer;
-//
-// protected SelectionAwareObservableCollection getSelectionAwareObservable(String[] values) {
-// Shell shell = BindingScenariosTestSuite.getShell();
-// this.viewer = new ListViewer(shell, SWT.NONE);
-// DataBindingContext ctx = DataBinding.createContext(new IObservableFactory[] {new SWTObservableFactory()});
-// SelectionAwareObservableCollection observableCollection = (SelectionAwareObservableCollection) ctx.createObservable(new Property(viewer, ViewersProperties.CONTENT, String.class, new Boolean(true)));
-// observableCollection.setElements(Arrays.asList(values));
-// return observableCollection;
-// }
-//
-// protected Object getSelectedObjectOfControl() {
-// StructuredSelection selection = (StructuredSelection) this.viewer.getSelection();
-// if (selection.isEmpty()) {
-// return null;
-// }
-// return selection.getFirstElement();
-// }
-//
-// protected void setSelectedValueOfControl(String value) {
-// this.viewer.setSelection(new StructuredSelection(new String[]{value}));
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/SWTObservablesTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/SWTObservablesTest.java
deleted file mode 100644
index a765394..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/SWTObservablesTest.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.jface.databinding.swt.ISWTObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.internal.databinding.internal.swt.ButtonObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.CComboObservableList;
-import org.eclipse.jface.internal.databinding.internal.swt.CComboObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.CLabelObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.ComboObservableList;
-import org.eclipse.jface.internal.databinding.internal.swt.ComboObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.LabelObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.ListObservableList;
-import org.eclipse.jface.internal.databinding.internal.swt.ListObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties;
-import org.eclipse.jface.internal.databinding.internal.swt.ScaleObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.SpinnerObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.TableObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.TextEditableObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.TextObservableValue;
-import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Scale;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @since 1.1
- */
-public class SWTObservablesTest extends AbstractSWTTestCase {
- private Shell shell;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- shell = getShell();
- RealmTester.setDefault(SWTObservables.getRealm(shell.getDisplay()));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- RealmTester.setDefault(null);
- }
-
- public void testObserveForeground() throws Exception {
- ISWTObservableValue value = SWTObservables.observeForeground(shell);
- assertNotNull(value);
- assertEquals(Color.class, value.getValueType());
- }
-
- public void testObserveBackground() throws Exception {
- ISWTObservableValue value = SWTObservables.observeBackground(shell);
- assertNotNull(value);
- assertEquals(Color.class, value.getValueType());
- }
-
- public void testObserveFont() throws Exception {
- ISWTObservableValue value = SWTObservables.observeFont(shell);
- assertNotNull(value);
- assertEquals(Font.class, value.getValueType());
- }
-
- public void testObserveSelectionOfSpinner() throws Exception {
- Spinner spinner = new Spinner(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeSelection(spinner);
- assertNotNull(value);
- assertTrue(value instanceof SpinnerObservableValue);
-
- SpinnerObservableValue spinnerObservable = (SpinnerObservableValue) value;
- assertEquals(SWTProperties.SELECTION, spinnerObservable.getAttribute());
- }
-
- public void testObserveSelectionOfButton() throws Exception {
- Button button = new Button(shell, SWT.PUSH);
- ISWTObservableValue value = SWTObservables.observeSelection(button);
- assertNotNull(value);
- assertTrue(value instanceof ButtonObservableValue);
- }
-
- public void testObserveSelectionOfCombo() throws Exception {
- Combo combo = new Combo(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeSelection(combo);
- assertNotNull(value);
- assertTrue(value instanceof ComboObservableValue);
-
- ComboObservableValue comboObservable = (ComboObservableValue) value;
- assertEquals(SWTProperties.SELECTION, comboObservable.getAttribute());
- }
-
- public void testObserveSelectionOfCCombo() throws Exception {
- CCombo combo = new CCombo(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeSelection(combo);
- assertNotNull(value);
- assertTrue(value instanceof CComboObservableValue);
-
- CComboObservableValue ccomboObservable = (CComboObservableValue) value;
- assertEquals(SWTProperties.SELECTION, ccomboObservable.getAttribute());
- }
-
- public void testObserveSelectionOfList() throws Exception {
- List list = new List(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeSelection(list);
- assertNotNull(value);
- assertTrue(value instanceof ListObservableValue);
- }
-
- public void testObserveSelectionOfScale() throws Exception {
- Scale scale = new Scale(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeSelection(scale);
- assertNotNull(value);
- assertTrue(value instanceof ScaleObservableValue);
-
- ScaleObservableValue scaleObservable = (ScaleObservableValue) value;
- assertEquals(SWTProperties.SELECTION, scaleObservable.getAttribute());
- }
-
- public void testObserveSelectionOfUnsupportedControl() throws Exception {
- try {
- Text text = new Text(shell, SWT.NONE);
- SWTObservables.observeSelection(text);
- fail("Exception should have been thrown");
- } catch (IllegalArgumentException e) {
- }
- }
-
- public void testObserveTextOfText() throws Exception {
- Text text = new Text(shell, SWT.NONE);
- assertFalse(text.isListening(SWT.FocusOut));
-
- ISWTObservableValue value = SWTObservables.observeText(text,
- SWT.FocusOut);
- assertNotNull(value);
- assertTrue(value instanceof TextObservableValue);
- assertTrue(text.isListening(SWT.FocusOut));
- }
-
- public void testObserveTextWithEventOfUnsupportedControl() throws Exception {
- Label label = new Label(shell, SWT.NONE);
- try {
- SWTObservables.observeText(label, SWT.FocusOut);
- fail("Exception should have been thrown");
- } catch (Exception e) {
- }
- }
-
- public void testObserveTextOfLabel() throws Exception {
- Label label = new Label(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeText(label);
- assertNotNull(label);
- assertTrue(value instanceof LabelObservableValue);
- }
-
- public void testObserveTextOfCLabel() throws Exception {
- CLabel label = new CLabel(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeText(label);
- assertNotNull(label);
- assertTrue(value instanceof CLabelObservableValue);
- }
-
- public void testObserveTextOfCombo() throws Exception {
- Combo combo = new Combo(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeText(combo);
- assertNotNull(value);
- assertTrue(value instanceof ComboObservableValue);
-
- ComboObservableValue comboObservable = (ComboObservableValue) value;
- assertEquals(SWTProperties.TEXT, comboObservable.getAttribute());
- }
-
- public void testObserveTextOfCCombo() throws Exception {
- CCombo combo = new CCombo(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeText(combo);
- assertNotNull(value);
- assertTrue(value instanceof CComboObservableValue);
-
- CComboObservableValue ccomboObservable = (CComboObservableValue) value;
- assertEquals(SWTProperties.TEXT, ccomboObservable.getAttribute());
- }
-
- public void testObserveTextOfUnsupportedControl() throws Exception {
- Table table = new Table(shell, SWT.NONE);
- try {
- SWTObservables.observeText(table);
- fail("Exception should have been thrown");
- } catch (IllegalArgumentException e) {
- }
- }
-
- public void testObserveItemsOfCombo() throws Exception {
- Combo combo = new Combo(shell, SWT.NONE);
- IObservableList list = SWTObservables.observeItems(combo);
- assertNotNull(list);
- assertTrue(list instanceof ComboObservableList);
- }
-
- public void testObserveItemsOfCCombo() throws Exception {
- CCombo ccombo = new CCombo(shell, SWT.NONE);
- IObservableList list = SWTObservables.observeItems(ccombo);
- assertNotNull(list);
- assertTrue(list instanceof CComboObservableList);
- }
-
- public void testObserveItemsOfList() throws Exception {
- List list = new List(shell, SWT.NONE);
- IObservableList observableList = SWTObservables.observeItems(list);
- assertNotNull(observableList);
- assertTrue(observableList instanceof ListObservableList);
- }
-
- public void testObserveItemsOfUnsupportedControl() throws Exception {
- Table table = new Table(shell, SWT.NONE);
- try {
- SWTObservables.observeItems(table);
- fail("Exception should have been thrown");
- } catch (IllegalArgumentException e) {
- }
- }
-
- public void testObserveSingleSelectionIndexOfTable() throws Exception {
- Table table = new Table(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables
- .observeSingleSelectionIndex(table);
- assertNotNull(value);
- assertTrue(value instanceof TableObservableValue);
-
- TableObservableValue tableObservable = (TableObservableValue) value;
- assertEquals(SWTProperties.SELECTION, tableObservable.getAttribute());
- }
-
- public void testObserveSingleSelectionIndexOfUnsupportedControl()
- throws Exception {
- List list = new List(shell, SWT.NONE);
- try {
- SWTObservables.observeSingleSelectionIndex(list);
- fail("Exception should have been thrown");
- } catch (IllegalArgumentException e) {
-
- }
- }
-
- public void testObserveMinOfSpinner() throws Exception {
- Spinner spinner = new Spinner(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeMin(spinner);
- assertNotNull(value);
- assertTrue(value instanceof SpinnerObservableValue);
-
- SpinnerObservableValue spinnerObservable = (SpinnerObservableValue) value;
- assertEquals(SWTProperties.MIN, spinnerObservable.getAttribute());
- }
-
- public void testObserveMinOfScale() throws Exception {
- Scale scale = new Scale(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeMin(scale);
- assertNotNull(value);
- assertTrue(value instanceof ScaleObservableValue);
-
- ScaleObservableValue scaleObservable = (ScaleObservableValue) value;
- assertEquals(SWTProperties.MIN, scaleObservable.getAttribute());
- }
-
- public void testObserveMinOfUnsupportedControl() throws Exception {
- Text text = new Text(shell, SWT.NONE);
- try {
- SWTObservables.observeMin(text);
- fail("Exception should have been thrown");
- } catch (IllegalArgumentException e) {
- }
- }
-
- public void testObserveMaxOfSpinner() throws Exception {
- Spinner spinner = new Spinner(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeMax(spinner);
- assertNotNull(value);
- assertTrue(value instanceof SpinnerObservableValue);
-
- SpinnerObservableValue spinnerObservable = (SpinnerObservableValue) value;
- assertEquals(SWTProperties.MAX, spinnerObservable.getAttribute());
- }
-
- public void testObserveMaxOfScale() throws Exception {
- Scale scale = new Scale(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeMax(scale);
- assertNotNull(value);
- assertTrue(value instanceof ScaleObservableValue);
-
- ScaleObservableValue scaleObservable = (ScaleObservableValue) value;
- assertEquals(SWTProperties.MAX, scaleObservable.getAttribute());
- }
-
- public void testObserveMaxOfUnsupportedControl() throws Exception {
- Text text = new Text(shell, SWT.NONE);
- try {
- SWTObservables.observeMax(text);
- fail("Exception should have been thrown");
- } catch (IllegalArgumentException e) {
- }
- }
-
- public void testObserveEditableOfText() throws Exception {
- Text text = new Text(shell, SWT.NONE);
- ISWTObservableValue value = SWTObservables.observeEditable(text);
- assertNotNull(value);
- assertTrue(value instanceof TextEditableObservableValue);
- }
-
- public void testObserveEditableOfUnsupportedControl() throws Exception {
- Label label = new Label(shell, SWT.NONE);
- try {
- SWTObservables.observeEditable(label);
- fail("Exception should have been thrown");
- } catch (IllegalArgumentException e) {
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/TableViewerObservableCollectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/TableViewerObservableCollectionTest.java
deleted file mode 100644
index 309bd6e..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/TableViewerObservableCollectionTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-
-/**
- * @since 1.0
- *
- */
-public class TableViewerObservableCollectionTest extends AbstractGetAndSetSelectionObservableCollectionTest {
-//
-// /*
-// * Test method for 'org.eclipse.jface.internal.databinding.swt.CComboObservableCollection.getSelectedObject()'
-// */
-// private TableViewer viewer;
-//
-// protected SelectionAwareObservableCollection getSelectionAwareObservable(String[] values) {
-// Shell shell = BindingScenariosTestSuite.getShell();
-// this.viewer = new TableViewer(shell, SWT.NONE);
-// DataBindingContext ctx = DataBinding.createContext(new IObservableFactory[] {new SWTObservableFactory()});
-// SelectionAwareObservableCollection observableCollection = (SelectionAwareObservableCollection) ctx.createObservable(new Property(viewer, ViewersProperties.CONTENT, String.class, new Boolean(true)));
-// observableCollection.setElements(Arrays.asList(values));
-// return observableCollection;
-// }
-//
-// protected Object getSelectedObjectOfControl() {
-// StructuredSelection selection = (StructuredSelection) this.viewer.getSelection();
-// if (selection.isEmpty()) {
-// return null;
-// }
-// return selection.getFirstElement();
-// }
-//
-// protected void setSelectedValueOfControl(String value) {
-// this.viewer.setSelection(new StructuredSelection(new String[]{value}));
-// }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/TextObservableValueTests.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/TextObservableValueTests.java
deleted file mode 100644
index 62e1e93..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/TextObservableValueTests.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920
- * Brad Reynolds - bug 164653
- *******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.swt;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.internal.databinding.internal.swt.TextObservableValue;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Tests to assert the inputs of the TextObservableValue constructor.
- *
- * @since 3.2
- */
-public class TextObservableValueTests extends TestCase {
- private Text text;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- RealmTester.setDefault(SWTObservables.getRealm(Display.getDefault()));
- Shell shell = new Shell();
- text = new Text(shell, SWT.NONE);
- }
-
- /**
- * Asserts that only valid SWT event types are accepted on construction of
- * TextObservableValue.
- */
- public void testConstructorUpdateEventTypes() {
- try {
- new TextObservableValue(text, SWT.NONE);
- new TextObservableValue(text, SWT.FocusOut);
- new TextObservableValue(text, SWT.Modify);
- assertTrue(true);
- } catch (IllegalArgumentException e) {
- fail();
- }
-
- try {
- new TextObservableValue(text, SWT.Verify);
- fail();
- } catch (IllegalArgumentException e) {
- assertTrue(true);
- }
- }
-
- public void testSetValue() throws Exception {
- TextObservableValue observableValue = new TextObservableValue(text,
- SWT.NONE);
-
- assertEquals("", observableValue.getValue());
- String value = "value";
- observableValue.setValue(value);
- assertEquals("observable value", value, observableValue.getValue());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/util/EventTrackers.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/util/EventTrackers.java
deleted file mode 100644
index 3624b5d..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/util/EventTrackers.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.util;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-
-/**
- * Implementations of change listeners that keep track of the number of times an
- * event fires.
- *
- * @since 1.1
- */
-public class EventTrackers {
- public static class ChangeEventTracker implements IChangeListener {
- public int count;
- public ChangeEvent event;
-
- public void handleChange(ChangeEvent event) {
- count++;
- this.event = event;
- }
- }
-
- public static class ValueChangeEventTracker implements IValueChangeListener {
- public int count;
- public ValueChangeEvent event;
-
- public void handleValueChange(ValueChangeEvent event) {
- count++;
- this.event = event;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/util/RealmTester.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/util/RealmTester.java
deleted file mode 100644
index 53ec9aa..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/util/RealmTester.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.util;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.runtime.AssertionFailedException;
-
-/**
- * Aids in the testing of Realms.
- *
- * @since 3.2
- */
-public class RealmTester {
-
- /**
- * Sets the default realm without using Realm.runWithDefault() for testing
- * purposes.
- *
- * @param realm
- */
- public static void setDefault(Realm realm) {
- CurrentRealm.setDefault(realm);
- }
-
- /**
- * Runs the provided <code>runnable</code> when the realm is both current
- * and not current. It checks for AssertionFailedExceptions and if an
- * exception occurs or doesn't occur as expected the test fails. The realm
- * of an observable created before the method was invoked must be of type
- * {@link CurrentRealm}. The default realm during the runnable invocation
- * is set to an instance of {@link CurrentRealm} when the runnable is
- * invoked.
- *
- * @param runnable
- */
- public static void exerciseCurrent(Runnable runnable) {
- CurrentRealm previousRealm = (CurrentRealm) Realm.getDefault();
- CurrentRealm realm = new CurrentRealm();
- setDefault(realm);
-
- try {
- realm.setCurrent(true);
- if (previousRealm != null) {
- previousRealm.setCurrent(true);
- }
-
- try {
- runnable.run();
- } catch (AssertionFailedException e) {
- Assert
- .fail("Correct realm, exception should not have been thrown");
- }
-
- realm.setCurrent(false);
- if (previousRealm != null) {
- previousRealm.setCurrent(false);
- }
-
- try {
- runnable.run();
- Assert
- .fail("Incorrect realm, exception should have been thrown");
- } catch (AssertionFailedException e) {
- }
- } finally {
- setDefault(previousRealm);
- }
- }
-
- /**
- * Allows for the toggling of the current status of the realm. The
- * syncExec(...) and asyncExec(...) implementations do nothing.
- *
- * @since 3.2
- */
- public static class CurrentRealm extends Realm {
- private boolean current;
-
- public CurrentRealm() {
- this(false);
- }
-
- public CurrentRealm(boolean current) {
- this.current = current;
- }
-
- public boolean isCurrent() {
- return current;
- }
-
- public void setCurrent(boolean current) {
- this.current = current;
- }
-
- protected void syncExec(Runnable runnable) {
- // do nothing
- }
-
- public void asyncExec(Runnable runnable) {
- // do nothing
- }
-
- protected static Realm setDefault(Realm realm) {
- return Realm.setDefault(realm);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableMapLabelProviderTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableMapLabelProviderTest.java
deleted file mode 100644
index cffed54..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableMapLabelProviderTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 164247
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.viewers;
-
-import java.util.HashSet;
-
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.set.WritableSet;
-import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider;
-import org.eclipse.jface.examples.databinding.ModelObject;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 1.1
- */
-public class ObservableMapLabelProviderTest extends AbstractDefaultRealmTestCase {
-
- public void testGetColumnText() throws Exception {
- WritableSet set = new WritableSet(new HashSet(), Item.class);
- Item item = new Item();
- String value = "value";
- item.setValue(value);
- set.add(item);
-
- ObservableMapLabelProvider labelProvider = new ObservableMapLabelProvider(BeansObservables.observeMap(set, Item.class, "value"));
- assertEquals(item.getValue(), labelProvider.getColumnText(item, 0));
- }
-
- public void testGetColumnTextNullValue() throws Exception {
- WritableSet set = new WritableSet(new HashSet(), Item.class);
- Item item = new Item();
- set.add(item);
-
- ObservableMapLabelProvider labelProvider = new ObservableMapLabelProvider(BeansObservables.observeMap(set, Item.class, "value"));
- assertNull(item.getValue());
- assertEquals("", labelProvider.getColumnText(item, 0));
- }
-
- private static class Item extends ModelObject {
- private String value;
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- String old = this.value;
-
- firePropertyChange("value", old, this.value = value);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableSetContentProviderTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableSetContentProviderTest.java
deleted file mode 100644
index dbf95fb..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableSetContentProviderTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.databinding.viewers;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableSetContentProvider;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.3
- *
- */
-public class ObservableSetContentProviderTest extends TestCase {
- public void testKnownElementsRealm() throws Exception {
- ObservableSetContentProvider contentProvider = new ObservableSetContentProvider();
- assertSame("realm for the known elements should be the SWT realm",
- SWTObservables.getRealm(Display.getDefault()), contentProvider
- .getKnownElements().getRealm());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/model/PersonTests.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/model/PersonTests.java
deleted file mode 100644
index 1c9b9c1..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/model/PersonTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds.
- * 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:
- * Brad Reynolds - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.tests.examples.model;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.examples.databinding.model.SimplePerson;
-
-/**
- * @since 3.2
- *
- */
-public class PersonTests extends TestCase {
- public void testSetName() {
- SimplePerson person = new SimplePerson();
- Listener listener = new Listener();
-
- person.addPropertyChangeListener(listener);
- assertEquals(0, listener.count);
- assertNull(listener.lastEvent);
- person.setState("new state"); //$NON-NLS-1$
-
- assertEquals(1, listener.count);
- assertNotNull(listener.lastEvent);
- assertEquals("state", listener.lastEvent.getPropertyName()); //$NON-NLS-1$
- assertEquals("", listener.lastEvent.getOldValue());
- assertEquals("new state", listener.lastEvent.getNewValue()); //$NON-NLS-1$
- assertEquals("new state", person.getState());
- }
-
- private class Listener implements PropertyChangeListener {
- private int count;
- private PropertyChangeEvent lastEvent;
-
- public void propertyChange(PropertyChangeEvent evt) {
- count++;
- this.lastEvent = evt;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ListBindingTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ListBindingTest.java
deleted file mode 100644
index 1b84c63..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ListBindingTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Brad Reynolds - bug 116920, 159768
- *******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.databinding.Binding;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateListStrategy;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 3.2
- *
- */
-public class ListBindingTest extends AbstractDefaultRealmTestCase {
- private IObservableList target;
- private IObservableList model;
- private DataBindingContext dbc;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- target = new WritableList(new ArrayList(), String.class);
- model = new WritableList(new ArrayList(), String.class);
- dbc = new DataBindingContext();
- }
-
- public void testUpdateModelFromTarget() throws Exception {
- Binding binding = dbc.bindList(target, model,
- new UpdateListStrategy(UpdateListStrategy.POLICY_ON_REQUEST),
- new UpdateListStrategy(UpdateListStrategy.POLICY_ON_REQUEST));
-
- target.add("1");
- List targetCopy = new ArrayList(target.size());
- targetCopy.addAll(target);
-
- model.add("2");
-
- assertFalse("target should not equal model", target.equals(model));
- binding.updateTargetToModel();
- assertEquals("target should not have changed", targetCopy, target);
- assertEquals("target != model", target, model);
- }
-
- public void testUpdateTargetFromModel() throws Exception {
- Binding binding = dbc.bindList(target, model,
- new UpdateListStrategy(UpdateListStrategy.POLICY_ON_REQUEST),
- new UpdateListStrategy(UpdateListStrategy.POLICY_ON_REQUEST));
-
- target.add("1");
- model.add("2");
-
- List modelCopy = new ArrayList(model.size());
- modelCopy.addAll(model);
-
- assertFalse("model should not equal target", model.equals(target));
- binding.updateModelToTarget();
-
- assertEquals("model should not have changed", modelCopy, model);
- assertEquals("model != target", model, target);
- }
-
- public void testGetTarget() throws Exception {
- Binding binding = dbc.bindList(target, model,
- null,
- null);
- assertEquals(target, binding.getTarget());
- }
-
- public void testGetModel() throws Exception {
- Binding binding = dbc.bindList(target, model,
- null,
- null);
- assertEquals(model, binding.getModel());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ValueBindingTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ValueBindingTest.java
deleted file mode 100644
index ad193d5..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/ValueBindingTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 116920
- * Brad Reynolds - bug 164653, 159768
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal;
-
-import org.eclipse.core.databinding.Binding;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 3.2
- *
- */
-public class ValueBindingTest extends AbstractDefaultRealmTestCase {
- /**
- * Bug 152543.
- *
- * @throws Exception
- */
- public void testNoUpdateTargetFromModel() throws Exception {
- try {
- new DataBindingContext().bindValue(new ObservableValueStub(),
- new ObservableValueStub(), new UpdateValueStrategy(
- UpdateValueStrategy.POLICY_NEVER),
- new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER));
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
-
- public void testValuePropagation() throws Exception {
- String initialValue = "value";
-
- WritableValue target = new WritableValue(null, String.class);
- WritableValue model = new WritableValue(initialValue, String.class);
-
- DataBindingContext dbc = new DataBindingContext();
-
- assertFalse(model.getValue().equals(target.getValue()));
- dbc.bindValue(target, model, null, null);
-
- assertEquals(target.getValue(), model.getValue());
- }
-
- public void testGetTarget() throws Exception {
- WritableValue target = new WritableValue();
- WritableValue model = new WritableValue();
- Binding valueBinding = new DataBindingContext().bindValue(target,
- model, null, null);
-
- assertEquals(target, valueBinding.getTarget());
- }
-
- public void testGetModel() throws Exception {
- WritableValue target = new WritableValue();
- WritableValue model = new WritableValue();
- Binding valueBinding = new DataBindingContext().bindValue(target,
- model, null, null);
-
- assertEquals(model, valueBinding.getModel());
- }
-
- private static class ObservableValueStub extends AbstractObservableValue {
- protected Object doGetValue() {
- // do nothing
- return null;
- }
-
- public Object getValueType() {
- // do nothing
- return null;
- }
-
- protected void doSetValue(Object value) {
-
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/Bean.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/Bean.java
deleted file mode 100644
index 0fb99e3..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/Bean.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Simple Java Bean for testing.
- *
- * @since 3.3
- */
-public class Bean {
- /* package */PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
- private String value;
- private List list;
- private Set set;
-
- public Bean() {
- }
-
- public Bean(String value) {
- this.value = value;
- }
-
- public Bean(List list) {
- this.list = list;
- }
-
- public Bean(Set set) {
- this.set = set;
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- changeSupport.firePropertyChange("value", this.value, this.value = value);
- }
-
- public List getList() {
- return list;
- }
-
- public void setList(List list) {
- changeSupport.firePropertyChange("list", this.list, this.list = list);
- }
-
- public Bean[] getListArray() {
- return (Bean[]) list.toArray(new Bean[list.size()]);
- }
-
- public Set getSet() {
- return set;
- }
-
- public void setSet(Set set) {
- changeSupport.firePropertyChange("set", this.set, this.set = set);
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableListDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableListDecoratorTest.java
deleted file mode 100644
index c02f534..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableListDecoratorTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableListDecorator;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableList;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.3
- */
-public class BeanObservableListDecoratorTest extends TestCase {
- private PropertyDescriptor propertyDescriptor;
- private JavaBeanObservableList observableList;
- private BeanObservableListDecorator decorator;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- Bean bean = new Bean();
- propertyDescriptor = new PropertyDescriptor(
- "list", Bean.class);
- observableList = new JavaBeanObservableList(
- SWTObservables.getRealm(Display.getDefault()), bean,
- propertyDescriptor, Bean.class);
- decorator = new BeanObservableListDecorator(observableList, observableList, propertyDescriptor);
- }
-
- public void testGetDelegate() throws Exception {
- assertEquals(observableList, decorator.getDelegate());
- }
-
- public void testGetObserved() throws Exception {
- assertEquals(observableList, decorator.getObserved());
- }
-
- public void testGetPropertyDescriptor() throws Exception {
- assertEquals(propertyDescriptor, decorator.getPropertyDescriptor());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableSetDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableSetDecoratorTest.java
deleted file mode 100644
index 0033e3b..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableSetDecoratorTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableSetDecorator;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableSet;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.3
- */
-public class BeanObservableSetDecoratorTest extends TestCase {
- private PropertyDescriptor propertyDescriptor;
- private JavaBeanObservableSet observableSet;
- private BeanObservableSetDecorator decorator;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- Bean bean = new Bean();
- propertyDescriptor = new PropertyDescriptor("set",
- Bean.class);
- observableSet = new JavaBeanObservableSet(
- SWTObservables.getRealm(Display.getDefault()), bean,
- propertyDescriptor, String.class);
- decorator = new BeanObservableSetDecorator(
- observableSet, observableSet, propertyDescriptor);
- }
-
- public void testGetDelegate() throws Exception {
- assertEquals(observableSet, decorator.getDelegate());
- }
-
- public void testGetObserved() throws Exception {
- assertEquals(observableSet, decorator.getObserved());
- }
-
- public void testGetPropertyDescriptor() throws Exception {
- assertEquals(propertyDescriptor, decorator.getPropertyDescriptor());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableValueDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableValueDecoratorTest.java
deleted file mode 100644
index 3127d9f..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/BeanObservableValueDecoratorTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.internal.databinding.internal.beans.BeanObservableValueDecorator;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.3
- */
-public class BeanObservableValueDecoratorTest extends TestCase {
- private Bean bean;
- private JavaBeanObservableValue observableValue;
- private BeanObservableValueDecorator decorator;
- private PropertyDescriptor propertyDescriptor;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- bean = new Bean();
- propertyDescriptor = new PropertyDescriptor("value",
- Bean.class);
- observableValue = new JavaBeanObservableValue(
- SWTObservables.getRealm(Display.getDefault()), bean,
- propertyDescriptor, String.class);
- decorator = new BeanObservableValueDecorator(
- observableValue, new WritableValue(bean, Object.class), observableValue
- .getPropertyDescriptor());
- }
-
- public void testGetDelegate() throws Exception {
- assertEquals(observableValue, decorator.getDelegate());
- }
-
- public void testGetObserved() throws Exception {
- assertEquals(bean, decorator.getObserved());
- }
-
- public void testGetPropertyDescriptor() throws Exception {
- assertEquals(propertyDescriptor, decorator.getPropertyDescriptor());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java
deleted file mode 100644
index 5ce3787..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-import java.util.Arrays;
-
-import org.eclipse.core.databinding.observable.list.IListChangeListener;
-import org.eclipse.core.databinding.observable.list.ListChangeEvent;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableList;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.3
- */
-public class JavaBeanObservableListTest extends AbstractDefaultRealmTestCase {
- private JavaBeanObservableList observableList;
- private PropertyDescriptor propertyDescriptor;
- private Bean bean;
- private String propertyName;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- propertyName = "list";
- propertyDescriptor = new PropertyDescriptor(propertyName, Bean.class);
- bean = new Bean();
-
- observableList = new JavaBeanObservableList(SWTObservables
- .getRealm(Display.getDefault()), bean, propertyDescriptor,
- Bean.class);
- }
-
- public void testGetObserved() throws Exception {
- assertEquals(bean, observableList.getObserved());
- }
-
- public void testGetPropertyDescriptor() throws Exception {
- assertEquals(propertyDescriptor, observableList.getPropertyDescriptor());
- }
-
- public void testRegistersListenerAfterFirstListenerIsAdded() throws Exception {
- assertFalse(bean.changeSupport.hasListeners(propertyName));
- observableList.addListChangeListener(new ListChangeListener());
- assertTrue(bean.changeSupport.hasListeners(propertyName));
- }
-
- public void testRemovesListenerAfterLastListenerIsRemoved() throws Exception {
- ListChangeListener listener = new ListChangeListener();
- observableList.addListChangeListener(listener);
-
- assertTrue(bean.changeSupport.hasListeners(propertyName));
- observableList.removeListChangeListener(listener);
- assertFalse(bean.changeSupport.hasListeners(propertyName));
- }
-
- public void testFiresListChangeEvents() throws Exception {
- ListChangeListener listener = new ListChangeListener();
- observableList.addListChangeListener(listener);
-
- assertEquals(0, listener.count);
- bean.setList(Arrays.asList(new String[] {"value"}));
- assertEquals(1, listener.count);
- }
-
- static class ListChangeListener implements IListChangeListener {
- int count;
- public void handleListChange(ListChangeEvent event) {
- count++;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableMapTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableMapTest.java
deleted file mode 100644
index 2f483e1..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableMapTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-import java.util.HashSet;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.map.IMapChangeListener;
-import org.eclipse.core.databinding.observable.map.MapChangeEvent;
-import org.eclipse.core.databinding.observable.map.MapDiff;
-import org.eclipse.core.databinding.observable.set.WritableSet;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableMap;
-import org.eclipse.jface.tests.databinding.observable.ThreadRealm;
-
-/**
- * @since 3.2
- *
- */
-public class JavaBeanObservableMapTest extends TestCase {
- private Bean model1;
-
- private Bean model2;
-
- private WritableSet set;
-
- private PropertyDescriptor propertyDescriptor;
-
- private JavaBeanObservableMap map;
-
- protected void setUp() throws Exception {
- ThreadRealm realm = new ThreadRealm();
- realm.init(Thread.currentThread());
- model1 = new Bean("1");
- model2 = new Bean("2");
-
- set = new WritableSet(realm, new HashSet(), Bean.class);
- set.add(model1);
- set.add(model2);
-
- propertyDescriptor = new PropertyDescriptor("value", Bean.class);
- map = new JavaBeanObservableMap(set, propertyDescriptor);
- }
-
- public void testGetValue() throws Exception {
- assertEquals(
- "The 'value' from the map should be the value of the property of the model.",
- model1.getValue(), map.get(model1));
- }
-
- public void testSetValueNotifications() throws Exception {
- String oldValue = model1.getValue();
- String newValue = model1.getValue() + model1.getValue();
- MapChangeListener listener = new MapChangeListener();
-
- map.addMapChangeListener(listener);
- assertEquals(0, listener.count);
- model1.setValue(newValue);
- assertEquals(1, listener.count);
- assertTrue(listener.diff.getChangedKeys().contains(model1));
- assertEquals(newValue, listener.diff.getNewValue(model1));
- assertEquals(oldValue, listener.diff.getOldValue(model1));
- assertFalse(listener.diff.getAddedKeys().contains(model1));
- assertFalse(listener.diff.getRemovedKeys().contains(model1));
- }
-
- public void testPutValue() throws Exception {
- String oldValue = model1.getValue();
- String newValue = model1.getValue() + model1.getValue();
- MapChangeListener listener = new MapChangeListener();
- map.addMapChangeListener(listener);
-
- assertEquals(0, listener.count);
- map.put(model1, newValue);
- assertEquals(1, listener.count);
- assertEquals(newValue, model1.getValue());
- assertEquals(oldValue, listener.diff.getOldValue(model1));
- assertEquals(newValue, listener.diff.getNewValue(model1));
- assertFalse(listener.diff.getAddedKeys().contains(model1));
- assertTrue(listener.diff.getChangedKeys().contains(model1));
- assertFalse(listener.diff.getRemovedKeys().contains(model1));
- }
-
- public void testAddKey() throws Exception {
- MapChangeListener listener = new MapChangeListener();
- map.addMapChangeListener(listener);
-
- Bean model3 = new Bean("3");
-
- assertEquals(0, listener.count);
- set.add(model3);
- assertEquals(1, listener.count);
- assertTrue(listener.diff.getAddedKeys().contains(model3));
- assertEquals(model3.getValue(), map.get(model3));
-
- String newValue = model3.getValue() + model3.getValue();
- model3.setValue(newValue);
- assertEquals(2, listener.count);
- assertEquals(3, map.size());
- }
-
- public void testRemoveKey() throws Exception {
- MapChangeListener listener = new MapChangeListener();
- map.addMapChangeListener(listener);
-
- assertEquals(0, listener.count);
- set.remove(model1);
- assertEquals(1, listener.count);
- assertFalse(listener.diff.getAddedKeys().contains(model1));
- assertFalse(listener.diff.getChangedKeys().contains(model1));
- assertTrue(listener.diff.getRemovedKeys().contains(model1));
- assertEquals(1, map.size());
- }
-
- public void testGetObserved() throws Exception {
- assertEquals(set, map.getObserved());
- }
-
- public void testGetPropertyDescriptor() throws Exception {
- assertEquals(propertyDescriptor, map.getPropertyDescriptor());
- }
-
- private static class MapChangeListener implements IMapChangeListener {
- int count;
-
- MapDiff diff;
-
- public void handleMapChange(MapChangeEvent event) {
- count++;
- this.diff = event.diff;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableSetTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableSetTest.java
deleted file mode 100644
index 9f17ccd..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableSetTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-import java.util.Arrays;
-import java.util.HashSet;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.set.ISetChangeListener;
-import org.eclipse.core.databinding.observable.set.SetChangeEvent;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableSet;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @since 3.3
- */
-public class JavaBeanObservableSetTest extends TestCase {
- private JavaBeanObservableSet observableSet;
- private Bean bean;
- private PropertyDescriptor propertyDescriptor;
- private String propertyName;
- private SetChangeListener listener;
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- bean = new Bean();
- propertyName = "set";
- propertyDescriptor = new PropertyDescriptor(propertyName, Bean.class);
-
- observableSet = new JavaBeanObservableSet(SWTObservables
- .getRealm(Display.getDefault()), bean, propertyDescriptor,
- Bean.class);
- listener = new SetChangeListener();
- }
-
- public void testGetObserved() throws Exception {
- assertEquals(bean, observableSet.getObserved());
- }
-
- public void testGetPropertyDescriptor() throws Exception {
- assertEquals(propertyDescriptor, observableSet.getPropertyDescriptor());
- }
-
- public void testGetElementType() throws Exception {
- assertEquals(Bean.class, observableSet.getElementType());
- }
-
- public void testRegistersListenerAfterFirstListenerIsAdded() throws Exception {
- assertFalse(bean.changeSupport.hasListeners(propertyName));
- observableSet.addSetChangeListener(new SetChangeListener());
- assertTrue(bean.changeSupport.hasListeners(propertyName));
- }
-
- public void testRemovesListenerAfterLastListenerIsRemoved() throws Exception {
- observableSet.addSetChangeListener(listener);
-
- assertTrue(bean.changeSupport.hasListeners(propertyName));
- observableSet.removeSetChangeListener(listener);
- assertFalse(bean.changeSupport.hasListeners(propertyName));
- }
-
- public void testFiresChangeEvents() throws Exception {
- observableSet.addSetChangeListener(listener);
- assertEquals(0, listener.count);
- bean.setSet(new HashSet(Arrays.asList(new String[] {"1"})));
- assertEquals(1, listener.count);
- }
-
- static class SetChangeListener implements ISetChangeListener {
- int count;
- public void handleSetChange(SetChangeEvent event) {
- count++;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableValueTest.java
deleted file mode 100644
index bbfd70c..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/JavaBeanObservableValueTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 171616
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyDescriptor;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableValue;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-import org.eclipse.jface.tests.databinding.util.EventTrackers.ValueChangeEventTracker;
-
-/**
- * @since 3.2
- */
-public class JavaBeanObservableValueTest extends AbstractDefaultRealmTestCase {
- private Bean bean;
- private JavaBeanObservableValue observableValue;
- private PropertyDescriptor propertyDescriptor;
- private String propertyName;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- bean = new Bean();
- propertyName = "value";
- propertyDescriptor = new PropertyDescriptor(propertyName, Bean.class);
- observableValue = new JavaBeanObservableValue(Realm.getDefault(), bean, propertyDescriptor, String.class);
- }
-
- public void testSetsValueInBean() throws Exception {
- String value = "value";
- assertNull(observableValue.getValue());
- observableValue.setValue(value);
- assertEquals("value", value, observableValue.getValue());
- }
-
- public void testGetObserved() throws Exception {
- assertEquals(bean, observableValue.getObserved());
- }
-
- public void testGetPropertyDescriptor() throws Exception {
- assertEquals(propertyDescriptor, observableValue.getPropertyDescriptor());
- }
-
- public void testRegistersListenerAfterFirstListenerIsAdded() throws Exception {
- assertFalse(bean.changeSupport.hasListeners(propertyName));
- observableValue.addValueChangeListener(new ValueChangeEventTracker());
- assertTrue(bean.changeSupport.hasListeners(propertyName));
- }
-
- public void testRemovesListenerAfterLastListenerIsRemoved() throws Exception {
- ValueChangeEventTracker listener = new ValueChangeEventTracker();
- observableValue.addValueChangeListener(listener);
-
- assertTrue(bean.changeSupport.hasListeners(propertyName));
- observableValue.removeValueChangeListener(listener);
- assertFalse(bean.changeSupport.hasListeners(propertyName));
- }
-
- public void testFiresValueChangeEvents() throws Exception {
- ValueChangeEventTracker listener = new ValueChangeEventTracker();
- observableValue.addValueChangeListener(listener);
-
- assertEquals(0, listener.count);
- bean.setValue(bean.getValue() + bean.getValue());
- assertEquals(1, listener.count);
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/ListenerSupportTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/ListenerSupportTest.java
deleted file mode 100644
index 40f62ea..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/beans/ListenerSupportTest.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.beans;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.util.Arrays;
-
-import org.eclipse.core.databinding.util.ILogger;
-import org.eclipse.core.databinding.util.Policy;
-import org.eclipse.core.internal.databinding.internal.beans.ListenerSupport;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-/**
- * @since 1.1
- */
-public class ListenerSupportTest extends AbstractDefaultRealmTestCase {
- private PropertyChangeListenerStub listener;
- private String propertyName;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- listener = new PropertyChangeListenerStub();
- propertyName = "value";
- }
-
- public void testAddPropertyChangeListenerWithPropertyName()
- throws Exception {
- SpecificListenerBean bean = new SpecificListenerBean();
-
- ListenerSupport support = new ListenerSupport(listener, propertyName);
- assertFalse(bean.changeSupport.hasListeners(propertyName));
- assertNull(support.getHookedTargets());
-
- support.hookListener(bean);
- assertTrue("has listeners", bean.changeSupport.hasListeners(propertyName));
- assertTrue("hooked target", Arrays.asList(support.getHookedTargets()).contains(bean));
- }
-
- public void testAddPropertyChangeListenerWithoutPropertyName()
- throws Exception {
- GenericListenerBean bean = new GenericListenerBean();
-
- ListenerSupport support = new ListenerSupport(listener, propertyName);
- assertFalse(bean.changeSupport.hasListeners(propertyName));
- assertNull(support.getHookedTargets());
-
- support.hookListener(bean);
- assertTrue("has listeners", bean.changeSupport.hasListeners(propertyName));
- assertTrue("hooked target", Arrays.asList(support.getHookedTargets()).contains(bean));
- }
-
- public void testChangeListenerIsOnlyNotifiedWhenWatchedPropertyChanges()
- throws Exception {
- GenericListenerBean bean = new GenericListenerBean();
- ListenerSupport support = new ListenerSupport(listener, propertyName);
- support.hookListener(bean);
-
- assertEquals(0, listener.count);
- bean.setValue("1");
- assertEquals(1, listener.count);
- assertEquals("value", listener.event.getPropertyName());
-
- bean.setOther("2");
- assertEquals(1, listener.count);
- }
-
- public void testLogStatusWhenAddPropertyChangeListenerMethodIsNotFound()
- throws Exception {
- class BeanStub {
- }
-
- class Log implements ILogger {
- int count;
- IStatus status;
-
- public void log(IStatus status) {
- count++;
- this.status = status;
- }
- }
-
- Log log = new Log();
- Policy.setLog(log);
-
- ListenerSupport support = new ListenerSupport(listener, "value");
- BeanStub bean = new BeanStub();
-
- assertEquals(0, log.count);
- support.hookListener(bean);
- assertEquals(1, log.count);
- assertEquals(IStatus.WARNING, log.status.getSeverity());
- }
-
- public void testRemovePropertyChangeListenerWithPropertyName()
- throws Exception {
- SpecificListenerBean bean = new SpecificListenerBean();
- ListenerSupport support = new ListenerSupport(listener, propertyName);
- support.hookListener(bean);
-
- assertTrue(bean.changeSupport.hasListeners(propertyName));
- assertTrue(Arrays.asList(support.getHookedTargets()).contains(bean));
-
- support.unhookListener(bean);
- assertFalse("has listeners", bean.changeSupport.hasListeners(propertyName));
- assertNull("unhooked target", support.getHookedTargets());
- }
-
- public void testRemovePropertyChangeListenerWithoutPropertyName()
- throws Exception {
- GenericListenerBean bean = new GenericListenerBean();
- ListenerSupport support = new ListenerSupport(listener, propertyName);
- support.hookListener(bean);
-
- assertTrue(bean.changeSupport.hasListeners(propertyName));
- assertTrue(Arrays.asList(support.getHookedTargets()).contains(bean));
-
- support.unhookListener(bean);
- assertFalse("has listeners", bean.changeSupport.hasListeners(propertyName));
- assertNull("unhooked target", support.getHookedTargets());
- }
-
- public void testLogStatusWhenRemovePropertyChangeListenerMethodIsNotFound()
- throws Exception {
- class InvalidBean {
- }
-
- class Log implements ILogger {
- int count;
- IStatus status;
-
- public void log(IStatus status) {
- count++;
- this.status = status;
- }
- }
-
- Log log = new Log();
- Policy.setLog(log);
-
- ListenerSupport support = new ListenerSupport(listener, "value");
- InvalidBean bean = new InvalidBean();
-
- support.hookListener(bean);
- log.count = 0;
- log.status = null;
- assertEquals(0, log.count);
- support.unhookListener(bean);
- assertEquals(1, log.count);
- assertEquals(IStatus.WARNING, log.status.getSeverity());
- }
-
- static class GenericListenerBean {
- private String other;
- PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
- private String value;
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- changeSupport.firePropertyChange("value", this.value,
- this.value = value);
- }
-
- public String getOther() {
- return other;
- }
-
- public void setOther(String other) {
- changeSupport.firePropertyChange("other", this.other,
- this.other = other);
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- changeSupport.removePropertyChangeListener(listener);
- }
- }
-
- static class SpecificListenerBean {
- PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
- String propertyName;
- String value;
-
- public void addPropertyChangeListener(String name,
- PropertyChangeListener listener) {
- this.propertyName = name;
- changeSupport.addPropertyChangeListener(name, listener);
- }
-
- public void removePropertyChangeListener(String name,
- PropertyChangeListener listener) {
- changeSupport.removePropertyChangeListener(name, listener);
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
- }
-
- static class PropertyChangeListenerStub implements PropertyChangeListener {
- PropertyChangeEvent event;
- int count;
-
- public void propertyChange(PropertyChangeEvent evt) {
- count++;
- this.event = evt;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/observable/UnmodifiableObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/observable/UnmodifiableObservableListTest.java
deleted file mode 100644
index d201122..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/observable/UnmodifiableObservableListTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Cerner Corporation 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.observable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.Diffs;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.Observables;
-import org.eclipse.core.databinding.observable.StaleEvent;
-import org.eclipse.core.databinding.observable.list.IListChangeListener;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.ListChangeEvent;
-import org.eclipse.core.databinding.observable.list.ListDiff;
-import org.eclipse.core.databinding.observable.list.ListDiffEntry;
-import org.eclipse.core.databinding.observable.list.ObservableList;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-public class UnmodifiableObservableListTest extends AbstractDefaultRealmTestCase {
- ObservableList unmodifiable;
- ObservableList mutable;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- List list = new ArrayList();
- list.add("1");
- list.add("2");
-
- mutable = new MutableObservableList(list, String.class);
- unmodifiable = (ObservableList) Observables.unmodifiableObservableList(mutable);
- }
-
- public void testFiresChangeEvents() throws Exception {
- ChangeCounter mutableListener = new ChangeCounter();
- ChangeCounter unmodifiableListener = new ChangeCounter();
-
- mutable.addChangeListener(mutableListener);
- unmodifiable.addChangeListener(unmodifiableListener);
-
- assertEquals(0, mutableListener.count);
- assertEquals(0, unmodifiableListener.count);
- mutable.add("3");
- assertEquals(1, mutableListener.count);
- assertEquals(1, unmodifiableListener.count);
- }
-
- public void testFiresListChangeEvents() throws Exception {
- ListChangeCounter mutableListener = new ListChangeCounter();
- ListChangeCounter unmodifiableListener = new ListChangeCounter();
-
- mutable.addListChangeListener(mutableListener);
- unmodifiable.addListChangeListener(unmodifiableListener);
-
- assertEquals(0, mutableListener.count);
- assertEquals(0, unmodifiableListener.count);
-
- String element = "3";
- mutable.add(element);
- assertEquals(1, mutableListener.count);
- assertEquals(mutable, mutableListener.source);
- assertEquals(1, mutableListener.diff.getDifferences().length);
-
- ListDiffEntry difference = mutableListener.diff.getDifferences()[0];
- assertEquals(element, difference.getElement());
- assertTrue(difference.isAddition());
- assertEquals(3, mutable.size());
-
- assertEquals(1, unmodifiableListener.count);
- assertEquals(unmodifiable, unmodifiableListener.source);
- assertEquals(1, unmodifiableListener.diff.getDifferences().length);
-
- difference = unmodifiableListener.diff.getDifferences()[0];
- assertEquals(element, difference.getElement());
- assertTrue(difference.isAddition());
- assertEquals(3, unmodifiable.size());
- }
-
- public void testFiresStaleEvents() throws Exception {
- StaleCounter mutableListener = new StaleCounter();
- StaleCounter unmodifiableListener = new StaleCounter();
-
- mutable.addStaleListener(mutableListener);
- unmodifiable.addStaleListener(unmodifiableListener);
-
- assertEquals(0, mutableListener.count);
- assertEquals(0, unmodifiableListener.count);
- mutable.setStale(true);
- assertEquals(1, mutableListener.count);
- assertEquals(mutable, mutableListener.source);
- assertTrue(mutable.isStale());
- assertEquals(1, unmodifiableListener.count);
- assertEquals(unmodifiable, unmodifiableListener.source);
- assertTrue(unmodifiable.isStale());
- }
-
- public void testIsStale() throws Exception {
- assertFalse(mutable.isStale());
- assertFalse(unmodifiable.isStale());
- mutable.setStale(true);
- assertTrue(mutable.isStale());
- assertTrue(unmodifiable.isStale());
- }
-
- public void testSetStaleOnUnmodifiableList() throws Exception {
- try {
- unmodifiable.setStale(true);
- fail("UnsupportedOperationException should have been thrown");
- } catch (UnsupportedOperationException e) {
- }
- }
-
- private static class StaleCounter implements IStaleListener {
- int count;
- IObservable source;
-
- public void handleStale(StaleEvent event) {
- count++;
- this.source = event.getObservable();
- }
- }
-
- private static class ChangeCounter implements IChangeListener {
- int count;
- IObservable source;
- public void handleChange(ChangeEvent event) {
- count++;
- this.source = event.getObservable();
- }
- }
-
- private static class ListChangeCounter implements IListChangeListener {
- int count;
- IObservableList source;
- ListDiff diff;
-
- public void handleListChange(ListChangeEvent event) {
- count++;
- this.source = event.getObservableList();
- this.diff = event.diff;
- }
- }
-
- private static class MutableObservableList extends ObservableList {
- /**
- * @param wrappedList
- * @param elementType
- */
- public MutableObservableList(List wrappedList, Object elementType) {
- super(wrappedList, elementType);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.internal.databinding.provisional.observable.list.ObservableList#add(java.lang.Object)
- */
- public boolean add(Object o) {
- boolean result = wrappedList.add(o);
- fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(wrappedList.size() - 1, true, o)));
-
- return result;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ButtonObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ButtonObservableValueTest.java
deleted file mode 100644
index 7ddbd91..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ButtonObservableValueTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.internal.databinding.internal.swt.ButtonObservableValue;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @since 3.2
- *
- */
-public class ButtonObservableValueTest extends TestCase {
- public void testSetValue() throws Exception {
- Shell shell = new Shell();
- Button button = new Button(shell, SWT.CHECK);
- ButtonObservableValue observableValue = new ButtonObservableValue(button);
- assertEquals(Boolean.FALSE, observableValue.getValue());
- assertFalse(button.getSelection());
-
- Boolean value = Boolean.TRUE;
- observableValue.setValue(value);
- assertTrue("button value", button.getSelection());
- assertEquals("observable value", value, observableValue.getValue());
- shell.dispose();
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueTest.java
deleted file mode 100644
index 5f8d800..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.internal.databinding.internal.swt.CComboObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @since 3.2
- */
-public class CComboObservableValueTest extends TestCase {
- public void testSetValueText() throws Exception {
- Shell shell = new Shell();
- CCombo combo = new CCombo(shell, SWT.NONE);
- CComboObservableValue observableValue = new CComboObservableValue(combo, SWTProperties.TEXT);
- assertEquals("", combo.getText());
- assertEquals("", observableValue.getValue());
-
- String value = "value";
- observableValue.setValue(value);
- assertEquals("combo value", value, combo.getText());
- assertEquals("observable value value is incorrect", value, observableValue.getValue());
- shell.dispose();
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CLabelObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CLabelObservableValueTest.java
deleted file mode 100644
index 4d13823..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CLabelObservableValueTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.internal.databinding.internal.swt.CLabelObservableValue;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @since 3.2
- *
- */
-public class CLabelObservableValueTest extends TestCase {
- public void testSetValue() throws Exception {
- Shell shell = new Shell();
- CLabel label = new CLabel(shell, SWT.NONE);
- CLabelObservableValue observableValue = new CLabelObservableValue(label);
-
- assertEquals(null, label.getText());
- assertEquals(null, observableValue.getValue());
-
- String value = "value";
- observableValue.setValue(value);
- assertEquals("label value", value, label.getText());
- assertEquals("observable value was incorrect", value, observableValue.getValue());
- shell.dispose();
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueTest.java
deleted file mode 100644
index ccd29f2..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.internal.databinding.internal.swt.ComboObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @since 3.2
- *
- */
-public class ComboObservableValueTest extends TestCase {
- public void testSetValueText() throws Exception {
- Shell shell = new Shell();
- Combo combo = new Combo(shell, SWT.NONE);
- ComboObservableValue observableValue = new ComboObservableValue(combo, SWTProperties.TEXT);
- assertEquals("", combo.getText());
- assertEquals("", observableValue.getValue());
-
- String value = "value";
- observableValue.setValue(value);
- assertEquals("combo text", value, combo.getText());
- assertEquals("observable value", value, observableValue.getValue());
- shell.dispose();
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ControlObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ControlObservableValueTest.java
deleted file mode 100644
index 031e8c0..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ControlObservableValueTest.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 170848
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import org.eclipse.jface.internal.databinding.internal.swt.ControlObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @since 3.2
- *
- */
-public class ControlObservableValueTest extends AbstractDefaultRealmTestCase {
- private Shell shell;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- shell = new Shell();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- if (shell != null && !shell.isDisposed()) {
- shell.dispose();
- shell = null;
- }
- }
-
- public void testSetValueEnabled() throws Exception {
- ControlObservableValue observableValue = new ControlObservableValue(
- shell, SWTProperties.ENABLED);
- Boolean value = Boolean.FALSE;
- observableValue.setValue(value);
- assertFalse(shell.isEnabled());
- }
-
- public void testGetValueEnabled() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.ENABLED);
- shell.setEnabled(false);
- assertEquals(Boolean.FALSE, value.getValue());
- }
-
- public void testGetValueTypeEnabled() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.ENABLED);
- assertEquals(boolean.class, value.getValueType());
- }
-
- public void testSetValueVisible() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.VISIBLE);
- value.setValue(Boolean.FALSE);
- assertFalse(shell.isVisible());
- }
-
- public void testGetValueVisible() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.VISIBLE);
- shell.setVisible(false);
- assertEquals(Boolean.FALSE, value.getValue());
- }
-
- public void testGetValueTypeVisible() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.VISIBLE);
- assertEquals(Boolean.TYPE, value.getValueType());
- }
-
- public void testSetValueForeground() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.FOREGROUND);
-
- Color color = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK);
-
- value.setValue(color);
- assertEquals(color, shell.getForeground());
- }
-
- public void testGetValueForeground() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.FOREGROUND);
-
- Color color = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK);
- shell.setForeground(color);
- assertEquals(color, value.getValue());
- }
-
- public void testGetValueTypeForgroundColor() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.FOREGROUND);
- assertEquals(Color.class, value.getValueType());
- }
-
- public void testGetValueBackground() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.BACKGROUND);
-
- Color color = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK);
- shell.setBackground(color);
- assertEquals(color, value.getValue());
- }
-
- public void testSetValueBackground() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.BACKGROUND);
-
- Color color = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK);
-
- value.setValue(color);
- assertEquals(color, shell.getBackground());
- }
-
- public void testGetValueTypeBackgroundColor() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.BACKGROUND);
- assertEquals(Color.class, value.getValueType());
- }
-
- public void testGetValueTypeTooltip() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.TOOLTIP_TEXT);
- assertEquals(String.class, value.getValueType());
- }
-
- public void testSetValueFont() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.FONT);
-
- Font font = JFaceResources.getDialogFont();
-
- value.setValue(font);
- assertEquals(font, shell.getFont());
- }
-
- public void testGetValueFont() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.FONT);
-
- Font font = JFaceResources.getDialogFont();
- shell.setFont(font);
- assertEquals(font, value.getValue());
- }
-
- public void testGetValueTypeFont() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.FONT);
- assertEquals(Font.class, value.getValueType());
- }
-
- public void testSetValueTooltipText() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.TOOLTIP_TEXT);
- String text = "text";
- value.setValue(text);
- assertEquals(text, shell.getToolTipText());
- }
-
- public void testGetValueTooltipText() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.TOOLTIP_TEXT);
- String text = "text";
- shell.setToolTipText(text);
- assertEquals(text, value.getValue());
- }
-
- public void testGetValueTypeTooltipText() throws Exception {
- ControlObservableValue value = new ControlObservableValue(shell,
- SWTProperties.TOOLTIP_TEXT);
- assertEquals(String.class, value.getValueType());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/LabelObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/LabelObservableValueTest.java
deleted file mode 100644
index e036697..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/LabelObservableValueTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.internal.databinding.internal.swt.LabelObservableValue;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @since 3.2
- */
-public class LabelObservableValueTest extends TestCase {
- public void testSetValue() throws Exception {
- Shell shell = new Shell();
- Label label = new Label(shell, SWT.NONE);
- LabelObservableValue observableValue = new LabelObservableValue(label);
-
- assertEquals("", label.getText());
- assertEquals("", observableValue.getValue());
-
- String value = "value";
- observableValue.setValue(value);
- assertEquals("label text", value, label.getText());
- assertEquals("observable value", value, observableValue.getValue());
- shell.dispose();
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueTest.java
deleted file mode 100644
index 38ccdab..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.jface.databinding.swt.ISWTObservableValue;
-import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties;
-import org.eclipse.jface.internal.databinding.internal.swt.ScaleObservableValue;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Scale;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @since 1.1
- */
-public class ScaleObservableValueTest extends AbstractDefaultRealmTestCase {
- private Shell shell = null;
- private Scale scale;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- shell = new Shell();
- scale = new Scale(shell, SWT.NONE);
- scale.setMaximum(1000);
- }
-
- public void testMinGetValue() throws Exception {
- ISWTObservableValue value = new ScaleObservableValue(scale, SWTProperties.MIN);
- int min = 100;
- scale.setMinimum(min);
-
- assertEquals(new Integer(100), value.getValue());
- }
-
- public void testMinTypeIsIntegerType() throws Exception {
- assertEquals(Integer.TYPE, new ScaleObservableValue(scale, SWTProperties.MIN).getValueType());
- }
-
- public void testMinSetValue() throws Exception {
- ISWTObservableValue value = new ScaleObservableValue(scale, SWTProperties.MIN);
- int min = 100;
- value.setValue(new Integer(min));
- assertEquals(min, scale.getMinimum());
- }
-
- public void testMaxGetValue() throws Exception {
- ISWTObservableValue value = new ScaleObservableValue(scale, SWTProperties.MAX);
- int max = 100;
- scale.setMaximum(max);
-
- assertEquals(new Integer(100), value.getValue());
- }
-
- public void testMaxSetValue() throws Exception {
- ISWTObservableValue value = new ScaleObservableValue(scale, SWTProperties.MAX);
- int max = 100;
- value.setValue(new Integer(max));
- assertEquals(max, scale.getMaximum());
- }
-
- public void testMaxTypeIsIntegerType() throws Exception {
- assertEquals(Integer.TYPE, new ScaleObservableValue(scale, SWTProperties.MAX).getValueType());
- }
-
- public void testSelectionChangeEvent() throws Exception {
- class ChangeListenerStub implements IChangeListener {
- int count;
- public void handleChange(ChangeEvent event) {
- count++;
- }
- }
-
- ISWTObservableValue value = new ScaleObservableValue(scale, SWTProperties.SELECTION);
- ChangeListenerStub listener = new ChangeListenerStub();
- value.addChangeListener(listener);
-
- scale.setSelection(scale.getSelection() + 1);
-
- assertEquals(0, listener.count);
- scale.notifyListeners(SWT.Selection, null);
- assertEquals(1, listener.count);
- }
-
- public void testSelectionGetValue() throws Exception {
- ISWTObservableValue value = new ScaleObservableValue(scale, SWTProperties.SELECTION);
- int selection = 5;
- scale.setSelection(selection);
- assertEquals(new Integer(5), value.getValue());
- }
-
- public void testSelectionSetValue() throws Exception {
- ISWTObservableValue value = new ScaleObservableValue(scale, SWTProperties.SELECTION);
- int selection = 5;
- value.setValue(new Integer(selection));
- assertEquals(selection, scale.getSelection());
- }
-
- public void testSelectionTypeIsIntegerType() throws Exception {
- assertEquals(Integer.TYPE, new ScaleObservableValue(scale, SWTProperties.SELECTION).getValueType());
- }
-
- public void testDisposeListenerWhenObservableIsDisposed() throws Exception {
- assertFalse(scale.isListening(SWT.Selection));
- ISWTObservableValue value = new ScaleObservableValue(scale, SWTProperties.SELECTION);
- assertTrue(scale.isListening(SWT.Selection));
- value.dispose();
- assertFalse(scale.isListening(SWT.Selection));
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueTest.java
deleted file mode 100644
index 5600064..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties;
-import org.eclipse.jface.internal.databinding.internal.swt.SpinnerObservableValue;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Spinner;
-
-/**
- * @since 3.2
- *
- */
-public class SpinnerObservableValueTest extends TestCase {
- public void testSetValueSelection() throws Exception {
- Shell shell = new Shell();
- Spinner spinner = new Spinner(shell, SWT.NONE);
- SpinnerObservableValue observableValue = new SpinnerObservableValue(spinner, SWTProperties.SELECTION);
-
- assertEquals(0, spinner.getSelection());
- assertEquals(0, ((Integer) observableValue.getValue()).intValue());
-
- Integer value = new Integer(1);
- observableValue.setValue(value);
- assertEquals("spinner selection", value.intValue(), spinner.getSelection());
- assertEquals("observable value", value, observableValue.getValue());
- shell.dispose();
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TableObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TableObservableValueTest.java
deleted file mode 100644
index 56c53fc..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TableObservableValueTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties;
-import org.eclipse.jface.internal.databinding.internal.swt.TableObservableValue;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * @since 3.2
- */
-public class TableObservableValueTest extends TestCase {
- public void testSetValue() throws Exception {
- Shell shell = new Shell();
- Table table = new Table(shell, SWT.NONE);
- TableObservableValue observableValue = new TableObservableValue(table, SWTProperties.SELECTION);
- new TableItem(table, SWT.NONE);
-
- assertEquals(-1, table.getSelectionIndex());
- assertEquals(-1, ((Integer) observableValue.getValue()).intValue());
-
- Integer value = new Integer(0);
- observableValue.setValue(value);
- assertEquals("table selection index", value.intValue(), table.getSelectionIndex());
- assertEquals("observable value", value, observableValue.getValue());
- shell.dispose();
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextEditableObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextEditableObservableValueTest.java
deleted file mode 100644
index abde200..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextEditableObservableValueTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.internal.swt;
-
-import org.eclipse.jface.internal.databinding.internal.swt.TextEditableObservableValue;
-import org.eclipse.jface.tests.databinding.AbstractSWTTestCase;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @since 1.1
- */
-public class TextEditableObservableValueTest extends
- AbstractSWTTestCase {
-
- private Text text;
- private TextEditableObservableValue value;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- text = new Text(getShell(), SWT.NONE);
- value = new TextEditableObservableValue(text);
- }
-
- public void testGetValue() throws Exception {
- text.setEditable(false);
- assertEquals(Boolean.valueOf(text.getEditable()), value.getValue());
-
- text.setEditable(true);
- assertEquals(Boolean.valueOf(text.getEditable()), value.getValue());
- }
-
- public void testSetValue() throws Exception {
- text.setEditable(false);
- value.setValue(Boolean.TRUE);
- assertEquals(Boolean.TRUE, Boolean.valueOf(text.getEditable()));
-
- value.setValue(Boolean.FALSE);
- assertEquals(Boolean.FALSE, Boolean.valueOf(text.getEditable()));
- }
-
- public void testGetType() throws Exception {
- assertEquals(Boolean.TYPE, value.getValueType());
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValueTest.java
deleted file mode 100644
index 6de9f33..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValueTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds.
- * 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 116920
- *******************************************************************************/
-package org.eclipse.jface.tests.internal.databinding.internal.viewers;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.internal.databinding.internal.viewers.SelectionProviderSingleSelectionObservableValue;
-import org.eclipse.jface.tests.databinding.util.EventTrackers.ValueChangeEventTracker;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Tests for SelectionProviderSingleSelectionObservableValue.
- *
- * @since 1.1
- */
-public class SelectionProviderSingleSelectionObservableValueTest extends TestCase {
- private ISelectionProvider selectionProvider;
-
- private TableViewer viewer;
-
- private static String[] model = new String[] { "0", "1" };
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- Shell shell = new Shell();
- viewer = new TableViewer(shell, SWT.NONE);
- viewer.setContentProvider(new ContentProvider());
- viewer.setInput(model);
- selectionProvider = viewer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- Shell shell = viewer.getTable().getShell();
- if (!shell.isDisposed())
- shell.dispose();
- }
-
- public void testConstructorIllegalArgumentException() {
- try {
- new SelectionProviderSingleSelectionObservableValue(SWTObservables.getRealm(Display.getDefault()), null);
- fail();
- } catch (IllegalArgumentException e) {
- }
- }
-
- /**
- * Asserts that when a selection is set on the viewer:
- * <ul>
- * <li>the selection is available in the observable</li>
- * <li>Value change events are fired with appropriate diff values</li>
- * </ul>
- */
- public void testGetSetValue() {
- SelectionProviderSingleSelectionObservableValue observable = new SelectionProviderSingleSelectionObservableValue(
- SWTObservables.getRealm(Display.getDefault()),
- selectionProvider);
- ValueChangeEventTracker listener = new ValueChangeEventTracker();
- observable.addValueChangeListener(listener);
- assertNull(observable.getValue());
-
- selectionProvider.setSelection(new StructuredSelection(model[0]));
- assertEquals(1, listener.count);
- assertNull(listener.event.diff.getOldValue());
- assertEquals(model[0], listener.event.diff.getNewValue());
- assertEquals(observable, listener.event.getObservableValue());
- assertEquals(model[0], observable.getValue());
-
- selectionProvider.setSelection(new StructuredSelection(model[1]));
- assertEquals(2, listener.count);
- assertEquals(model[0], listener.event.diff.getOldValue());
- assertEquals(model[1], listener.event.diff.getNewValue());
- assertEquals(observable, listener.event.getObservableValue());
- assertEquals(model[1], observable.getValue());
-
- selectionProvider.setSelection(StructuredSelection.EMPTY);
- assertEquals(3, listener.count);
- assertEquals(model[1], listener.event.diff.getOldValue());
- assertNull(listener.event.diff.getNewValue());
- assertEquals(observable, listener.event.getObservableValue());
- assertEquals(null, observable.getValue());
- }
-
- private class ContentProvider implements IStructuredContentProvider {
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // TODO Auto-generated method stub
-
- }
-
- public Object[] getElements(Object inputElement) {
- return (String[]) inputElement;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/observable/AbstractObservableTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/observable/AbstractObservableTest.java
deleted file mode 100644
index 6fcca32..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/observable/AbstractObservableTest.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds.
- * 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:
- * Brad Reynolds - initial API and implementation
- * Brad Reynolds - bug 116920
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.provisional.observable;
-
-import org.eclipse.core.databinding.observable.AbstractObservable;
-import org.eclipse.core.databinding.observable.ChangeEvent;
-import org.eclipse.core.databinding.observable.IChangeListener;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.IStaleListener;
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.databinding.observable.StaleEvent;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-import org.eclipse.jface.tests.databinding.util.RealmTester;
-import org.eclipse.jface.tests.databinding.util.RealmTester.CurrentRealm;
-
-/**
- * Tests for AbstractObservable.
- *
- * @since 1.1
- */
-public class AbstractObservableTest extends AbstractDefaultRealmTestCase {
- private ObservableStub observable;
-
- protected void setUp() throws Exception {
- super.setUp();
- observable = new ObservableStub(Realm.getDefault());
- }
-
- public void testStaleListener() throws Exception {
- assertFalse(observable.hasListeners());
-
- StaleListener listener1 = new StaleListener();
-
- assertFalse(observable.firstListenerAdded);
- observable.addStaleListener(listener1);
- assertTrue(observable.firstListenerAdded);
- observable.firstListenerAdded = false; // reset
-
- assertTrue(observable.hasListeners());
- assertEquals(0, listener1.count);
-
- observable.fireStale();
-
- assertEquals(1, listener1.count);
- assertSame(observable, listener1.source);
-
- // Add a second stale listener as 1 vs. 2 listener code is different.
- StaleListener listener2 = new StaleListener();
- assertEquals(0, listener2.count);
- observable.addStaleListener(listener2);
- observable.fireStale();
-
- assertEquals(2, listener1.count);
- assertEquals(1, listener2.count);
-
- // Add a third stale listener as 2 vs. 3 or greater code is different.
- StaleListener listener3 = new StaleListener();
- observable.addStaleListener(listener3);
- assertEquals(0, listener3.count);
-
- observable.fireStale();
-
- assertEquals(3, listener1.count);
- assertEquals(2, listener2.count);
- assertEquals(1, listener3.count);
-
- assertFalse(observable.lastListenerRemoved);
- observable.removeStaleListener(listener1);
- observable.removeStaleListener(listener2);
- observable.removeStaleListener(listener3);
- assertTrue(observable.lastListenerRemoved);
-
- assertFalse(observable.hasListeners());
- }
-
- public void testChangeListener() throws Exception {
- assertFalse(observable.hasListeners());
-
- ChangeListener listener1 = new ChangeListener();
-
- assertFalse(observable.firstListenerAdded);
- observable.addChangeListener(listener1);
- assertTrue(observable.firstListenerAdded);
- observable.firstListenerAdded = false;
-
- assertTrue(observable.hasListeners());
- assertEquals(0, listener1.count);
-
- observable.fireChange();
-
- assertEquals(1, listener1.count);
- assertSame(observable, listener1.source);
-
- // Add a second listener as the 1 vs. 2 listener code is different.
- ChangeListener listener2 = new ChangeListener();
- observable.addChangeListener(listener2);
- assertEquals(0, listener2.count);
-
- observable.fireChange();
- assertEquals(2, listener1.count);
- assertEquals(1, listener2.count);
-
- // Add a third listener as the 2 vs. 3 or greater code is different.
- ChangeListener listener3 = new ChangeListener();
- observable.addChangeListener(listener3);
- assertEquals(0, listener3.count);
-
- observable.fireChange();
-
- assertEquals(3, listener1.count);
- assertEquals(2, listener2.count);
- assertEquals(1, listener3.count);
-
- assertFalse(observable.lastListenerRemoved);
- observable.removeChangeListener(listener1);
- observable.removeChangeListener(listener2);
- observable.removeChangeListener(listener3);
- assertTrue(observable.lastListenerRemoved);
-
- assertFalse(observable.hasListeners());
- }
-
- public void testHasListenersWithChangeAndStaleListeners() throws Exception {
- ChangeListener changeListener = new ChangeListener();
- StaleListener staleListener = new StaleListener();
-
- assertFalse(observable.hasListeners());
- assertFalse(observable.firstListenerAdded);
- assertFalse(observable.lastListenerRemoved);
-
- observable.addChangeListener(changeListener);
- assertTrue(observable.hasListeners());
- assertTrue(observable.firstListenerAdded);
- assertFalse(observable.lastListenerRemoved);
-
- // reset
- observable.firstListenerAdded = false;
- observable.lastListenerRemoved = false;
-
- observable.addStaleListener(staleListener);
- assertTrue(observable.hasListeners());
- assertFalse(observable.firstListenerAdded);
- assertFalse(observable.lastListenerRemoved);
-
- observable.removeChangeListener(changeListener);
- assertTrue(observable.hasListeners());
- assertFalse(observable.firstListenerAdded);
- assertFalse(observable.lastListenerRemoved);
-
- observable.removeStaleListener(staleListener);
- assertFalse(observable.hasListeners());
- assertFalse(observable.firstListenerAdded);
- assertTrue(observable.lastListenerRemoved);
- }
-
- public void testFireStaleRealmChecks() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
-
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- observable = new ObservableStub();
- observable.fireStale();
- }
- });
- }
-
- public void testFireChangeRealmChecks() throws Exception {
- RealmTester.setDefault(new CurrentRealm(true));
-
- RealmTester.exerciseCurrent(new Runnable() {
- public void run() {
- observable = new ObservableStub();
- observable.fireChange();
- }
- });
- }
-
- private class ChangeListener implements IChangeListener {
- int count;
- IObservable source;
-
- public void handleChange(ChangeEvent event) {
- count++;
- this.source = event.getObservable();
- }
- }
-
- private class StaleListener implements IStaleListener {
- int count;
- IObservable source;
-
- public void handleStale(StaleEvent event) {
- count++;
- this.source = event.getObservable();
- }
- }
-
- private static class ObservableStub extends AbstractObservable {
- public ObservableStub() {
- this(Realm.getDefault());
- }
-
- /**
- * @param realm
- */
- public ObservableStub(Realm realm) {
- super(realm);
- }
-
- private boolean firstListenerAdded;
- private boolean lastListenerRemoved;
-
- protected Object doGetValue() {
- return null;
- }
-
- public Object getValueType() {
- return null;
- }
-
- protected void fireStale() {
- super.fireStale();
- }
-
- protected void fireChange() {
- super.fireChange();
- }
-
- public boolean isStale() {
- return false;
- }
-
- protected boolean hasListeners() {
- return super.hasListeners();
- }
-
- protected void firstListenerAdded() {
- firstListenerAdded = true;
- }
-
- protected void lastListenerRemoved() {
- lastListenerRemoved = true;
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/observable/ObservablesTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/observable/ObservablesTest.java
deleted file mode 100644
index b97183c..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/observable/ObservablesTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Cerner Corporation 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.provisional.observable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.databinding.observable.Observables;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.ObservableList;
-import org.eclipse.core.internal.databinding.observable.UnmodifiableObservableList;
-import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
-
-public class ObservablesTest extends AbstractDefaultRealmTestCase {
- public void testUnmodifableObservableListExceptions() throws Exception {
- try {
- Observables.unmodifiableObservableList(null);
- fail("IllegalArgumentException should have been thrown.");
- } catch (IllegalArgumentException e) {
- }
- }
-
- public void testUnmodifiableObservableList() throws Exception {
- IObservableList unmodifiable = Observables.unmodifiableObservableList(new ObservableListStub(new ArrayList(0), String.class));
- assertTrue(unmodifiable instanceof UnmodifiableObservableList);
- }
-
- private static class ObservableListStub extends ObservableList {
- /**
- * @param wrappedList
- * @param elementType
- */
- protected ObservableListStub(List wrappedList, Object elementType) {
- super(wrappedList, elementType);
- }
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/viewers/SelectionObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/viewers/SelectionObservableValueTest.java
deleted file mode 100644
index 7f8b640..0000000
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/viewers/SelectionObservableValueTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Brad Reynolds 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:
- * Brad Reynolds - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jface.tests.internal.databinding.provisional.viewers;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.viewers.ViewersObservables;
-import org.eclipse.jface.tests.databinding.util.EventTrackers.ValueChangeEventTracker;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @since 1.1
- */
-public class SelectionObservableValueTest extends TestCase {
- public void testSetValue() throws Exception {
- Shell shell = new Shell();
- ListViewer viewer = new ListViewer(shell);
- String[] items = new String[] {"1", "2", "3"};
- viewer.setContentProvider(new ArrayContentProvider());
- viewer.setInput(items);
-
- IObservableValue observable = ViewersObservables.observeSingleSelection(viewer);
- ValueChangeEventTracker listener = new ValueChangeEventTracker();
- observable.addValueChangeListener(listener);
-
- assertNull(observable.getValue());
- assertEquals(StructuredSelection.EMPTY, viewer.getSelection());
- assertEquals(0, listener.count);
-
- observable.setValue(items[0]);
- assertEquals("observable value", items[0], observable.getValue());
- assertEquals("viewer selection", items[0], ((StructuredSelection) viewer.getSelection()).getFirstElement());
- assertEquals("value change event", 1, listener.count);
-
- observable.setValue(items[0]);
- assertEquals("value did not change, event should not have fired", 1, listener.count);
-
- observable.setValue(null);
- assertNull(observable.getValue());
- assertEquals("viewer selection should be empty", StructuredSelection.EMPTY, viewer.getSelection());
- assertEquals("value change event did not fire", 2, listener.count);
- }
-}
diff --git a/tests/org.eclipse.jface.tests.databinding/test.xml b/tests/org.eclipse.jface.tests.databinding/test.xml
deleted file mode 100644
index 73284d5..0000000
--- a/tests/org.eclipse.jface.tests.databinding/test.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}\..\.."/>
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.jface.tests.databinding"/>
- <property name="library-file"
- value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="sniff-folder"
- value="${eclipse-home}/databinding_sniff_folder"/>
- <delete dir="${sniff-folder}" quiet="true"/>
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${sniff-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.jface.tests.databinding.BindingTestSuite"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project>