diff options
author | cvs2svn | 2007-11-05 21:26:35 +0000 |
---|---|---|
committer | cvs2svn | 2007-11-05 21:26:35 +0000 |
commit | efbd0d56319992cf85a772d8e26f02f40868c2fc (patch) | |
tree | ed1483f001e711955d49c31e0d5f7b003c16e977 | |
parent | 29ca410386d5cf5fa86ae514cbd50a598aaf5dbd (diff) | |
download | org.eclipse.e4.databinding-efbd0d56319992cf85a772d8e26f02f40868c2fc.tar.gz org.eclipse.e4.databinding-efbd0d56319992cf85a772d8e26f02f40868c2fc.tar.xz org.eclipse.e4.databinding-efbd0d56319992cf85a772d8e26f02f40868c2fc.zip |
This commit was manufactured by cvs2svn to create branchI20071107-1300I20071107-0940
'zBranch_I20071106-0800'.
Sprout from master 2007-11-05 21:26:33 UTC Tod Creasey <tod> 'Fix for Bug 208205 [Markers] New Markers view: Limit visible items should be per group'
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/PojoObservables.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.observable/src/org/eclipse/core/databinding/observable/AbstractObservable.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeManager.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeSupport.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Diffs.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IChangeListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservable.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservableCollection.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservablesListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObserving.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IStaleListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ObservableEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ObservableTracker.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Observables.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Realm.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/StaleEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IObservableList.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListDiff.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListDiffEntry.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ObservableList.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/WritableList.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/package.html
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/BidirectionalMap.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/IMapChangeListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/IObservableMap.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/MapDiff.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ObservableMap.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/WritableMap.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/package.html
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/IObservableFactory.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/MasterDetailObservables.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/package.html
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/package.html
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/AbstractObservableSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/IObservableSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ISetChangeListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/MappedSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ObservableSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetDiff.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/UnionSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/WritableSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/package.html
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/AbstractObservableValue.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/AbstractVetoableValue.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ChangeVetoException.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ComputedValue.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IObservableValue.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IValueChangeListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IValueChangingListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IVetoableValue.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangingEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueDiff.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/WritableValue.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/package.html
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/ILogger.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/Policy.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/package.html
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/EmptyObservableList.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/EmptyObservableSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/IStalenessConsumer.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/ProxyObservableSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/StalenessTracker.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableList.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableSet.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableValue.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenCountUpdate.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenUpdate.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IHasChildrenUpdate.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IObservableTree.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IOrderedTreeProvider.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/ITreeChangeListener.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IUnorderedTreeProvider.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IViewerUpdate.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeChangeEvent.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiff.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffNode.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffVisitor.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.java
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/package.html
bundles/org.eclipse.core.databinding/.classpath
bundles/org.eclipse.core.databinding/.cvsignore
bundles/org.eclipse.core.databinding/.project
bundles/org.eclipse.core.databinding/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.core.databinding/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.core.databinding/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF
bundles/org.eclipse.core.databinding/about.html
bundles/org.eclipse.core.databinding/build.properties
bundles/org.eclipse.core.databinding/component.xml
bundles/org.eclipse.core.databinding/plugin.properties
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/AggregateValidationStatus.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/Binding.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/BindingException.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/DataBindingContext.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ListBinding.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ObservablesManager.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateListStrategy.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateStrategy.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateValueStrategy.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ValueBinding.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/Converter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/IConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/AbstractObservable.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeManager.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeSupport.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Diffs.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IChangeListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservable.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservableCollection.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservablesListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObserving.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IStaleListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ObservableEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ObservableTracker.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Realm.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/StaleEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IObservableList.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiff.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiffEntry.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ObservableList.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/WritableList.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/BidirectionalMap.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/IMapChangeListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/IObservableMap.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapDiff.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ObservableMap.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/WritableMap.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/IObservableFactory.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/MasterDetailObservables.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/AbstractObservableSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/IObservableSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ISetChangeListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/MappedSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ObservableSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetDiff.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/UnionSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/WritableSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/AbstractObservableValue.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/AbstractVetoableValue.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ChangeVetoException.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ComputedValue.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IObservableValue.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IValueChangeListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IValueChangingListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IVetoableValue.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueChangingEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueDiff.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/WritableValue.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/ILogger.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/Policy.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/IValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/ValidationStatus.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Activator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingMessages.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingStatus.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ClassLookupSupport.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/IdentityWrapper.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Pair.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Queue.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/RandomAccessListIterator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Util.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ValidationStatusMap.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateConversionSupport.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IdentityConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IntegerToStringConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToByteConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToDoubleConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToFloatConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToIntegerConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToLongConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToNumberConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToShortConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/ObjectToStringConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StatusToStringConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanPrimitiveConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToByteConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToCharacterConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToDateConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToShortConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/messages.properties
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/EmptyObservableList.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/EmptyObservableSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/IStalenessConsumer.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/ProxyObservableSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/StalenessTracker.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableList.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableSet.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableValue.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenCountUpdate.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenUpdate.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IHasChildrenUpdate.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IObservableTree.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IOrderedTreeProvider.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/ITreeChangeListener.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IUnorderedTreeProvider.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IViewerUpdate.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeChangeEvent.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiff.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffNode.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffVisitor.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/package.html
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/AbstractStringToNumberValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberFormatConverter.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToByteValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToDoubleValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToFloatValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToIntegerValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToLongValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToNumberValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToShortValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToUnboundedNumberValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ObjectToPrimitiveValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ReadOnlyValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToByteValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToDateValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToDoubleValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToFloatValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToIntegerValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToLongValidator.java
bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToShortValidator.java
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/databinding/wizard/package.html
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/CComboSingleSelectionObservableValue.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/ComboSingleSelectionObservableValue.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/ListSingleSelectionObservableValue.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/SingleSelectionObservableValue.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/TableSingleSelectionObservableValue.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/LeafNodesSet.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/SelectionProviderMultipleSelectionObservableList.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/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/IParentProvider.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/TreeNode.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/UnorderedTreeContentProvider.java
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/ViewerLabelProvider.java
bundles/org.eclipse.jface/.classpath
bundles/org.eclipse.jface/.cvsignore
bundles/org.eclipse.jface/.options
bundles/org.eclipse.jface/.project
bundles/org.eclipse.jface/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.jface/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.jface/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.jface/META-INF/MANIFEST.MF
bundles/org.eclipse.jface/about.html
bundles/org.eclipse.jface/build.properties
bundles/org.eclipse.jface/component.xml
bundles/org.eclipse.jface/icons/full/help.gif
bundles/org.eclipse.jface/icons/full/message_error.gif
bundles/org.eclipse.jface/icons/full/message_info.gif
bundles/org.eclipse.jface/icons/full/message_warning.gif
bundles/org.eclipse.jface/icons/full/page.gif
bundles/org.eclipse.jface/icons/full/pref_dialog_title.gif
bundles/org.eclipse.jface/icons/full/title_banner.png
bundles/org.eclipse.jface/plugin.properties
bundles/org.eclipse.jface/scripts/exportplugin.xml
bundles/org.eclipse.jface/src/org/eclipse/jface/action/AbstractAction.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/AbstractGroupMarker.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/Action.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ContributionItem.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ContributionManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ControlContribution.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/CoolBarManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ExternalActionManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ExternalActionManager.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/action/GroupMarker.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IAction.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IContributionItem.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IContributionManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IContributionManagerOverrides.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ICoolBarManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IMenuCreator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IMenuListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IMenuListener2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IMenuManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IStatusLineManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/IToolBarManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/LegacyActionTools.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/MenuManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/Separator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/StatusLine.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/StatusLineLayoutData.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/StatusLineManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/SubContributionItem.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/SubContributionManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/SubCoolBarManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/SubMenuManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/SubStatusLineManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/SubToolBarManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ToolBarContributionItem.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ToolBarManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/action/images/stop.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/action/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/Binding.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/BindingManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/BindingManagerEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/CachedBindingSet.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/IBindingManagerListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/ISchemeListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/Scheme.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/SchemeEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/Trigger.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/TriggerSequence.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/IKeyLookup.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/KeyBinding.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/KeyLookupFactory.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/KeySequence.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/KeySequenceText.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/KeyStroke.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/ParseException.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/SWTKeyLookup.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/SWTKeySupport.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/AbstractKeyFormatter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/AbstractKeyFormatter.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/EmacsKeyFormatter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/EmacsKeyFormatter.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/FormalKeyFormatter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/IKeyFormatter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/KeyFormatterFactory.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/NativeKeyFormatter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/NativeKeyFormatter.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/formatting/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ActionHandler.java
bundles/org.eclipse.jface/src/org/eclipse/jface/commands/PersistentState.java
bundles/org.eclipse.jface/src/org/eclipse/jface/commands/RadioState.java
bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ToggleState.java
bundles/org.eclipse.jface/src/org/eclipse/jface/commands/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/contexts/IContextIds.java
bundles/org.eclipse.jface/src/org/eclipse/jface/contexts/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/AnimatorFactory.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ControlAnimator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ControlEnableState.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/Dialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogMessageArea.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogPage.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogSettings.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogTray.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ErrorDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ErrorSupportProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IDialogBlockedHandler.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IDialogConstants.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IDialogPage.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IDialogSettings.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IInputValidator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IMessageProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IPageChangeProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IPageChangedListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IPageChangingListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IconAndMessageDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ImageAndMessageArea.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/InputDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/MessageDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/MessageDialogWithToggle.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/PageChangedEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/PageChangingEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/PopupDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ProgressIndicator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ProgressMonitorDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/StatusDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/TitleAreaDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/TrayDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/images/help.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/images/message_error.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/images/message_info.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/images/message_warning.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/images/popup_menu.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/images/popup_menu_disabled.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/images/title_banner.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/AutoCompleteField.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ComboContentAdapter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/DecoratedField.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldAssistColors.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldDecoration.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/FieldDecorationRegistry.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/IContentProposal.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/IContentProposalListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/IContentProposalListener2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/IContentProposalProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/IControlContentAdapter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/IControlContentAdapter2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/IControlCreator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/SimpleContentProposalProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/TextContentAdapter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/TextControlCreator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/images/contassist_ovr.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/images/error_ovr.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/images/errorqf_ovr.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/images/info_ovr.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/images/required_field_cue.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/images/warn_ovr.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/images/dots_button.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/internal/InternalPolicy.java
bundles/org.eclipse.jface/src/org/eclipse/jface/internal/JFaceActivator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/internal/provisional/action/CoolBarManager2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/internal/provisional/action/ICoolBarManager2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/internal/provisional/action/IToolBarContributionItem.java
bundles/org.eclipse.jface/src/org/eclipse/jface/internal/provisional/action/IToolBarManager2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/internal/provisional/action/ToolBarContributionItem2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/internal/provisional/action/ToolBarManager2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/layout/AbstractColumnLayout.java
bundles/org.eclipse.jface/src/org/eclipse/jface/layout/GridDataFactory.java
bundles/org.eclipse.jface/src/org/eclipse/jface/layout/GridLayoutFactory.java
bundles/org.eclipse.jface/src/org/eclipse/jface/layout/LayoutConstants.java
bundles/org.eclipse.jface/src/org/eclipse/jface/layout/LayoutGenerator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/layout/TableColumnLayout.java
bundles/org.eclipse.jface/src/org/eclipse/jface/layout/TreeColumnLayout.java
bundles/org.eclipse.jface/src/org/eclipse/jface/layout/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/menus/AbstractTrimWidget.java
bundles/org.eclipse.jface/src/org/eclipse/jface/menus/IMenuStateIds.java
bundles/org.eclipse.jface/src/org/eclipse/jface/menus/IWidget.java
bundles/org.eclipse.jface/src/org/eclipse/jface/menus/TextState.java
bundles/org.eclipse.jface/src/org/eclipse/jface/menus/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/messages.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/AccumulatingProgressMonitor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/IRunnableContext.java
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/IRunnableWithProgress.java
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/IThreadListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/ModalContext.java
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/BooleanFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/BooleanPropertyAction.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/ColorFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/ColorSelector.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/ComboFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/DirectoryFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/FieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/FieldEditorPreferencePage.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/FileFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/FontFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IPersistentPreferenceStore.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IPreferenceNode.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IPreferencePage.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IPreferencePageContainer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IPreferenceStore.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/IntegerFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/JFacePreferences.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/ListEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PathEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceConverter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceNode.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferencePage.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceStore.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/RadioGroupFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/ScaleFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/StringButtonFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/StringFieldEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/images/pref_dialog_title.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/AbstractResourceManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ArrayFontDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ColorDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ColorRegistry.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/CompositeImageDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/DataFormatException.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/DerivedImageDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/DeviceResourceDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/DeviceResourceException.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/DeviceResourceManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/FileImageDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/FontDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/FontRegistry.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ImageDataImageDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ImageDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ImageRegistry.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/JFaceColors.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/JFaceResources.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/LocalResourceManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/MissingImageDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/RGBColorDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ResourceManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ResourceRegistry.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/StringConverter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/URLImageDescriptor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_aix.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_hp-ux.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_linux.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_linux_gtk.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_macosx.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_qnx.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_sunos.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_windows2000.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_windows98.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_windowsnt.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/jfacefonts_windowsxp.properties
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/util/Assert.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/DelegatingDragAdapter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/DelegatingDropAdapter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/Geometry.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/ILogger.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/IOpenEventListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/IPropertyChangeListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/ISafeRunnableRunner.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/ListenerList.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/LocalSelectionTransfer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/OpenStrategy.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/Policy.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/PropertyChangeEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/SafeRunnable.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/SafeRunnableDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/TransferDragSourceListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/TransferDropTargetListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java
bundles/org.eclipse.jface/src/org/eclipse/jface/util/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractListViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTableViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AcceptAllFilter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ArrayContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/BaseLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CellEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CellLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CellNavigationStrategy.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckStateChangedEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxCellEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTableViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTreeViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColorCellEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnLayoutData.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnPixelData.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerEditorActivationEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerEditorActivationListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerEditorActivationStrategy.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerEditorDeactivationEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnViewerToolTipSupport.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnWeightData.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ComboBoxCellEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ComboViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ContentViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CustomHashtable.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DecoratingLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DecorationContext.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DecorationOverlayIcon.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DialogCellEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DoubleClickEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/EditingSupport.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/FocusCellHighlighter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/FocusCellOwnerDrawHighlighter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IBaseLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IBasicPropertyConstants.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ICellEditorListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ICellEditorValidator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ICellModifier.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ICheckStateListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ICheckable.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IColorDecorator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IColorProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IDecoration.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IDecorationContext.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IDelayedLabelDecorator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IDoubleClickListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IElementComparer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IFilter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IFontDecorator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IFontProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IInputProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IInputSelectionProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ILabelDecorator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ILabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ILabelProviderListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ILazyContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ILazyTreeContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ILazyTreePathContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ILightweightLabelDecorator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IOpenListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IPostSelectionProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ISelection.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ISelectionChangedListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ISelectionProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IStructuredContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IStructuredSelection.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableColorProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableFontProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITreeContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITreePathContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITreePathLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITreeSelection.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITreeViewerListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/IViewerLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/LabelDecorator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/LabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/LabelProviderChangedEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ListViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/NamedHandleObjectLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/OpenEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/OwnerDrawLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/SWTFocusCellManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/SelectionChangedEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredSelection.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableColumnViewerLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableLayout.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableTreeViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewerColumn.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewerEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewerFocusCellManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewerRow.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TextCellEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeColumnViewerLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeExpansionEvent.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeNode.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeNodeContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreePath.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreePathViewerSorter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeSelection.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewerColumn.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewerEditor.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewerFocusCellManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewerRow.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/Viewer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerCell.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerColumn.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerComparator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerDropAdapter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerFilter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerLabel.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerRow.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerSorter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/WrappedViewerLabelProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/AbstractConcurrentModel.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/AbstractVirtualTable.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/BackgroundContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/ChangeQueue.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/ConcurrentTableUpdator.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/DeferredContentProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/FastProgressReporter.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/IConcurrentModel.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/IConcurrentModelListener.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/IntHashMap.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/LazySortedCollection.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/SetModel.java
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/window/ApplicationWindow.java
bundles/org.eclipse.jface/src/org/eclipse/jface/window/DefaultToolTip.java
bundles/org.eclipse.jface/src/org/eclipse/jface/window/IShellProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/window/SameShellProvider.java
bundles/org.eclipse.jface/src/org/eclipse/jface/window/ToolTip.java
bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java
bundles/org.eclipse.jface/src/org/eclipse/jface/window/WindowManager.java
bundles/org.eclipse.jface/src/org/eclipse/jface/window/package.html
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/IWizard.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/IWizardContainer.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/IWizardContainer2.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/IWizardNode.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/IWizardPage.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/ProgressMonitorPart.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/Wizard.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardPage.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardSelectionPage.java
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/images/page.gif
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/package.html
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/icons/progress/ani/1.png
bundles/org.eclipse.ui.forms/icons/progress/ani/2.png
bundles/org.eclipse.ui.forms/icons/progress/ani/3.png
bundles/org.eclipse.ui.forms/icons/progress/ani/4.png
bundles/org.eclipse.ui.forms/icons/progress/ani/5.png
bundles/org.eclipse.ui.forms/icons/progress/ani/6.png
bundles/org.eclipse.ui.forms/icons/progress/ani/7.png
bundles/org.eclipse.ui.forms/icons/progress/ani/8.png
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/FormImages.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.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.jdt.ui.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/ProjectExplorer.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/content.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/NavigatorExtensionStateService.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/OverridableTabListContentProvider.java
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/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/AbstractOverridableTabListPropertySection.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/AbstractSectionDescriptor.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/AbstractTabDescriptor.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/IOverridableTabList.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/IOverridableTabListContentProvider.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/ITabDescriptor.java
bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/views/properties/tabbed/ITabDescriptorProvider.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/TabContents.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
bundles/org.eclipse.ui.workbench/.classpath
bundles/org.eclipse.ui.workbench/.cvsignore
bundles/org.eclipse.ui.workbench/.options
bundles/org.eclipse.ui.workbench/.project
bundles/org.eclipse.ui.workbench/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui.workbench/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui.workbench/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui.workbench/Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/AbstractSourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ActiveShellExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/BasicWorkingSetElementAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ExtensionFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IActionBars.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IActionBars2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IActionDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IActionDelegate2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IActionDelegateWithEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IActionFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IContainmentAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IDecoratorManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorActionBarContributor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorActionDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorInput.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorLauncher.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorMatchingStrategy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IEditorSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IElementFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IExportWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IFileEditorMapping.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IFolderLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IImportWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IInPlaceEditor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IInPlaceEditorInput.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IKeyBindingService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ILocalWorkingSetManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IMemento.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/INavigationHistory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/INavigationLocation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/INavigationLocationProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/INestableKeyBindingService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/INewWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/INullSelectionListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IObjectActionDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPageLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPageListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPageService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPartListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPartListener2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPartService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPathEditorInput.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPersistable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPersistableEditor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPersistableElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPerspectiveDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPerspectiveFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPerspectiveListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPerspectiveListener2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPerspectiveListener3.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPerspectiveListener4.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPerspectiveRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPlaceholderFolderLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPluginContribution.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPropertyListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IReusableEditor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISaveableFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISaveablePart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISaveablePart2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISaveablesLifecycleListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISaveablesSource.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISelectionListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISelectionService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISharedImages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IShowEditorInput.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISizeProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISourceProviderListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/ISources.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IStartup.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IViewActionDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IViewLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IViewPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IViewReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IViewSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWindowListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbench.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchActionConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPart2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPart3.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPartConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPartDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPartReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPartSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPropertyPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchWindow.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchWindowActionDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchWindowPulldownDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchWindowPulldownDelegate2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkingSet.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkingSetElementAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkingSetManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkingSetUpdater.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/LegacyHandlerSubmissionExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/NavigationLocation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/PartInitException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/PerspectiveAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/PlatformUI.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/Saveable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/SaveablesLifecycleEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/SelectionEnabler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/SubActionBars.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/SubActionBars2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/WorkbenchException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/about/ISystemSummarySection.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/about/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionContext.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionGroup.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/BaseNewWizardMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/BaseSelectionListenerAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/CommandNotMappedException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/CompoundContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ExportResourcesAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ImportResourcesAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/LabelRetargetAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/NewWizardAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/NewWizardDropDownAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/OpenInNewWindowAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/OpenNewPageMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/OpenNewWindowMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/OpenPerspectiveAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/OpenPerspectiveMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/PartEventAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/QuickMenuCreator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/RetargetAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/SelectionProviderAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/SimpleWildcardTester.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/WorkingSetFilterActionGroup.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivitiesPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ActivityManagerEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/CategoryEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivity.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityManagerListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityPatternBinding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IActivityRequirementBinding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategoryActivityBinding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ICategoryListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IIdentifier.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IIdentifierListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IMutableActivityManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPoint.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointAdvisor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/ITriggerPointManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IWorkbenchActivitySupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/IdentifierEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/NotDefinedException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchActivityHelper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/WorkbenchTriggerPointAdvisor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/activities/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/ActionBarAdvisor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/IActionBarConfigurer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/IWorkbenchConfigurer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/IWorkbenchWindowConfigurer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchWindowAdvisor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/branding/IBundleGroupConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/branding/IProductConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/branding/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/browser/AbstractWebBrowser.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/browser/AbstractWorkbenchBrowserSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/browser/IWebBrowser.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/browser/IWorkbenchBrowserSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/browser/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/CategoryEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/CommandEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/CommandException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/CommandManagerEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ExecutionException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ExtensionParameterValues.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/HandlerEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/HandlerSubmission.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ICategory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ICategoryListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ICommand.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ICommandListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ICommandManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ICommandManagerListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/ICommandService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/IElementReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/IElementUpdater.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/IHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/IHandlerListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/IKeyConfiguration.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/IKeyConfigurationListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/IKeySequenceBinding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/IWorkbenchCommandSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/KeyConfigurationEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/NotDefinedException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/NotHandledException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/Priority.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/commands/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/ContextEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/ContextException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/ContextManagerEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/EnabledSubmission.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/IContext.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/IContextActivation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/IContextListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/IContextManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/IContextManagerListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/IContextService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/IWorkbenchContextSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/NotDefinedException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/contexts/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CheckedTreeSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/ContainerCheckedTreeViewer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/EditorSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/ElementListSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/ElementTreeSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FileEditorMappingContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FileEditorMappingLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FileSystemElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/IOverwriteQuery.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/ISelectionStatusValidator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/ISelectionValidator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/IWorkingSetEditWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/IWorkingSetNewWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/IWorkingSetPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/IWorkingSetSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/ListDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/ListSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PatternFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PreferenceLinkArea.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PreferencesUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PropertyDialogAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PropertyPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/SearchPattern.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/SelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/SelectionStatusDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/TwoArrayQuickSorter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/TwoPaneElementSelector.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/TypeFilteringDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/WorkingSetConfigurationBlock.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/WorkingSetGroup.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/YesNoCancelListSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dnd/IDragAndDropService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dnd/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/fieldassist/ContentAssistCommandAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/fieldassist/ContentAssistField.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/fieldassist/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/handlers/IHandlerActivation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/handlers/IHandlerService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/handlers/RegistryRadioState.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/handlers/RegistryToggleState.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/handlers/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/help/AbstractHelpUI.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/help/DialogPageContextComputer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/help/IContextComputer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/help/IWorkbenchHelpSystem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/help/ViewContextComputer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/help/WorkbenchHelp.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/help/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AbstractEnabledHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AbstractEvaluationHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AbstractPartSelectionTracker.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AbstractSelectionService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSet.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionSetActionBars.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionSetContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionSetManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionSetMenuManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionSetSeparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionSetsEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActivateEditorHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActiveEditorAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActivityPersistanceHelper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AnimatedTabFeedback.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AnimationEngine.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/AnimationFeedbackBase.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/BaseSaveAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/BrandingProperties.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/BundleGroupProperties.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CloseAllHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CloseAllSavedAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CloseEditorHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CloseOthersHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CompatibleWorkbenchPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ContainerPlaceholder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CycleBaseHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CycleEditorHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CyclePerspectiveHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CycleViewHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DefaultAnimationFeedback.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DefaultSaveable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DefaultStackPresentationSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DetachedPlaceHolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DetachedWindow.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DirtyPerspectiveMarker.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DragCursors.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DragHandle.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorActionBuilder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorAreaHelper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorAreaTrimToolBar.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorHistory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorHistoryItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorMenuManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorPane.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorPluginAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorSashContainer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorSiteDragAndDropServiceImpl.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorStack.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ErrorEditorPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ErrorViewPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ExtensionEventHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ExtensionEventHandler.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ExtensionEventHandlerMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewBar.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewBarContextMenuContribution.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewDnDHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FolderLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/HeapStatus.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IActionSetContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IBackgroundSaveListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IChangeListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ICompatibleWorkbenchPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IHeapStatusConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ILayoutContainer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IObjectActionContributor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IObjectContributor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IPreferenceConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IReorderListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ISelectionConversionService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IStickyViewManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ITrimAreaChangeListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IWorkbenchConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IWorkbenchGraphicConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IWorkbenchHelpContextIds.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IWorkbenchThemeConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ImageAnimationFeedback.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ImageCycleFeedbackBase.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntModel.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/InternalHandlerUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/InternalSaveable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntroAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/JFaceUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/KeyBindingService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutPartSash.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutTree.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LayoutTreeNode.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LegacyAnimationFeedback.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LocalWorkingSetManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/LockToolBarAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/MessageLine.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Model.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/MultiEditorInnerPane.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/NavigationHistory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/NavigationHistoryAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/NavigationHistoryEditorInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/NavigationHistoryEntry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ObjectActionContributorManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ObjectActionContributorReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ObjectContributorManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ObjectFilterTest.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ObjectPluginAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/OpenPerspectivePropertyTester.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/OpenPreferencesAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/OverlayIcon.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PageEventAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PageLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PageListenerList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PagePartSelectionTracker.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PageSelectionService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartListenerList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartListenerList2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPane.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPlaceholder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPluginAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartTester.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveBarContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveBarManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveBarNewContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveListenerList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveTracker.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PinEditorAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PlaceholderFolderLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionCoolBarContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionSet.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionSetBuilder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionSetReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PopupMenuExtender.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ProductInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ProductProperties.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/RadioMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/RectangleAnimation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/RectangleAnimationFeedbackBase.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/RectangleAnimationImageFeedback.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ReferenceCounter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ResetPerspectiveAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveAllAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveAsAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SavePerspectiveAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveablesList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SelectionAdapterFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SelectionConversionService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Semaphore.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SharedImages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShellPool.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowFastViewContribution.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowInAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowInMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowPartPaneMenuHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ShowViewMenuHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/StickyViewManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/StickyViewManager32.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SwitchToWindowMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ToggleEditorsVisibilityAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/TrimArea.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/TrimDragPreferences.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/TrimDropTarget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/TrimFrame.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/TrimLayoutData.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/TrimUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/UILockListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewActionBars.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewActionBuilder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewLayoutRec.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewPane.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewPluginAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewSashContainer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewStack.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewStackTrimToolBar.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewerActionBuilder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WWinActionBars.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WWinPartService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WWinPluginAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WWinPluginPulldown.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WindowPartSelectionTracker.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WindowSelectionService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WindowTrimProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchColors.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchEditorsHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchErrorHandlerProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchImages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchLayoutSettingsTransfer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPagePartList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowPropertyTester.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbookEditorsHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetMenuContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutBundleGroupData.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutData.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/AbstractWorkingSetPulldownDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/ClearWorkingSetAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/CommandAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/DynamicHelpAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/EditWorkingSetAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/HelpContentsAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/HelpSearchAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/HelpSearchContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/ModifyWorkingSetDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/NewWizardShortcutAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/PinEditorContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/SelectWorkingSetAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/actions/SelectWorkingSetsAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityManagerFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityPatternBinding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityPatternBindingDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityPropertyTester.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityRegistryEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityRequirementBinding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ActivityRequirementBindingDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Category.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/CategoryActivityBinding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/CategoryActivityBindingDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/CategoryDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/IActivityRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/IActivityRegistryListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Persistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ProxyActivityManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/AbstractTriggerPoint.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityEnabler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityViewerFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/CategorizedActivity.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/ImageBindingRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/RegistryTriggerPoint.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchTriggerPoints.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/messages.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/application/CompatibilityActionBarAdvisor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/application/CompatibilityWorkbenchWindowAdvisor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/browser/DefaultWorkbenchBrowserSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManagerEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImagePersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImageService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandPersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/ElementReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/ICommandImageManagerListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/ICommandImageService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/ILegacyAttributeNames.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/LegacyCommandListenerWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/WorkbenchCommandSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ActiveContextSourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextActivation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextPersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/LegacyContextListenerWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/NestableContextService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/SlaveContextService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/WorkbenchContextSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DeclarativeDecorator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationBuilder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationImageBuilder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationResult.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorRunnable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/FullImageDecoratorRunnable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/FullTextDecoratorRunnable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/LightweightActionDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/OverlayCache.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutFeaturesDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutPluginsDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutSystemDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AbstractWorkingSetDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ActionSetComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AdaptableForwarder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/BundleSigningTray.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/CapabilityFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/DataTransferWizardCollectionComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/DecoratorsPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/DialogUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/EditorsPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/EmptyPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/EmptyPropertyPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ErrorPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/EventLoopProgressMonitor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ExportPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ExportWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FileEditorsPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FileExtensionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/IPropertyPageContributor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ImportExportPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ImportExportWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ImportPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ImportWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardCollectionComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardSelectionPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PerspContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PerspectivesPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PreferenceBoldLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PreferenceHistoryEntry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PreferenceNodeFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PreferencePageHistory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PreferencePatternFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PreferencesPageContainer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ProductInfoDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageContributorManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageNode.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/SavePerspectiveDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/SelectPerspectiveDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ShowViewDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/SimpleWorkingSetSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/StartupPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewPatternFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardTagFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchDialogBlockedHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchEditorsDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceNode.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardListSelectionPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardNode.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardSelectionPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkingSetEditWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkingSetFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkingSetLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkingSetNewWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkingSetSelectionDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkingSetTypePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/AbstractDropTarget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/CompatibilityDragTarget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/DragBorder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/DragUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/IDragOverListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/IDropTarget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/IDropTarget2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/InsertCaret.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/SwtUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/TestDropLocation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/ActivePartExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/AlwaysEnabledExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/AndExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/CompositeExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacyActionExpressionWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacyActionSetExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorActionBarExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorContributionExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacySelectionEnablerWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacyViewContributionExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/LegacyViewerContributionExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/expressions/WorkbenchWindowExpression.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ActionCommandMappingService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/CloseAllPerspectivesHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ClosePartHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ClosePerspectiveHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/DisplayHelpHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/EditActionSetsHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ExecutableExtensionHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerActivation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/IActionCommandMappingService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/IWorkbenchWindowHandlerDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerListenerWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/MaximizePartHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/MinimizePartHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/NestableHandlerService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/NewEditorHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/PropertyDialogHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/QuitHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ShowKeyAssistHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ShowPreferencePageHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/ToggleCoolbarHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WorkbenchWindowHandlerDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/intro.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/AbstractKeyFormatter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/AbstractKeyFormatter.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/AbstractModifierKeyComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/AlphabeticModifierKeyComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/CancelOnModifyListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/CategoryPatternFilter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/CompactKeyFormatter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/EmacsKeyFormatter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/EmacsKeyFormatter.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/FormalKeyFormatter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/GnomeKeyFormatter.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/ImageFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KdeKeyFormatter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KdeKeyFormatter.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KeyBindingState.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KeySequenceBinding.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferenceFiltersDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/LegacySchemeListenerWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/MacKeyFormatter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/MacKeyFormatter.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NativeKeyFormatter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NativeKeyFormatter.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NativeModifierKeyComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferenceMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/OutOfOrderListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/OutOfOrderVerifyListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/WindowsKeyFormatter.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/CacheWrapper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/CellData.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/CellLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/CellLayoutUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/GridInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/ICachingLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/ITrimManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/IWindowTrim.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/LayoutCache.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/LayoutUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/Row.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/SizeCache.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/TrimArea.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/TrimCommonUIHandle.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/TrimDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/TrimDragPreferenceDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/TrimLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/layout/TrimToolBarBase.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/AbstractWorkbenchWidget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/ContributionRoot.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/FocusControlSourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/IActionSetsListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/IMenuActivation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/IMenuLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/InternalControlContribution.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/InternalMenuService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuActivation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuLocationURI.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/MenuPersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/TrimAdditionCacheEntry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/TrimContributionManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WindowMenuService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/messages.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ExternalProgramImageDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/Policy.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ProgramImageDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/StringMatcher.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/TestPartListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/UIListenerLogging.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/UIStats.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/operations/WorkbenchOperationSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/IPartHost.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/IPartPropertyProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/IWorkbenchScopeConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/NullEditorInput.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/NullPersistable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/Part.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/SelectionProviderAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/AbstractBooleanListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/AbstractIntegerListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/AbstractPropertyListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/Base64.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/IDynamicPropertyMap.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/IPropertyMap.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/IPropertyMapListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceStoreAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceTransferElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceTransferManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PreferencesAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PropertyListenerList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PropertyMapAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PropertyMapUnion.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PropertyUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/SettingsTransferRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/ThemeAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/ThemeManagerAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/WorkbenchPreferenceExtensionNode.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/WorkbenchSettingsTransfer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/WorkingSetPropertyPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/WorkingSetSettingsTransfer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/AbstractTableInformationControl.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/BasicPartList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/DefaultActionBarPresentationFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/ISelfUpdatingAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/NativePresentationFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/NativeStackPresentation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/PaneFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/PaneFolderButtonListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/PresentablePart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/PresentationFactoryUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/PresentationSerializer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuClose.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuCloseAll.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuCloseOthers.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuDetach.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuFastView.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuFastViewOrientation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMaximize.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMinimize.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMove.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMoveFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMovePane.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuPinEditor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuRestore.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuSize.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuSizeFastView.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuStateChange.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/UpdatingActionContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultMultiTabListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultPartList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultSimpleTabListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultTabFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultTabFolderColors.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultTabItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/DefaultThemeListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/EmptyTabFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/EmptyTabItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/NativePresentationFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/NativeTabFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/defaultpresentation/NativeTabItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultSimpleTabListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultTabFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultTabFolderColors.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultTabItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/DefaultThemeListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/PaneFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/PaneFolderButtonListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/r33/WorkbenchPresentationFactory_33.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/AbstractTabFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/AbstractTabItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/EnhancedFillLayout.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/IPresentablePartList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/ISystemMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/LeftToRightTabOrder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/PartInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/PresentablePartFolder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/ProxyControl.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/ReplaceDragHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/StandardEditorSystemMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/StandardSystemToolbar.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/StandardViewSystemMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/TabDragHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/TabFolderEvent.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/TabFolderListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/TabOrder.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/TabbedStackPresentation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/util/WidgetTabItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/AbstractProgressViewer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/AnimationItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/AnimationManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/BlockedJobsDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/DetailedProgressViewer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ErrorInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/FinishedJobs.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/GroupInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/IAnimationProcessor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/IJobBusyListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/IJobProgressManagerListener.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/IProgressUpdateCollector.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobTreeElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/JobsViewPreferenceDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationProcessor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressCanvasViewer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressManagerUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorFocusJobDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorJobsDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressRegion.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressView.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressViewUpdater.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressViewerContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressViewerLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/StatusAdapterHelper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/SubTaskInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/TaskInfo.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/VirtualInfoItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/VirtualProgressView.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/VirtualProgressViewer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/messages.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/provisional/application/IActionBarConfigurer2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/provisional/presentations/IActionBarPresentationFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/ActionElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/ActionProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/CamelUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/EditorElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/EditorProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/PreferenceElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/PreferenceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/PropertiesElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/PropertiesProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessEntry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/ViewElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/ViewProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/WizardElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/WizardProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/messages.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ActionSetDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ActionSetRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/CategorizedPageRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/Category.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/FileEditorMapping.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/IActionSet.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/IActionSetDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/KeywordRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveExtensionReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveParameterValues.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PreferencePageParameterValues.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PreferencePageRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PreferenceTransferRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PropertyPagesRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/RegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/StickyViewDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ViewParameterValues.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/WizardParameterValues.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/WizardsRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActionSetSourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActivePartSourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ActiveShellSourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/CurrentSelectionSourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/EvaluationAuthority.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/EvaluationReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/EvaluationResultCache.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/EvaluationResultCacheComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/EvaluationService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ExpressionAuthority.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/IEvaluationReference.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/IEvaluationResultCache.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/IEvaluationService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/INestable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ISourceProviderService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/MenuSourceProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/PreferencePersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/RegistryPersistence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/ServiceLocator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/SourcePriorityNameMapping.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/services/SourceProviderService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/splash/EclipseSplashHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/splash/SplashHandlerFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusHandlerDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusHandlerDescriptorsMap.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusHandlerProductBindingDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusHandlerRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusNotificationManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/statushandlers/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/testing/WorkbenchPartTestable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/testing/WorkbenchTestable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/CascadingColorRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/CascadingFontRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/CascadingMap.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/CascadingTheme.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/FontDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ICategorizedThemeElementDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/IEditable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/IHierarchalThemeElementDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/IThemeDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/IThemeElementDefinition.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/IThemeRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/LightColorFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/RGBContrastFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/Theme.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/Theme.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeElementCategory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeElementHelper.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistryReader.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistryReader.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/WorkbenchPreview.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/WorkbenchThemeManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/tweaklets/AllowGrabFocus.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/tweaklets/Animations.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/tweaklets/GrabFocus.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/tweaklets/ImageAnimationTweak.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/tweaklets/LegacyAnimations.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/tweaklets/TabBehaviour.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/tweaklets/TabBehaviourMRU.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/tweaklets/Tweaklets.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/BundleUtility.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/ConfigurationElementMemento.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/ImageSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/PrefUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/SWTResourceUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/StatusLineContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/Util.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/AbstractExtensionWizardRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/AbstractWizardRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/ExportWizardRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/ImportWizardRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/NewWizardRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/preferences/PreferencesExportWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/preferences/PreferencesImportWizard.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/preferences/PreferencesMessages.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/wizards/preferences/messages.properties
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IntroContentDetector.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/intro/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/CharacterKey.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/IBindingService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/IKeyFormatter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/Key.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/KeyFormatterFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/KeySequence.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/ModifierKey.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/NaturalKey.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/ParseException.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/SWTKeySupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/SpecialKey.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/AbstractContributionFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/AbstractWorkbenchTrimWidget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItemParameter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/IContributionRoot.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/IMenuService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/IWorkbenchWidget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/MenuUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/UIElement.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/WorkbenchWindowControlContribution.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/AdaptableList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/BaseWorkbenchContentProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/IWorkbenchAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/IWorkbenchAdapter2.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/PerspectiveLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/WorkbenchAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/WorkbenchLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/WorkbenchPartLabelProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/WorkbenchViewerComparator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/WorkbenchViewerSorter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/model/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/IWorkbenchOperationSupport.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/LinearUndoViolationUserApprover.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/NonLocalUndoUserApprover.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/RedoActionHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/UndoActionHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/UndoRedoActionGroup.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/CellEditorActionHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/CoolItemGroupMarker.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/DrillDownAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/DrillDownComposite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/DrillFrame.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/DrillStack.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/EditorActionBarContributor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/EditorPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IContributedContentsView.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IDropActionDelegate.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IPageBookViewPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IPageSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/ISetSelectionTarget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IShowInSource.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IShowInTarget.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IShowInTargetList.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IWorkbenchPartOrientation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IntroPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MessagePage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiEditor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiEditorInput.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageEditor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageEditorActionBarContributor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageEditorSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageSelectionProvider.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/Page.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBook.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBookView.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PluginDropAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PluginTransfer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PluginTransferData.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/ShowInContext.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/ViewPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/plugin/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/IWorkbenchPreferenceContainer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/IWorkingCopyManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/SettingsTransfer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/ViewPreferencesAction.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/ViewSettingsDialog.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/WizardPropertyPage.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/WorkingCopyManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/AbstractPresentationFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/IPartMenu.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/IPresentablePart.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/IPresentationSerializer.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/IStackPresentationSite.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/PresentationUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/StackDropResult.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/StackPresentation.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/WorkbenchPresentationFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/DeferredTreeContentManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/IDeferredWorkbenchAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/IElementCollector.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/IJobRunnable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/IProgressConstants.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/IProgressService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/IWorkbenchSiteProgressService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/PendingUpdateAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/UIJob.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/WorkbenchJob.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IDisposable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IServiceLocator.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IServiceScopes.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/IServiceWithSources.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/services/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/splash/AbstractSplashHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/splash/BasicSplashHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/splash/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/AbstractStatusHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/StatusAdapter.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchErrorHandler.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/swt/IFocusService.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/swt/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/testing/ITestHarness.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/testing/IWorkbenchPartTestable.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/testing/TestableObject.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/testing/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/ColorUtil.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/IColorFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/ITheme.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/IThemeManager.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/IThemePreview.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/RGBBlendColorFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/views/IStickyViewDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/views/IViewCategory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/views/IViewDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/views/IViewRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/views/package.html
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/wizards/IWizardCategory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/wizards/IWizardDescriptor.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/wizards/IWizardRegistry.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/wizards/package.html
bundles/org.eclipse.ui.workbench/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.workbench/about.html
bundles/org.eclipse.ui.workbench/build.properties
bundles/org.eclipse.ui.workbench/plugin.properties
bundles/org.eclipse.ui.workbench/plugin.xml
bundles/org.eclipse.ui.workbench/scripts/exportplugin.xml
bundles/org.eclipse.ui/.classpath
bundles/org.eclipse.ui/.cvsignore
bundles/org.eclipse.ui/.options
bundles/org.eclipse.ui/.project
bundles/org.eclipse.ui/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.ui/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.ui/.settings/org.eclipse.pde.prefs
bundles/org.eclipse.ui/META-INF/MANIFEST.MF
bundles/org.eclipse.ui/about.html
bundles/org.eclipse.ui/build.properties
bundles/org.eclipse.ui/buildnotes_workbench.html
bundles/org.eclipse.ui/component.xml
bundles/org.eclipse.ui/icons/full/dlcl16/backward_nav.gif
bundles/org.eclipse.ui/icons/full/dlcl16/close_view.gif
bundles/org.eclipse.ui/icons/full/dlcl16/collapseall.gif
bundles/org.eclipse.ui/icons/full/dlcl16/forward_nav.gif
bundles/org.eclipse.ui/icons/full/dlcl16/home_nav.gif
bundles/org.eclipse.ui/icons/full/dlcl16/linkto_help.gif
bundles/org.eclipse.ui/icons/full/dlcl16/min_view.gif
bundles/org.eclipse.ui/icons/full/dlcl16/pin_view.gif
bundles/org.eclipse.ui/icons/full/dlcl16/progress_rem.gif
bundles/org.eclipse.ui/icons/full/dlcl16/progress_remall.gif
bundles/org.eclipse.ui/icons/full/dlcl16/progress_stop.gif
bundles/org.eclipse.ui/icons/full/dlcl16/step_current.gif
bundles/org.eclipse.ui/icons/full/dlcl16/step_done.gif
bundles/org.eclipse.ui/icons/full/dlcl16/synced.gif
bundles/org.eclipse.ui/icons/full/dlcl16/trash.gif
bundles/org.eclipse.ui/icons/full/dlcl16/up_nav.gif
bundles/org.eclipse.ui/icons/full/dlcl16/view_menu.gif
bundles/org.eclipse.ui/icons/full/dtool16/clear_co.gif
bundles/org.eclipse.ui/icons/full/dtool16/copy_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/cut_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/delete_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/export_wiz.gif
bundles/org.eclipse.ui/icons/full/dtool16/help_contents.gif
bundles/org.eclipse.ui/icons/full/dtool16/import_wiz.gif
bundles/org.eclipse.ui/icons/full/dtool16/new_fastview.gif
bundles/org.eclipse.ui/icons/full/dtool16/new_wiz.gif
bundles/org.eclipse.ui/icons/full/dtool16/paste_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/pin_editor.gif
bundles/org.eclipse.ui/icons/full/dtool16/print_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/redo_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/save_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/saveall_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/saveas_edit.gif
bundles/org.eclipse.ui/icons/full/dtool16/undo_edit.gif
bundles/org.eclipse.ui/icons/full/elcl16/backward_nav.gif
bundles/org.eclipse.ui/icons/full/elcl16/close_view.gif
bundles/org.eclipse.ui/icons/full/elcl16/collapseall.gif
bundles/org.eclipse.ui/icons/full/elcl16/forward_nav.gif
bundles/org.eclipse.ui/icons/full/elcl16/home_nav.gif
bundles/org.eclipse.ui/icons/full/elcl16/linkto_help.gif
bundles/org.eclipse.ui/icons/full/elcl16/min_view.gif
bundles/org.eclipse.ui/icons/full/elcl16/pin_view.gif
bundles/org.eclipse.ui/icons/full/elcl16/progress_rem.gif
bundles/org.eclipse.ui/icons/full/elcl16/progress_remall.gif
bundles/org.eclipse.ui/icons/full/elcl16/progress_stop.gif
bundles/org.eclipse.ui/icons/full/elcl16/refresh_nav.gif
bundles/org.eclipse.ui/icons/full/elcl16/step_current.gif
bundles/org.eclipse.ui/icons/full/elcl16/step_done.gif
bundles/org.eclipse.ui/icons/full/elcl16/synced.gif
bundles/org.eclipse.ui/icons/full/elcl16/thin_close_view.gif
bundles/org.eclipse.ui/icons/full/elcl16/thin_hide_toolbar.GIF
bundles/org.eclipse.ui/icons/full/elcl16/thin_max_view.gif
bundles/org.eclipse.ui/icons/full/elcl16/thin_min_view.gif
bundles/org.eclipse.ui/icons/full/elcl16/thin_restore_view.GIF
bundles/org.eclipse.ui/icons/full/elcl16/thin_show_toolbar.GIF
bundles/org.eclipse.ui/icons/full/elcl16/thin_view_menu.GIF
bundles/org.eclipse.ui/icons/full/elcl16/trash.gif
bundles/org.eclipse.ui/icons/full/elcl16/up_nav.gif
bundles/org.eclipse.ui/icons/full/elcl16/view_menu.gif
bundles/org.eclipse.ui/icons/full/etool16/clear_co.gif
bundles/org.eclipse.ui/icons/full/etool16/copy_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/cut_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/delete_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/editor_area.gif
bundles/org.eclipse.ui/icons/full/etool16/export_wiz.gif
bundles/org.eclipse.ui/icons/full/etool16/fastview_restore.gif
bundles/org.eclipse.ui/icons/full/etool16/help_contents.gif
bundles/org.eclipse.ui/icons/full/etool16/help_search.gif
bundles/org.eclipse.ui/icons/full/etool16/import_wiz.gif
bundles/org.eclipse.ui/icons/full/etool16/new_fastview.gif
bundles/org.eclipse.ui/icons/full/etool16/new_wiz.gif
bundles/org.eclipse.ui/icons/full/etool16/paste_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/pin_editor.gif
bundles/org.eclipse.ui/icons/full/etool16/print_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/redo_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/save_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/saveall_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/saveas_edit.gif
bundles/org.eclipse.ui/icons/full/etool16/undo_edit.gif
bundles/org.eclipse.ui/icons/full/eview16/bkmrk_nav.gif
bundles/org.eclipse.ui/icons/full/eview16/default_persp.gif
bundles/org.eclipse.ui/icons/full/eview16/defaultview_misc.gif
bundles/org.eclipse.ui/icons/full/eview16/filenav_nav.gif
bundles/org.eclipse.ui/icons/full/eview16/new_persp.gif
bundles/org.eclipse.ui/icons/full/eview16/outline_co.gif
bundles/org.eclipse.ui/icons/full/eview16/problems_view.gif
bundles/org.eclipse.ui/icons/full/eview16/prop_ps.gif
bundles/org.eclipse.ui/icons/full/eview16/tasks_tsk.gif
bundles/org.eclipse.ui/icons/full/obj16/activity.gif
bundles/org.eclipse.ui/icons/full/obj16/activity_category.gif
bundles/org.eclipse.ui/icons/full/obj16/add_obj.gif
bundles/org.eclipse.ui/icons/full/obj16/blank.gif
bundles/org.eclipse.ui/icons/full/obj16/change_obj.gif
bundles/org.eclipse.ui/icons/full/obj16/delete_obj.gif
bundles/org.eclipse.ui/icons/full/obj16/elements_obj.gif
bundles/org.eclipse.ui/icons/full/obj16/error_tsk.gif
bundles/org.eclipse.ui/icons/full/obj16/file_obj.gif
bundles/org.eclipse.ui/icons/full/obj16/fldr_obj.gif
bundles/org.eclipse.ui/icons/full/obj16/font.gif
bundles/org.eclipse.ui/icons/full/obj16/generic_element.gif
bundles/org.eclipse.ui/icons/full/obj16/generic_elements.gif
bundles/org.eclipse.ui/icons/full/obj16/info_tsk.gif
bundles/org.eclipse.ui/icons/full/obj16/keygroups_obj.gif
bundles/org.eclipse.ui/icons/full/obj16/layout_co.gif
bundles/org.eclipse.ui/icons/full/obj16/menu.gif
bundles/org.eclipse.ui/icons/full/obj16/separator.gif
bundles/org.eclipse.ui/icons/full/obj16/signed_no_tbl.gif
bundles/org.eclipse.ui/icons/full/obj16/signed_unkn_tbl.gif
bundles/org.eclipse.ui/icons/full/obj16/signed_yes_tbl.gif
bundles/org.eclipse.ui/icons/full/obj16/submenu.gif
bundles/org.eclipse.ui/icons/full/obj16/theme_category.gif
bundles/org.eclipse.ui/icons/full/obj16/toolbar.gif
bundles/org.eclipse.ui/icons/full/obj16/warn_tsk.gif
bundles/org.eclipse.ui/icons/full/obj16/workingsets.gif
bundles/org.eclipse.ui/icons/full/ovr16/lock_ovr.gif
bundles/org.eclipse.ui/icons/full/ovr16/pinned_ovr.gif
bundles/org.eclipse.ui/icons/full/pointer/bottom_mask.bmp
bundles/org.eclipse.ui/icons/full/pointer/bottom_source.bmp
bundles/org.eclipse.ui/icons/full/pointer/invalid_mask.bmp
bundles/org.eclipse.ui/icons/full/pointer/invalid_source.bmp
bundles/org.eclipse.ui/icons/full/pointer/left_mask.bmp
bundles/org.eclipse.ui/icons/full/pointer/left_source.bmp
bundles/org.eclipse.ui/icons/full/pointer/offscreen_mask.bmp
bundles/org.eclipse.ui/icons/full/pointer/offscreen_source.bmp
bundles/org.eclipse.ui/icons/full/pointer/right_mask.bmp
bundles/org.eclipse.ui/icons/full/pointer/right_source.bmp
bundles/org.eclipse.ui/icons/full/pointer/stack_mask.bmp
bundles/org.eclipse.ui/icons/full/pointer/stack_source.bmp
bundles/org.eclipse.ui/icons/full/pointer/tofastview_mask.bmp
bundles/org.eclipse.ui/icons/full/pointer/tofastview_source.bmp
bundles/org.eclipse.ui/icons/full/pointer/top_mask.bmp
bundles/org.eclipse.ui/icons/full/pointer/top_source.bmp
bundles/org.eclipse.ui/icons/full/progress/errorstate.gif
bundles/org.eclipse.ui/icons/full/progress/lockedstate.gif
bundles/org.eclipse.ui/icons/full/progress/progress_error.gif
bundles/org.eclipse.ui/icons/full/progress/progress_none.gif
bundles/org.eclipse.ui/icons/full/progress/progress_ok.gif
bundles/org.eclipse.ui/icons/full/progress/progress_task.gif
bundles/org.eclipse.ui/icons/full/progress/pview.gif
bundles/org.eclipse.ui/icons/full/progress/sleeping.gif
bundles/org.eclipse.ui/icons/full/progress/waiting.gif
bundles/org.eclipse.ui/icons/full/wizban/export_wiz.png
bundles/org.eclipse.ui/icons/full/wizban/exportdir_wiz.png
bundles/org.eclipse.ui/icons/full/wizban/exportpref_wiz.png
bundles/org.eclipse.ui/icons/full/wizban/import_wiz.png
bundles/org.eclipse.ui/icons/full/wizban/importdir_wiz.png
bundles/org.eclipse.ui/icons/full/wizban/importpref_wiz.png
bundles/org.eclipse.ui/icons/full/wizban/new_wiz.png
bundles/org.eclipse.ui/icons/full/wizban/workset_wiz.png
bundles/org.eclipse.ui/plugin.properties
bundles/org.eclipse.ui/plugin.xml
bundles/org.eclipse.ui/schema/acceleratorConfigurations.exsd
bundles/org.eclipse.ui/schema/acceleratorScopes.exsd
bundles/org.eclipse.ui/schema/acceleratorSets.exsd
bundles/org.eclipse.ui/schema/actionDefinitions.exsd
bundles/org.eclipse.ui/schema/actionSetPartAssociations.exsd
bundles/org.eclipse.ui/schema/actionSets.exsd
bundles/org.eclipse.ui/schema/activities.exsd
bundles/org.eclipse.ui/schema/activitySupport.exsd
bundles/org.eclipse.ui/schema/bindings.exsd
bundles/org.eclipse.ui/schema/browserSupport.exsd
bundles/org.eclipse.ui/schema/commandImages.exsd
bundles/org.eclipse.ui/schema/commands.exsd
bundles/org.eclipse.ui/schema/commonAction.exsd
bundles/org.eclipse.ui/schema/commonExpression.exsd
bundles/org.eclipse.ui/schema/contexts.exsd
bundles/org.eclipse.ui/schema/decorators.exsd
bundles/org.eclipse.ui/schema/dropActions.exsd
bundles/org.eclipse.ui/schema/editorActions.exsd
bundles/org.eclipse.ui/schema/editors.exsd
bundles/org.eclipse.ui/schema/elementFactories.exsd
bundles/org.eclipse.ui/schema/encodings.exsd
bundles/org.eclipse.ui/schema/exportWizards.exsd
bundles/org.eclipse.ui/schema/fontDefinitions.exsd
bundles/org.eclipse.ui/schema/handlers.exsd
bundles/org.eclipse.ui/schema/helpSupport.exsd
bundles/org.eclipse.ui/schema/importWizards.exsd
bundles/org.eclipse.ui/schema/internalTweaklets.exsd
bundles/org.eclipse.ui/schema/intro.exsd
bundles/org.eclipse.ui/schema/keywords.exsd
bundles/org.eclipse.ui/schema/menus.exsd
bundles/org.eclipse.ui/schema/newWizards.exsd
bundles/org.eclipse.ui/schema/perspectiveExtensions.exsd
bundles/org.eclipse.ui/schema/perspectives.exsd
bundles/org.eclipse.ui/schema/popupMenus.exsd
bundles/org.eclipse.ui/schema/preferencePages.exsd
bundles/org.eclipse.ui/schema/preferenceTransfer.exsd
bundles/org.eclipse.ui/schema/presentationFactories.exsd
bundles/org.eclipse.ui/schema/propertyPages.exsd
bundles/org.eclipse.ui/schema/splashHandlers.exsd
bundles/org.eclipse.ui/schema/startup.exsd
bundles/org.eclipse.ui/schema/statusHandlers.exsd
bundles/org.eclipse.ui/schema/systemSummarySections.exsd
bundles/org.eclipse.ui/schema/themes.exsd
bundles/org.eclipse.ui/schema/viewActions.exsd
bundles/org.eclipse.ui/schema/views.exsd
bundles/org.eclipse.ui/schema/workingSets.exsd
bundles/org.eclipse.ui/scripts/exportplugin.xml
bundles/org.eclipse.ui/src/org/eclipse/ui/internal/UIPlugin.java
bundles/org.eclipse.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.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/Snippet013TableViewerEditing.java
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet014WizardDialog.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/FocusBorderCellHighlighter.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/Snippet036FocusBorderCellHighlighter.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet037FancyCustomTooltips.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet038TreeViewerInlinelEditingOldAPI.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet039ListViewer.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet040TableViewerSorting.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet041TableViewerAlternatingColors.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet042ToolTipSupportFor32API.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet043NoColumnTreeViewerKeyboardEditing.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet044NoColumnTableViewerKeyboardEditing.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet045TableViewerFillFromBackgroundThread.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet046UpdateViewerFromBackgroundThread.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet047VirtualLazyTreeViewer.java
examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet048TreeViewerTabWithCheckboxFor3_3.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/Eclipse JFace Snippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.java
examples/org.eclipse.jface.snippets/META-INF/MANIFEST.MF
examples/org.eclipse.jface.snippets/build.properties
examples/org.eclipse.ui.examples.contributions/.classpath
examples/org.eclipse.ui.examples.contributions/.project
examples/org.eclipse.ui.examples.contributions/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.ui.examples.contributions/.settings/org.eclipse.jdt.ui.prefs
examples/org.eclipse.ui.examples.contributions/.settings/org.eclipse.pde.prefs
examples/org.eclipse.ui.examples.contributions/META-INF/MANIFEST.MF
examples/org.eclipse.ui.examples.contributions/about.html
examples/org.eclipse.ui.examples.contributions/build.properties
examples/org.eclipse.ui.examples.contributions/icons/change_obj.gif
examples/org.eclipse.ui.examples.contributions/icons/editor.gif
examples/org.eclipse.ui.examples.contributions/icons/sample.gif
examples/org.eclipse.ui.examples.contributions/plugin.properties
examples/org.eclipse.ui.examples.contributions/plugin.xml
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/Activator.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/ContributionMessages.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/ExampleControlContribution.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/editor/DeltaInfoHandler.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/editor/InfoEditor.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/handlers/GlobalMenuHandler.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/messages.properties
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/model/Person.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/model/PersonInput.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/view/EditInfoHandler.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/view/InfoView.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/view/RefreshInfoHandler.java
examples/org.eclipse.ui.examples.contributions/src/org/eclipse/ui/examples/contributions/view/SwapInfoHandler.java
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/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/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.conformance/.classpath
tests/org.eclipse.jface.tests.databinding.conformance/.project
tests/org.eclipse.jface.tests.databinding.conformance/META-INF/MANIFEST.MF
tests/org.eclipse.jface.tests.databinding.conformance/about.html
tests/org.eclipse.jface.tests.databinding.conformance/build.properties
tests/org.eclipse.jface.tests.databinding.conformance/plugin.properties
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableCollectionContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableListContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableSetContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableValueContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableCollectionContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableDelegateTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableListContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableStaleContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableValueContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableCollectionContractDelegate.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableContractDelegate.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableValueContractDelegate.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableCollectionContractDelegate.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableContractDelegate.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableValueContractDelegate.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/swt/SWTMutableObservableValueContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/swt/SWTObservableValueContractTest.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ChangeEventTracker.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/CurrentRealm.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/DelegatingRealm.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ListChangeEventTracker.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/MapChangeEventTracker.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/RealmTester.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/SetChangeEventTracker.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/SuiteBuilder.java
tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ValueChangeEventTracker.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/AggregateValidationStatusTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/DatabindingContextTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ListBindingTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ObservablesManagerTest.java
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/ValueBindingTest.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/beans/PojoObservablesTest.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/AbstractObservableTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/DiffsTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/Diffs_ListDiffTests.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/LockRealm.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/ObservablesTest.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/ThreadRealm.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/AbstractObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/ObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/WritableListTest.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/databinding/observable/set/AbstractObservableSetTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/ObservableSetTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/UnionSetTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/WritableSetTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/AbstractObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/AbstractVetoableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/ComputedValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/WritableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/validation/ValidationStatusTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/BindingMessagesTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/BindingStatusTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/QueueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/RandomAccessListIteratorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/DateConversionSupportTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/IdentityConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/IntegerToStringConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToBigDecimalTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToBigIntegerConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToByteConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToFloatConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToIntegerConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToLongConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToNumberTestHarness.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToShortConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/ObjectToPrimitiveValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StatusToStringConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToBooleanConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToByteConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserByteTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserDoubleTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserFloatTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserIntegerTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserLongTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserShortTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToShortConverterTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/Bean.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/BeanObservableListDecoratorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/BeanObservableSetDecoratorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/BeanObservableValueDecoratorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableArrayBasedListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableMapTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableSetTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/ListenerSupportTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/NonStandardBean.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/UnmodifiableObservableListTest.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/AbstractStringToNumberValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToByteValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToFloatValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToIntegerValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToLongValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToNumberValidatorTestHarness.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToShortValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToUnboundedNumberValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToByteValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToFloatValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToIntegerValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToLongValidatorTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToNumberValidatorTestHarness.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToShortValidatorTest.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/BindingTestSetup.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/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/SWTObservablesTest.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/databinding/mask/internal/EditMaskLexerAndTokenTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/databinding/mask/internal/EditMaskParserTest.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/swt/ButtonObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueSelectionTest.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/CComboObservableValueTextTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboSingleSelectionObservableValueTest.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/ComboObservableValueSelectionTest.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/ComboObservableValueTextTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboSingleSelectionObservableValueTest.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/ListSingleSelectionObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueMaxTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueMinTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueSelectionTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueMaxTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueMinTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueSelectionTest.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/TableSingleSelectionObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TestCounterValueChangeListener.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/swt/TextObservableValueFocusOutTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueModifyTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderMultiSelectionObservableListTest.java
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValueTest.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.forms/.classpath
tests/org.eclipse.ui.tests.forms/.project
tests/org.eclipse.ui.tests.forms/META-INF/MANIFEST.MF
tests/org.eclipse.ui.tests.forms/about.html
tests/org.eclipse.ui.tests.forms/build.properties
tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/AllFormsPerformanceTests.java
tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/AllFormsTests.java
tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/layout/AllLayoutTests.java
tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/layout/TestTableWrapLayout.java
tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/performance/FormsPerformanceTest.java
tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/plugin/FormsTestPlugin.java
tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/util/AllUtilityTests.java
tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/util/FormImagesTests.java
tests/org.eclipse.ui.tests.forms/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/TweakletCheckTest.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/TestOverrideableActionProvider.java
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/extension/DatContentProvider.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/ProgressMonitorDialogPerformanceTest.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/black_triangle.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/blue_circle.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/blue_square.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/blue_triangle.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/green_circle.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/green_square.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/green_triangle.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/red_circle.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/red_square.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/red_star.gif
tests/org.eclipse.ui.tests.views.properties.tabbed/icons/red_triangle.gif
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/TabbedPropertySheetPageDynamicTest.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/TabbedPropertySheetPageOverrideTest.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/TabbedPropertySheetPageTextTest.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsBlackSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsBlueSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsCircleSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsElementSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsGreenSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsRedSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsSquareSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsStarSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/filters/DynamicTestsTriangleSectionFilter.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/model/DynamicTestsColor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/model/DynamicTestsElement.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/model/DynamicTestsShape.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsAdvancedSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsBlackSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsBlueSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsCircleSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsElementSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsGreenSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsRedSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsSectionDescriptorProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsSquareSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsStarSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/section/descriptors/DynamicTestsTriangleSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsAbstractLabelSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsBlackSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsBlueSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsCircleSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsElementSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsGreenSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsRedSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsSquareSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsStarSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/sections/DynamicTestsTriangleSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/tab/descriptors/DynamicTestsAdvancedTabDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/tab/descriptors/DynamicTestsBlackTabDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/tab/descriptors/DynamicTestsColorTabDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/tab/descriptors/DynamicTestsElementTabDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/tab/descriptors/DynamicTestsShapeTabDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/tab/descriptors/DynamicTestsTabDescriptorProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/views/DynamicTestsTitleBarLabelProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/views/DynamicTestsTreeNode.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/views/DynamicTestsTypeMapper.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/views/DynamicTestsView.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/dynamic/views/DynamicTestsViewContentProvider.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/override/OverrideTestsContentProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/OverrideTestsLabelProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/OverrideTestsSelection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/OverrideTestsSelectionProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/OverrideTestsView.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/folders/AbstractTabFolder.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/folders/AdvancedTabFolder.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/folders/BasicTabFolder.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/folders/EmptyTabFolder.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/folders/IOverrideTestsTabFolder.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/folders/IOverrideTestsTabItemSelectionListener.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/folders/OverrideTestsTabFolderPropertySheetPage.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/folders/OverrideTestsTabFolderPropertySheetPageContentManager.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/items/EmptyItem.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/items/ErrorItem.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/items/FileItem.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/items/FolderItem.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/items/IOverrideTestsItem.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/items/InformationItem.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/items/WarningItem.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/AbstractTabList.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/AdvancedTabList.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/BasicTabList.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/EmptyTabList.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/IOverrideTestsTabList.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/OverrideTestsSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/OverrideTestsSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/OverrideTestsSectionDescriptorProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/OverrideTestsTabItem.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/override/tablist/OverrideTestsTabListsContentsManager.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/text/TextTestsLabelProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/text/TextTestsLabelSection.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/text/TextTestsSectionDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/text/TextTestsTabDescriptor.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/text/TextTestsTabDescriptorProvider.java
tests/org.eclipse.ui.tests.views.properties.tabbed/src/org/eclipse/ui/tests/views/properties/tabbed/text/TextTestsView.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
tests/org.eclipse.ui.tests/.classpath
tests/org.eclipse.ui.tests/.cvsignore
tests/org.eclipse.ui.tests/.project
tests/org.eclipse.ui.tests/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.ui.tests/.settings/org.eclipse.jdt.ui.prefs
tests/org.eclipse.ui.tests/.settings/org.eclipse.pde.prefs
tests/org.eclipse.ui.tests/Benchmark Tests/org/eclipse/ui/tests/benchmarks/OpenCloseTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/AllTests.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/AllTests.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/ContributionItemTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/DummyAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/DummyContributionManager.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/JFaceActionTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/MenuManagerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/AllTests.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogSettingsTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/InputDialogTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/TitleAreaDialogTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/images/AllTests.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/images/ImageRegistryTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/images/ResourceManagerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/ColorAndFontLabelProviderTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/ColorAndFontViewerLabelProviderTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/CompositeLabelProviderTableTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/CompositeLabelProviderTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/DecoratingLabelProviderTests.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/DecoratingLabelProviderTreePathTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/DecoratingLabelProviderTreeTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/TestColorAndFontLabelProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/layout/AllTests.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/layout/GeometryTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AbstractTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug138608Test.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200337TableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200558Test.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CComboViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTreeViewerMissingTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/CheckboxTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComboViewerComparerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComboViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComparatorModelChange.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/IComparatorModelListener.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ITestModelListener.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/LazySortedCollectionTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerComparatorTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerRefreshTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/MultipleEqualElementsTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/SimpleTableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/SimpleTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/SimpleVirtualLazyTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredItemViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredSelectionTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/StructuredViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableColorProviderTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableFontProviderTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableViewerComparatorTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestComparator.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestElement.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLabelProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLazyModelContentProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModel.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelChange.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelLazyTreeContentProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeSelectionTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerColumnTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerComparatorTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ViewerComparatorTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ViewerTestCase.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/VirtualLazyTableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/VirtualLazyTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/VirtualTableViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/VirtualTreeViewerTest.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/images/java.gif
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddChildAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddElementAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddFilterAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/AddSiblingAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeChildLabelAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeInputLabelAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ChangeLabelAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ClearSelectionAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ConcurrentTableTestView.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/CreateModelAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteChildrenAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/DeleteSiblingsAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ExpandAllAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Filter.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/FlushInputAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyDeferredVirtualTableView.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyVirtualTableView.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetFilterAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/ResetSorterAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetLabelProviderAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/SetSorterAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/Sorter.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestApplicationWindow.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowser.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestBrowserAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestCheckboxTree.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestLazyVirtualTree.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestList.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestSelectionAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTable.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTree.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTableTreeLabelProvider.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestTree.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/TestVirtualTree.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/VirtualTableView.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/WorldChangedAction.java
tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/ui/tests/propertyPages/TestPropertyPage.java
tests/org.eclipse.ui.tests/Eclipse Part References Test/org/eclipse/ui/parts/tests/EditorsReferencesTest.java
tests/org.eclipse.ui.tests/Eclipse Part References Test/org/eclipse/ui/parts/tests/PartsReferencesTestSuite.java
tests/org.eclipse.ui.tests/Eclipse Part References Test/org/eclipse/ui/parts/tests/ViewsReferencesTest.java
tests/org.eclipse.ui.tests/Eclipse Part References Test/org/eclipse/ui/parts/tests/util/PartsTestUtil.java
tests/org.eclipse.ui.tests/Eclipse Part References Test/org/eclipse/ui/parts/tests/util/PartsWorkbenchAdvisor.java
tests/org.eclipse.ui.tests/Eclipse Part References Test/org/eclipse/ui/parts/tests/util/PartsWorkbenchWindowAdvisor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/PerspectiveState.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/SelectionProviderView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/TestPlugin.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/ActivitiesTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/ActivityPreferenceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/DynamicModelActivityRegistry.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/DynamicTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/ImagesTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/MenusTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/PersistanceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/StaticTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/activities/UtilTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableDecoratorTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableResourceWrapper.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptableTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/AdaptedResourceNavigator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/MarkerImageProviderTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/NullLabelDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/ResourceAction.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/SelectionAdapterTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableContentProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestAdaptableWorkbenchAdapter.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestMarkerImageProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/TestNavigatorActionGroup.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/adaptable/WorkingSetTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ApiTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/Bug42616Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/Bug75118Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/DeprecatedSessionRestoreTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/EditorIconTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/GenericCommandActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionBarsTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionDelegateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IActionFilterTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IConstants.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IDeprecatedWorkbenchPageTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionBarContributorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorActionDelegateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorDescriptorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorLauncherTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorMatchingStrategyTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorRegistryTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IEditorSiteTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IFileEditorMappingTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageLayoutTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageListenerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPageServiceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPartServiceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveDescriptorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveListenerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IPerspectiveRegistryTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ISelectionServiceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewActionDelegateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IViewSiteTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPageTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartSiteTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchPartTestableTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowActionDelegateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkbenchWindowTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetManagerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IWorkingSetTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListContentProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElement.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElementActionFilter.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListElementPropertyTester.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ListView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockAction.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionBarContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorMatchingStrategy.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorWithState.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPartListener.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockPropertyListener.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockSelectionProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockViewPartMult.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkbenchWindowActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetPage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockWorkingSetTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PerspectiveViewsBug120934.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PerspectiveViewsBug88345.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PerspectiveWithFastView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PerspectiveWithMultiViewPlaceholdersAtTopLevel.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PerspectiveWithMultiViewPlaceholdersInFolder.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PerspectiveWithMultiViewPlaceholdersInPlaceholderFolder.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/PlatformUITest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SaveableMockViewPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionCreateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionEditorPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionPerspective.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionRestoreTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/SessionView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/StartupClass.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/StartupTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/StickyViewTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/TrimLayoutTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/TrimList.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/UIJobTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/UserSaveableMockViewPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/UserSaveableSharedViewPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ViewPerspective.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/ViewUtils.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/XMLMementoTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/ArbitraryPropertyTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/CustomTitleView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/DynamicItem.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/EditorWithCreateControlsException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/EditorWithDisposeException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/EditorWithInitException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/EditorWithInitRuntimeException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/EditorWithInputException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/EmptyView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/HeavyResourceView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/MenuContributionHarness.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/OverriddenTitleTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/OverriddenTitleView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/RawIViewPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/RawIViewPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/TextWidget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/TitleTestEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/TitleTestView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/ViewPartTitleTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/ViewWithCreateControlsException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/ViewWithDisposeException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/ViewWithInitException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/workbenchpart/ViewWithInitRuntimeException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/AbstractTestLogger.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/AutoTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/AutoTestLogger.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/AutoTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/AutoTestWrapper.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/TestResult.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/TestResultFilter.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/TestResults.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/UITestCaseWithResult.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/autotests/XmlUtil.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/ActionDelegateProxyTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/ActiveActionSetExpression.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/ActiveContextExpression.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/Bug125792Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/Bug66182Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/Bug70503Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/Bug73756Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/Bug74982Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/Bug74990Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/Bug87856Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/CommandActionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/CommandCallbackTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/CommandEnablementTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/CommandManagerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/CommandParameterTypeTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/CommandSerializationTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/CommandsTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/HandlerActivationTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/HelpContextIdTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/IntegerConverter.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/StateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/SubtractIntegerHandler.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/commands/ViewActionDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/compare/UIComparePreferences.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/compare/UIComparePreferencesAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/concurrency/ConcurrencyTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/concurrency/NestedSyncExecDeadlockTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/concurrency/TestBug105491.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/concurrency/TestBug108162.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/concurrency/TestBug138695.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/concurrency/TestBug98621.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/concurrency/TransferRuleTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/contexts/Bug74990Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/contexts/Bug84763Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/contexts/ContextPage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/contexts/ContextsTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/contexts/ExtensionTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/contexts/MockPageView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/contexts/MockViewPart5.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/contexts/PartContextTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/DataTransferTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ExportArchiveFileOperationTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ExportFileSystemOperationTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportArchiveOperationTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExportWizardsCategoryTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportOperationTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/TestExportWizard.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/TestImportWizard.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/tests.ini
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/BackgroundColorDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/BadIndexDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/BadIndexDecoratorTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorAdaptableTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorEnablementTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorTableTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorTableTreeTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorTableTreeView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorTableView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorTestPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorTreeTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorTreeView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorViewerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorsTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/ExceptionDecoratorTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/FontDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/ForegroundColorDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/HeavyNullImageDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/HeavyNullTextDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/LightweightDecoratorTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/NullImageDecorator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TableElement.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestAdaptableDecoratorContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestDecoratorContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestElement.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestLabelProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestLightweightDecoratorContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestLightweightDecoratorMultipleQuadrantContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestResourceDecoratorContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestResourceMappingDecoratorContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestTableContentProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestTreeContentProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TestUnadaptableDecoratorContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/TreeElement.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DataTransferTestStub.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DeprecatedUIDialogs.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DeprecatedUIDialogsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DeprecatedUIPreferences.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DeprecatedUIPreferencesAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DeprecatedUIWizards.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/DeprecatedUIWizardsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/EnableTestPreferencePage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/FontFieldEditorTestPreferencePage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/NavigatorTestStub.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PreferenceDialogWrapper.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/PropertyDialogWrapper.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/SearchPatternAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TaskListTestStub.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TextEditorTestStub.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TextMessageDialogs.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/TextMessageDialogsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIAbstractFilteredResourcesSelectionDialog.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIAutomatedSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIEditWorkingSetWizardAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIErrorDialogs.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIFilteredResourcesSelectionDialog.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIFilteredResourcesSelectionDialogAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIInteractiveSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogs.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIMessageDialogsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UINewWorkingSetWizardAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferences.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIPreferencesAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizards.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWorkingSetWizardsAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/Bug87211Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DetachedDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DetachedWindowDragTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragDropPerspectiveFactory.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragOperations.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/EditorAreaDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/EditorDragSource.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/EditorDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/EditorTabDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/EditorTitleDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/ExistingWindowProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/FastViewBarDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/IWorkbenchWindowProvider.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/StandaloneViewPerspective.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/TestDragSource.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/ViewDragSource.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/ViewDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/ViewTabDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/ViewTitleDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/WindowDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/WorkbenchWindowDropTarget.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/AcceleratorConfigurationsExtensionDynamicTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/AcceleratorScopesExtensionDynamicTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ActionDefinitionsExtensionDynamicTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ActionSetTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ActivitySupportTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/BindingsExtensionDynamicTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/BrowserTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/CommandsExtensionDynamicTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ContextsExtensionDynamicTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DecoratorTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicPluginsTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicSupportTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicTestType.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicUtils.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/EditorTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/EncodingTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/HandlersExtensionDynamicTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/HelpSupportTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/IntroTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/KeywordTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/MarkerSupportTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/NewWizardTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ObjectContributionTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/PerspectiveTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/PreferencePageTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/PropertyPageTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/StartupTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/StatusHandlerTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/TestInstallUtil.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ViewTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/WorkingSetTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/encoding/EncodingTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/encoding/EncodingTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/fieldassist/FieldAssistAPITest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/fieldassist/FieldAssistTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/filteredtree/FilteredTreeTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/ide/api/FileEditorInputTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionExpressionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ActionSetExpressionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/Bug41931Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/Bug78470Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/Bug99858Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/EditorActionBarsTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedSourceViewer.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelection.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ExtendedTextSelectionActionFilter.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/ForcedException.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/InternalTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/PopupMenuExpressionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/TestMemento.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/TextSelectionActionExpressionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/internal/WorkbenchWindowSubordinateSourcesTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/intro/IntroPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/intro/IntroTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/intro/IntroTest2.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/intro/IntroTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/intro/MockIntroPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/intro/NoIntroPartTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/BindingInteractionsTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/BindingManagerTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/BindingPersistenceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug36420Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug36537Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug40023Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug42024Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug42035Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug42627Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43168Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43321Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43538Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43597Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43610Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug43800Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug44460Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/Bug53489Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/KeysCsvTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/KeysTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/PreferenceMutator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/keys/TestBinding.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/layout/constraints/LayoutConstraintsView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeakTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/manual/BrokenUpdatePreferencePage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/manual/ExplicitlyBusyView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/manual/SaveablesView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/manual/TestBackgroundSaveEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/manual/UIPreferencesManual.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/manual/ViewWithSaveables.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/Bug75909Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/DeclarativeFilterActivityTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/DeclarativeFilterDeclarationTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/DeclarativeFilterTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/MarkerSupportRegistryTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/MarkerViewTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/MarkersTestMarkersView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/ResourceMappingMarkersTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/ResourceMappingTestView.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/TestResolutionGenerator.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/TestResourceMapping.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/markers/old_dialog_settings.xml
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/AddMarkersAction.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/BrokenWorkbenchWindowPulldownDelegate.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/ChangeEnablementHandler.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/ContextIdValues.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/HelloDHandler.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/HelloEHandler.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/HelloUpdateHandler.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/MenuBaseTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/MenuBuilder.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/MenuPopulationTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/MenuTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/MenuVisibilityTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/MenusTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/ObjectContributionClasses.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/ObjectContributionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/RemoveMarkersAction.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/menus/ToggleContextHandler.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multieditor/MultiEditorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multieditor/MultiEditorTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestActionBarContributor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TiledEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multipageeditor/ContextTextEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multipageeditor/MultiEditorInputTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multipageeditor/MultiPageEditorTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multipageeditor/MultiPageKeyBindingTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multipageeditor/MultiVariablePageEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multipageeditor/MultiVariablePageTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multipageeditor/TestKeyBindingMultiPageEditorPart.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/multipageeditor/TestMultiPageEditor.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/AbstractNavigatorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/DuplicateMenuItemTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/NavigatorTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/navigator/ResourceNavigatorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/AdvancedTestOperation.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/MultiThreadedOperationsTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/OperationsAPITest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/OperationsTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/TestOperation.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/UnredoableTestOperation.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/WorkbenchOperationHistoryTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/WorkbenchOperationStressTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/operations/WorkspaceOperationsTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/preferences/DeprecatedFontPreferenceTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/preferences/FontPreferenceTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/preferences/ListenerRemovalTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/preferences/PreferencesTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/preferences/ScopedPreferenceStoreTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/preferences/TestPreferenceInitializer.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/preferences/WorkingCopyPreferencesTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/presentations/Bug48589Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/presentations/PresentationsTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertyPages/PropertyPageEnablementTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertyPages/TableResizePropertyPage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertyPages/TreeResizePropertyPage.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/ComboBoxPropertyDescriptorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetAuto.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/propertysheet/PropertySheetTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/quickaccess/CamelUtilTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/quickaccess/QuickAccessTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/services/EvaluationServiceTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/services/ServicesTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/ArbitraryPropertiesEditorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/ArbitraryPropertiesViewTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/Bug108033Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/Bug95357Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/Bug98800Test.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/EditorWithStateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/HandlerStateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/IntroSessionTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/LocaleTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/SessionTests.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/ThemeStateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/ViewWithState.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/session/WorkbenchSessionTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/statushandlers/StatusHandlingTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/statushandlers/TestStatusHandler.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/statushandlers/WizardsStatusHandlingTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/stress/OpenCloseTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/stress/OpenCloseTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/JFaceThemeTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/TestColorFactory.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemeAPITest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemePropertyListener.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemeTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemesTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ActivateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/CloseTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/OpenEditorTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ShowViewTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomPerspectiveFactory.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestCase.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomTestSuite.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomedEditorActivateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomedEditorCloseTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomedViewActivateTest.java
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/zoom/ZoomedViewCloseTest.java
tests/org.eclipse.ui.tests/JFace-All Tests.launch
tests/org.eclipse.ui.tests/META-INF/MANIFEST.MF
tests/org.eclipse.ui.tests/Manual Component Tests/CommonNavigator.txt
tests/org.eclipse.ui.tests/Manual Component Tests/Component Tests.html
tests/org.eclipse.ui.tests/Manual Component Tests/Export.txt
tests/org.eclipse.ui.tests/Manual Component Tests/FieldAssist.txt
tests/org.eclipse.ui.tests/Manual Component Tests/FilteredResourcesSelectionDialog.txt
tests/org.eclipse.ui.tests/Manual Component Tests/Import.txt
tests/org.eclipse.ui.tests/Manual Component Tests/Navigator.txt
tests/org.eclipse.ui.tests/Manual Component Tests/Outline.txt
tests/org.eclipse.ui.tests/Manual Component Tests/Preferences.txt
tests/org.eclipse.ui.tests/Manual Component Tests/PropertiesDialog.txt
tests/org.eclipse.ui.tests/Manual Component Tests/PropertiesView.txt
tests/org.eclipse.ui.tests/Manual Component Tests/StatusHandling.txt
tests/org.eclipse.ui.tests/Manual Component Tests/Tasks.txt
tests/org.eclipse.ui.tests/Manual Component Tests/TextEditor.txt
tests/org.eclipse.ui.tests/Manual Component Tests/Undo test files/A.java
tests/org.eclipse.ui.tests/Manual Component Tests/Undo test files/B.java
tests/org.eclipse.ui.tests/Manual Component Tests/Undo test files/C.java
tests/org.eclipse.ui.tests/Manual Component Tests/Undo test files/D.java
tests/org.eclipse.ui.tests/Manual Component Tests/Undo.txt
tests/org.eclipse.ui.tests/Manual Component Tests/WelcomeEditor.txt
tests/org.eclipse.ui.tests/Manual Component Tests/WorkbenchAction.txt
tests/org.eclipse.ui.tests/Manual Component Tests/WorkbenchLayout.txt
tests/org.eclipse.ui.tests/Manual Scenario Tests/Bookmarks View.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Common Navigator Resource View.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/File System Export.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/File System Import.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Navigator View.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/New File Wizard.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/New Folder Wizard.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/New Project Wizard.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Outline View.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Persistence.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Preferences.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Problems View.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Properties Dialog.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Properties View.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Tasks View.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Test Scenarios.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Text Editor
tests/org.eclipse.ui.tests/Manual Scenario Tests/Welcome Editor.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Window Actions.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/Window Layout.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/ZIP Export.html
tests/org.eclipse.ui.tests/Manual Scenario Tests/ZIP Import.html
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/actions/OpenErrorDialogAction.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/actions/OpenInfoDialogAction.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/actions/OpenWarningDialogAction.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/actions/ThrowNullPointerAction.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/actions/ThrowOutOfMemoryAction.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/handlers/EclipseStatus.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/jobs/TestJob.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/jobs/UITestJob.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/views/PartInitExceptionEditor.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/views/PartInitExceptionView.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/views/RuntimeExceptionEditor.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/views/RuntimeExceptionView.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/views/StatusHandlingView.java
tests/org.eclipse.ui.tests/Status Handling Test Bed/org/eclipse/ui/tests/statushandlers/wizards/FaultyExportWizard.java
tests/org.eclipse.ui.tests/UI Test Suite.launch
tests/org.eclipse.ui.tests/UI-Parts References Test Suite.launch
tests/org.eclipse.ui.tests/UI-Session Tests.launch
tests/org.eclipse.ui.tests/about.html
tests/org.eclipse.ui.tests/build.properties
tests/org.eclipse.ui.tests/data/PerspectiveSwitchSourceCode.txt
tests/org.eclipse.ui.tests/data/dragtests.xml
tests/org.eclipse.ui.tests/data/dynamic_classes.txt
tests/org.eclipse.ui.tests/data/dynamic_classes.zip
tests/org.eclipse.ui.tests/data/dynamic_classes/.classpath
tests/org.eclipse.ui.tests/data/dynamic_classes/.cvsignore
tests/org.eclipse.ui.tests/data/dynamic_classes/.externalToolBuilders/Jar Builder.launch
tests/org.eclipse.ui.tests/data/dynamic_classes/.project
tests/org.eclipse.ui.tests/data/dynamic_classes/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.ui.tests/data/dynamic_classes/META-INF/MANIFEST.MF
tests/org.eclipse.ui.tests/data/dynamic_classes/browser/org/eclipse/ui/dynamic/DynamicBrowserSupport.java
tests/org.eclipse.ui.tests/data/dynamic_classes/build.properties
tests/org.eclipse.ui.tests/data/dynamic_classes/build.xml
tests/org.eclipse.ui.tests/data/dynamic_classes/commands/org/eclipse/ui/dynamic/commands/DynamicHandler.java
tests/org.eclipse.ui.tests/data/dynamic_classes/decorator/org/eclipse/ui/dynamic/DynamicLabelDecorator.java
tests/org.eclipse.ui.tests/data/dynamic_classes/decorator/org/eclipse/ui/dynamic/DynamicLightweightLabelDecorator.java
tests/org.eclipse.ui.tests/data/dynamic_classes/editor/org/eclipse/ui/dynamic/DynamicEditor.java
tests/org.eclipse.ui.tests/data/dynamic_classes/handlers/org/eclipse/ui/dynamic/handlers/DynamicHandler.java
tests/org.eclipse.ui.tests/data/dynamic_classes/help/org/eclipse/ui/dynamic/DynamicHelpSupport.java
tests/org.eclipse.ui.tests/data/dynamic_classes/intro/org/eclipse/ui/dynamic/DynamicIntro.java
tests/org.eclipse.ui.tests/data/dynamic_classes/markerSupport/org/eclipse/ui/dynamic/markerSupport/DynamicTestsSubCategoryProvider.java
tests/org.eclipse.ui.tests/data/dynamic_classes/newWizard/org/eclipse/ui/dynamic/DynamicWizard.java
tests/org.eclipse.ui.tests/data/dynamic_classes/oc/org/eclipse/ui/dynamic/MockObjectActionDelegate.java
tests/org.eclipse.ui.tests/data/dynamic_classes/oc/org/eclipse/ui/dynamic/MockViewActionDelegate.java
tests/org.eclipse.ui.tests/data/dynamic_classes/perspective/org/eclipse/ui/dynamic/DynamicPerspective.java
tests/org.eclipse.ui.tests/data/dynamic_classes/preferencePage/org/eclipse/ui/dynamic/DynamicPreferencePage.java
tests/org.eclipse.ui.tests/data/dynamic_classes/propertyPage/org/eclipse/ui/dynamic/DynamicPropertyPage.java
tests/org.eclipse.ui.tests/data/dynamic_classes/startup/org/eclipse/ui/dynamic/DynamicStartup.java
tests/org.eclipse.ui.tests/data/dynamic_classes/statusHandler/org/eclipse/ui/dynamic/DynamicStatusHandler.java
tests/org.eclipse.ui.tests/data/dynamic_classes/view/org/eclipse/ui/dynamic/DynamicView.java
tests/org.eclipse.ui.tests/data/dynamic_classes/workingSet/org/eclipse/ui/dynamic/DynamicWorkingSetElementAdapter.java
tests/org.eclipse.ui.tests/data/dynamic_classes/workingSet/org/eclipse/ui/dynamic/DynamicWorkingSetPage.java
tests/org.eclipse.ui.tests/data/dynamic_classes/workingSet/org/eclipse/ui/dynamic/DynamicWorkingSetUpdater.java
tests/org.eclipse.ui.tests/data/org.eclipse.acceleratorConfigurationsExtensionDynamicTest/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.acceleratorScopesExtensionDynamicTest/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.actionDefinitionsExtensionDynamicTest/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.bindingsExtensionDynamicTest/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.commandsExtensionDynamicTest/commands.jar
tests/org.eclipse.ui.tests/data/org.eclipse.commandsExtensionDynamicTest/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.contextsExtensionDynamicTest/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.datatransferArchives/ArchiveTestSource.tar
tests/org.eclipse.ui.tests/data/org.eclipse.datatransferArchives/ArchiveTestSource.zip
tests/org.eclipse.ui.tests/data/org.eclipse.datatransferArchives/EmptyFolderInArchive.tar
tests/org.eclipse.ui.tests/data/org.eclipse.datatransferArchives/EmptyFolderInArchive.zip
tests/org.eclipse.ui.tests/data/org.eclipse.datatransferArchives/FileAtRootTest.tar
tests/org.eclipse.ui.tests/data/org.eclipse.datatransferArchives/FileAtRootTest.zip
tests/org.eclipse.ui.tests/data/org.eclipse.datatransferArchives/helloworld.tar
tests/org.eclipse.ui.tests/data/org.eclipse.datatransferArchives/helloworld.zip
tests/org.eclipse.ui.tests/data/org.eclipse.handlersExtensionDynamicTest/handlers.jar
tests/org.eclipse.ui.tests/data/org.eclipse.handlersExtensionDynamicTest/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newActionSet1/WhatDoesItDo.txt
tests/org.eclipse.ui.tests/data/org.eclipse.newActionSet1/anything.gif
tests/org.eclipse.ui.tests/data/org.eclipse.newActionSet1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newActivitySupport1/anything.gif
tests/org.eclipse.ui.tests/data/org.eclipse.newActivitySupport1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newBrowser1/browser.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newBrowser1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newDecorator1/anything.gif
tests/org.eclipse.ui.tests/data/org.eclipse.newDecorator1/decorator.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newDecorator1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newEditor1/anything.gif
tests/org.eclipse.ui.tests/data/org.eclipse.newEditor1/editor.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newEditor1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newEncoding1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newHelpSupport1/help.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newHelpSupport1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newIntro1/intro.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newIntro1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newKeyword1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newMarkerSupport/markerSupport.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newMarkerSupport/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newMultiEditor/build.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newMultiEditor/test01.txt
tests/org.eclipse.ui.tests/data/org.eclipse.newMultiEditor/test02.txt
tests/org.eclipse.ui.tests/data/org.eclipse.newMultiEditor/test03.etest
tests/org.eclipse.ui.tests/data/org.eclipse.newMultiEditor/test04.properties
tests/org.eclipse.ui.tests/data/org.eclipse.newNewWizard1/anything.gif
tests/org.eclipse.ui.tests/data/org.eclipse.newNewWizard1/newWizard.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newNewWizard1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newOC1/oc.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newOC1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newPerspective1/perspective.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newPerspective1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newPerspectiveExtension1/anything.gif
tests/org.eclipse.ui.tests/data/org.eclipse.newPerspectiveExtension1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newPreferencePage1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newPreferencePage1/preferencePage.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newPropertyPage1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newPropertyPage1/propertyPage.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newStartup1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newStartup1/startup.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newStatusHandler1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newStatusHandler1/statusHandler.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newView1/anything.gif
tests/org.eclipse.ui.tests/data/org.eclipse.newView1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newView1/view.jar
tests/org.eclipse.ui.tests/data/org.eclipse.newWorkingSet1/anything.gif
tests/org.eclipse.ui.tests/data/org.eclipse.newWorkingSet1/plugin.xml
tests/org.eclipse.ui.tests/data/org.eclipse.newWorkingSet1/workingSet.jar
tests/org.eclipse.ui.tests/data/testContentType.zip
tests/org.eclipse.ui.tests/data/workspaces/editorSessionTests.zip
tests/org.eclipse.ui.tests/data/workspaces/importExistingFromDirTest.zip
tests/org.eclipse.ui.tests/data/workspaces/introSessionTests.zip
tests/org.eclipse.ui.tests/data/workspaces/themeSessionTests.zip
tests/org.eclipse.ui.tests/doc/Introduction.html
tests/org.eclipse.ui.tests/doc/JUnitPractices.html
tests/org.eclipse.ui.tests/icons/anything.gif
tests/org.eclipse.ui.tests/icons/binary_co.gif
tests/org.eclipse.ui.tests/icons/dynamic.gif
tests/org.eclipse.ui.tests/icons/editor.gif
tests/org.eclipse.ui.tests/icons/mockeditorpart1.gif
tests/org.eclipse.ui.tests/icons/mockeditorpart2.gif
tests/org.eclipse.ui.tests/icons/pack_empty_co.gif
tests/org.eclipse.ui.tests/icons/view.gif
tests/org.eclipse.ui.tests/plugin.xml
tests/org.eclipse.ui.tests/schema/sample.exsd
tests/org.eclipse.ui.tests/test.xml
tests/org.eclipse.ui.tests/uiSniff
tests/org.eclipse.ui.tests/uiSniff.bat
605 files changed, 0 insertions, 63902 deletions
diff --git a/bundles/org.eclipse.core.databinding.beans/.classpath b/bundles/org.eclipse.core.databinding.beans/.classpath deleted file mode 100644 index ce739334..00000000 --- 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 ba077a40..00000000 --- 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 b4a9c589..00000000 --- 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 0aade4c4..00000000 --- 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 59509e09..00000000 --- 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 fee4b048..00000000 --- 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 7d9695a7..00000000 --- a/bundles/org.eclipse.core.databinding.beans/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.core.databinding.beans -Bundle-Version: 1.0.100.qualifier -Bundle-ClassPath: . -Bundle-Vendor: %providerName -Bundle-Localization: plugin -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 46023304..00000000 --- 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 6f0a513e..00000000 --- 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 083e360f..00000000 --- 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 1de49816..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/BeansObservables.java +++ /dev/null @@ -1,423 +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); - } - - /** - * 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); - } - - /*package*/ 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. The returned - * list is mutable. - * - * @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 - * @see #observeList(Realm, Object, String, Class) - */ - 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. The returned - * list is mutable. When an item is added or removed the setter is invoked - * for the list on the parent bean to provide notification to other - * listeners via <code>PropertyChangeEvents</code>. This is done to - * provide the same behavior as is expected from arrays as specified in the - * bean spec in section 7.2. - * - * @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 - */ - /*package*/ 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> - */ - /* package*/ 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 c2545ef4..00000000 --- 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/PojoObservables.java b/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/PojoObservables.java deleted file mode 100644 index 08741f88..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/databinding/beans/PojoObservables.java +++ /dev/null @@ -1,368 +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.databinding.beans; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyDescriptor; - -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 for POJOs (plain old java objects) - * that conform to idea of an object with getters and setters but does not - * provide {@link PropertyChangeEvent property change events} on change. This - * factory is identical to {@link BeansObservables} except for this fact. - * - * @since 1.2 - */ -final public class PojoObservables { - - /** - * Returns an observable value in the default realm tracking the current - * value of the named property of the given pojo. - * - * @param pojo - * the object - * @param propertyName - * the name of the property - * @return an observable value tracking the current value of the named - * property of the given pojo - */ - public static IObservableValue observeValue(Object pojo, String propertyName) { - return observeValue(Realm.getDefault(), pojo, propertyName); - } - - /** - * Returns an observable value in the given realm tracking the current value - * of the named property of the given pojo. - * - * @param realm - * the realm - * @param pojo - * the object - * @param propertyName - * the name of the property - * @return an observable value tracking the current value of the named - * property of the given pojo - */ - public static IObservableValue observeValue(Realm realm, Object pojo, - String propertyName) { - - PropertyDescriptor descriptor = BeansObservables.getPropertyDescriptor( - pojo.getClass(), propertyName); - return new JavaBeanObservableValue(realm, pojo, descriptor, false); - } - - /** - * Returns an observable map in the default realm tracking the current - * values of the named property for the pojos in the given set. - * - * @param domain - * the set of pojo objects - * @param pojoClass - * the common base type of pojo 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 pojos in the given domain set - */ - public static IObservableMap observeMap(IObservableSet domain, - Class pojoClass, String propertyName) { - PropertyDescriptor descriptor = BeansObservables.getPropertyDescriptor( - pojoClass, propertyName); - return new JavaBeanObservableMap(domain, descriptor, false); - } - - /** - * Returns an array of observable maps in the default realm tracking the - * current values of the named propertys for the pojos in the given set. - * - * @param domain - * the set of objects - * @param pojoClass - * 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 pojos in the given domain set - */ - public static IObservableMap[] observeMaps(IObservableSet domain, - Class pojoClass, String[] propertyNames) { - IObservableMap[] result = new IObservableMap[propertyNames.length]; - for (int i = 0; i < propertyNames.length; i++) { - result[i] = observeMap(domain, pojoClass, propertyNames[i]); - } - return result; - } - - /** - * Returns an observable list in the given realm tracking the - * collection-typed named property of the given pojo object. The returned - * list is mutable. - * - * @param realm - * the realm - * @param pojo - * the object - * @param propertyName - * the name of the collection-typed property - * @return an observable list tracking the collection-typed named property - * of the given pojo object - * @see #observeList(Realm, Object, String, Class) - */ - public static IObservableList observeList(Realm realm, Object pojo, - String propertyName) { - return observeList(realm, pojo, propertyName, null); - } - - /** - * Returns an observable list in the given realm tracking the - * collection-typed named property of the given bean object. The returned - * list is mutable. When an item is added or removed the setter is invoked - * for the list on the parent bean to provide notification to other - * listeners via <code>PropertyChangeEvents</code>. This is done to - * provide the same behavior as is expected from arrays as specified in the - * bean spec in section 7.2. - * - * @param realm - * the realm - * @param pojo - * 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 pojo, - String propertyName, Class elementType) { - PropertyDescriptor propertyDescriptor = BeansObservables - .getPropertyDescriptor(pojo.getClass(), propertyName); - elementType = BeansObservables.getCollectionElementType(elementType, - propertyDescriptor); - - return new JavaBeanObservableList(realm, pojo, propertyDescriptor, - elementType, false); - } - - /** - * Returns an observable set in the given realm tracking the - * collection-typed named property of the given pojo object. - * - * @param realm - * the realm - * @param pojo - * the pojo object - * @param propertyName - * the name of the property - * @return an observable set tracking the collection-typed named property of - * the given pojo object - */ - public static IObservableSet observeSet(Realm realm, Object pojo, - String propertyName) { - return observeSet(realm, pojo, propertyName, null); - } - - /** - * @param realm - * @param pojo - * @param propertyName - * @param elementType - * can be <code>null</code> - * @return an observable set that tracks the current value of the named - * property for given pojo object - */ - public static IObservableSet observeSet(Realm realm, Object pojo, - String propertyName, Class elementType) { - PropertyDescriptor propertyDescriptor = BeansObservables - .getPropertyDescriptor(pojo.getClass(), propertyName); - elementType = BeansObservables.getCollectionElementType(elementType, - propertyDescriptor); - - return new JavaBeanObservableSet(realm, pojo, propertyDescriptor, - elementType, false); - } - - /** - * Returns a factory for creating obervable values tracking the given - * property of a particular pojo 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 pojo 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 pojo 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); - } - }; - } - - /** - * @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); - } - }; - } - - /** - * 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, BeansObservables.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, BeansObservables - .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, BeansObservables - .getValueTypePropertyDescriptor(master, propertyName)); - - return decorator; - } -} 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 c290e497..00000000 --- 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> -Provides classes for observing JavaBeans(tm) objects. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe objects that conform to the <a href="http://java.sun.com/products/javabeans/docs/spec.html">JavaBean specification</a> for bound properties.</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 2f5ddab6..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableListDecorator.java +++ /dev/null @@ -1,220 +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; -import org.eclipse.core.internal.databinding.Util; - -/** - * {@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) { - if (o instanceof BeanObservableListDecorator) { - BeanObservableListDecorator other = (BeanObservableListDecorator) o; - return Util.equals(other.delegate, delegate); - } - return Util.equals(delegate, 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 d3299cfd..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableSetDecorator.java +++ /dev/null @@ -1,174 +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; -import org.eclipse.core.internal.databinding.Util; - -/** - * {@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 obj) { - if (obj instanceof BeanObservableSetDecorator) { - BeanObservableSetDecorator other = (BeanObservableSetDecorator) obj; - return Util.equals(other.delegate, delegate); - } - return Util.equals(delegate, obj); - } - - 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 1fa2d5e8..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/BeanObservableValueDecorator.java +++ /dev/null @@ -1,131 +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; -import org.eclipse.core.internal.databinding.Util; - -/** - * {@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) { - if (obj instanceof BeanObservableValueDecorator) { - BeanObservableValueDecorator other = (BeanObservableValueDecorator) obj; - return Util.equals(other.delegate, delegate); - } - return Util.equals(delegate, 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 491f9edb..00000000 --- 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 45c4eee2..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableList.java +++ /dev/null @@ -1,372 +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.Array; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.databinding.BindingException; -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.list.ListDiffEntry; -import org.eclipse.core.databinding.observable.list.ObservableList; - -/** - * @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; - - private boolean attachListeners; - - /** - * @param realm - * @param object - * @param descriptor - * @param elementType - */ - public JavaBeanObservableList(Realm realm, Object object, - PropertyDescriptor descriptor, Class elementType) { - this(realm, object, descriptor, elementType, true); - } - - /** - * @param realm - * @param object - * @param descriptor - * @param elementType - * @param attachListeners - */ - public JavaBeanObservableList(Realm realm, Object object, - PropertyDescriptor descriptor, Class elementType, - boolean attachListeners) { - - super(realm, new ArrayList(), elementType); - this.object = object; - this.descriptor = descriptor; - this.attachListeners = attachListeners; - - if (attachListeners) { - this.collectionListenSupport = new ListenerSupport( - collectionListener, descriptor.getName()); - } - - // initialize list without firing events - wrappedList.addAll(Arrays.asList(getValues())); - } - - protected void firstListenerAdded() { - if (attachListeners) { - collectionListenSupport.hookListener(this.object); - } - } - - protected void lastListenerRemoved() { - if (collectionListenSupport != null) { - collectionListenSupport.dispose(); - } - } - - public void dispose() { - super.dispose(); - lastListenerRemoved(); - } - - private Object primGetValues() { - Exception ex = null; - try { - Method readMethod = descriptor.getReadMethod(); - if (!readMethod.isAccessible()) { - readMethod.setAccessible(true); - } - return readMethod.invoke(object, new Object[0]); - } catch (IllegalArgumentException e) { - ex = e; - } catch (IllegalAccessException e) { - ex = e; - } catch (InvocationTargetException e) { - ex = e; - } - throw new BindingException("Could not read collection values", ex); //$NON-NLS-1$ - } - - 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; - } - - public Object getObserved() { - return object; - } - - public PropertyDescriptor getPropertyDescriptor() { - return descriptor; - } - - private void setValues() { - if (descriptor.getPropertyType().isArray()) { - Class componentType = descriptor.getPropertyType() - .getComponentType(); - Object[] newArray = (Object[]) Array.newInstance(componentType, - wrappedList.size()); - wrappedList.toArray(newArray); - primSetValues(newArray); - } else { - // assume that it is a java.util.List - primSetValues(new ArrayList(wrappedList)); - } - } - - private void primSetValues(Object newValue) { - Exception ex = null; - try { - Method writeMethod = descriptor.getWriteMethod(); - if (!writeMethod.isAccessible()) { - writeMethod.setAccessible(true); - } - writeMethod.invoke(object, new Object[] { newValue }); - return; - } catch (IllegalArgumentException e) { - ex = e; - } catch (IllegalAccessException e) { - ex = e; - } catch (InvocationTargetException e) { - ex = e; - } - throw new BindingException("Could not write collection values", ex); //$NON-NLS-1$ - } - - public Object set(int index, Object element) { - getterCalled(); - updating = true; - try { - Object oldElement = wrappedList.set(index, element); - setValues(); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry( - index, true, element), Diffs.createListDiffEntry(index + 1, - false, oldElement))); - return oldElement; - } finally { - updating = false; - } - } - - public Object remove(int index) { - getterCalled(); - updating = true; - try { - Object oldElement = wrappedList.remove(index); - setValues(); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry( - index, false, oldElement))); - return oldElement; - } finally { - updating = false; - } - } - - public boolean add(Object element) { - updating = true; - try { - int index = wrappedList.size(); - boolean result = wrappedList.add(element); - setValues(); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry( - index, true, element))); - return result; - } finally { - updating = false; - } - } - - public void add(int index, Object element) { - updating = true; - try { - wrappedList.add(index, element); - setValues(); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry( - index, true, element))); - } finally { - updating = false; - } - } - - public boolean addAll(Collection c) { - if (c.isEmpty()) { - return false; - } - updating = true; - try { - int index = wrappedList.size(); - boolean result = wrappedList.addAll(c); - setValues(); - ListDiffEntry[] entries = new ListDiffEntry[c.size()]; - int i = 0; - for (Iterator it = c.iterator(); it.hasNext();) { - Object o = it.next(); - entries[i++] = Diffs.createListDiffEntry(index++, true, o); - } - fireListChange(Diffs.createListDiff(entries)); - return result; - } finally { - updating = false; - } - } - - public boolean addAll(int index, Collection c) { - if (c.isEmpty()) { - return false; - } - updating = true; - try { - boolean result = wrappedList.addAll(index, c); - setValues(); - ListDiffEntry[] entries = new ListDiffEntry[c.size()]; - int i = 0; - for (Iterator it = c.iterator(); it.hasNext();) { - Object o = it.next(); - entries[i++] = Diffs.createListDiffEntry(index++, true, o); - } - fireListChange(Diffs.createListDiff(entries)); - return result; - } finally { - updating = false; - } - } - - public boolean remove(Object o) { - getterCalled(); - int index = wrappedList.indexOf(o); - if (index == -1) { - return false; - } - updating = true; - try { - Object oldElement = wrappedList.remove(index); - setValues(); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry( - index, false, oldElement))); - return true; - } finally { - updating = false; - } - } - - public boolean removeAll(Collection c) { - getterCalled(); - boolean changed = false; - updating = true; - try { - List diffEntries = new ArrayList(); - for (Iterator it = c.iterator(); it.hasNext();) { - Object o = it.next(); - int index = wrappedList.indexOf(o); - if (index != -1) { - changed = true; - Object oldElement = wrappedList.remove(index); - diffEntries.add(Diffs.createListDiffEntry(index, false, - oldElement)); - } - } - setValues(); - fireListChange(Diffs.createListDiff((ListDiffEntry[]) diffEntries - .toArray(new ListDiffEntry[diffEntries.size()]))); - return changed; - } finally { - updating = false; - } - } - - public boolean retainAll(Collection c) { - getterCalled(); - boolean changed = false; - updating = true; - try { - List diffEntries = new ArrayList(); - int index = 0; - for (Iterator it = wrappedList.iterator(); it.hasNext();) { - Object o = it.next(); - boolean retain = c.contains(o); - if (retain) { - index++; - } else { - changed = true; - it.remove(); - diffEntries.add(Diffs.createListDiffEntry(index, false, o)); - } - } - setValues(); - fireListChange(Diffs.createListDiff((ListDiffEntry[]) diffEntries - .toArray(new ListDiffEntry[diffEntries.size()]))); - return changed; - } finally { - updating = false; - } - } - - public void clear() { - updating = true; - try { - List diffEntries = new ArrayList(); - for (Iterator it = wrappedList.iterator(); it.hasNext();) { - Object o = it.next(); - diffEntries.add(Diffs.createListDiffEntry(0, false, o)); - } - setValues(); - fireListChange(Diffs.createListDiff((ListDiffEntry[]) diffEntries - .toArray(new ListDiffEntry[diffEntries.size()]))); - } finally { - updating = false; - } - } - -} 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 7fa1d721..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableMap.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.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; - - private boolean attachListeners; - - /** - * @param domain - * @param propertyDescriptor - */ - public JavaBeanObservableMap(IObservableSet domain, - PropertyDescriptor propertyDescriptor) { - this(domain, propertyDescriptor, true); - } - - /** - * @param domain - * @param propertyDescriptor - * @param attachListeners - */ - public JavaBeanObservableMap(IObservableSet domain, - PropertyDescriptor propertyDescriptor, boolean attachListeners) { - super(domain); - - this.propertyDescriptor = propertyDescriptor; - this.attachListeners = attachListeners; - if (attachListeners) { - this.listenerSupport = new ListenerSupport(elementListener, - propertyDescriptor.getName()); - } - init(); - } - - protected void hookListener(Object domainElement) { - if (attachListeners) { - listenerSupport.hookListener(domainElement); - } - } - - protected void unhookListener(Object domainElement) { - if (attachListeners) { - 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 0aaeb1e6..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableSet.java +++ /dev/null @@ -1,155 +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; - - private boolean attachListeners; - - /** - * @param realm - * @param object - * @param descriptor - * @param elementType - */ - public JavaBeanObservableSet(Realm realm, Object object, - PropertyDescriptor descriptor, Class elementType) { - this(realm, object, descriptor, elementType, true); - } - - /** - * @param realm - * @param object - * @param descriptor - * @param elementType - * @param attachListeners - */ - public JavaBeanObservableSet(Realm realm, Object object, - PropertyDescriptor descriptor, Class elementType, - boolean attachListeners) { - super(realm, new HashSet(), elementType); - this.object = object; - this.descriptor = descriptor; - this.attachListeners = attachListeners; - if (attachListeners) { - this.collectionListenSupport = new ListenerSupport( - collectionListener, descriptor.getName()); - } - - wrappedSet.addAll(Arrays.asList(getValues())); - } - - protected void firstListenerAdded() { - if (attachListeners) { - 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 643c5c43..00000000 --- a/bundles/org.eclipse.core.databinding.beans/src/org/eclipse/core/internal/databinding/internal/beans/JavaBeanObservableValue.java +++ /dev/null @@ -1,190 +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.InvocationTargetException; -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.internal.databinding.Util; -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 ListenerSupport listenerSupport; - - private boolean attachListeners; - - /** - * @param realm - * @param object - * @param descriptor - */ - public JavaBeanObservableValue(Realm realm, Object object, - PropertyDescriptor descriptor) { - this(realm, object, descriptor, true); - } - - /** - * @param realm - * @param object - * @param descriptor - * @param attachListeners - */ - public JavaBeanObservableValue(Realm realm, Object object, - PropertyDescriptor descriptor, boolean attachListeners) { - super(realm); - this.object = object; - this.propertyDescriptor = descriptor; - this.attachListeners = attachListeners; - } - - protected void firstListenerAdded() { - if (!attachListeners) { - return; - } - - 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(); - - if (Util.equals(oldValue, value)) { - return; - } - - Method writeMethod = propertyDescriptor.getWriteMethod(); - if (!writeMethod.isAccessible()) { - writeMethod.setAccessible(true); - } - writeMethod.invoke(object, new Object[] { value }); - fireValueChange(Diffs.createValueDiff(oldValue, doGetValue())); - } catch (InvocationTargetException e) { - /* - * InvocationTargetException wraps any exception thrown by the - * invoked method. - */ - throw new RuntimeException(e.getCause()); - } 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 (InvocationTargetException e) { - /* - * InvocationTargetException wraps any exception thrown by the - * invoked method. - */ - throw new RuntimeException(e.getCause()); - } 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(); - listenerSupport = null; - } - } - - public Object getValueType() { - return propertyDescriptor.getPropertyType(); - } - - 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 81448919..00000000 --- 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.observable/src/org/eclipse/core/databinding/observable/AbstractObservable.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/AbstractObservable.java deleted file mode 100644 index 98ceb05f..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/AbstractObservable.java +++ /dev/null @@ -1,72 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.AssertionFailedException; - -/** - * @since 1.0 - */ -public abstract class AbstractObservable extends ChangeManager implements IObservable { - - /** - * @param realm - */ - public AbstractObservable(Realm realm) { - super(realm); - } - - public synchronized void addChangeListener(IChangeListener listener) { - addListener(ChangeEvent.TYPE, listener); - } - - public synchronized void removeChangeListener(IChangeListener listener) { - removeListener(ChangeEvent.TYPE, listener); - } - - public synchronized void addStaleListener(IStaleListener listener) { - addListener(StaleEvent.TYPE, listener); - } - - public synchronized void removeStaleListener(IStaleListener listener) { - removeListener(StaleEvent.TYPE, listener); - } - - protected void fireChange() { - checkRealm(); - fireEvent(new ChangeEvent(this)); - } - - protected void fireStale() { - checkRealm(); - fireEvent(new StaleEvent(this)); - } - - /** - * - */ - public synchronized void dispose() { - super.dispose(); - } - - /** - * Asserts that the realm is the current realm. - * - * @see Realm#isCurrent() - * @throws AssertionFailedException if the realm is not the current realm - */ - protected void checkRealm() { - Assert.isTrue(getRealm().isCurrent()); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeEvent.java deleted file mode 100644 index 60950cf2..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeEvent.java +++ /dev/null @@ -1,48 +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.databinding.observable; - -/** - * Generic change event denoting that the state of an {@link IObservable} object - * has changed. This event does not carry information about the kind of change - * that occurred. - * - * @since 1.0 - * - */ -public class ChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = -3241193109844979384L; - static final Object TYPE = new Object(); - - /** - * Creates a new change event object. - * - * @param source - * the observable that changed state - */ - public ChangeEvent(IObservable source) { - super(source); - } - - protected void dispatch(IObservablesListener listener) { - ((IChangeListener) listener).handleChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeManager.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeManager.java deleted file mode 100644 index 788cb4b1..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeManager.java +++ /dev/null @@ -1,161 +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.databinding.observable; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.ListenerList; - -/** - * Listener management implementation. Exposed to subclasses in form of - * {@link AbstractObservable} and {@link ChangeSupport}. - * - * @since 1.0 - * - */ -/* package */ class ChangeManager { - - ListenerList[] listenerLists = null; - Object listenerTypes[] = null; - private Realm realm; - - /** - * @param realm - * - */ - /* package */ ChangeManager(Realm realm) { - Assert.isNotNull(realm); - this.realm = realm; - } - - /** - * @param listenerType - * @param listener - */ - protected void addListener(Object listenerType, - IObservablesListener listener) { - int listenerTypeIndex = findListenerTypeIndex(listenerType); - if (listenerTypeIndex == -1) { - int length; - if (listenerTypes == null) { - length = 0; - listenerTypes = new Object[1]; - listenerLists = new ListenerList[1]; - } else { - length = listenerTypes.length; - System.arraycopy(listenerTypes, 0, - listenerTypes = new Object[length + 1], 0, length); - System - .arraycopy(listenerLists, 0, - listenerLists = new ListenerList[length + 1], - 0, length); - } - listenerTypes[length] = listenerType; - listenerLists[length] = new ListenerList(); - boolean hadListeners = hasListeners(); - listenerLists[length].add(listener); - if (!hadListeners) { - this.firstListenerAdded(); - } - return; - } - ListenerList listenerList = listenerLists[listenerTypeIndex]; - boolean hadListeners = true; - if (listenerList.size() == 0) { - hadListeners = hasListeners(); - } - listenerList.add(listener); - if (!hadListeners) { - firstListenerAdded(); - } - } - - /** - * @param listenerType - * @param listener - */ - protected void removeListener(Object listenerType, - IObservablesListener listener) { - int listenerTypeIndex = findListenerTypeIndex(listenerType); - if (listenerTypeIndex != -1) { - listenerLists[listenerTypeIndex].remove(listener); - if (listenerLists[listenerTypeIndex].size() == 0) { - if (!hasListeners()) { - this.lastListenerRemoved(); - } - } - } - } - - protected boolean hasListeners() { - if (listenerTypes == null) { - return false; - } - for (int i = 0; i < listenerTypes.length; i++) { - if (listenerLists[i].size() > 0) { - return true; - } - } - return false; - } - - private int findListenerTypeIndex(Object listenerType) { - if (listenerTypes != null) { - for (int i = 0; i < listenerTypes.length; i++) { - if (listenerTypes[i] == listenerType) { - return i; - } - } - } - return -1; - } - - protected void fireEvent(ObservableEvent event) { - Object listenerType = event.getListenerType(); - int listenerTypeIndex = findListenerTypeIndex(listenerType); - if (listenerTypeIndex != -1) { - Object[] listeners = listenerLists[listenerTypeIndex] - .getListeners(); - for (int i = 0; i < listeners.length; i++) { - event.dispatch((IObservablesListener) listeners[i]); - } - } - } - - /** - * - */ - protected void firstListenerAdded() { - } - - /** - * - */ - protected void lastListenerRemoved() { - } - - /** - * - */ - public void dispose() { - listenerLists = null; - listenerTypes = null; - realm = null; - } - - /** - * @return Returns the realm. - */ - public Realm getRealm() { - return realm; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeSupport.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeSupport.java deleted file mode 100644 index e91daeb3..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ChangeSupport.java +++ /dev/null @@ -1,79 +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.databinding.observable; - -/** - * @since 1.0 - * - */ -public abstract class ChangeSupport extends ChangeManager { - - /** - * @param realm - */ - public ChangeSupport(Realm realm) { - super(realm); - } - - public void addListener(Object listenerType, - IObservablesListener listener) { - super.addListener(listenerType, listener); - } - - public void removeListener(Object listenerType, - IObservablesListener listener) { - super.removeListener(listenerType, listener); - } - - public void fireEvent(ObservableEvent event) { - super.fireEvent(event); - } - - /** - * - */ - protected abstract void firstListenerAdded(); - - /** - * - */ - protected abstract void lastListenerRemoved(); - - /** - * @param listener - */ - public void addChangeListener(IChangeListener listener) { - addListener(ChangeEvent.TYPE, listener); - } - - /** - * @param listener - */ - public void removeChangeListener(IChangeListener listener) { - removeListener(ChangeEvent.TYPE, listener); - } - - /** - * @param listener - */ - public void addStaleListener(IStaleListener listener) { - addListener(StaleEvent.TYPE, listener); - } - - /** - * @param listener - */ - public void removeStaleListener(IStaleListener listener) { - removeListener(StaleEvent.TYPE, listener); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Diffs.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Diffs.java deleted file mode 100644 index e971ffdc..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Diffs.java +++ /dev/null @@ -1,460 +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.databinding.observable; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.list.ListDiff; -import org.eclipse.core.databinding.observable.list.ListDiffEntry; -import org.eclipse.core.databinding.observable.map.MapDiff; -import org.eclipse.core.databinding.observable.set.SetDiff; -import org.eclipse.core.databinding.observable.value.ValueDiff; -import org.eclipse.core.internal.databinding.Util; - -/** - * @since 1.0 - * - */ -public class Diffs { - - /** - * @param oldList - * @param newList - * @return the differences between oldList and newList - */ - public static ListDiff computeListDiff(List oldList, List newList) { - List diffEntries = new ArrayList(); - createListDiffs(new ArrayList(oldList), newList, diffEntries); - ListDiff listDiff = createListDiff((ListDiffEntry[]) diffEntries - .toArray(new ListDiffEntry[diffEntries.size()])); - return listDiff; - } - - /** - * adapted from EMF's ListDifferenceAnalyzer - */ - private static void createListDiffs(List oldList, List newList, - List listDiffs) { - int index = 0; - for (Iterator it = newList.iterator(); it.hasNext();) { - Object newObject = it.next(); - if (oldList.size() <= index) { - listDiffs.add(createListDiffEntry(index, true, newObject)); - } else { - boolean done; - do { - done = true; - Object targetObject = oldList.get(index); - if (targetObject == null ? newObject != null - : !targetObject.equals(newObject)) { - int position = listIndexOf(oldList, newObject, index); - if (position != -1) { - int targetIndex = listIndexOf(newList, - targetObject, index); - if (targetIndex == -1) { - listDiffs.add(createListDiffEntry(index, false, targetObject)); - oldList.remove(index); - done = false; - } else if (targetIndex > position) { - if (oldList.size() <= targetIndex) { - targetIndex = oldList.size() - 1; - } - listDiffs.add(createListDiffEntry(index, false, newObject)); - oldList.remove(index); - listDiffs.add(createListDiffEntry(targetIndex, true, newObject)); - oldList.add(targetIndex, newObject); - done = false; - } else { - listDiffs.add(createListDiffEntry(position, false, newObject)); - oldList.remove(position); - listDiffs.add(createListDiffEntry(index, true, newObject)); - oldList.add(index, newObject); - } - } else { - oldList.add(index, newObject); - listDiffs.add(createListDiffEntry(index, true, newObject)); - } - } - } while (!done); - } - ++index; - } - for (int i = oldList.size(); i > index;) { - listDiffs.add(createListDiffEntry(--i, false, oldList.get(i))); - } - } - - /** - * @param list - * @param object - * @param index - * @return the index, or -1 if not found - */ - private static int listIndexOf(List list, Object object, int index) { - int size = list.size(); - for (int i=index; i<size;i++) { - Object candidate = list.get(i); - if (candidate==null ? object==null : candidate.equals(object)) { - return i; - } - } - return -1; - } - - /** - * Checks whether the two objects are <code>null</code> -- allowing for - * <code>null</code>. - * - * @param left - * The left object to compare; may be <code>null</code>. - * @param right - * The right object to compare; may be <code>null</code>. - * @return <code>true</code> if the two objects are equivalent; - * <code>false</code> otherwise. - */ - public static final boolean equals(final Object left, final Object right) { - return left == null ? right == null : ((right != null) && left - .equals(right)); - } - - /** - * @param oldSet - * @param newSet - * @return a set diff - */ - public static SetDiff computeSetDiff(Set oldSet, Set newSet) { - Set additions = new HashSet(newSet); - additions.removeAll(oldSet); - Set removals = new HashSet(oldSet); - removals.removeAll(newSet); - return createSetDiff(additions, removals); - } - - /** - * Computes the difference between two maps. - * - * @param oldMap - * @param newMap - * @return a map diff representing the changes needed to turn oldMap into - * newMap - */ - public static MapDiff computeMapDiff(Map oldMap, Map newMap) { - // starts out with all keys from the new map, we will remove keys from - // the old map as we go - final Set addedKeys = new HashSet(newMap.keySet()); - final Set removedKeys = new HashSet(); - final Set changedKeys = new HashSet(); - final Map oldValues = new HashMap(); - final Map newValues = new HashMap(); - for (Iterator it = oldMap.keySet().iterator(); it.hasNext();) { - Object oldKey = it.next(); - if (addedKeys.remove(oldKey)) { - // potentially changed key since it is in oldMap and newMap - Object oldValue = oldMap.get(oldKey); - Object newValue = newMap.get(oldKey); - if (!Util.equals(oldValue, newValue)) { - changedKeys.add(oldKey); - oldValues.put(oldKey, oldValue); - newValues.put(oldKey, newValue); - } - } else { - removedKeys.add(oldKey); - oldValues.put(oldKey, oldMap.get(oldKey)); - } - } - for (Iterator it = addedKeys.iterator(); it.hasNext();) { - Object newKey = it.next(); - newValues.put(newKey, newMap.get(newKey)); - } - return new MapDiff() { - public Set getAddedKeys() { - return addedKeys; - } - - public Set getChangedKeys() { - return changedKeys; - } - - public Set getRemovedKeys() { - return removedKeys; - } - - public Object getNewValue(Object key) { - return newValues.get(key); - } - - public Object getOldValue(Object key) { - return oldValues.get(key); - } - }; - } - - /** - * @param oldValue - * @param newValue - * @return a value diff - */ - public static ValueDiff createValueDiff(final Object oldValue, - final Object newValue) { - return new ValueDiff() { - - public Object getOldValue() { - return oldValue; - } - - public Object getNewValue() { - return newValue; - } - }; - } - - /** - * @param additions - * @param removals - * @return a set diff - */ - public static SetDiff createSetDiff(Set additions, Set removals) { - final Set unmodifiableAdditions = Collections - .unmodifiableSet(additions); - final Set unmodifiableRemovals = Collections.unmodifiableSet(removals); - return new SetDiff() { - - public Set getAdditions() { - return unmodifiableAdditions; - } - - public Set getRemovals() { - return unmodifiableRemovals; - } - }; - } - - /** - * @param difference - * @return a list diff with one differing entry - */ - public static ListDiff createListDiff(ListDiffEntry difference) { - return createListDiff(new ListDiffEntry[] { difference }); - } - - /** - * @param difference1 - * @param difference2 - * @return a list diff with two differing entries - */ - public static ListDiff createListDiff(ListDiffEntry difference1, - ListDiffEntry difference2) { - return createListDiff(new ListDiffEntry[] { difference1, difference2 }); - } - - /** - * @param differences - * @return a list diff with the given entries - */ - public static ListDiff createListDiff(final ListDiffEntry[] differences) { - return new ListDiff() { - public ListDiffEntry[] getDifferences() { - return differences; - } - }; - } - - /** - * @param position - * @param isAddition - * @param element - * @return a list diff entry - */ - public static ListDiffEntry createListDiffEntry(final int position, - final boolean isAddition, final Object element) { - return new ListDiffEntry() { - - public int getPosition() { - return position; - } - - public boolean isAddition() { - return isAddition; - } - - public Object getElement() { - return element; - } - }; - } - - /** - * @param addedKey - * @param newValue - * @return a map diff - */ - public static MapDiff createMapDiffSingleAdd(final Object addedKey, - final Object newValue) { - return new MapDiff() { - - public Set getAddedKeys() { - return Collections.singleton(addedKey); - } - - public Set getChangedKeys() { - return Collections.EMPTY_SET; - } - - public Object getNewValue(Object key) { - return newValue; - } - - public Object getOldValue(Object key) { - return null; - } - - public Set getRemovedKeys() { - return Collections.EMPTY_SET; - } - }; - } - - /** - * @param existingKey - * @param oldValue - * @param newValue - * @return a map diff - */ - public static MapDiff createMapDiffSingleChange(final Object existingKey, - final Object oldValue, final Object newValue) { - return new MapDiff() { - - public Set getAddedKeys() { - return Collections.EMPTY_SET; - } - - public Set getChangedKeys() { - return Collections.singleton(existingKey); - } - - public Object getNewValue(Object key) { - return newValue; - } - - public Object getOldValue(Object key) { - return oldValue; - } - - public Set getRemovedKeys() { - return Collections.EMPTY_SET; - } - }; - } - - /** - * @param removedKey - * @param oldValue - * @return a map diff - */ - public static MapDiff createMapDiffSingleRemove(final Object removedKey, - final Object oldValue) { - return new MapDiff() { - - public Set getAddedKeys() { - return Collections.EMPTY_SET; - } - - public Set getChangedKeys() { - return Collections.EMPTY_SET; - } - - public Object getNewValue(Object key) { - return null; - } - - public Object getOldValue(Object key) { - return oldValue; - } - - public Set getRemovedKeys() { - return Collections.singleton(removedKey); - } - }; - } - - /** - * @param copyOfOldMap - * @return a map diff - */ - public static MapDiff createMapDiffRemoveAll(final Map copyOfOldMap) { - return new MapDiff() { - - public Set getAddedKeys() { - return Collections.EMPTY_SET; - } - - public Set getChangedKeys() { - return Collections.EMPTY_SET; - } - - public Object getNewValue(Object key) { - return null; - } - - public Object getOldValue(Object key) { - return copyOfOldMap.get(key); - } - - public Set getRemovedKeys() { - return copyOfOldMap.keySet(); - } - }; - } - - /** - * @param addedKeys - * @param removedKeys - * @param changedKeys - * @param oldValues - * @param newValues - * @return a map diff - */ - public static MapDiff createMapDiff(final Set addedKeys, - final Set removedKeys, final Set changedKeys, final Map oldValues, - final Map newValues) { - return new MapDiff() { - - public Set getAddedKeys() { - return addedKeys; - } - - public Set getChangedKeys() { - return changedKeys; - } - - public Object getNewValue(Object key) { - return newValues.get(key); - } - - public Object getOldValue(Object key) { - return oldValues.get(key); - } - - public Set getRemovedKeys() { - return removedKeys; - } - }; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IChangeListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IChangeListener.java deleted file mode 100644 index d0a5cee9..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IChangeListener.java +++ /dev/null @@ -1,42 +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.databinding.observable; - -import org.eclipse.core.databinding.observable.list.IListChangeListener; -import org.eclipse.core.databinding.observable.map.IMapChangeListener; -import org.eclipse.core.databinding.observable.set.ISetChangeListener; -import org.eclipse.core.databinding.observable.value.IValueChangeListener; - -/** - * Listener for generic change events. Note that the change events do not carry - * information about the change, they only specify the affected observable. To - * listen for specific change events, use more specific change listeners. - * - * @see IValueChangeListener - * @see IListChangeListener - * @see ISetChangeListener - * @see IMapChangeListener - * - * @since 1.0 - */ -public interface IChangeListener extends IObservablesListener { - - /** - * Handle a generic change to the given observable. The given event object - * must only be used locally in this method because it may be reused for - * other change notifications. - * - * @param event - */ - public void handleChange(ChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservable.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservable.java deleted file mode 100644 index 4445fbde..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservable.java +++ /dev/null @@ -1,108 +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.databinding.observable; - -/** - * An object with state that allows to listen for state changes. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes in the framework that implement this - * interface. Note that direct implementers of this interface outside of the - * framework will be broken in future releases when methods are added to this - * interface. - * </p> - * <p> - * Implementations must not manage listeners themselves, listener management - * must be delegated to a private instance of type {@link ChangeSupport} if - * it is not inherited from {@link AbstractObservable}. - * </p> - * - * @since 1.0 - * - */ -public interface IObservable { - - /** - * Returns the realm for this observable. Unless otherwise specified, - * getters and setters must be accessed from within this realm. Listeners - * will be within this realm when they receive events from this observable. - * <p> - * Because observables can only be accessed from within one realm, and they - * always fire events on that realm, their state can be observed in an - * incremental way. It is always safe to call getters of an observable from - * within a change listener attached to that observable. - * </p> - * - * @return the realm - */ - public Realm getRealm(); - - /** - * Adds the given change listener to the list of change listeners. Change - * listeners are notified about changes of the state of this observable in a - * generic way, without specifying the change that happened. To get the - * changed state, a change listener needs to query for the current state of - * this observable. - * - * @param listener - */ - public void addChangeListener(IChangeListener listener); - - /** - * Removes the given change listener from the list of change listeners. Has - * no effect if the given listener is not registered as a change listener. - * - * @param listener - */ - public void removeChangeListener(IChangeListener listener); - - /** - * Adds the given stale listener to the list of stale listeners. Stale - * listeners are notified when an observable object becomes stale, not when - * is becomes non-stale. - * - * @param listener - * - * @see #isStale() - */ - public void addStaleListener(IStaleListener listener); - - /** - * Removes the given stale listener from the list of stale listeners. Has no - * effect if the given listener is not registered as a stale listener. - * - * @param listener - */ - public void removeStaleListener(IStaleListener listener); - - /** - * Returns whether the state of this observable is stale and is expected to - * change soon. A non-stale observable that becomes stale will notify its - * stale listeners. A stale object that becomes non-stale does so by - * changing its state and notifying its change listeners, it does <b>not</b> - * notify its stale listeners about becoming non-stale. Clients that do not - * expect asynchronous changes may ignore staleness of observable objects. - * - * @return true if this observable's state is stale and will change soon. - * - * @TrackedGetter - implementers must call - * {@link ObservableTracker#getterCalled(IObservable)}. - */ - public boolean isStale(); - - /** - * Disposes of this observable object, removing all listeners registered - * with this object, and all listeners this object might have registered on - * other objects. - */ - public void dispose(); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservableCollection.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservableCollection.java deleted file mode 100644 index 38685b20..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservableCollection.java +++ /dev/null @@ -1,42 +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.databinding.observable; - -import java.util.Collection; - -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.set.IObservableSet; - -/** - * Interface for observable collections. Only general change listeners can be - * added to an observable collection. Listeners interested in incremental - * changes have to be added using more concrete subtypes such as - * {@link IObservableList} or {@link IObservableSet}. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - */ -public interface IObservableCollection extends IObservable, Collection { - - /** - * @return the element type of this observable value, or <code>null</code> - * if this observable collection is untyped. - */ - Object getElementType(); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservablesListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservablesListener.java deleted file mode 100644 index ac63bb17..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObservablesListener.java +++ /dev/null @@ -1,23 +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.databinding.observable; - -/** - * Marker interface for all listener types in the observables framework. Not - * intended to be directly implemented by clients. - * - * @since 1.0 - * - */ -public interface IObservablesListener { - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObserving.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObserving.java deleted file mode 100644 index 1c9fc139..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IObserving.java +++ /dev/null @@ -1,31 +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.databinding.observable; - -/** - * - * Mixin interface for IObservables that observe other objects. - * - * @since 1.0 - * - */ -public interface IObserving { - - /** - * Returns the observed object, or <code>null</code> if this observing - * object does not currently observe an object. - * - * @return the observed object, or <code>null</code> - */ - public Object getObserved(); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IStaleListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IStaleListener.java deleted file mode 100644 index 57291983..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/IStaleListener.java +++ /dev/null @@ -1,31 +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.databinding.observable; - -/** - * Listener for staleness events. An observable object is stale if its state - * will change eventually. - * - * @since 1.0 - */ -public interface IStaleListener extends IObservablesListener { - - /** - * Handle the event that the given observable object is now stale. The given - * event object must only be used locally in this method because it may be - * reused for other change notifications. - * - * @param staleEvent - */ - public void handleStale(StaleEvent staleEvent); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ObservableEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ObservableEvent.java deleted file mode 100644 index 38a865c5..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ObservableEvent.java +++ /dev/null @@ -1,67 +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.databinding.observable; - -import java.util.EventObject; - -/** - * Abstract event object for events fired by {@link IObservable} objects. All - * events fired by observables must be derived from this class so that the way - * of dispatching events can be improved in later versions of the framework. - * - * @since 1.0 - * - */ -public abstract class ObservableEvent extends EventObject { - - /** - * Creates a new observable event. - * - * @param source - */ - public ObservableEvent(IObservable source) { - super(source); - } - - /** - * - */ - private static final long serialVersionUID = 7693906965267871813L; - - /** - * Returns the observable that generated this event. - * - * @return the observable that generated this event - */ - public IObservable getObservable() { - return (IObservable) getSource(); - } - - /** - * Dispatch this event to the given listener. Subclasses must implement this - * method by calling the appropriate type-safe event handling method on the - * given listener according to the type of this event. - * - * @param listener - * the listener that should handle the event - */ - protected abstract void dispatch(IObservablesListener listener); - - /** - * Returns a unique object used for distinguishing this event type from - * others. - * - * @return a unique object representing the concrete type of this event. - */ - protected abstract Object getListenerType(); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ObservableTracker.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ObservableTracker.java deleted file mode 100644 index dbebe433..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/ObservableTracker.java +++ /dev/null @@ -1,180 +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.core.databinding.observable; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.internal.databinding.IdentityWrapper; -import org.eclipse.core.runtime.Assert; - -/** - * This class makes it possible to monitor whenever an IObservable is read from. - * This can be used to automatically attach and remove listeners. How to use it: - * - * <p> - * If you are implementing an IObservable, invoke getterCalled(this) whenever a - * getter is called - that is, whenever your observable is read from. You only - * need to do this once per method call. If one getter delegates to another, the - * outer getter doesn't need to call the method since the inner one will. - * </p> - * - * <p> - * If you want to determine what observables were used in a particular block of - * code, call runAndMonitor(Runnable). This will execute the given runnable and - * return the set of observables that were read from. - * </p> - * - * <p> - * This can be used to automatically attach listeners. For example, imagine you - * have a block of code that updates some widget by reading from a bunch of - * observables. Whenever one of those observables changes, you want to re-run - * the code and cause the widget to be refreshed. You could do this in the - * traditional manner by attaching one listener to each observable and - * re-running your widget update code whenever one of them changes, but this - * code is repetitive and requires updating the listener code whenever you - * refactor the widget updating code. - * </p> - * - * <p> - * Alternatively, you could use a utility class that runs the code in a - * runAndMonitor block and automatically attach listeners to any observable used - * in updating the widget. The advantage of the latter approach is that it, - * eliminates the code for attaching and detaching listeners and will always - * stay in synch with changes to the widget update logic. - * </p> - * - * @since 1.0 - */ -public class ObservableTracker { - - /** - * Threadlocal storage pointing to the current Set of IObservables, or null - * if none. Note that this is actually the top of a stack. Whenever a method - * changes the current value, it remembers the old value as a local variable - * and restores the old value when the method exits. - */ - private static ThreadLocal currentChangeListener = new ThreadLocal(); - - private static ThreadLocal currentStaleListener = new ThreadLocal(); - - private static ThreadLocal currentObservableSet = new ThreadLocal(); - - /** - * Invokes the given runnable, and returns the set of IObservables that were - * read by the runnable. If the runnable calls this method recursively, the - * result will not contain IObservables that were used within the inner - * runnable. - * - * @param runnable - * runnable to execute - * @param changeListener - * listener to register with all accessed observables - * @param staleListener - * listener to register with all accessed observables, or - * <code>null</code> if no stale listener is to be registered - * @return an array of unique observable objects - */ - public static IObservable[] runAndMonitor(Runnable runnable, - IChangeListener changeListener, IStaleListener staleListener) { - // Remember the previous value in the listener stack - Set lastObservableSet = (Set) currentObservableSet.get(); - IChangeListener lastChangeListener = (IChangeListener) currentChangeListener - .get(); - IStaleListener lastStaleListener = (IStaleListener) currentStaleListener - .get(); - - Set observableSet = new HashSet(); - // Push the new listeners to the top of the stack - currentObservableSet.set(observableSet); - currentChangeListener.set(changeListener); - currentStaleListener.set(staleListener); - try { - runnable.run(); - } finally { - // Pop the new listener off the top of the stack (by restoring the - // previous listener) - currentObservableSet.set(lastObservableSet); - currentChangeListener.set(lastChangeListener); - currentStaleListener.set(lastStaleListener); - } - - int i = 0; - IObservable[] result = new IObservable[observableSet.size()]; - for (Iterator it = observableSet.iterator(); it.hasNext();) { - IdentityWrapper wrapper = (IdentityWrapper) it.next(); - result[i++] = (IObservable) wrapper.unwrap(); - } - - return result; - } - - /** - * Runs the given runnable without tracking dependencies. - * @param runnable - */ - public static void runAndIgnore(Runnable runnable) { - // Remember the previous value in the listener stack - Set lastObservableSet = (Set) currentObservableSet.get(); - IChangeListener lastChangeListener = (IChangeListener) currentChangeListener - .get(); - IStaleListener lastStaleListener = (IStaleListener) currentStaleListener - .get(); - currentObservableSet.set(null); - currentChangeListener.set(null); - currentStaleListener.set(null); - try { - runnable.run(); - } finally { - // Pop the new listener off the top of the stack (by restoring the - // previous listener) - currentObservableSet.set(lastObservableSet); - currentChangeListener.set(lastChangeListener); - currentStaleListener.set(lastStaleListener); - } - } - - /** - * Notifies the ObservableTracker that an observable was read from. The - * JavaDoc for methods that invoke this method should include the following - * tag: "@TrackedGetter This method will notify ObservableTracker that the - * receiver has been read from". This lets callers know that they can rely - * on automatic updates from the object without explicitly attaching a - * listener. - * - * @param observable - */ - public static void getterCalled(IObservable observable) { - Assert.isTrue(observable.getRealm().isCurrent()); - Set lastObservableSet = (Set) currentObservableSet.get(); - if (lastObservableSet == null) { - return; - } - IChangeListener lastChangeListener = (IChangeListener) currentChangeListener - .get(); - IStaleListener lastStaleListener = (IStaleListener) currentStaleListener - .get(); - - boolean added = false; - if (lastObservableSet != null) { - added = lastObservableSet.add(new IdentityWrapper(observable)); - } - - // If anyone is listening for observable usage... - if (added && lastChangeListener != null) { - observable.addChangeListener(lastChangeListener); - } - if (added && lastStaleListener != null) { - observable.addStaleListener(lastStaleListener); - } - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Observables.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Observables.java deleted file mode 100644 index 9a5abfa3..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Observables.java +++ /dev/null @@ -1,165 +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.core.databinding.observable; - -import java.util.List; -import java.util.Set; - -import org.eclipse.core.databinding.observable.list.IListChangeListener; -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.list.ObservableList; -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.internal.databinding.observable.EmptyObservableList; -import org.eclipse.core.internal.databinding.observable.EmptyObservableSet; -import org.eclipse.core.internal.databinding.observable.ProxyObservableSet; -import org.eclipse.core.internal.databinding.observable.UnmodifiableObservableList; - -/** - * Contains static methods to operate on or return - * {@link IObservable Observables}. - * - * @since 3.2 - */ -public class Observables { - /** - * @param list - * @return list Returns an unmodifiable view of the provided - * <code>list</code>. - */ - public static IObservableList unmodifiableObservableList( - IObservableList list) { - if (list == null) { - throw new IllegalArgumentException( - "Parameter " + list + " was null."); //$NON-NLS-1$ //$NON-NLS-2$ - } - - return new UnmodifiableObservableList(list); - } - - /** - * Returns an empty observable list. The returned list continues to work - * after it has been disposed of and can be disposed of multiple times. - * - * @return an empty observable list. - */ - public static IObservableList emptyObservableList() { - return new EmptyObservableList(Realm.getDefault()); - } - - /** - * Returns an empty observable list. The returned list continues to work - * after it has been disposed of and can be disposed of multiple times. - * - * @param realm - * @return an empty observable list. - */ - public static IObservableList emptyObservableList(Realm realm) { - return new EmptyObservableList(realm); - } - - /** - * Returns an empty observable set. The returned set continues to work after - * it has been disposed of and can be disposed of multiple times. - * - * @return an empty observable set. - */ - public static IObservableSet emptyObservableSet() { - return new EmptyObservableSet(Realm.getDefault()); - } - - /** - * Returns an empty observable set. The returned set continues to work after - * it has been disposed of and can be disposed of multiple times. - * - * @param realm - * @return an empty observable set. - */ - public static IObservableSet emptyObservableSet(Realm realm) { - return new EmptyObservableSet(realm); - } - - /** - * @param set - * @return Returns an observableSet backed by the given set - */ - public static IObservableSet staticObservableSet(Set set) { - return new ObservableSet(Realm.getDefault(), set, Object.class) { - public void addChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void addSetChangeListener(ISetChangeListener listener) { - } - }; - } - - /** - * @param realm - * @param set - * @return Returns an observableSet backed by the given set - */ - public static IObservableSet staticObservableSet(Realm realm, Set set) { - return new ObservableSet(realm, set, Object.class) { - public void addChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void addSetChangeListener(ISetChangeListener listener) { - } - }; - } - - /** - * Returns an observable set that contains the same elements as the given - * set, and fires the same events as the given set, but can be disposed of - * without disposing of the wrapped set. - * - * @param target - * the set to wrap - * @return a proxy observable set - */ - public static IObservableSet proxyObservableSet(IObservableSet target) { - return new ProxyObservableSet(target); - } - - /** - * @param list - * @return an observable list that never fires events - */ - public static IObservableList staticObservableList(List list) { - return staticObservableList(Realm.getDefault(), list); - } - - /** - * @param realm - * @param list - * @return an observable list that never fires events - */ - public static IObservableList staticObservableList(Realm realm, List list) { - return new ObservableList(realm, list, Object.class) { - public void addChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void addListChangeListener(IListChangeListener listener) { - } - }; - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Realm.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Realm.java deleted file mode 100644 index 27d08ff7..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Realm.java +++ /dev/null @@ -1,293 +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 168153 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable; - -import org.eclipse.core.databinding.Binding; -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.internal.databinding.Queue; -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.core.runtime.Status; - -/** - * A realm defines a context from which objects implementing {@link IObservable} - * must be accessed, and on which these objects will notify their listeners. To - * bridge between observables from different realms, subclasses of - * {@link Binding} can be used. - * <p> - * A block of code is said to be executing within a realm if calling - * {@link #isCurrent()} from that block returns true. Code reached by calling - * methods from that block will execute within the same realm, with the - * exception of methods on this class that can be used to execute code within a - * specific realm. Clients can use {@link #syncExec(Runnable)}, - * {@link #asyncExec(Runnable)}, or {@link #exec(Runnable)} to execute a - * runnable within this realm. Note that using {@link #syncExec(Runnable)} can - * lead to deadlocks and should be avoided if the current thread holds any - * locks. - * </p> - * <p> - * It is instructive to think about possible implementations of Realm: It can be - * based on executing on a designated thread such as a UI thread, or based on - * holding a lock. In the former case, calling syncExec on a realm that is not - * the current realm will execute the given runnable on a different thread (the - * designated thread). In the latter case, calling syncExec may execute the - * given runnable on the calling thread, but calling - * {@link #asyncExec(Runnable)} will execute the given runnable on a different - * thread. Therefore, no assumptions can be made about the thread that will - * execute arguments to {@link #asyncExec(Runnable)}, - * {@link #syncExec(Runnable)}, or {@link #exec(Runnable)}. - * </p> - * <p> - * It is possible that a block of code is executing within more than one realm. - * This can happen for implementations of Realm that are based on holding a lock - * but don't use a separate thread to run runnables given to - * {@link #syncExec(Runnable)}. Realm implementations of this kind should be - * appropriately documented because it increases the opportunity for deadlock. - * </p> - * <p> - * Some implementations of {@link IObservable} provide constructors which do not - * take a Realm argument and are specified to create the observable instance - * with the current default realm. The default realm can be set for the - * currently executing thread by using {@link #runWithDefault(Realm, Runnable)}. - * Note that the default realm does not have to be the current realm. - * </p> - * <p> - * Subclasses must override at least one of asyncExec()/syncExec(). For realms - * based on a designated thread, it may be easier to implement asyncExec and - * keep the default implementation of syncExec. For realms based on holding a - * lock, it may be easier to implement syncExec and keep the default - * implementation of asyncExec. - * </p> - * - * @since 1.0 - * - * @see IObservable - */ -public abstract class Realm { - - private static ThreadLocal defaultRealm = new ThreadLocal(); - - /** - * Returns the default realm for the calling thread, or <code>null</code> - * if no default realm has been set. - * - * @return the default realm, or <code>null</code> - */ - public static Realm getDefault() { - return (Realm) defaultRealm.get(); - } - - /** - * Sets the default realm for the calling thread, returning the current - * default thread. This method is inherently unsafe, it is recommended to - * use {@link #runWithDefault(Realm, Runnable)} instead. This method is - * exposed to subclasses to facilitate testing. - * - * @param realm - * the new default realm, or <code>null</code> - * @return the previous default realm, or <code>null</code> - */ - protected static Realm setDefault(Realm realm) { - Realm oldValue = getDefault(); - defaultRealm.set(realm); - return oldValue; - } - - /** - * @return true if the caller is executing in this realm. This method must - * not have side-effects (such as, for example, implicitly placing - * the caller in this realm). - */ - abstract public boolean isCurrent(); - - private Thread workerThread; - - Queue workQueue = new Queue(); - - /** - * Runs the given runnable. If an exception occurs within the runnable, it - * is logged and not re-thrown. If the runnable implements - * {@link ISafeRunnable}, the exception is passed to its - * <code>handleException<code> method. - * - * @param runnable - */ - protected static void safeRun(final Runnable runnable) { - ISafeRunnable safeRunnable; - if (runnable instanceof ISafeRunnable) { - safeRunnable = (ISafeRunnable) runnable; - } else { - safeRunnable = new ISafeRunnable() { - public void handleException(Throwable exception) { - Policy - .getLog() - .log( - new Status( - IStatus.ERROR, - Policy.JFACE_DATABINDING, - IStatus.OK, - "Unhandled exception: " + exception.getMessage(), exception)); //$NON-NLS-1$ - } - public void run() throws Exception { - runnable.run(); - } - }; - } - SafeRunner.run(safeRunnable); - } - - /** - * Causes the <code>run()</code> method of the runnable to be invoked from - * within this realm. If the caller is executing in this realm, the - * runnable's run method is invoked directly, otherwise it is run at the - * next reasonable opportunity using asyncExec. - * <p> - * If the given runnable is an instance of {@link ISafeRunnable}, its - * exception handler method will be called if any exceptions occur while - * running it. Otherwise, the exception will be logged. - * </p> - * - * @param runnable - */ - public void exec(Runnable runnable) { - if (isCurrent()) { - safeRun(runnable); - } else { - asyncExec(runnable); - } - } - - /** - * Causes the <code>run()</code> method of the runnable to be invoked from - * within this realm at the next reasonable opportunity. The caller of this - * method continues to run in parallel, and is not notified when the - * runnable has completed. - * <p> - * If the given runnable is an instance of {@link ISafeRunnable}, its - * exception handler method will be called if any exceptions occur while - * running it. Otherwise, the exception will be logged. - * </p> - * <p> - * Subclasses should use {@link #safeRun(Runnable)} to run the runnable. - * </p> - * - * @param runnable - */ - public void asyncExec(Runnable runnable) { - synchronized (workQueue) { - ensureWorkerThreadIsRunning(); - workQueue.enqueue(runnable); - workQueue.notifyAll(); - } - } - - /** - * - */ - private void ensureWorkerThreadIsRunning() { - if (workerThread == null) { - workerThread = new Thread() { - public void run() { - try { - while (true) { - Runnable work = null; - synchronized (workQueue) { - while (workQueue.isEmpty()) { - workQueue.wait(); - } - work = (Runnable) workQueue.dequeue(); - } - syncExec(work); - } - } catch (InterruptedException e) { - // exit - } - } - }; - workerThread.start(); - } - } - - /** - * Causes the <code>run()</code> method of the runnable to be invoked from - * within this realm at the next reasonable opportunity. This method is - * blocking the caller until the runnable completes. - * <p> - * If the given runnable is an instance of {@link ISafeRunnable}, its - * exception handler method will be called if any exceptions occur while - * running it. Otherwise, the exception will be logged. - * </p> - * <p> - * Subclasses should use {@link #safeRun(Runnable)} to run the runnable. - * </p> - * <p> - * Note: This class is not meant to be called by clients and therefore has - * only protected access. - * </p> - * - * @param runnable - */ - protected void syncExec(Runnable runnable) { - SyncRunnable syncRunnable = new SyncRunnable(runnable); - asyncExec(syncRunnable); - synchronized (syncRunnable) { - while (!syncRunnable.hasRun) { - try { - syncRunnable.wait(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - } - } - - static class SyncRunnable implements Runnable { - boolean hasRun = false; - - private Runnable runnable; - - SyncRunnable(Runnable runnable) { - this.runnable = runnable; - } - - public void run() { - try { - safeRun(runnable); - } finally { - synchronized (this) { - hasRun = true; - this.notifyAll(); - } - } - } - } - - /** - * Sets the provided <code>realm</code> as the default for the duration of - * {@link Runnable#run()} and resets the previous realm after completion. - * Note that this will not set the given realm as the current realm. - * - * @param realm - * @param runnable - */ - public static void runWithDefault(Realm realm, Runnable runnable) { - Realm oldRealm = Realm.getDefault(); - try { - defaultRealm.set(realm); - runnable.run(); - } finally { - defaultRealm.set(oldRealm); - } - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/StaleEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/StaleEvent.java deleted file mode 100644 index 14e8c76b..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/StaleEvent.java +++ /dev/null @@ -1,54 +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.databinding.observable; - -/** - * Generic event denoting that the state of an {@link IObservable} object is - * about to change. Note that this event is only fired when an observable - * becomes stale, not when it becomes unstale; an observable that becomes - * unstale should always fire a change event. Staleness can be used (for - * example) to notify listeners when an observable has started a background - * thread for updating its state. Clients can safely ignore staleness. - * - * @see IObservable#isStale() - * - * @since 1.0 - * - */ -public class StaleEvent extends ObservableEvent { - - /** - * Creates a new stale event. - * - * @param source - * the source observable - */ - public StaleEvent(IObservable source) { - super(source); - } - - /** - * - */ - private static final long serialVersionUID = 3491012225431471077L; - - static final Object TYPE = new Object(); - - protected void dispatch(IObservablesListener listener) { - ((IStaleListener) listener).handleStale(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.java deleted file mode 100644 index c4e054c2..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.java +++ /dev/null @@ -1,270 +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 - * Brad Reynolds - bug 167204 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.list; - -import java.util.AbstractList; -import java.util.Collection; -import java.util.Iterator; - -import org.eclipse.core.databinding.observable.ChangeEvent; -import org.eclipse.core.databinding.observable.ChangeSupport; -import org.eclipse.core.databinding.observable.IChangeListener; -import org.eclipse.core.databinding.observable.IStaleListener; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.StaleEvent; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.AssertionFailedException; - -/** - * Subclasses should override at least get(int index) and size(). - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - * - */ -public abstract class AbstractObservableList extends AbstractList implements - IObservableList { - - private ChangeSupport changeSupport; - - /** - * @param realm - * - */ - public AbstractObservableList(Realm realm) { - Assert.isNotNull(realm); - changeSupport = new ChangeSupport(realm){ - protected void firstListenerAdded() { - AbstractObservableList.this.firstListenerAdded(); - } - protected void lastListenerRemoved() { - AbstractObservableList.this.lastListenerRemoved(); - } - }; - } - - /** - * - */ - public AbstractObservableList() { - this(Realm.getDefault()); - } - - public boolean isStale() { - return false; - } - - public synchronized void addListChangeListener(IListChangeListener listener) { - changeSupport.addListener(ListChangeEvent.TYPE, listener); - } - - public synchronized void removeListChangeListener(IListChangeListener listener) { - changeSupport.removeListener(ListChangeEvent.TYPE, listener); - } - - protected void fireListChange(ListDiff diff) { - // fire general change event first - fireChange(); - changeSupport.fireEvent(new ListChangeEvent(this, diff)); - } - - public synchronized void addChangeListener(IChangeListener listener) { - changeSupport.addChangeListener(listener); - } - - public synchronized void removeChangeListener(IChangeListener listener) { - changeSupport.removeChangeListener(listener); - } - - public synchronized void addStaleListener(IStaleListener listener) { - changeSupport.addStaleListener(listener); - } - - public synchronized void removeStaleListener(IStaleListener listener) { - changeSupport.removeStaleListener(listener); - } - - /** - * Fires change event. Must be invoked from the current realm. - */ - protected void fireChange() { - checkRealm(); - changeSupport.fireEvent(new ChangeEvent(this)); - } - - /** - * Fires stale event. Must be invoked from the current realm. - */ - protected void fireStale() { - checkRealm(); - changeSupport.fireEvent(new StaleEvent(this)); - } - - /** - * - */ - protected void firstListenerAdded() { - } - - /** - * - */ - protected void lastListenerRemoved() { - } - - /** - * - */ - public synchronized void dispose() { - changeSupport = null; - lastListenerRemoved(); - } - - public final int size() { - getterCalled(); - return doGetSize(); - } - - /** - * @return the size - */ - protected abstract int doGetSize(); - - /** - * - */ - private void getterCalled() { - ObservableTracker.getterCalled(this); - } - - public boolean isEmpty() { - getterCalled(); - return super.isEmpty(); - } - - public boolean contains(Object o) { - getterCalled(); - return super.contains(o); - } - - public Iterator iterator() { - getterCalled(); - final Iterator wrappedIterator = super.iterator(); - return new Iterator() { - public void remove() { - wrappedIterator.remove(); - } - - public boolean hasNext() { - return wrappedIterator.hasNext(); - } - - public Object next() { - return wrappedIterator.next(); - } - }; - } - - public Object[] toArray() { - getterCalled(); - return super.toArray(); - } - - public Object[] toArray(Object a[]) { - getterCalled(); - return super.toArray(a); - } - - // Modification Operations - - public boolean add(Object o) { - getterCalled(); - return super.add(o); - } - - public boolean remove(Object o) { - getterCalled(); - return super.remove(o); - } - - // Bulk Modification Operations - - public boolean containsAll(Collection c) { - getterCalled(); - return super.containsAll(c); - } - - public boolean addAll(Collection c) { - getterCalled(); - return super.addAll(c); - } - - public boolean addAll(int index, Collection c) { - getterCalled(); - return super.addAll(c); - } - - public boolean removeAll(Collection c) { - getterCalled(); - return super.removeAll(c); - } - - public boolean retainAll(Collection c) { - getterCalled(); - return super.retainAll(c); - } - - // Comparison and hashing - - public boolean equals(Object o) { - getterCalled(); - return super.equals(o); - } - - public int hashCode() { - getterCalled(); - return super.hashCode(); - } - - public int indexOf(Object o) { - getterCalled(); - return super.indexOf(o); - } - - public int lastIndexOf(Object o) { - getterCalled(); - return super.lastIndexOf(o); - } - - public Realm getRealm() { - return changeSupport.getRealm(); - } - - /** - * Asserts that the realm is the current realm. - * - * @see Realm#isCurrent() - * @throws AssertionFailedException - * if the realm is not the current realm - */ - protected void checkRealm() { - Assert.isTrue(getRealm().isCurrent()); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java deleted file mode 100644 index 83727299..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java +++ /dev/null @@ -1,33 +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.databinding.observable.list; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for changes to observable lists. - * - * @since 1.0 - */ -public interface IListChangeListener extends IObservablesListener { - - /** - * Handle a change to an observable list. The change is described by the - * diff object. The given event object must only be used locally in this - * method because it may be reused for other change notifications. The diff - * object referenced by the event is immutable and may be used non-locally. - * - * @param event - */ - void handleListChange(ListChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IObservableList.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IObservableList.java deleted file mode 100644 index 27589e98..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IObservableList.java +++ /dev/null @@ -1,169 +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.core.databinding.observable.list; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.core.databinding.observable.IObservableCollection; - -/** - * A list whose changes can be tracked by list change listeners. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the framework classes that implement this interface. - * Note that direct implementers of this interface outside of the framework will - * be broken in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - */ -public interface IObservableList extends List, IObservableCollection { - - /** - * Adds the given list change listener to the list of list change listeners. - * @param listener - */ - public void addListChangeListener(IListChangeListener listener); - - /** - * Removes the given list change listener from the list of list change listeners. - * Has no effect if the given listener is not registered as a list change listener. - * - * @param listener - */ - public void removeListChangeListener(IListChangeListener listener); - - /** - * @TrackedGetter - */ - public int size(); - - /** - * @TrackedGetter - */ - public boolean isEmpty(); - - /** - * @TrackedGetter - */ - public boolean contains(Object o); - - /** - * @TrackedGetter - */ - public Iterator iterator(); - - /** - * @TrackedGetter - */ - public Object[] toArray(); - - /** - * @TrackedGetter - */ - public Object[] toArray(Object a[]); - - /** - * - */ - public boolean add(Object o); - - /** - * - */ - public boolean remove(Object o); - - /** - * @TrackedGetter - */ - public boolean containsAll(Collection c); - - /** - * - */ - public boolean addAll(Collection c); - - /** - * - */ - public boolean addAll(int index, Collection c); - - /** - * - */ - public boolean removeAll(Collection c); - - /** - * - */ - public boolean retainAll(Collection c); - - /** - * @TrackedGetter - */ - public boolean equals(Object o); - - /** - * @TrackedGetter - */ - public int hashCode(); - - /** - * @TrackedGetter - */ - public Object get(int index); - - /** - * - */ - public Object set(int index, Object element); - - /** - * - */ - public Object remove(int index); - - /** - * @TrackedGetter - */ - public int indexOf(Object o); - - /** - * @TrackedGetter - */ - public int lastIndexOf(Object o); - - /** - * @TrackedGetter - */ - public ListIterator listIterator(); - - /** - * @TrackedGetter - */ - public ListIterator listIterator(int index); - - /** - * @TrackedGetter - */ - public List subList(int fromIndex, int toIndex); - - /** - * @return the type of the elements or <code>null</code> if untyped - */ - Object getElementType(); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.java deleted file mode 100644 index 1b2ce4d7..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.java +++ /dev/null @@ -1,68 +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.databinding.observable.list; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * List change event describing an incremental change of an - * {@link IObservableList} object. - * - * @since 1.0 - */ -public class ListChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = -9154315534258776672L; - - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable list. Listeners must - * not change this field. - */ - public ListDiff diff; - - /** - * Creates a new list change event. - * - * @param source - * the source observable list - * @param diff - * the list change - */ - public ListChangeEvent(IObservableList source, ListDiff diff) { - super(source); - this.diff = diff; - } - - /** - * Returns the observable list from which this event originated. - * - * @return the observable list from which this event originated - */ - public IObservableList getObservableList() { - return (IObservableList) getSource(); - } - - protected void dispatch(IObservablesListener listener) { - ((IListChangeListener) listener).handleListChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListDiff.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListDiff.java deleted file mode 100644 index b87edadf..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListDiff.java +++ /dev/null @@ -1,60 +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.databinding.observable.list; - - -/** - * Object describing a diff between two lists. - * - * @since 1.0 - */ -public abstract class ListDiff { - - /** - * Returns a list of ListDiffEntry - * - * @return a list of ListDiffEntry - */ - public abstract ListDiffEntry[] getDifferences(); - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - ListDiffEntry[] differences = getDifferences(); - StringBuffer buffer = new StringBuffer(); - buffer.append(getClass().getName()); - - if (differences == null || differences.length == 0) { - buffer - .append("{}"); //$NON-NLS-1$ - } else { - buffer - .append("{"); //$NON-NLS-1$ - - for (int i = 0; i < differences.length; i++) { - if (i > 0) - buffer.append(", "); //$NON-NLS-1$ - - buffer - .append("difference[") //$NON-NLS-1$ - .append(i) - .append("] [") //$NON-NLS-1$ - .append(differences[i] != null ? differences[i].toString() : "null") //$NON-NLS-1$ - .append("]"); //$NON-NLS-1$ - } - buffer.append("}"); //$NON-NLS-1$ - } - - return buffer.toString(); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListDiffEntry.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListDiffEntry.java deleted file mode 100644 index da2e79ff..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListDiffEntry.java +++ /dev/null @@ -1,53 +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.core.databinding.observable.list; - -/** - * A single addition of an element to a list or removal of an element from a list. - * - * @since 1.0 - */ -public abstract class ListDiffEntry { - - /** - * @return the 0-based position of the addition or removal - */ - public abstract int getPosition(); - - /** - * @return true if this represents an addition, false if this represents a removal - */ - public abstract boolean isAddition(); - - /** - * @return the element that was added or removed - */ - public abstract Object getElement(); - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer - .append(this.getClass().getName()) - .append("{position [") //$NON-NLS-1$ - .append(getPosition()) - .append("], isAddition [") //$NON-NLS-1$ - .append(isAddition()) - .append("], element [") //$NON-NLS-1$ - .append(getElement() != null ? getElement().toString() : "null") //$NON-NLS-1$ - .append("]}"); //$NON-NLS-1$ - - return buffer.toString(); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ObservableList.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ObservableList.java deleted file mode 100644 index 7ce5417d..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ObservableList.java +++ /dev/null @@ -1,316 +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 - * Brad Reynolds - bug 167204 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.list; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * Abstract implementation of {@link IObservableList}, based on an underlying regular list. - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - * - */ -public abstract class ObservableList extends AbstractObservable implements - IObservableList { - - protected List wrappedList; - - /** - * Stale state of the list. Access must occur in the current realm. - */ - private boolean stale = false; - - private Object elementType; - - protected ObservableList(List wrappedList, Object elementType) { - this(Realm.getDefault(), wrappedList, elementType); - } - - protected ObservableList(Realm realm, List wrappedList, Object elementType) { - super(realm); - this.wrappedList = wrappedList; - this.elementType = elementType; - } - - public synchronized void addListChangeListener(IListChangeListener listener) { - addListener(ListChangeEvent.TYPE, listener); - } - - public synchronized void removeListChangeListener(IListChangeListener listener) { - removeListener(ListChangeEvent.TYPE, listener); - } - - protected void fireListChange(ListDiff diff) { - // fire general change event first - super.fireChange(); - fireEvent(new ListChangeEvent(this, diff)); - } - - public boolean contains(Object o) { - getterCalled(); - return wrappedList.contains(o); - } - - public boolean containsAll(Collection c) { - getterCalled(); - return wrappedList.containsAll(c); - } - - public boolean equals(Object o) { - getterCalled(); - return wrappedList.equals(o); - } - - public int hashCode() { - getterCalled(); - return wrappedList.hashCode(); - } - - public boolean isEmpty() { - getterCalled(); - return wrappedList.isEmpty(); - } - - public Iterator iterator() { - getterCalled(); - final Iterator wrappedIterator = wrappedList.iterator(); - return new Iterator() { - - public void remove() { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - return wrappedIterator.hasNext(); - } - - public Object next() { - return wrappedIterator.next(); - } - }; - } - - public int size() { - getterCalled(); - return wrappedList.size(); - } - - public Object[] toArray() { - getterCalled(); - return wrappedList.toArray(); - } - - public Object[] toArray(Object[] a) { - getterCalled(); - return wrappedList.toArray(a); - } - - public String toString() { - getterCalled(); - return wrappedList.toString(); - } - - /** - * @TrackedGetter - */ - public Object get(int index) { - getterCalled(); - return wrappedList.get(index); - } - - /** - * @TrackedGetter - */ - public int indexOf(Object o) { - getterCalled(); - return wrappedList.indexOf(o); - } - - /** - * @TrackedGetter - */ - public int lastIndexOf(Object o) { - getterCalled(); - return wrappedList.lastIndexOf(o); - } - - // List Iterators - - /** - * @TrackedGetter - */ - public ListIterator listIterator() { - return listIterator(0); - } - - /** - * @TrackedGetter - */ - public ListIterator listIterator(int index) { - getterCalled(); - final ListIterator wrappedIterator = wrappedList.listIterator(index); - return new ListIterator() { - - public int nextIndex() { - return wrappedIterator.nextIndex(); - } - - public int previousIndex() { - return wrappedIterator.previousIndex(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - return wrappedIterator.hasNext(); - } - - public boolean hasPrevious() { - return wrappedIterator.hasPrevious(); - } - - public Object next() { - return wrappedIterator.next(); - } - - public Object previous() { - return wrappedIterator.previous(); - } - - public void add(Object o) { - throw new UnsupportedOperationException(); - } - - public void set(Object o) { - throw new UnsupportedOperationException(); - } - }; - } - - - public List subList(int fromIndex, int toIndex) { - getterCalled(); - return wrappedList.subList(fromIndex, toIndex); - } - - protected void getterCalled() { - ObservableTracker.getterCalled(this); - } - - public Object set(int index, Object element) { - throw new UnsupportedOperationException(); - } - - public Object remove(int index) { - throw new UnsupportedOperationException(); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public void add(int index, Object element) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(int index, Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - /** - * Returns the stale state. Must be invoked from the current realm. - * - * @return stale state - */ - public boolean isStale() { - checkRealm(); - return stale; - } - - /** - * Sets the stale state. Must be invoked from the current realm. - * - * @param stale - * The stale state to list. This will fire a stale event if the - * given boolean is true and this observable list was not already - * stale. - */ - public void setStale(boolean stale) { - checkRealm(); - - boolean wasStale = this.stale; - this.stale = stale; - if (!wasStale && stale) { - fireStale(); - } - } - - protected void fireChange() { - throw new RuntimeException("fireChange should not be called, use fireListChange() instead"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.jface.provisional.databinding.observable.AbstractObservable#dispose() - */ - public synchronized void dispose() { - super.dispose(); - } - - public Object getElementType() { - return elementType; - } - - protected void updateWrappedList(List newList) { - List oldList = wrappedList; - ListDiff listDiff = Diffs.computeListDiff(oldList, newList); - wrappedList = newList; - fireListChange(listDiff); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/WritableList.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/WritableList.java deleted file mode 100644 index 4158ce6e..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/WritableList.java +++ /dev/null @@ -1,214 +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 167204 - * Gautam Saggar - bug 169529 - * Brad Reynolds - bug 147515 - *******************************************************************************/ -package org.eclipse.core.databinding.observable.list; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; - -/** - * Mutable observable list backed by an ArrayList. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - */ -public class WritableList extends ObservableList { - - /** - * Creates an empty writable list in the default realm with a - * <code>null</code> element type. - * - */ - public WritableList() { - this(Realm.getDefault()); - } - - /** - * Creates an empty writable list with a <code>null</code> element type. - * - * @param realm - */ - public WritableList(Realm realm) { - this(realm, new ArrayList(), null); - } - - /** - * Construts a new instance with the default realm. - * - * @param toWrap - * @param elementType - * can be <code>null</code> - */ - public WritableList(List toWrap, Object elementType) { - this(Realm.getDefault(), toWrap, elementType); - } - - /** - * Creates a writable list containing elements of the given type, wrapping - * an existing client-supplied list. - * - * @param realm - * @param toWrap - * The java.utilList to wrap - * @param elementType - * can be <code>null</code> - */ - public WritableList(Realm realm, List toWrap, Object elementType) { - super(realm, toWrap, elementType); - } - - public Object set(int index, Object element) { - checkRealm(); - Object oldElement = wrappedList.set(index, element); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index, - false, oldElement), Diffs.createListDiffEntry(index, true, - element))); - return oldElement; - } - - public Object remove(int index) { - checkRealm(); - Object oldElement = wrappedList.remove(index); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index, - false, oldElement))); - return oldElement; - } - - public boolean add(Object element) { - checkRealm(); - boolean added = wrappedList.add(element); - if (added) { - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry( - wrappedList.size() - 1, true, element))); - } - return added; - } - - public void add(int index, Object element) { - checkRealm(); - wrappedList.add(index, element); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index, - true, element))); - } - - public boolean addAll(Collection c) { - checkRealm(); - ListDiffEntry[] entries = new ListDiffEntry[c.size()]; - int i = 0; - int addIndex = wrappedList.size(); - for (Iterator it = c.iterator(); it.hasNext();) { - Object element = it.next(); - entries[i++] = Diffs.createListDiffEntry(addIndex++, true, element); - } - boolean added = wrappedList.addAll(c); - fireListChange(Diffs.createListDiff(entries)); - return added; - } - - public boolean addAll(int index, Collection c) { - checkRealm(); - ListDiffEntry[] entries = new ListDiffEntry[c.size()]; - int i = 0; - int addIndex = index; - for (Iterator it = c.iterator(); it.hasNext();) { - Object element = it.next(); - entries[i++] = Diffs.createListDiffEntry(addIndex++, true, element); - } - boolean added = wrappedList.addAll(index, c); - fireListChange(Diffs.createListDiff(entries)); - return added; - } - - public boolean remove(Object o) { - checkRealm(); - int index = wrappedList.indexOf(o); - if (index == -1) { - return false; - } - wrappedList.remove(index); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index, - false, o))); - return true; - } - - public boolean removeAll(Collection c) { - checkRealm(); - List entries = new ArrayList(); - for (Iterator it = c.iterator(); it.hasNext();) { - Object element = it.next(); - int removeIndex = wrappedList.indexOf(element); - if (removeIndex != -1) { - wrappedList.remove(removeIndex); - entries.add(Diffs.createListDiffEntry(removeIndex, false, - element)); - } - } - fireListChange(Diffs.createListDiff((ListDiffEntry[]) entries - .toArray(new ListDiffEntry[entries.size()]))); - return entries.size() > 0; - } - - public boolean retainAll(Collection c) { - checkRealm(); - List entries = new ArrayList(); - int removeIndex = 0; - for (Iterator it = wrappedList.iterator(); it.hasNext();) { - Object element = it.next(); - if (!c.contains(element)) { - entries.add(Diffs.createListDiffEntry(removeIndex, false, - element)); - it.remove(); - } else { - // only increment if we haven't removed the current element - removeIndex++; - } - } - fireListChange(Diffs.createListDiff((ListDiffEntry[]) entries - .toArray(new ListDiffEntry[entries.size()]))); - return entries.size() > 0; - } - - public void clear() { - checkRealm(); - List entries = new ArrayList(); - for (Iterator it = wrappedList.iterator(); it.hasNext();) { - Object element = it.next(); - // always report 0 as the remove index - entries.add(Diffs.createListDiffEntry(0, false, element)); - it.remove(); - } - fireListChange(Diffs.createListDiff((ListDiffEntry[]) entries - .toArray(new ListDiffEntry[entries.size()]))); - } - - /** - * @param elementType - * can be <code>null</code> - * @return new list with the default realm. - */ - public static WritableList withElementType(Object elementType) { - return new WritableList(Realm.getDefault(), new ArrayList(), - elementType); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/package.html b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/package.html deleted file mode 100644 index 2c2f1db6..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/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> -Provides classes for observing changes in lists. -<h2> -Package Specification</h2> -<p> -This package provides classes for observing changes in lists.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java deleted file mode 100644 index 29248b13..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java +++ /dev/null @@ -1,162 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.map; - -import java.util.AbstractMap; - -import org.eclipse.core.databinding.observable.ChangeEvent; -import org.eclipse.core.databinding.observable.ChangeSupport; -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.StaleEvent; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.AssertionFailedException; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public abstract class AbstractObservableMap extends AbstractMap implements - IObservableMap { - - private ChangeSupport changeSupport; - - private boolean stale; - - /** - */ - public AbstractObservableMap() { - this(Realm.getDefault()); - } - - /** - * - */ - protected void lastListenerRemoved() { - } - - /** - * - */ - protected void firstListenerAdded() { - } - - /** - * @param realm - */ - public AbstractObservableMap(Realm realm) { - Assert.isNotNull(realm); - changeSupport = new ChangeSupport(realm){ - protected void firstListenerAdded() { - AbstractObservableMap.this.firstListenerAdded(); - } - protected void lastListenerRemoved() { - AbstractObservableMap.this.lastListenerRemoved(); - } - }; - } - - public synchronized void addMapChangeListener(IMapChangeListener listener) { - changeSupport.addListener(MapChangeEvent.TYPE, listener); - } - - public synchronized void removeMapChangeListener(IMapChangeListener listener) { - changeSupport.removeListener(MapChangeEvent.TYPE, listener); - } - - public synchronized void addChangeListener(IChangeListener listener) { - changeSupport.addChangeListener(listener); - } - - public synchronized void addStaleListener(IStaleListener listener) { - changeSupport.addStaleListener(listener); - } - - public synchronized void dispose() { - changeSupport.dispose(); - changeSupport = null; - } - - public Realm getRealm() { - return changeSupport.getRealm(); - } - - public boolean isStale() { - checkRealm(); - return stale; - } - - public synchronized void removeChangeListener(IChangeListener listener) { - changeSupport.removeChangeListener(listener); - } - - public synchronized void removeStaleListener(IStaleListener listener) { - changeSupport.removeStaleListener(listener); - } - - /** - * Sets the stale state. Must be invoked from the current realm. - * - * @param stale - */ - public void setStale(boolean stale) { - checkRealm(); - this.stale = stale; - if (stale) { - fireStale(); - } - } - - /** - * Fires stale events. Must be invoked from current realm. - */ - protected void fireStale() { - checkRealm(); - changeSupport.fireEvent(new StaleEvent(this)); - } - - /** - * Fires change events. Must be invoked from current realm. - */ - protected void fireChange() { - checkRealm(); - changeSupport.fireEvent(new ChangeEvent(this)); - } - - /** - * Fires map change events. Must be invoked from current realm. - * - * @param diff - */ - protected void fireMapChange(MapDiff diff) { - checkRealm(); - changeSupport.fireEvent(new MapChangeEvent(this, diff)); - } - - /** - * Asserts that the realm is the current realm. - * - * @see Realm#isCurrent() - * @throws AssertionFailedException - * if the realm is not the current realm - */ - protected void checkRealm() { - Assert.isTrue(getRealm().isCurrent()); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/BidirectionalMap.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/BidirectionalMap.java deleted file mode 100644 index c83f6eef..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/BidirectionalMap.java +++ /dev/null @@ -1,104 +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.databinding.observable.map; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - * - */ -public class BidirectionalMap extends ObservableMap { - - private Map valueToElements = new HashMap(); - - private IMapChangeListener mapListener = new IMapChangeListener() { - - public void handleMapChange(MapChangeEvent event) { - MapDiff diff = event.diff; - for (Iterator it = diff.getAddedKeys().iterator(); it.hasNext();) { - Object addedKey = it.next(); - addMapping(addedKey, diff.getNewValue(addedKey)); - } - for (Iterator it = diff.getChangedKeys().iterator(); it.hasNext();) { - Object changedKey = it.next(); - removeMapping(changedKey, diff.getOldValue(changedKey)); - addMapping(changedKey, diff.getNewValue(changedKey)); - } - for (Iterator it = diff.getRemovedKeys().iterator(); it.hasNext();) { - Object removedKey = it.next(); - removeMapping(removedKey, diff.getOldValue(removedKey)); - } - fireMapChange(diff); - } - }; - - /** - * @param wrappedMap - */ - public BidirectionalMap(IObservableMap wrappedMap) { - super(wrappedMap.getRealm(), wrappedMap); - wrappedMap.addMapChangeListener(mapListener); - for (Iterator it = wrappedMap.entrySet().iterator(); it.hasNext();) { - Map.Entry entry = (Entry) it.next(); - addMapping(entry.getKey(), entry.getValue()); - } - } - - /** - * @param key - * @param value - */ - private void addMapping(Object key, Object value) { - Object elementOrSet = valueToElements.get(value); - if (elementOrSet == null) { - valueToElements.put(value, key); - return; - } - if (!(elementOrSet instanceof Set)) { - elementOrSet = new HashSet(Collections.singleton(elementOrSet)); - valueToElements.put(value, elementOrSet); - } - Set set = (Set) elementOrSet; - set.add(key); - } - - /** - * @param functionValue - * @param element - */ - private void removeMapping(Object functionValue, Object element) { - Object elementOrSet = valueToElements.get(functionValue); - if (elementOrSet instanceof Set) { - Set set = (Set) elementOrSet; - set.remove(element); - if (set.size() == 0) { - valueToElements.remove(functionValue); - } - } else { - valueToElements.remove(functionValue); - } - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java deleted file mode 100644 index f7438926..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java +++ /dev/null @@ -1,161 +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.databinding.observable.map; - -import java.util.AbstractSet; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.observable.set.ISetChangeListener; -import org.eclipse.core.databinding.observable.set.SetChangeEvent; - -/** - * Maps objects to one of their attributes. Tracks changes to the underlying - * observable set of objects (keys), as well as changes to attribute values. - */ -public abstract class ComputedObservableMap extends AbstractObservableMap { - - private final IObservableSet keySet; - - private ISetChangeListener setChangeListener = new ISetChangeListener() { - public void handleSetChange(SetChangeEvent event) { - Set addedKeys = new HashSet(event.diff.getAdditions()); - Set removedKeys = new HashSet(event.diff.getRemovals()); - Map oldValues = new HashMap(); - Map newValues = new HashMap(); - for (Iterator it = removedKeys.iterator(); it.hasNext();) { - Object removedKey = it.next(); - Object oldValue = doGet(removedKey); - unhookListener(removedKey); - if (oldValue != null) { - oldValues.put(removedKey, oldValue); - } - } - for (Iterator it = addedKeys.iterator(); it.hasNext();) { - Object addedKey = it.next(); - hookListener(addedKey); - Object newValue = doGet(addedKey); - newValues.put(addedKey, newValue); - } - fireMapChange(Diffs.createMapDiff(addedKeys, removedKeys, - Collections.EMPTY_SET, oldValues, newValues)); - } - }; - - private Set entrySet = new EntrySet(); - - private class EntrySet extends AbstractSet { - - public Iterator iterator() { - final Iterator keyIterator = keySet.iterator(); - return new Iterator() { - - public boolean hasNext() { - return keyIterator.hasNext(); - } - - public Object next() { - final Object key = keyIterator.next(); - return new Map.Entry() { - - public Object getKey() { - return key; - } - - public Object getValue() { - return get(getKey()); - } - - public Object setValue(Object value) { - return put(getKey(), value); - } - }; - } - - public void remove() { - keyIterator.remove(); - } - }; - } - - public int size() { - return keySet.size(); - } - - } - - /** - * @param keySet - */ - public ComputedObservableMap(IObservableSet keySet) { - super(keySet.getRealm()); - this.keySet = keySet; - this.keySet.addSetChangeListener(setChangeListener); - } - - protected void init() { - for (Iterator it = this.keySet.iterator(); it.hasNext();) { - Object key = it.next(); - hookListener(key); - } - } - - protected final void fireSingleChange(Object key, Object oldValue, - Object newValue) { - fireMapChange(Diffs.createMapDiffSingleChange(key, oldValue, newValue)); - } - - public Set entrySet() { - return entrySet; - } - - public Set keySet() { - return keySet; - } - - final public Object get(Object key) { - return doGet(key); - } - - final public Object put(Object key, Object value) { - return doPut(key, value); - } - - /** - * @param removedKey - */ - protected abstract void unhookListener(Object removedKey); - - /** - * @param addedKey - */ - protected abstract void hookListener(Object addedKey); - - /** - * @param key - * @return the value for the given key - */ - protected abstract Object doGet(Object key); - - /** - * @param key - * @param value - * @return the old value for the given key - */ - protected abstract Object doPut(Object key, Object value); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/IMapChangeListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/IMapChangeListener.java deleted file mode 100644 index 3bc829e9..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/IMapChangeListener.java +++ /dev/null @@ -1,35 +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.databinding.observable.map; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for changes to observable maps. - * - * @since 1.0 - * - */ -public interface IMapChangeListener extends IObservablesListener { - - /** - * Handle a change an observable map. The given event object must only be - * used locally in this method because it may be reused for other change - * notifications. The diff object referenced by the event is immutable and - * may be used non-locally. - * - * @param event - * the event - */ - void handleMapChange(MapChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/IObservableMap.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/IObservableMap.java deleted file mode 100644 index 17d06649..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/IObservableMap.java +++ /dev/null @@ -1,104 +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 164653 - ******************************************************************************/ - -package org.eclipse.core.databinding.observable.map; - -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.IObservable; - -/** - * Observable Map. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.1 - */ -public interface IObservableMap extends Map, IObservable { - - /** - * @param listener - */ - public void addMapChangeListener(IMapChangeListener listener); - - /** - * @param listener - */ - public void removeMapChangeListener(IMapChangeListener listener); - - /** - * @TrackedGetter - */ - public int size(); - - /** - * @TrackedGetter - */ - public boolean isEmpty(); - - /** - * @TrackedGetter - */ - public boolean containsKey(Object key); - - /** - * @TrackedGetter - */ - public boolean containsValue(Object value); - - /** - * @TrackedGetter - */ - public Object get(Object key); - - /** - * - */ - public Object put(Object key, Object value); - - /** - * - */ - public Object remove(Object key); - - /** - * @TrackedGetter - */ - public Set keySet(); - - /** - * @TrackedGetter - */ - public Collection values(); - - /** - * @TrackedGetter - */ - public Set entrySet(); - - /** - * @TrackedGetter - */ - public boolean equals(Object o); - - /** - * @TrackedGetter - */ - public int hashCode(); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.java deleted file mode 100644 index 90bfef93..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.java +++ /dev/null @@ -1,68 +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.databinding.observable.map; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * Map change event describing an incremental change of an - * {@link IObservableMap} object. - * - * @since 1.0 - * - */ -public class MapChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = -8092347212410548463L; - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable map. Listeners must - * not change this field. - */ - public MapDiff diff; - - /** - * Creates a new map change event - * - * @param source - * the source observable map - * @param diff - * the map change - */ - public MapChangeEvent(IObservableMap source, MapDiff diff) { - super(source); - this.diff = diff; - } - - /** - * Returns the observable map from which this event originated. - * - * @return the observable map from which this event originated - */ - public IObservableMap getObservableMap() { - return (IObservableMap) getSource(); - } - - protected void dispatch(IObservablesListener listener) { - ((IMapChangeListener) listener).handleMapChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/MapDiff.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/MapDiff.java deleted file mode 100644 index f54c37cd..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/MapDiff.java +++ /dev/null @@ -1,54 +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.databinding.observable.map; - -import java.util.Set; - -/** - * @since 1.1 - * - */ -public abstract class MapDiff { - - /** - * @return the set of keys which were added - */ - public abstract Set getAddedKeys(); - - /** - * @return the set of keys which were removed - */ - public abstract Set getRemovedKeys(); - - /** - * @return the set of keys for which the value has changed - */ - public abstract Set getChangedKeys(); - - /** - * Returns the old value for the given key, which must be an element of - * {@link #getRemovedKeys()} or {@link #getChangedKeys()}. - * - * @param key - * @return the old value for the given key. - */ - public abstract Object getOldValue(Object key); - - /** - * Returns the new value for the given key, which must be an element of - * {@link #getChangedKeys()} or {@link #getAddedKeys()}. - * - * @param key - * @return the new value for the given key. - */ - public abstract Object getNewValue(Object key); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ObservableMap.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ObservableMap.java deleted file mode 100644 index 59883b12..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ObservableMap.java +++ /dev/null @@ -1,161 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.map; - -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public class ObservableMap extends AbstractObservable implements IObservableMap { - - protected Map wrappedMap; - - private boolean stale = false; - - /** - * @param wrappedMap - */ - public ObservableMap(Map wrappedMap) { - this(Realm.getDefault(), wrappedMap); - } - - /** - * @param realm - * @param wrappedMap - */ - public ObservableMap(Realm realm, Map wrappedMap) { - super(realm); - this.wrappedMap = wrappedMap; - } - - public synchronized void addMapChangeListener(IMapChangeListener listener) { - addListener(MapChangeEvent.TYPE, listener); - } - - public synchronized void removeMapChangeListener(IMapChangeListener listener) { - removeListener(MapChangeEvent.TYPE, listener); - } - - protected void getterCalled() { - ObservableTracker.getterCalled(this); - } - - protected void fireMapChange(MapDiff diff) { - checkRealm(); - - // fire general change event first - super.fireChange(); - - fireEvent(new MapChangeEvent(this, diff)); - } - - public boolean containsKey(Object key) { - getterCalled(); - return wrappedMap.containsKey(key); - } - - public boolean containsValue(Object value) { - getterCalled(); - return wrappedMap.containsValue(value); - } - - public Set entrySet() { - getterCalled(); - return wrappedMap.entrySet(); - } - - public Object get(Object key) { - getterCalled(); - return wrappedMap.get(key); - } - - public boolean isEmpty() { - getterCalled(); - return wrappedMap.isEmpty(); - } - - public Set keySet() { - getterCalled(); - return wrappedMap.keySet(); - } - - public int size() { - getterCalled(); - return wrappedMap.size(); - } - - public Collection values() { - getterCalled(); - return wrappedMap.values(); - } - - /** - * Returns the stale state. Must be invoked from the current realm. - * - * @return stale state - */ - public boolean isStale() { - checkRealm(); - return stale; - } - - /** - * Sets the stale state. Must be invoked from the current realm. - * - * @param stale - * The stale state to set. This will fire a stale event if the - * given boolean is true and this observable set was not already - * stale. - */ - public void setStale(boolean stale) { - checkRealm(); - boolean wasStale = this.stale; - this.stale = stale; - if (!wasStale && stale) { - fireStale(); - } - } - - public Object put(Object key, Object value) { - throw new UnsupportedOperationException(); - } - - public Object remove(Object key) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - public void putAll(Map arg0) { - throw new UnsupportedOperationException(); - } - - public synchronized void dispose() { - super.dispose(); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/WritableMap.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/WritableMap.java deleted file mode 100644 index e61a22f0..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/WritableMap.java +++ /dev/null @@ -1,106 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.map; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public class WritableMap extends ObservableMap { - - /** - * - */ - public WritableMap() { - this(Realm.getDefault()); - } - - /** - * @param realm - */ - public WritableMap(Realm realm) { - super(realm, new HashMap()); - } - - /** - * Associates the provided <code>value</code> with the <code>key</code>. Must be invoked from the current realm. - */ - public Object put(Object key, Object value) { - checkRealm(); - Object result = wrappedMap.put(key, value); - if (result==null) { - fireMapChange(Diffs.createMapDiffSingleAdd(key, value)); - } else { - fireMapChange(Diffs.createMapDiffSingleChange(key, result, value)); - } - return result; - } - - /** - * Removes the value with the provide <code>key</code>. Must be invoked from the current realm. - */ - public Object remove(Object key) { - checkRealm(); - Object result = wrappedMap.remove(key); - if (result!=null) { - fireMapChange(Diffs.createMapDiffSingleRemove(key, result)); - } - return result; - } - - /** - * Clears the map. Must be invoked from the current realm. - */ - public void clear() { - checkRealm(); - Map copy = new HashMap(wrappedMap.size()); - copy.putAll(wrappedMap); - wrappedMap.clear(); - fireMapChange(Diffs.createMapDiffRemoveAll(copy)); - } - - /** - * Adds the provided <code>map</code>'s contents to this map. Must be invoked from the current realm. - */ - public void putAll(Map map) { - checkRealm(); - Set addedKeys = new HashSet(map.size()); - Map changes = new HashMap(map.size()); - for (Iterator it = map.entrySet().iterator(); it.hasNext();) { - Map.Entry entry = (Entry) it.next(); - Object previousValue = wrappedMap.put(entry.getKey(), entry.getValue()); - if (previousValue==null) { - addedKeys.add(entry.getKey()); - } else { - changes.put(entry.getKey(), previousValue); - } - } - fireMapChange(Diffs.createMapDiff(addedKeys, Collections.EMPTY_SET, changes.keySet(), changes, wrappedMap)); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/package.html b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/package.html deleted file mode 100644 index 22107ea3..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/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> -Provides classes that can be used to observe changes in maps. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe changes in maps.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/IObservableFactory.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/IObservableFactory.java deleted file mode 100644 index e113f141..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/IObservableFactory.java +++ /dev/null @@ -1,31 +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.databinding.observable.masterdetail; - -import org.eclipse.core.databinding.observable.IObservable; - -/** - * Generates an {@link IObservable} when passed a target instance. - * - * @since 1.0 - */ -public interface IObservableFactory { - - /** - * Creates an observable for the given target object. - * - * @param target - * @return the new observable - */ - public IObservable createObservable(Object target); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/MasterDetailObservables.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/MasterDetailObservables.java deleted file mode 100644 index 54334b22..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/MasterDetailObservables.java +++ /dev/null @@ -1,97 +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 147515 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.masterdetail; - -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableList; -import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableSet; -import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableValue; - -/** - * Allows for the observation of an attribute, the detail, of an observable - * representing selection or another transient instance, the master. - * - * @since 1.0 - */ -public class MasterDetailObservables { - - /** - * Creates a detail observable value from a master observable value and a - * factory. This can be used to create observable values that represent a - * property of a selected object in a table. - * - * @param master - * the observable value to track - * @param detailFactory - * a factory for creating {@link IObservableValue} instances - * given a current value of the master - * @param detailType - * the value type of the detail observable value, typically of - * type java.lang.Class and can be <code>null</code> - * @return an observable value of the given value type that, for any current - * value of the given master value, behaves like the observable - * value created by the factory for that current value. - */ - public static IObservableValue detailValue(IObservableValue master, - IObservableFactory detailFactory, Object detailType) { - return new DetailObservableValue(master, detailFactory, detailType); - } - - /** - * Creates a detail observable list from a master observable value and a - * factory. This can be used to create observable lists that represent a - * list property of a selected object in a table. - * - * @param master - * the observable value to track - * @param detailFactory - * a factory for creating {@link IObservableList} instances given - * a current value of the master - * @param detailElementType - * the element type of the detail observable list, typically of - * type java.lang.Class and can be <code>null</code> - * @return an observable list with the given element type that, for any - * current value of the given master value, behaves like the - * observable list created by the factory for that current value. - */ - public static IObservableList detailList(IObservableValue master, - IObservableFactory detailFactory, Object detailElementType) { - return new DetailObservableList(detailFactory, master, - detailElementType); - } - - /** - * Creates a detail observable set from a master observable value and a - * factory. This can be used to create observable sets that represent a set - * property of a selected object in a table. - * - * @param master - * the observable value to track - * @param detailFactory - * a factory for creating {@link IObservableSet} instances given - * a current value of the master - * @param detailElementType - * the element type of the detail observable set, typically of - * type java.lang.Class and can be <code>null</code> - * @return an observable set with the given element type that, for any - * current value of the given master value, behaves like the - * observable set created by the factory for that current value. - */ - public static IObservableSet detailSet(IObservableValue master, - IObservableFactory detailFactory, Object detailElementType) { - return new DetailObservableSet(detailFactory, master, detailElementType); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/package.html b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/package.html deleted file mode 100644 index 07b72e5b..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/masterdetail/package.html +++ /dev/null @@ -1,17 +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> -Provides classes that can be used to observe a detail of a master object. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe a detail of a master object. -A common use case for master detail is observing the detail (e.g. name) of a master (e.g. selected Person) of a list of elements.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/package.html b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/package.html deleted file mode 100644 index 0739c1ca..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/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> -Provides the core APIs for observing changes in objects. -<h2> -Package Specification</h2> -<p> -This package provides the core APIs for observing changes in objects.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/AbstractObservableSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/AbstractObservableSet.java deleted file mode 100644 index 24528069..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/AbstractObservableSet.java +++ /dev/null @@ -1,217 +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.databinding.observable.set; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.ChangeSupport; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * Abstract implementation of {@link IObservableSet}. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - */ -public abstract class AbstractObservableSet extends AbstractObservable implements - IObservableSet { - - private ChangeSupport changeSupport; - - private boolean stale = false; - - protected AbstractObservableSet() { - this(Realm.getDefault()); - } - - protected void firstListenerAdded() { - super.firstListenerAdded(); - } - - protected void lastListenerRemoved() { - super.lastListenerRemoved(); - } - - protected AbstractObservableSet(Realm realm) { - super(realm); - changeSupport = new ChangeSupport(realm){ - protected void firstListenerAdded() { - AbstractObservableSet.this.firstListenerAdded(); - } - protected void lastListenerRemoved() { - AbstractObservableSet.this.lastListenerRemoved(); - } - }; - } - - public synchronized void addSetChangeListener(ISetChangeListener listener) { - changeSupport.addListener(SetChangeEvent.TYPE, listener); - } - - public synchronized void removeSetChangeListener(ISetChangeListener listener) { - changeSupport.removeListener(SetChangeEvent.TYPE, listener); - } - - protected abstract Set getWrappedSet(); - - protected void fireSetChange(SetDiff diff) { - // fire general change event first - super.fireChange(); - - changeSupport.fireEvent(new SetChangeEvent(this, diff)); - } - - public boolean contains(Object o) { - getterCalled(); - return getWrappedSet().contains(o); - } - - public boolean containsAll(Collection c) { - getterCalled(); - return getWrappedSet().containsAll(c); - } - - public boolean equals(Object o) { - getterCalled(); - return getWrappedSet().equals(o); - } - - public int hashCode() { - getterCalled(); - return getWrappedSet().hashCode(); - } - - public boolean isEmpty() { - getterCalled(); - return getWrappedSet().isEmpty(); - } - - public Iterator iterator() { - getterCalled(); - final Iterator wrappedIterator = getWrappedSet().iterator(); - return new Iterator() { - - public void remove() { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - ObservableTracker.getterCalled(AbstractObservableSet.this); - return wrappedIterator.hasNext(); - } - - public Object next() { - ObservableTracker.getterCalled(AbstractObservableSet.this); - return wrappedIterator.next(); - } - }; - } - - public int size() { - getterCalled(); - return getWrappedSet().size(); - } - - public Object[] toArray() { - getterCalled(); - return getWrappedSet().toArray(); - } - - public Object[] toArray(Object[] a) { - getterCalled(); - return getWrappedSet().toArray(a); - } - - public String toString() { - getterCalled(); - return getWrappedSet().toString(); - } - - protected void getterCalled() { - ObservableTracker.getterCalled(this); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - /** - * @return Returns the stale state. - */ - public boolean isStale() { - checkRealm(); - return stale; - } - - /** - * @param stale - * The stale state to set. This will fire a stale event if the - * given boolean is true and this observable set was not already - * stale. - */ - public void setStale(boolean stale) { - checkRealm(); - boolean wasStale = this.stale; - this.stale = stale; - if (!wasStale && stale) { - fireStale(); - } - } - - - protected void fireChange() { - throw new RuntimeException("fireChange should not be called, use fireSetChange() instead"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.jface.provisional.databinding.observable.AbstractObservable#dispose() - */ - public synchronized void dispose() { - super.dispose(); - - if (changeSupport != null) { - changeSupport.dispose(); - changeSupport = null; - } - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/IObservableSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/IObservableSet.java deleted file mode 100644 index 324033a4..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/IObservableSet.java +++ /dev/null @@ -1,126 +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.databinding.observable.set; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.databinding.observable.IObservableCollection; - -/** - * A set whose changes can be tracked by set change listeners. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - * - */ -public interface IObservableSet extends Set, IObservableCollection { - - /** - * @param listener - */ - public void addSetChangeListener(ISetChangeListener listener); - - /** - * @param listener - */ - public void removeSetChangeListener(ISetChangeListener listener); - - /** - * @return the element type or <code>null</code> if untyped - */ - public Object getElementType(); - - /** - * @TrackedGetter - */ - int size(); - - /** - * @TrackedGetter - */ - boolean isEmpty(); - - /** - * @TrackedGetter - */ - boolean contains(Object o); - - /** - * @TrackedGetter - */ - Iterator iterator(); - - /** - * @TrackedGetter - */ - Object[] toArray(); - - /** - * @TrackedGetter - */ - Object[] toArray(Object a[]); - - // Modification Operations - - /** - * @TrackedGetter - */ - boolean add(Object o); - - /** - * @TrackedGetter - */ - boolean remove(Object o); - - // Bulk Operations - - /** - * @TrackedGetter - */ - boolean containsAll(Collection c); - - /** - * @TrackedGetter - */ - boolean addAll(Collection c); - - /** - * @TrackedGetter - */ - boolean retainAll(Collection c); - - /** - * @TrackedGetter - */ - boolean removeAll(Collection c); - - // Comparison and hashing - - /** - * @TrackedGetter - */ - boolean equals(Object o); - - /** - * @TrackedGetter - */ - int hashCode(); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ISetChangeListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ISetChangeListener.java deleted file mode 100644 index 51c429a3..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ISetChangeListener.java +++ /dev/null @@ -1,35 +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.databinding.observable.set; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for changes to observable sets. - * - * @since 1.0 - * - */ -public interface ISetChangeListener extends IObservablesListener { - - /** - * Handle a change to an observable set. The given event object must only be - * used locally in this method because it may be reused for other change - * notifications. The diff object referenced by the event is immutable and - * may be used non-locally. - * - * @param event - * the event - */ - void handleSetChange(SetChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java deleted file mode 100644 index e145fb3c..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java +++ /dev/null @@ -1,84 +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.databinding.observable.set; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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; - -/** - * Observable set backed by an observable list. The wrapped list must not - * contain duplicate elements. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - * - */ -public class ListToSetAdapter extends ObservableSet { - - private final IObservableList list; - - private IListChangeListener listener = new IListChangeListener() { - - public void handleListChange(ListChangeEvent event) { - Set added = new HashSet(); - Set removed = new HashSet(); - ListDiffEntry[] differences = event.diff.getDifferences(); - for (int i = 0; i < differences.length; i++) { - ListDiffEntry entry = differences[i]; - Object element = entry.getElement(); - if (entry.isAddition()) { - if (wrappedSet.add(element)) { - if (!removed.remove(element)) - added.add(element); - } - } else { - if (wrappedSet.remove(element)) { - removed.add(element); - added.remove(element); - } - } - } - fireSetChange(Diffs.createSetDiff(added, removed)); - } - }; - - /** - * @param list - */ - public ListToSetAdapter(IObservableList list) { - super(list.getRealm(), new HashSet(), list.getElementType()); - this.list = list; - wrappedSet.addAll(list); - this.list.addListChangeListener(listener); - } - - public synchronized void dispose() { - super.dispose(); - if (list != null && listener != null) { - list.removeListChangeListener(listener); - listener = null; - } - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/MappedSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/MappedSet.java deleted file mode 100644 index c51c0c5c..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/MappedSet.java +++ /dev/null @@ -1,157 +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.databinding.observable.set; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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.core.databinding.observable.map.MapDiff; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - * - */ -public class MappedSet extends ObservableSet { - - private final IObservableMap wrappedMap; - - /* - * Map from values (range elements) to Integer ref counts - */ - private Map valueCounts = new HashMap(); - - private ISetChangeListener domainListener = new ISetChangeListener() { - public void handleSetChange(SetChangeEvent event) { - Set additions = new HashSet(); - for (Iterator it = event.diff.getAdditions().iterator(); it.hasNext();) { - Object added = it.next(); - Object mapValue = wrappedMap.get(added); - if (handleAddition(mapValue)) { - additions.add(mapValue); - } - } - Set removals = new HashSet(); - for (Iterator it = event.diff.getRemovals().iterator(); it.hasNext();) { - Object removed = it.next(); - Object mapValue = wrappedMap.get(removed); - if (handleRemoval(mapValue)) { - removals.add(mapValue); - } - } - fireSetChange(Diffs.createSetDiff(additions, removals)); - } - }; - - private IMapChangeListener mapChangeListener = new IMapChangeListener() { - public void handleMapChange(MapChangeEvent event) { - MapDiff diff = event.diff; - Set additions = new HashSet(); - Set removals = new HashSet(); - for (Iterator it = diff.getRemovedKeys().iterator(); it.hasNext();) { - Object key = it.next(); - Object oldValue = diff.getOldValue(key); - if (handleRemoval(oldValue)) { - removals.add(oldValue); - } - } - for (Iterator it = diff.getChangedKeys().iterator(); it.hasNext();) { - Object key = it.next(); - Object oldValue = diff.getOldValue(key); - Object newValue = diff.getNewValue(key); - if (handleRemoval(oldValue)) { - removals.add(oldValue); - } - if (handleAddition(newValue)) { - additions.add(newValue); - } - } - for (Iterator it = diff.getAddedKeys().iterator(); it.hasNext();) { - Object key = it.next(); - Object newValue = diff.getNewValue(key); - if (handleAddition(newValue)) { - additions.add(newValue); - } - } - fireSetChange(Diffs.createSetDiff(additions, removals)); - } - }; - - private IObservableSet input; - - /** - * @param input - * @param map - */ - public MappedSet(IObservableSet input, IObservableMap map) { - super(input.getRealm(), Collections.EMPTY_SET, Object.class); - setWrappedSet(valueCounts.keySet()); - this.wrappedMap = map; - this.input = input; - for (Iterator it = input.iterator(); it.hasNext();) { - Object element = it.next(); - Object functionValue = wrappedMap.get(element); - handleAddition(functionValue); - } - input.addSetChangeListener(domainListener); - map.addMapChangeListener(mapChangeListener); - } - - /** - * @param mapValue - * @return true if the given mapValue was an addition - */ - protected boolean handleAddition(Object mapValue) { - Integer count = (Integer) valueCounts.get(mapValue); - if (count == null) { - valueCounts.put(mapValue, new Integer(1)); - return true; - } - valueCounts.put(mapValue, new Integer(count.intValue() + 1)); - return false; - } - - /** - * @param mapValue - * @return true if the given mapValue has been removed - */ - protected boolean handleRemoval(Object mapValue) { - Integer count = (Integer) valueCounts.get(mapValue); - if (count.intValue() <= 1) { - valueCounts.remove(mapValue); - return true; - } - valueCounts.put(mapValue, new Integer(count.intValue() - 1)); - return false; - } - - public synchronized void dispose() { - wrappedMap.removeMapChangeListener(mapChangeListener); - input.removeSetChangeListener(domainListener); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ObservableSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ObservableSet.java deleted file mode 100644 index 4b3a6df0..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ObservableSet.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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.set; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * Abstract implementation of {@link IObservableSet}. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - * - */ -public abstract class ObservableSet extends AbstractObservable implements - IObservableSet { - - protected Set wrappedSet; - - private boolean stale = false; - - protected Object elementType; - - protected ObservableSet(Set wrappedSet, Object elementType) { - this(Realm.getDefault(), wrappedSet, elementType); - } - - protected ObservableSet(Realm realm, Set wrappedSet, Object elementType) { - super(realm); - this.wrappedSet = wrappedSet; - this.elementType = elementType; - } - - public synchronized void addSetChangeListener(ISetChangeListener listener) { - addListener(SetChangeEvent.TYPE, listener); - } - - public synchronized void removeSetChangeListener(ISetChangeListener listener) { - removeListener(SetChangeEvent.TYPE, listener); - } - - protected void fireSetChange(SetDiff diff) { - // fire general change event first - super.fireChange(); - - fireEvent(new SetChangeEvent(this, diff)); - } - - public boolean contains(Object o) { - getterCalled(); - return wrappedSet.contains(o); - } - - public boolean containsAll(Collection c) { - getterCalled(); - return wrappedSet.containsAll(c); - } - - public boolean equals(Object o) { - getterCalled(); - return wrappedSet.equals(o); - } - - public int hashCode() { - getterCalled(); - return wrappedSet.hashCode(); - } - - public boolean isEmpty() { - getterCalled(); - return wrappedSet.isEmpty(); - } - - public Iterator iterator() { - getterCalled(); - final Iterator wrappedIterator = wrappedSet.iterator(); - return new Iterator() { - - public void remove() { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - ObservableTracker.getterCalled(ObservableSet.this); - return wrappedIterator.hasNext(); - } - - public Object next() { - ObservableTracker.getterCalled(ObservableSet.this); - return wrappedIterator.next(); - } - }; - } - - public int size() { - getterCalled(); - return wrappedSet.size(); - } - - public Object[] toArray() { - getterCalled(); - return wrappedSet.toArray(); - } - - public Object[] toArray(Object[] a) { - getterCalled(); - return wrappedSet.toArray(a); - } - - public String toString() { - getterCalled(); - return wrappedSet.toString(); - } - - protected void getterCalled() { - ObservableTracker.getterCalled(this); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - /** - * @return Returns the stale state. - */ - public boolean isStale() { - checkRealm(); - return stale; - } - - /** - * @param stale - * The stale state to set. This will fire a stale event if the - * given boolean is true and this observable set was not already - * stale. - */ - public void setStale(boolean stale) { - checkRealm(); - boolean wasStale = this.stale; - this.stale = stale; - if (!wasStale && stale) { - fireStale(); - } - } - - /** - * @param wrappedSet The wrappedSet to set. - */ - protected void setWrappedSet(Set wrappedSet) { - this.wrappedSet = wrappedSet; - } - - protected void fireChange() { - throw new RuntimeException("fireChange should not be called, use fireSetChange() instead"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.jface.provisional.databinding.observable.AbstractObservable#dispose() - */ - public synchronized void dispose() { - super.dispose(); - } - - public Object getElementType() { - return elementType; - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java deleted file mode 100644 index 4873885e..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java +++ /dev/null @@ -1,68 +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.databinding.observable.set; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * List change event describing an incremental change of an - * {@link IObservableSet} object. - * - * @since 1.0 - * - */ -public class SetChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = 7436547103857482256L; - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable set. Listeners must - * not change this field. - */ - public SetDiff diff; - - /** - * Creates a new set change event. - * - * @param source - * the source observable set - * @param diff - * the set change - */ - public SetChangeEvent(IObservableSet source, SetDiff diff) { - super(source); - this.diff = diff; - } - - /** - * Returns the observable set from which this event originated. - * - * @return the observable set from which this event originated - */ - public IObservableSet getObservableSet() { - return (IObservableSet) getSource(); - } - - protected void dispatch(IObservablesListener listener) { - ((ISetChangeListener) listener).handleSetChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetDiff.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetDiff.java deleted file mode 100644 index d1a2f138..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetDiff.java +++ /dev/null @@ -1,47 +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.databinding.observable.set; - -import java.util.Set; - -/** - * @since 1.0 - * - */ -public abstract class SetDiff { - - /** - * @return the set of added elements - */ - public abstract Set getAdditions(); - - /** - * @return the set of removed elements - */ - public abstract Set getRemovals(); - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer - .append(getClass().getName()) - .append("{additions [") //$NON-NLS-1$ - .append(getAdditions() != null ? getAdditions().toString() : "null") //$NON-NLS-1$ - .append("], removals [") //$NON-NLS-1$ - .append(getRemovals() != null ? getRemovals().toString() : "null") //$NON-NLS-1$ - .append("]}"); //$NON-NLS-1$ - - return buffer.toString(); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/UnionSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/UnionSet.java deleted file mode 100644 index 082a0f6e..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/UnionSet.java +++ /dev/null @@ -1,209 +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.databinding.observable.set; - -import java.util.ArrayList; -import java.util.Collection; -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.Realm; -import org.eclipse.core.internal.databinding.observable.IStalenessConsumer; -import org.eclipse.core.internal.databinding.observable.StalenessTracker; - -/** - * Represents a set consisting of the union of elements from one or more other - * sets. This object does not need to be explicitly disposed. If nobody is - * listening to the UnionSet, the set will remove its listeners. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - */ -public final class UnionSet extends ObservableSet { - - /** - * child sets - */ - private IObservableSet[] childSets; - - private boolean stale = false; - - /** - * Map of elements onto Integer reference counts. This map is constructed - * when the first listener is added to the union set. Null if nobody is - * listening to the UnionSet. - */ - private HashMap refCounts = null; - - private StalenessTracker stalenessTracker; - - /** - * @param childSets - */ - public UnionSet(IObservableSet[] childSets) { - super(childSets[0].getRealm(), null, childSets[0].getElementType()); - this.childSets = childSets; - this.stalenessTracker = new StalenessTracker(childSets, - stalenessConsumer); - } - - private ISetChangeListener childSetChangeListener = new ISetChangeListener() { - public void handleSetChange(SetChangeEvent event) { - processAddsAndRemoves(event.diff.getAdditions(), event.diff.getRemovals()); - } - }; - - private IStalenessConsumer stalenessConsumer = new IStalenessConsumer() { - public void setStale(boolean stale) { - boolean oldStale = UnionSet.this.stale; - UnionSet.this.stale = stale; - if (stale && !oldStale) { - fireStale(); - } - } - }; - - public boolean isStale() { - checkRealm(); - if (refCounts != null) { - return stale; - } - - for (int i = 0; i < childSets.length; i++) { - IObservableSet childSet = childSets[i]; - - if (childSet.isStale()) { - return true; - } - } - return false; - } - - private void processAddsAndRemoves(Set adds, Set removes) { - Set addsToFire = new HashSet(); - Set removesToFire = new HashSet(); - - for (Iterator iter = adds.iterator(); iter.hasNext();) { - Object added = iter.next(); - - Integer refCount = (Integer) refCounts.get(added); - if (refCount == null) { - refCounts.put(added, new Integer(1)); - addsToFire.add(added); - } else { - int refs = refCount.intValue(); - refCount = new Integer(refs + 1); - refCounts.put(added, refCount); - } - } - - for (Iterator iter = removes.iterator(); iter.hasNext();) { - Object removed = iter.next(); - - Integer refCount = (Integer) refCounts.get(removed); - if (refCount != null) { - int refs = refCount.intValue(); - if (refs <= 1) { - removesToFire.add(removed); - refCounts.remove(removed); - } else { - refCount = new Integer(refCount.intValue() - 1); - refCounts.put(removed, refCount); - } - } - } - - // just in case the removes overlapped with the adds - addsToFire.removeAll(removesToFire); - - if (addsToFire.size() > 0 || removesToFire.size() > 0) { - fireSetChange(Diffs.createSetDiff(addsToFire, removesToFire)); - } - } - - protected void firstListenerAdded() { - super.firstListenerAdded(); - - refCounts = new HashMap(); - for (int i = 0; i < childSets.length; i++) { - IObservableSet next = childSets[i]; - next.addSetChangeListener(childSetChangeListener); - incrementRefCounts(next); - } - stalenessTracker = new StalenessTracker(childSets, stalenessConsumer); - setWrappedSet(refCounts.keySet()); - } - - protected void lastListenerRemoved() { - super.lastListenerRemoved(); - - for (int i = 0; i < childSets.length; i++) { - IObservableSet next = childSets[i]; - - next.removeSetChangeListener(childSetChangeListener); - stalenessTracker.removeObservable(next); - } - refCounts = null; - stalenessTracker = null; - setWrappedSet(null); - } - - private ArrayList incrementRefCounts(Collection added) { - ArrayList adds = new ArrayList(); - - for (Iterator iter = added.iterator(); iter.hasNext();) { - Object next = iter.next(); - - Integer refCount = (Integer) refCounts.get(next); - if (refCount == null) { - adds.add(next); - refCount = new Integer(1); - refCounts.put(next, refCount); - } else { - refCount = new Integer(refCount.intValue() + 1); - refCounts.put(next, refCount); - } - } - return adds; - } - - protected void getterCalled() { - super.getterCalled(); - if (refCounts == null) { - // no listeners, recompute - setWrappedSet(computeElements()); - } - } - - private Set computeElements() { - // If there is no cached value, compute the union from scratch - if (refCounts == null) { - Set result = new HashSet(); - for (int i = 0; i < childSets.length; i++) { - result.addAll(childSets[i]); - } - return result; - } - - // Else there is a cached value. Return it. - return refCounts.keySet(); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/WritableSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/WritableSet.java deleted file mode 100644 index bbf11cea..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/WritableSet.java +++ /dev/null @@ -1,164 +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 147515 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.set; - -import java.util.Collection; -import java.util.Collections; -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.Realm; - -/** - * Mutable (writable) implementation of {@link IObservableSet}. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - */ -public class WritableSet extends ObservableSet { - - /** - * Constructs a new instance with the default realm, empty list, and a - * <code>null</code> element type. - * - */ - public WritableSet() { - this(Realm.getDefault()); - } - - /** - * Construts a new instance with the default realm. - * - * @param c - * @param elementType - * can be <code>null</code> - */ - public WritableSet(Collection c, Object elementType) { - this(Realm.getDefault(), new HashSet(c), elementType); - } - - /** - * Constructs a new instance with an empty list and a <code>null</code> element type. - * - * @param realm - */ - public WritableSet(Realm realm) { - this(realm, new HashSet(), null); - } - - /** - * Constructs a new instance. - * - * @param realm - * @param c - * @param elementType - * can be <code>null</code> - */ - public WritableSet(Realm realm, Collection c, Object elementType) { - super(realm, new HashSet(c), elementType); - this.elementType = elementType; - } - - public boolean add(Object o) { - checkRealm(); - boolean added = wrappedSet.add(o); - if (added) { - fireSetChange(Diffs.createSetDiff(Collections.singleton(o), Collections.EMPTY_SET)); - } - return added; - } - - public boolean addAll(Collection c) { - checkRealm(); - Set adds = new HashSet(); - Iterator it = c.iterator(); - while (it.hasNext()) { - Object element = it.next(); - if (wrappedSet.add(element)) { - adds.add(element); - } - } - if (adds.size() > 0) { - fireSetChange(Diffs.createSetDiff(adds, Collections.EMPTY_SET)); - return true; - } - return false; - } - - public boolean remove(Object o) { - checkRealm(); - boolean removed = wrappedSet.remove(o); - if (removed) { - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, Collections - .singleton(o))); - } - return removed; - } - - public boolean removeAll(Collection c) { - checkRealm(); - Set removes = new HashSet(); - Iterator it = c.iterator(); - while (it.hasNext()) { - Object element = it.next(); - if (wrappedSet.remove(element)) { - removes.add(element); - } - } - if (removes.size() > 0) { - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, removes)); - return true; - } - return false; - } - - public boolean retainAll(Collection c) { - checkRealm(); - Set removes = new HashSet(); - Iterator it = wrappedSet.iterator(); - while (it.hasNext()) { - Object element = it.next(); - if (!c.contains(element)) { - it.remove(); - removes.add(element); - } - } - if (removes.size() > 0) { - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, removes)); - return true; - } - return false; - } - - public void clear() { - checkRealm(); - Set removes = new HashSet(wrappedSet); - wrappedSet.clear(); - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, removes)); - } - - /** - * @param elementType can be <code>null</code> - * @return new instance with the default realm - */ - public static WritableSet withElementType(Object elementType) { - return new WritableSet(Realm.getDefault(), new HashSet(), elementType); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/package.html b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/package.html deleted file mode 100644 index 5a57448a..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/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> -Provides classes that can be used to observe changes in sets. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe changes in sets.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/AbstractObservableValue.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/AbstractObservableValue.java deleted file mode 100644 index be67adc4..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/AbstractObservableValue.java +++ /dev/null @@ -1,92 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - * - */ -abstract public class AbstractObservableValue extends AbstractObservable implements IObservableValue { - /** - * Constructs a new instance with the default realm. - */ - public AbstractObservableValue() { - this(Realm.getDefault()); - } - - /** - * @param realm - */ - public AbstractObservableValue(Realm realm) { - super(realm); - } - - public synchronized void addValueChangeListener(IValueChangeListener listener) { - addListener(ValueChangeEvent.TYPE, listener); - } - - public synchronized void removeValueChangeListener(IValueChangeListener listener) { - removeListener(ValueChangeEvent.TYPE, listener); - } - - final public void setValue(Object value) { - checkRealm(); - doSetValue(value); - } - - /** - * Template method for setting the value of the observable. By default the - * method throws an {@link UnsupportedOperationException}. - * - * @param value - */ - protected void doSetValue(Object value) { - throw new UnsupportedOperationException(); - } - - protected void fireValueChange(ValueDiff diff) { - // fire general change event first - super.fireChange(); - fireEvent(new ValueChangeEvent(this, diff)); - } - - public final Object getValue() { - ObservableTracker.getterCalled(this); - return doGetValue(); - } - - abstract protected Object doGetValue(); - - public boolean isStale() { - return false; - } - - protected void fireChange() { - throw new RuntimeException( - "fireChange should not be called, use fireValueChange() instead"); //$NON-NLS-1$ - } - - public synchronized void dispose() { - super.dispose(); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/AbstractVetoableValue.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/AbstractVetoableValue.java deleted file mode 100644 index d3cff74b..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/AbstractVetoableValue.java +++ /dev/null @@ -1,95 +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.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.internal.databinding.Util; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - * - */ -public abstract class AbstractVetoableValue extends AbstractObservableValue - implements IVetoableValue { - - /** - * Creates a new vetoable value. - */ - public AbstractVetoableValue() { - this(Realm.getDefault()); - } - - /** - * @param realm - */ - public AbstractVetoableValue(Realm realm) { - super(realm); - } - - final protected void doSetValue(Object value) { - Object currentValue = doGetValue(); - ValueDiff diff = Diffs.createValueDiff(currentValue, value); - boolean okToProceed = fireValueChanging(diff); - if (!okToProceed) { - throw new ChangeVetoException("Change not permitted"); //$NON-NLS-1$ - } - doSetApprovedValue(value); - - if (!Util.equals(diff.getOldValue(), diff.getNewValue())) { - fireValueChange(diff); - } - } - - /** - * Sets the value. Invoked after performing veto checks. Should not fire change events. - * - * @param value - */ - protected abstract void doSetApprovedValue(Object value); - - public synchronized void addValueChangingListener( - IValueChangingListener listener) { - addListener(ValueChangingEvent.TYPE, listener); - } - - public synchronized void removeValueChangingListener( - IValueChangingListener listener) { - removeListener(ValueChangingEvent.TYPE, listener); - } - - /** - * Notifies listeners about a pending change, and returns true if no - * listener vetoed the change. - * - * @param diff - * @return false if the change was vetoed, true otherwise - */ - protected boolean fireValueChanging(ValueDiff diff) { - checkRealm(); - - ValueChangingEvent event = new ValueChangingEvent(this, diff); - fireEvent(event); - return !event.veto; - } - - public synchronized void dispose() { - super.dispose(); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ChangeVetoException.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ChangeVetoException.java deleted file mode 100644 index 3c9261ff..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ChangeVetoException.java +++ /dev/null @@ -1,28 +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.core.databinding.observable.value; - -/** - * @since 1.0 - * - */ -public class ChangeVetoException extends RuntimeException { - - /** - * @param string - */ - public ChangeVetoException(String string) { - super(string); - } - - private static final long serialVersionUID = 1L; - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ComputedValue.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ComputedValue.java deleted file mode 100644 index 18168098..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ComputedValue.java +++ /dev/null @@ -1,249 +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 147515 - *******************************************************************************/ -package org.eclipse.core.databinding.observable.value; - -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.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.StaleEvent; - -/** - * A Lazily calculated value that automatically computes and registers listeners - * on its dependencies as long as all of its dependencies are IObservable - * objects - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public abstract class ComputedValue extends AbstractObservableValue { - - private boolean dirty = true; - - private boolean stale = false; - - private Object cachedValue = null; - - /** - * Array of observables this computed value depends on. This field has - * a value of <code>null</code> if we are not currently listening. - */ - private IObservable[] dependencies = null; - - /** - * - */ - public ComputedValue() { - this(Realm.getDefault(), null); - } - - /** - * @param valueType can be <code>null</code> - */ - public ComputedValue(Object valueType) { - this(Realm.getDefault(), valueType); - } - - /** - * @param realm - * - */ - public ComputedValue(Realm realm) { - this(realm, null); - } - - /** - * @param realm - * @param valueType - */ - public ComputedValue(Realm realm, Object valueType) { - super(realm); - this.valueType = valueType; - } - - /** - * Inner class that implements interfaces that we don't want to expose as - * public API. Each interface could have been implemented using a separate - * anonymous class, but we combine them here to reduce the memory overhead - * and number of classes. - * - * <p> - * The Runnable calls computeValue and stores the result in cachedValue. - * </p> - * - * <p> - * The IChangeListener stores each observable in the dependencies list. - * This is registered as the listener when calling ObservableTracker, to - * detect every observable that is used by computeValue. - * </p> - * - * <p> - * The IChangeListener is attached to every dependency. - * </p> - * - */ - private class PrivateInterface implements Runnable, IChangeListener, - IStaleListener { - public void run() { - cachedValue = calculate(); - } - - public void handleStale(StaleEvent event) { - if (!dirty && !stale) { - stale = true; - fireStale(); - } - } - - public void handleChange(ChangeEvent event) { - makeDirty(); - } - } - - private PrivateInterface privateInterface = new PrivateInterface(); - - private Object valueType; - - protected final Object doGetValue() { - if (dirty) { - // This line will do the following: - // - Run the calculate method - // - While doing so, add any observable that is touched to the - // dependencies list - IObservable[] newDependencies = ObservableTracker.runAndMonitor( - privateInterface, privateInterface, null); - - stale = false; - for (int i = 0; i < newDependencies.length; i++) { - IObservable observable = newDependencies[i]; - // Add a change listener to the new dependency. - if (observable.isStale()) { - stale = true; - } else { - observable.addStaleListener(privateInterface); - } - } - - dependencies = newDependencies; - - dirty = false; - } - - return cachedValue; - } - - /** - * Subclasses must override this method to provide the object's value. - * - * @return the object's value - */ - protected abstract Object calculate(); - - protected final void makeDirty() { - if (!dirty) { - dirty = true; - - stopListening(); - - // copy the old value - final Object oldValue = cachedValue; - // Fire the "dirty" event. This implementation recomputes the new - // value lazily. - fireValueChange(new ValueDiff() { - - public Object getOldValue() { - return oldValue; - } - - public Object getNewValue() { - return getValue(); - } - }); - } - } - - /** - * - */ - private void stopListening() { - // Stop listening for dependency changes. - if (dependencies != null) { - for (int i = 0; i < dependencies.length; i++) { - IObservable observable = dependencies[i]; - - observable.removeChangeListener(privateInterface); - observable.removeStaleListener(privateInterface); - } - dependencies = null; - } - } - - public boolean isStale() { - // we need to recompute, otherwise staleness wouldn't mean anything - getValue(); - return stale; - } - - public Object getValueType() { - return valueType; - } - - // this method exists here so that we can call it from the runnable below. - protected boolean hasListeners() { - return super.hasListeners(); - } - - public synchronized void addChangeListener(IChangeListener listener) { - super.addChangeListener(listener); - // Some clients just add a listener and expect to get notified even if - // they never called getValue(), so we have to call getValue() ourselves - // here to be sure. Need to be careful about realms though, this method - // can be called outside of our realm. - // See also bug 198211. If a client calls this outside of our realm, - // they may receive change notifications before the runnable below has - // been executed. It is their job to figure out what to do with those - // notifications. - getRealm().exec(new Runnable() { - public void run() { - if (dependencies == null) { - // We are not currently listening. - if (hasListeners()) { - // But someone is listening for changes. Call getValue() - // to make sure we start listening to the observables we - // depend on. - getValue(); - } - } - } - }); - getValue(); - } - - public synchronized void addValueChangeListener(IValueChangeListener listener) { - super.addValueChangeListener(listener); - // If somebody is listening, we need to make sure we attach our own - // listeners - getValue(); - } - - public synchronized void dispose() { - super.dispose(); - stopListening(); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IObservableValue.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IObservableValue.java deleted file mode 100644 index ecff44f5..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IObservableValue.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.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; - -/** - * A value whose changes can be tracked by value change listeners. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - * - */ -public interface IObservableValue extends IObservable { - - /** - * The value type of this observable value, or <code>null</code> if this - * observable value is untyped. - * - * @return the value type, or <code>null</null> - */ - public Object getValueType(); - - /** - * Returns the value. Must be invoked in the {@link Realm} of the observable. - * - * @return the current value - * @TrackedGetter - */ - public Object getValue(); - - /** - * Sets the value. Must be invoked in the {@link Realm} of the observable. - * - * @param value - * the value to set - * @throws UnsupportedOperationException - * if this observable value cannot be set. - */ - public void setValue(Object value); - - /** - * - * @param listener - */ - public void addValueChangeListener(IValueChangeListener listener); - - /** - * @param listener - */ - public void removeValueChangeListener(IValueChangeListener listener); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IValueChangeListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IValueChangeListener.java deleted file mode 100644 index 7af53822..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IValueChangeListener.java +++ /dev/null @@ -1,35 +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.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for changes to observable values. - * - * @since 1.0 - * - */ -public interface IValueChangeListener extends IObservablesListener { - - /** - * Handles a change to an observable value. The given event object must only - * be used locally in this method because it may be reused for other change - * notifications. The diff object referenced by the event is immutable and - * may be used non-locally. - * - * @param event - * the event - */ - void handleValueChange(ValueChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IValueChangingListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IValueChangingListener.java deleted file mode 100644 index ceb07b74..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IValueChangingListener.java +++ /dev/null @@ -1,34 +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.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for pre-change events for observable values. - * - * @since 1.0 - * - */ -public interface IValueChangingListener extends IObservablesListener { - - /** - * This method is called when the value is about to change and provides an - * opportunity to veto the change. The given event object must only be used - * locally in this method because it may be reused for other change - * notifications. The diff object referenced by the event is immutable and - * may be used non-locally. - * - * @param event - */ - public void handleValueChanging(ValueChangingEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IVetoableValue.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IVetoableValue.java deleted file mode 100644 index 15cdee48..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/IVetoableValue.java +++ /dev/null @@ -1,38 +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.core.databinding.observable.value; - -/** - * An observable value whose changes can be vetoed by listeners. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - * - */ -public interface IVetoableValue extends IObservableValue { - - /** - * @param listener - */ - public void addValueChangingListener(IValueChangingListener listener); - - /** - * @param listener - */ - public void removeValueChangingListener(IValueChangingListener listener); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.java deleted file mode 100644 index 3d4fba90..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.java +++ /dev/null @@ -1,69 +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.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * Value change event describing a change of an {@link IObservableValue} - * object's current value. - * - * @since 1.0 - * - */ -public class ValueChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = 2305345286999701156L; - - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable value. Listeners must - * not change this field. - */ - public ValueDiff diff; - - /** - * Creates a new value change event. - * - * @param source - * the source observable value - * @param diff - * the value change - */ - public ValueChangeEvent(IObservableValue source, ValueDiff diff) { - super(source); - this.diff = diff; - } - - /** - * Returns the observable value from which this event originated. - * - * @return returns the observable value from which this event originated - */ - public IObservableValue getObservableValue() { - return (IObservableValue) source; - } - - protected void dispatch(IObservablesListener listener) { - ((IValueChangeListener) listener).handleValueChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangingEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangingEvent.java deleted file mode 100644 index f92cde7b..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangingEvent.java +++ /dev/null @@ -1,74 +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.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * Value changing event describing a pending change of an - * {@link IObservableValue} object's current value. Listeners can veto the - * pending change by setting {@link #veto} to <code>true</code>. - * - * @since 1.0 - * - */ -public class ValueChangingEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = 2305345286999701156L; - - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable value. Listeners must - * not change this field. - */ - public ValueDiff diff; - - /** - * Flag for vetoing this change. Default value is <code>false</code>, can - * be set to <code>true</code> by listeners to veto this change. - */ - public boolean veto = false; - - /** - * Creates a new value changing event. - * - * @param source - * the source observable value - * @param diff - * the value change - */ - public ValueChangingEvent(IObservableValue source, ValueDiff diff) { - super(source); - this.diff = diff; - } - - /** - * @return the observable value from which this event originated - */ - public IObservableValue getObservableValue() { - return (IObservableValue) source; - } - - protected void dispatch(IObservablesListener listener) { - ((IValueChangingListener) listener).handleValueChanging(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueDiff.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueDiff.java deleted file mode 100644 index 62a2f866..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueDiff.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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.Diffs; - -/** - * @since 1.0 - * - */ -public abstract class ValueDiff { - /** - * Creates a value diff. - */ - public ValueDiff() { - } - - /** - * @return the old value - */ - public abstract Object getOldValue(); - - /** - * @return the new value - */ - public abstract Object getNewValue(); - - public boolean equals(Object obj) { - if (obj instanceof ValueDiff) { - ValueDiff val = (ValueDiff) obj; - - return Diffs.equals(val.getNewValue(), getNewValue()) - && Diffs.equals(val.getOldValue(), getOldValue()); - - } - return false; - } - - public int hashCode() { - final int prime = 31; - int result = 1; - Object nv = getNewValue(); - Object ov = getOldValue(); - result = prime * result + ((nv == null) ? 0 : nv.hashCode()); - result = prime * result + ((ov == null) ? 0 : ov.hashCode()); - return result; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer - .append(getClass().getName()) - .append("{oldValue [") //$NON-NLS-1$ - .append(getOldValue() != null ? getOldValue().toString() : "null") //$NON-NLS-1$ - .append("], newValue [") //$NON-NLS-1$ - .append(getNewValue() != null ? getNewValue().toString() : "null") //$NON-NLS-1$ - .append("]}"); //$NON-NLS-1$ - - return buffer.toString(); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/WritableValue.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/WritableValue.java deleted file mode 100644 index 5d794f1a..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/WritableValue.java +++ /dev/null @@ -1,113 +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 158687 - * Brad Reynolds - bug 164653, 147515 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; - -/** - * Mutable (writable) implementation of {@link IObservableValue} that will maintain a value and fire - * change events when the value changes. - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public class WritableValue extends AbstractObservableValue { - - private final Object valueType; - - /** - * Constructs a new instance with the default realm, a <code>null</code> - * value type, and a <code>null</code> value. - */ - public WritableValue() { - this(null, null); - } - - /** - * Constructs a new instance with the default realm. - * - * @param initialValue - * can be <code>null</code> - * @param valueType - * can be <code>null</code> - */ - public WritableValue(Object initialValue, Object valueType) { - this(Realm.getDefault(), initialValue, valueType); - } - - /** - * Constructs a new instance with the provided <code>realm</code>, a - * <code>null</code> value type, and a <code>null</code> initial value. - * - * @param realm - */ - public WritableValue(Realm realm) { - this(realm, null, null); - } - - /** - * Constructs a new instance. - * - * @param realm - * @param initialValue - * can be <code>null</code> - * @param valueType - * can be <code>null</code> - */ - public WritableValue(Realm realm, Object initialValue, Object valueType) { - super(realm); - this.valueType = valueType; - this.value = initialValue; - } - - private Object value = null; - - public Object doGetValue() { - return value; - } - - /** - * @param value - * The value to set. - */ - public void doSetValue(Object value) { - boolean changed = false; - - if (this.value == null && value != null) { - changed = true; - } else if (this.value != null && !this.value.equals(value)) { - changed = true; - } - - if (changed) { - fireValueChange(Diffs.createValueDiff(this.value, this.value = value)); - } - } - - public Object getValueType() { - return valueType; - } - - /** - * @param elementType can be <code>null</code> - * @return new instance with the default realm and a value of <code>null</code> - */ - public static WritableValue withValueType(Object elementType) { - return new WritableValue(Realm.getDefault(), null, elementType); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/package.html b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/package.html deleted file mode 100644 index 4ce13df5..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/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> -Provides classes that can be used to observe changes in discrete values. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe changes in discrete values.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/ILogger.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/ILogger.java deleted file mode 100644 index 652d7193..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/ILogger.java +++ /dev/null @@ -1,38 +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: - * Chris Gross (schtoo@schtoo.com) - initial API and implementation - * (bug 49497 [RCP] JFace dependency on org.eclipse.core.runtime enlarges standalone JFace applications) - *******************************************************************************/ - -package org.eclipse.core.databinding.util; - -import org.eclipse.core.runtime.IStatus; - -/** - * A mechanism to log errors throughout JFace Data Binding. - * <p> - * Clients may provide their own implementation to change how errors are logged - * from within JFace Data Binding. - * </p> - * - * @see Policy#getLog() - * @see Policy#setLog(ILogger) - * @since 1.1 - */ -public interface ILogger { - - /** - * Logs the given status. - * - * @param status - * the status to log - */ - public void log(IStatus status); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/Policy.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/Policy.java deleted file mode 100644 index e081da00..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/Policy.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 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 - * Chris Gross (schtoo@schtoo.com) - support for ILogger added - * (bug 49497 [RCP] JFace dependency on org.eclipse.core.runtime enlarges standalone JFace applications) - * Brad Reynolds - bug 164653 - * Tom Schindl <tom.schindl@bestsolution.at> - bug 194587 - *******************************************************************************/ -package org.eclipse.core.databinding.util; - -import org.eclipse.core.runtime.IStatus; - -/** - * The Policy class handles settings for behaviour, debug flags and logging - * within JFace Data Binding. - * - * @since 1.1 - */ -public class Policy { - - /** - * Constant for the the default setting for debug options. - */ - public static final boolean DEFAULT = false; - - /** - * The unique identifier of the JFace plug-in. - */ - public static final String JFACE_DATABINDING = "org.eclipse.core.databinding";//$NON-NLS-1$ - - private static ILogger log; - - /** - * Returns the dummy log to use if none has been set - */ - private static ILogger getDummyLog() { - return new ILogger() { - public void log(IStatus status) { - System.err.println(status.getPlugin() + " - " + status.getCode() + " - " + status.getMessage()); //$NON-NLS-1$//$NON-NLS-2$ - if( status.getException() != null ) { - status.getException().printStackTrace(System.err); - } - } - }; - } - - /** - * Sets the logger used by JFace Data Binding to log errors. - * - * @param logger - * the logger to use, or <code>null</code> to use the default - * logger - */ - public static synchronized void setLog(ILogger logger) { - log = logger; - } - - /** - * Returns the logger used by JFace Data Binding to log errors. - * <p> - * The default logger prints the status to <code>System.err</code>. - * </p> - * - * @return the logger - */ - public static synchronized ILogger getLog() { - if (log == null) { - log = getDummyLog(); - } - return log; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/package.html b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/package.html deleted file mode 100644 index 0b186a7b..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/util/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> -Provides general utilities for data binding. -<h2> -Package Specification</h2> -<p> -This package provides general utilities for data binding.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/EmptyObservableList.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/EmptyObservableList.java deleted file mode 100644 index 4b061e9c..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/EmptyObservableList.java +++ /dev/null @@ -1,170 +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.internal.databinding.observable; - -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -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; - -/** - * Singleton empty list - */ -public class EmptyObservableList implements IObservableList { - - private static final List emptyList = Collections.EMPTY_LIST; - - private Realm realm; - - /** - * Creates a singleton empty list. This list may be disposed multiple times - * without any side-effects. - * - * @param realm - */ - public EmptyObservableList(Realm realm) { - this.realm = realm; - } - - public void addListChangeListener(IListChangeListener listener) { - } - - public void removeListChangeListener(IListChangeListener listener) { - } - - public Object getElementType() { - return null; - } - - public int size() { - return 0; - } - - public boolean isEmpty() { - return true; - } - - public boolean contains(Object o) { - return false; - } - - public Iterator iterator() { - return emptyList.iterator(); - } - - public Object[] toArray() { - return emptyList.toArray(); - } - - public Object[] toArray(Object[] a) { - return emptyList.toArray(a); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean containsAll(Collection c) { - return c.isEmpty(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - public void addChangeListener(IChangeListener listener) { - } - - public void removeChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void removeStaleListener(IStaleListener listener) { - } - - public boolean isStale() { - return false; - } - - public void dispose() { - } - - public boolean addAll(int index, Collection c) { - throw new UnsupportedOperationException(); - } - - public Object get(int index) { - return emptyList.get(index); - } - - public int indexOf(Object o) { - return -1; - } - - public int lastIndexOf(Object o) { - return -1; - } - - public ListIterator listIterator() { - return emptyList.listIterator(); - } - - public ListIterator listIterator(int index) { - return emptyList.listIterator(index); - } - - public Object remove(int index) { - throw new UnsupportedOperationException(); - } - - public Object set(int index, Object element) { - throw new UnsupportedOperationException(); - } - - public List subList(int fromIndex, int toIndex) { - return emptyList.subList(fromIndex, toIndex); - } - - public void add(int arg0, Object arg1) { - throw new UnsupportedOperationException(); - } - - public Realm getRealm() { - return realm; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/EmptyObservableSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/EmptyObservableSet.java deleted file mode 100644 index a425a282..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/EmptyObservableSet.java +++ /dev/null @@ -1,129 +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.internal.databinding.observable; - -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.Set; - -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; - -/** - * Singleton empty set - */ -public class EmptyObservableSet implements IObservableSet { - - private static final Set emptySet = Collections.EMPTY_SET; - - private Realm realm; - - /** - * Creates a singleton empty set. This set may be disposed multiple times - * without any side-effects. - * - * @param realm - */ - public EmptyObservableSet(Realm realm) { - this.realm = realm; - } - - public void addSetChangeListener(ISetChangeListener listener) { - } - - public void removeSetChangeListener(ISetChangeListener listener) { - } - - public Object getElementType() { - return null; - } - - public int size() { - return 0; - } - - public boolean isEmpty() { - return true; - } - - public boolean contains(Object o) { - return false; - } - - public Iterator iterator() { - return emptySet.iterator(); - } - - public Object[] toArray() { - return emptySet.toArray(); - } - - public Object[] toArray(Object[] a) { - return emptySet.toArray(a); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean containsAll(Collection c) { - return c.isEmpty(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - public void addChangeListener(IChangeListener listener) { - } - - public void removeChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void removeStaleListener(IStaleListener listener) { - } - - public boolean isStale() { - return false; - } - - public void dispose() { - } - - public Realm getRealm() { - return realm; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/IStalenessConsumer.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/IStalenessConsumer.java deleted file mode 100644 index cfe5c612..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/IStalenessConsumer.java +++ /dev/null @@ -1,24 +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.core.internal.databinding.observable; - -/** - * @since 1.0 - * - */ -public interface IStalenessConsumer { - /** - * @param stale - * - */ - public void setStale(boolean stale); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/ProxyObservableSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/ProxyObservableSet.java deleted file mode 100644 index 28c84549..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/ProxyObservableSet.java +++ /dev/null @@ -1,72 +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.internal.databinding.observable; - -import java.util.Set; - -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; - -/** - * Wraps an observable set. This object acts like an exact copy of the original - * set, and tracks all the changes in the original. The only difference is that - * disposing the wrapper will not dispose the original. You can use this whenever - * you need to return an IObservableSet from a method that expects the caller - * to dispose the set, but you have an IObservableSet that you don't want disposed. - */ -public final class ProxyObservableSet extends AbstractObservableSet { - - private IObservableSet toDelegateTo; - private ISetChangeListener listener = new ISetChangeListener() { - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.ISetChangeListener#handleSetChange(org.eclipse.jface.internal.databinding.provisional.observable.set.IObservableSet, org.eclipse.jface.internal.databinding.provisional.observable.set.SetDiff) - */ - public void handleSetChange(SetChangeEvent event) { - fireSetChange(event.diff); - } - }; - - /** - * Constructs a DelegatingObservableSet that tracks the state of the given set. - * - * @param toDelegate - */ - public ProxyObservableSet(IObservableSet toDelegate) { - super(toDelegate.getRealm()); - this.toDelegateTo = toDelegate; - toDelegate.addSetChangeListener(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.AbstractObservableSet#getWrappedSet() - */ - protected Set getWrappedSet() { - return toDelegateTo; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.IObservableSet#getElementType() - */ - public Object getElementType() { - return toDelegateTo.getElementType(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.AbstractObservableSet#dispose() - */ - public void dispose() { - toDelegateTo.removeSetChangeListener(listener); - super.dispose(); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/StalenessTracker.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/StalenessTracker.java deleted file mode 100644 index 6324325e..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/StalenessTracker.java +++ /dev/null @@ -1,127 +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.core.internal.databinding.observable; - -import java.util.HashMap; -import java.util.Map; - -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.StaleEvent; -import org.eclipse.core.internal.databinding.IdentityWrapper; - -/** - * @since 1.0 - * - */ -public class StalenessTracker { - - private Map staleMap = new HashMap(); - - private int staleCount = 0; - - private final IStalenessConsumer stalenessConsumer; - - private class ChildListener implements IStaleListener, IChangeListener { - public void handleStale(StaleEvent event) { - processStalenessChange((IObservable) event.getSource(), true); - } - - public void handleChange(ChangeEvent event) { - processStalenessChange((IObservable) event.getSource(), true); - } - } - - private ChildListener childListener = new ChildListener(); - - /** - * @param observables - * @param stalenessConsumer - */ - public StalenessTracker(IObservable[] observables, - IStalenessConsumer stalenessConsumer) { - this.stalenessConsumer = stalenessConsumer; - for (int i = 0; i < observables.length; i++) { - IObservable observable = observables[i]; - doAddObservable(observable, false); - } - stalenessConsumer.setStale(staleCount > 0); - } - - /** - * @param child - * @param callback - */ - public void processStalenessChange(IObservable child, boolean callback) { - boolean oldStale = staleCount > 0; - IdentityWrapper wrappedChild = new IdentityWrapper(child); - boolean oldChildStale = getOldChildStale(wrappedChild); - boolean newChildStale = child.isStale(); - if (oldChildStale != newChildStale) { - if (oldChildStale) { - staleCount--; - } else { - staleCount++; - } - staleMap.put(wrappedChild, newChildStale ? Boolean.TRUE : Boolean.FALSE); - } - boolean newStale = staleCount > 0; - if (callback && (newStale != oldStale)) { - stalenessConsumer.setStale(newStale); - } - } - - /** - * @param wrappedChild - */ - private boolean getOldChildStale(IdentityWrapper wrappedChild) { - Object oldChildValue = staleMap.get(wrappedChild); - boolean oldChildStale = oldChildValue == null ? false - : ((Boolean) oldChildValue).booleanValue(); - return oldChildStale; - } - - /** - * @param observable - */ - public void addObservable(IObservable observable) { - doAddObservable(observable, true); - } - - private void doAddObservable(IObservable observable, boolean callback) { - processStalenessChange(observable, callback); - observable.addChangeListener(childListener); - observable.addStaleListener(childListener); - } - - /** - * @param observable - */ - public void removeObservable(IObservable observable) { - boolean oldStale = staleCount > 0; - IdentityWrapper wrappedChild = new IdentityWrapper(observable); - boolean oldChildStale = getOldChildStale(wrappedChild); - if (oldChildStale) { - staleCount--; - } - staleMap.remove(wrappedChild); - observable.removeChangeListener(childListener); - observable.removeStaleListener(childListener); - boolean newStale = staleCount > 0; - if (newStale != oldStale) { - stalenessConsumer.setStale(newStale); - } - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java deleted file mode 100644 index 87ab6eac..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java +++ /dev/null @@ -1,71 +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.core.internal.databinding.observable; - -import org.eclipse.core.databinding.observable.IStaleListener; -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.ObservableList; - -/** - * ObservableList implementation that prevents modification by consumers. Events - * in the originating wrapped list are propagated and thrown from this instance - * when appropriate. All mutators throw an UnsupportedOperationException. - * - * @since 3.2 - */ -/* - * Implementation makes the assumption that the superclass (UnmodifiableList) is - * unmodifiable and that all modify methods throw an - * UnsupportedOperationException. - */ -public class UnmodifiableObservableList extends ObservableList { - /** - * List that is being made unmodifiable. - */ - private final IObservableList wrappedList; - - /** - * @param wrappedList - */ - public UnmodifiableObservableList(IObservableList wrappedList) { - super(wrappedList.getRealm(), wrappedList, wrappedList.getElementType()); - this.wrappedList = wrappedList; - - wrappedList.addListChangeListener(new IListChangeListener() { - public void handleListChange(ListChangeEvent event) { - // Fires a Change and then ListChange event. - fireListChange(event.diff); - } - }); - - wrappedList.addStaleListener(new IStaleListener() { - public void handleStale(StaleEvent event) { - fireStale(); - } - }); - } - - /** - * Because this instance is immutable staleness cannot be changed. - * - */ - public void setStale(boolean stale) { - throw new UnsupportedOperationException(); - } - - public boolean isStale() { - return wrappedList.isStale(); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableList.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableList.java deleted file mode 100755 index 07624b88..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableList.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 - * Brad Reynolds - bug 147515 - *******************************************************************************/ -package org.eclipse.core.internal.databinding.observable.masterdetail; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObserving; -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.ObservableList; -import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; -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.runtime.Assert; - -/** - * @since 3.2 - * - */ - -public class DetailObservableList extends ObservableList implements IObserving { - - private boolean updating = false; - - private IListChangeListener innerChangeListener = new IListChangeListener() { - public void handleListChange(ListChangeEvent event) { - if (!updating) { - fireListChange(event.diff); - } - } - }; - - private Object currentOuterValue; - - private IObservableList innerObservableList; - - private IObservableFactory factory; - - private IObservableValue outerObservableValue; - - private Object detailType; - - /** - * @param factory - * @param outerObservableValue - * @param detailType - */ - public DetailObservableList(IObservableFactory factory, - IObservableValue outerObservableValue, Object detailType) { - super(outerObservableValue.getRealm(), new ArrayList(), detailType); - this.factory = factory; - this.outerObservableValue = outerObservableValue; - this.detailType = detailType; - updateInnerObservableValue(outerObservableValue); - - outerObservableValue.addValueChangeListener(outerChangeListener); - } - - IValueChangeListener outerChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - List oldList = new ArrayList(wrappedList); - updateInnerObservableValue(outerObservableValue); - fireListChange(Diffs.computeListDiff(oldList, wrappedList)); - } - }; - - private void updateInnerObservableValue( - IObservableValue outerObservableValue) { - currentOuterValue = outerObservableValue.getValue(); - if (innerObservableList != null) { - innerObservableList.removeListChangeListener(innerChangeListener); - innerObservableList.dispose(); - } - if (currentOuterValue == null) { - innerObservableList = null; - wrappedList = new ArrayList(); - } else { - this.innerObservableList = (IObservableList) factory - .createObservable(currentOuterValue); - wrappedList = innerObservableList; - - if (detailType != null) { - Object innerValueType = innerObservableList.getElementType(); - Assert.isTrue(getElementType().equals(innerValueType), - "Cannot change value type in a nested observable list"); //$NON-NLS-1$ - } - innerObservableList.addListChangeListener(innerChangeListener); - } - } - - public void dispose() { - super.dispose(); - - if (outerObservableValue != null) { - outerObservableValue.removeValueChangeListener(outerChangeListener); - outerObservableValue.dispose(); - } - if (innerObservableList != null) { - innerObservableList.removeListChangeListener(innerChangeListener); - innerObservableList.dispose(); - } - currentOuterValue = null; - factory = null; - innerObservableList = null; - innerChangeListener = null; - } - - public Object getObserved() { - if (innerObservableList instanceof IObserving) { - return ((IObserving)innerObservableList).getObserved(); - } - return null; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableSet.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableSet.java deleted file mode 100755 index ee002789..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableSet.java +++ /dev/null @@ -1,125 +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.observable.masterdetail; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObserving; -import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; -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.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.runtime.Assert; - -/** - * @since 3.2 - * - */ -public class DetailObservableSet extends ObservableSet implements IObserving { - - private boolean updating = false; - - private ISetChangeListener innerChangeListener = new ISetChangeListener() { - public void handleSetChange(SetChangeEvent event) { - if (!updating) { - fireSetChange(event.diff); - } - } - }; - - private Object currentOuterValue; - - private IObservableSet innerObservableSet; - - private IObservableValue outerObservableValue; - - private IObservableFactory factory; - - /** - * @param factory - * @param outerObservableValue - * @param detailType - */ - public DetailObservableSet(IObservableFactory factory, - IObservableValue outerObservableValue, Object detailType) { - super(outerObservableValue.getRealm(), new HashSet(), detailType); - this.factory = factory; - this.outerObservableValue = outerObservableValue; - updateInnerObservableValue(outerObservableValue); - - outerObservableValue.addValueChangeListener(outerChangeListener); - } - - IValueChangeListener outerChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - Set oldSet = new HashSet(wrappedSet); - updateInnerObservableValue(outerObservableValue); - fireSetChange(Diffs.computeSetDiff(oldSet, wrappedSet)); - } - }; - - private void updateInnerObservableValue( - IObservableValue outerObservableValue) { - currentOuterValue = outerObservableValue.getValue(); - if (innerObservableSet != null) { - innerObservableSet.removeSetChangeListener(innerChangeListener); - innerObservableSet.dispose(); - } - if (currentOuterValue == null) { - innerObservableSet = null; - wrappedSet = new HashSet(); - } else { - this.innerObservableSet = (IObservableSet) factory - .createObservable(currentOuterValue); - wrappedSet = innerObservableSet; - - if (elementType != null) { - Object innerValueType = innerObservableSet.getElementType(); - - Assert.isTrue(elementType.equals(innerValueType), - "Cannot change value type in a nested observable set"); //$NON-NLS-1$ - } - - innerObservableSet.addSetChangeListener(innerChangeListener); - } - } - - public void dispose() { - super.dispose(); - - if (outerObservableValue != null) { - outerObservableValue.removeValueChangeListener(outerChangeListener); - outerObservableValue.dispose(); - } - if (innerObservableSet != null) { - innerObservableSet.removeSetChangeListener(innerChangeListener); - innerObservableSet.dispose(); - } - currentOuterValue = null; - factory = null; - innerObservableSet = null; - innerChangeListener = null; - } - - public Object getObserved() { - if (innerObservableSet instanceof IObserving) { - return ((IObserving)innerObservableSet).getObserved(); - } - return null; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableValue.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableValue.java deleted file mode 100755 index c1b1654d..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableValue.java +++ /dev/null @@ -1,136 +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 147515 - *******************************************************************************/ -package org.eclipse.core.internal.databinding.observable.masterdetail; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObserving; -import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; -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; -import org.eclipse.core.runtime.Assert; - -/** - * @since 1.0 - * - */ -public class DetailObservableValue extends AbstractObservableValue implements IObserving { - - private boolean updating = false; - - private IValueChangeListener innerChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - if (!updating) { - fireValueChange(event.diff); - } - } - }; - - private Object currentOuterValue; - - private IObservableValue innerObservableValue; - - private Object detailType; - - private IObservableValue outerObservableValue; - - private IObservableFactory factory; - - /** - * @param outerObservableValue - * @param factory - * @param detailType - */ - public DetailObservableValue(IObservableValue outerObservableValue, - IObservableFactory factory, Object detailType) { - super(outerObservableValue.getRealm()); - this.factory = factory; - this.detailType = detailType; - this.outerObservableValue = outerObservableValue; - updateInnerObservableValue(outerObservableValue); - - outerObservableValue.addValueChangeListener(outerChangeListener); - } - - IValueChangeListener outerChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - Object oldValue = doGetValue(); - updateInnerObservableValue(outerObservableValue); - fireValueChange(Diffs.createValueDiff(oldValue, doGetValue())); - } - }; - - private void updateInnerObservableValue( - IObservableValue outerObservableValue) { - currentOuterValue = outerObservableValue.getValue(); - if (innerObservableValue != null) { - innerObservableValue.removeValueChangeListener(innerChangeListener); - innerObservableValue.dispose(); - } - if (currentOuterValue == null) { - innerObservableValue = null; - } else { - this.innerObservableValue = (IObservableValue) factory - .createObservable(currentOuterValue); - Object innerValueType = innerObservableValue.getValueType(); - - if (detailType != null) { - Assert - .isTrue( - detailType.equals(innerValueType), - "Cannot change value type in a nested observable value, from " + innerValueType + " to " + detailType); //$NON-NLS-1$ //$NON-NLS-2$ - } - innerObservableValue.addValueChangeListener(innerChangeListener); - } - } - - public void doSetValue(Object value) { - if (innerObservableValue != null) - innerObservableValue.setValue(value); - } - - public Object doGetValue() { - return innerObservableValue == null ? null : innerObservableValue - .getValue(); - } - - public Object getValueType() { - return detailType; - } - - public void dispose() { - super.dispose(); - - if (outerObservableValue != null) { - outerObservableValue.removeValueChangeListener(outerChangeListener); - outerObservableValue.dispose(); - } - if (innerObservableValue != null) { - innerObservableValue.removeValueChangeListener(innerChangeListener); - innerObservableValue.dispose(); - } - currentOuterValue = null; - factory = null; - innerObservableValue = null; - innerChangeListener = null; - } - - public Object getObserved() { - if (innerObservableValue instanceof IObserving) { - return ((IObserving)innerObservableValue).getObserved(); - } - return null; - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.java deleted file mode 100644 index e1226c9d..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.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 164134 - *******************************************************************************/ - -package org.eclipse.core.internal.databinding.observable.tree; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.core.runtime.Status; - -/** - * @since 3.3 - * - */ -public abstract class AbstractObservableTree extends AbstractObservable - implements IObservableTree { - - private boolean stale; - - private ListenerList treeListeners = new ListenerList(ListenerList.IDENTITY); - - /** - * @param realm - */ - public AbstractObservableTree(Realm realm) { - super(realm); - } - - public void addChild(TreePath parentPath, Object childElement) { - throw new UnsupportedOperationException(); - } - - public void addTreeChangeListener(ITreeChangeListener listener) { - treeListeners.add(listener); - } - - public int getChildCount(TreePath parentPath) { - return getChildren(parentPath).length; - } - - public boolean hasChildren(TreePath parentPath) { - return getChildCount(parentPath) > 0; - } - - public void insertChild(TreePath parentPath, int index, Object childElement) { - throw new UnsupportedOperationException(); - } - - public boolean isLazy() { - return false; - } - - public boolean isOrdered() { - return false; - } - - public void removeChild(TreePath parentPath, Object childElement) { - throw new UnsupportedOperationException(); - } - - public void removeChild(TreePath parentPath, int index) { - throw new UnsupportedOperationException(); - } - - public void removeTreeChangeListener(ITreeChangeListener listener) { - treeListeners.remove(listener); - } - - public void setChildCount(TreePath parentPath, int count) { - throw new UnsupportedOperationException(); - } - - public void setChildren(TreePath parentPath, Object[] children) { - throw new UnsupportedOperationException(); - } - - public void updateChildren(IChildrenUpdate update) { - TreePath parent = update.getParent(); - Object[] children = getChildren(parent); - for (int i = 0; i < update.getLength(); i++) { - int targetIndex = update.getOffset() + i; - if (targetIndex < children.length) { - update.setChild(children[targetIndex], targetIndex); - } else { - update - .setStatus(new Status( - IStatus.WARNING, - Policy.JFACE_DATABINDING, - IStatus.OK, - BindingMessages - .getString(BindingMessages.INDEX_OUT_OF_RANGE), - null)); - } - } - update.done(); - } - - public void updateChildrenCount(IChildrenCountUpdate update) { - TreePath[] parents = update.getParents(); - for (int i = 0; i < parents.length; i++) { - update.setChildCount(parents[i], getChildCount(parents[i])); - } - update.done(); - } - - public void updateHasChildren(IHasChildrenUpdate update) { - TreePath[] parents = update.getElements(); - for (int i = 0; i < parents.length; i++) { - update.setHasChilren(parents[i], hasChildren(parents[i])); - } - update.done(); - } - - public boolean isStale() { - return stale; - } - - /** - * @param stale - */ - public void setStale(boolean stale) { - this.stale = stale; - if (stale) { - fireStale(); - } - } - - protected void fireTreeChange(TreeDiff diff) { - // fire general change event first - fireChange(); - - Object[] listeners = treeListeners.getListeners(); - TreeChangeEvent event = new TreeChangeEvent(this, diff); - for (int i = 0; i < listeners.length; i++) { - ((ITreeChangeListener) listeners[i]).handleTreeChange(event); - } - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenCountUpdate.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenCountUpdate.java deleted file mode 100644 index 331176a9..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenCountUpdate.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.core.internal.databinding.observable.tree; - -/** - * Request monitor used to collect the number of children for an element in a lazy - * observable tree. - * - * @since 3.3 - */ -public interface IChildrenCountUpdate extends IViewerUpdate { - - /** - * Returns the parent elements that children counts have been requested for - * as tree paths. An empty path identifies the root element. - * - * @return parent elements as tree paths - */ - public TreePath[] getParents(); - - /** - * Sets the number of children for the given parent. - * - * @param parentPath - * parent element or empty path for root element - * @param numChildren - * number of children - */ - public void setChildCount(TreePath parentPath, int numChildren); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenUpdate.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenUpdate.java deleted file mode 100644 index 8d4b961e..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenUpdate.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.core.internal.databinding.observable.tree; - -/** - * Context sensitive children update request for a parent and subrange of its - * children. - * - * @since 3.3 - */ -public interface IChildrenUpdate extends IViewerUpdate { - - /** - * Returns the parent element that children are being requested for - * as a tree path. An empty path identifies the root element. - * - * @return parent element as a tree path - */ - public TreePath getParent(); - - /** - * Returns the offset at which children have been requested for. This is - * the index of the first child being requested. - * - * @return offset at which children have been requested for - */ - public int getOffset(); - - /** - * Returns the number of children requested. - * - * @return number of children requested - */ - public int getLength(); - - /** - * Sets the child for this request's parent at the given offset. - * - * @param child child - * @param index child offset - * - * TODO: what to do with <code>null</code> - */ - public void setChild(Object child, int index); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IHasChildrenUpdate.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IHasChildrenUpdate.java deleted file mode 100644 index f3eadd65..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IHasChildrenUpdate.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.core.internal.databinding.observable.tree; - -/** - * Context sensitive update request for whether elements have children. - * - * @since 3.3 - */ -public interface IHasChildrenUpdate extends IViewerUpdate { - - /** - * The elements this request is for specified as tree paths. An empty path - * identifies the root element. - * - * @return elements as tree paths - */ - public TreePath[] getElements(); - - /** - * Sets whether the given element has children. - * - * @param element - * tree path to element, or empty for root element - * @param hasChildren - * whether it has children - */ - public void setHasChilren(TreePath element, boolean hasChildren); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IObservableTree.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IObservableTree.java deleted file mode 100644 index a8774528..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IObservableTree.java +++ /dev/null @@ -1,145 +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.internal.databinding.observable.tree; - -import org.eclipse.core.databinding.observable.IObservable; - -/** - * - * A tree whose changes can be tracked by tree change listeners. If the tree is - * ordered ({@link #isOrdered()}), the order of children for a given tree path - * matters, and tree change notifications will always specify indices. If the - * tree is unordered, the children of a tree path are an unordered set and - * indices in change notifications are not specified. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the framework classes that implement this interface. - * Note that direct implementers of this interface outside of the framework will - * be broken in future releases when methods are added to this interface. - * </p> - * - * @since 1.1 - */ -public interface IObservableTree extends IObservable { - - /** - * Element that can be returned from synchronous getters if this observable - * tree is lazy. - */ - public final static Object UNKNOWN_ELEMENT = new Object(); - - /** - * @param listener - */ - public void addTreeChangeListener(ITreeChangeListener listener); - - /** - * @param listener - */ - public void removeTreeChangeListener(ITreeChangeListener listener); - - /** - * Returns whether the order of children for a given parent is important. If - * this tree is ordered, tree change notifications will always specify - * indices. - * - * @return true if the order of children for a given parent is important - */ - public boolean isOrdered(); - - /** - * Returns whether this tree is optimized to fetch subsets of children - * lazily and possibly asynchronously. Implies {@link #isOrdered()}. - * - * @return true if this tree - */ - public boolean isLazy(); - - /** - * @param parentPath - * @return the children at the given parent path - */ - public Object[] getChildren(TreePath parentPath); - - /** - * @param parentPath - * @param children - */ - public void setChildren(TreePath parentPath, Object[] children); - - /** - * @param parentPath - * @param childElement - */ - public void addChild(TreePath parentPath, Object childElement); - - /** - * @param parentPath - * @param childElement - */ - public void removeChild(TreePath parentPath, Object childElement); - - /** - * @param parentPath - * @param index - * @param childElement - */ - public void insertChild(TreePath parentPath, int index, Object childElement); - - /** - * @param parentPath - * @param index - */ - public void removeChild(TreePath parentPath, int index); - - /** - * @param parentPath - * @return <code>true</code> if the element at the given path has children - */ - public boolean hasChildren(TreePath parentPath); - - /** - * @param parentPath - * @return the number of children of the element at the given path - */ - public int getChildCount(TreePath parentPath); - - /** - * @param parentPath - * @param count - */ - public void setChildCount(TreePath parentPath, int count); - - /** - * Updates the number of children for the given parent elements in the - * specified request. - * - * @param update specifies counts to update and stores result - */ - public void updateChildrenCount(IChildrenCountUpdate update); - - /** - * Updates children as requested by the update. - * - * @param update specifies children to update and stores result - */ - public void updateChildren(IChildrenUpdate update); - - /** - * Updates whether elements have children. - * - * @param update specifies elements to update and stores result - */ - public void updateHasChildren(IHasChildrenUpdate update); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IOrderedTreeProvider.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IOrderedTreeProvider.java deleted file mode 100644 index f60d5611..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IOrderedTreeProvider.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.core.internal.databinding.observable.tree; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.list.IObservableList; - -/** - * Objects that implement this interface are capable of describing a tree by - * returning the list of children of any given element in the tree. - * - * @since 3.3 - */ -public interface IOrderedTreeProvider { - /** - * Returns the children of the given element, or null if the element is a - * leaf node. The caller of this method is expected to dispose the result - * list when it is no longer needed. - * - * @param element - * the tree path of the element to query - * @return the children of the given element, or null if the element is a - * leaf node - */ - IObservableList createChildList(TreePath element); - - /** - * @return the realm shared by all child lists - */ - Realm getRealm(); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/ITreeChangeListener.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/ITreeChangeListener.java deleted file mode 100644 index 8fe9f8f5..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/ITreeChangeListener.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.core.internal.databinding.observable.tree; - -/** - * @since 3.3 - * - */ -public interface ITreeChangeListener { - /** - * @param event - */ - void handleTreeChange(TreeChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IUnorderedTreeProvider.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IUnorderedTreeProvider.java deleted file mode 100644 index 81941c80..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IUnorderedTreeProvider.java +++ /dev/null @@ -1,36 +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.internal.databinding.observable.tree; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.set.IObservableSet; - -/** - * @since 1.0 - * - */ -public interface IUnorderedTreeProvider { - /** - * @return the realm for the createChildSet method - */ - public Realm getRealm(); - - /** - * Returns the children of the given element, or null if the element is a leaf node. - * The caller of this method is expected to dispose the result set when it is no - * longer needed. - * - * @param element element to query - * @return the children of the given element, or null if the element is a leaf node - */ - IObservableSet createChildSet(Object element); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IViewerUpdate.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IViewerUpdate.java deleted file mode 100644 index 26cadab4..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/IViewerUpdate.java +++ /dev/null @@ -1,47 +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.internal.databinding.observable.tree; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; - -/** - * A context sensitive viewer update request. - * - * @since 3.3 - */ -public interface IViewerUpdate extends IProgressMonitor { - - /** - * Sets the status of this request, possibly <code>null</code>. - * When a request fails, the status indicates why the request failed. - * A <code>null</code> status is considered to be successful. - * - * @param status request status - */ - public void setStatus(IStatus status); - - /** - * Returns the status of this request, or <code>null</code>. - * - * @return request status or <code>null</code> - */ - public IStatus getStatus(); - - /** - * Returns the model element corresponding to the given tree path. - * Returns the root element for the empty path. - * - * @param path viewer tree path - * @return corresponding model element - */ - public Object getElement(TreePath path); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeChangeEvent.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeChangeEvent.java deleted file mode 100644 index b5051d5e..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeChangeEvent.java +++ /dev/null @@ -1,47 +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.internal.databinding.observable.tree; - -import java.util.EventObject; - -/** - * @since 3.3 - * - */ -public class TreeChangeEvent extends EventObject { - - /** - * - */ - private static final long serialVersionUID = -3198503763995528027L; - /** - * - */ - public TreeDiff diff; - - /** - * @param source - * @param diff - */ - public TreeChangeEvent(IObservableTree source, TreeDiff diff) { - super(source); - this.diff = diff; - } - - /** - * @return the observable tree from which this event originated - */ - public IObservableTree getObservable() { - return (IObservableTree) getSource(); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiff.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiff.java deleted file mode 100644 index 7c419ea5..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiff.java +++ /dev/null @@ -1,39 +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.internal.databinding.observable.tree; - -/** - * Describes the difference between two trees as a tree of tree diff nodes. - * - * @since 1.1 - * - */ -public abstract class TreeDiff extends TreeDiffNode { - - /** - * Returns the tree path (possibly empty) of the parent, or - * <code>null</code> if the underlying tree is not lazy and never contains - * duplicate elements. - * - * @return the tree path (possibly empty) of the unchanged parent, or - * <code>null</code> - */ - public abstract TreePath getParentPath(); - - /** - * @param visitor - */ - public void accept(TreeDiffVisitor visitor) { - doAccept(visitor, getParentPath()); - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffNode.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffNode.java deleted file mode 100644 index a8b8b8d9..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffNode.java +++ /dev/null @@ -1,91 +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.internal.databinding.observable.tree; - -/** - * @since 1.1 - * - */ -public abstract class TreeDiffNode { - - /** - * - */ - public final static int NO_CHANGE = 0x00; - - /** - * - */ - public final static int ADDED = 0x01; - - /** - * - */ - public final static int REMOVED = 0x02; - - /** - * - */ - public final static int REPLACED = 0x03; - - /** - * - */ - public static final TreeDiffNode[] NO_CHILDREN = new TreeDiffNode[0]; - - /** - * - */ - public static final int INDEX_UNKNOWN = -1; - - /** - * @return the change type - */ - public abstract int getChangeType(); - - /** - * @return the element that was removed, or the replaced element - */ - public abstract Object getOldElement(); - - /** - * @return the element that was not changed, added, or the replacement - * element - */ - public abstract Object getNewElement(); - - /** - * @return the index at which the element was added, removed, or replaced - */ - public abstract int getIndex(); - - /** - * Returns the child tree diff objects that describe changes to children. If - * the change type is REMOVED, there will be no children. - * - * @return the nodes representing changes to children - */ - public abstract TreeDiffNode[] getChildren(); - - protected void doAccept(TreeDiffVisitor visitor, TreePath parentPath) { - TreePath currentPath = parentPath.createChildPath(getNewElement()); - boolean recurse = visitor.visit(this, currentPath); - if (recurse) { - TreeDiffNode[] children = getChildren(); - for (int i = 0; i < children.length; i++) { - TreeDiffNode child = children[i]; - child.doAccept(visitor, currentPath); - } - } - } - -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffVisitor.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffVisitor.java deleted file mode 100644 index 837464dc..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffVisitor.java +++ /dev/null @@ -1,33 +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.internal.databinding.observable.tree; - -/** - * @since 3.3 - * - */ -public abstract class TreeDiffVisitor { - - /** - * Visits the given tree diff. - * - * @param diff - * the diff to visit - * @param currentPath - * the current path (the diff's element is the last segment of - * the path) - * - * @return <code>true</code> if the tree diff's children should be - * visited; <code>false</code> if they should be skipped. - */ - public abstract boolean visit(TreeDiffNode diff, TreePath currentPath); -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.java b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.java deleted file mode 100644 index 632b0137..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.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.core.internal.databinding.observable.tree; - -import org.eclipse.core.runtime.Assert; - -/** - * A tree path denotes a model element in a tree viewer. Tree path objects have - * value semantics. A model element is represented by a path of elements in the - * tree from the root element to the leaf element. - * <p> - * Clients may instantiate this class. Not intended to be subclassed. - * </p> - * - * @since 3.2 - */ -public final class TreePath { - - /** - * Constant for representing an empty tree path. - */ - public static final TreePath EMPTY = new TreePath(new Object[0]); - - private Object[] segments; - - private int hash; - - /** - * Constructs a path identifying a leaf node in a tree. - * - * @param segments - * path of elements to a leaf node in a tree, starting with the - * root element - */ - public TreePath(Object[] segments) { - Assert.isNotNull(segments); - for (int i = 0; i < segments.length; i++) { - Assert.isNotNull(segments[i]); - } - this.segments = segments; - } - - /** - * Returns the element at the specified index in this path. - * - * @param index - * index of element to return - * @return element at the specified index - */ - public Object getSegment(int index) { - return segments[index]; - } - - /** - * Returns the number of elements in this path. - * - * @return the number of elements in this path - */ - public int getSegmentCount() { - return segments.length; - } - - /** - * Returns the first element in this path. - * - * @return the first element in this path - */ - public Object getFirstSegment() { - if (segments.length == 0) { - return null; - } - return segments[0]; - } - - /** - * Returns the last element in this path. - * - * @return the last element in this path - */ - public Object getLastSegment() { - if (segments.length == 0) { - return null; - } - return segments[segments.length - 1]; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - if (!(other instanceof TreePath)) { - return false; - } - TreePath otherPath = (TreePath) other; - if (segments.length != otherPath.segments.length) { - return false; - } - for (int i = 0; i < segments.length; i++) { - if (!segments[i].equals(otherPath.segments[i])) { - return false; - } - } - return true; - } - - public int hashCode() { - if (hash == 0) { - for (int i = 0; i < segments.length; i++) { - hash += segments[i].hashCode(); - } - } - return hash; - } - - /** - * Returns whether this path starts with the same segments as the given - * path, using the given comparer to compare segments. - * - * @param treePath - * path to compare to - * @return whether the given path is a prefix of this path, or the same as - * this path - */ - public boolean startsWith(TreePath treePath) { - int thisSegmentCount = getSegmentCount(); - int otherSegmentCount = treePath.getSegmentCount(); - if (otherSegmentCount == thisSegmentCount) { - return equals(treePath); - } - if (otherSegmentCount > thisSegmentCount) { - return false; - } - for (int i = 0; i < otherSegmentCount; i++) { - Object otherSegment = treePath.getSegment(i); - if (!otherSegment.equals(segments[i])) { - return false; - } - } - return true; - } - - /** - * Returns a copy of this tree path with one segment removed from the end, - * or <code>null</code> if this tree path has no segments. - * @return a tree path - */ - public TreePath getParentPath() { - int segmentCount = getSegmentCount(); - if (segmentCount <= 1) { - return null; - } - Object[] parentSegments = new Object[segmentCount - 1]; - System.arraycopy(segments, 0, parentSegments, 0, segmentCount - 1); - return new TreePath(parentSegments); - } - - /** - * Returns a copy of this tree path with the given segment added at the end. - * @param newSegment - * @return a tree path - */ - public TreePath createChildPath(Object newSegment) { - int segmentCount = getSegmentCount(); - Object[] childSegments = new Object[segmentCount + 1]; - if(segmentCount>0) { - System.arraycopy(segments, 0, childSegments, 0, segmentCount); - } - childSegments[segmentCount] = newSegment; - return new TreePath(childSegments); - } -} diff --git a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/package.html b/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/package.html deleted file mode 100644 index d720e2b4..00000000 --- a/bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/tree/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/.classpath b/bundles/org.eclipse.core.databinding/.classpath deleted file mode 100644 index ce739334..00000000 --- a/bundles/org.eclipse.core.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/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/.cvsignore b/bundles/org.eclipse.core.databinding/.cvsignore deleted file mode 100644 index ba077a40..00000000 --- a/bundles/org.eclipse.core.databinding/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/bundles/org.eclipse.core.databinding/.project b/bundles/org.eclipse.core.databinding/.project deleted file mode 100644 index 20fa52a7..00000000 --- a/bundles/org.eclipse.core.databinding/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.core.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.core.databinding/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.core.databinding/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f1b4e192..00000000 --- a/bundles/org.eclipse.core.databinding/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,71 +0,0 @@ -#Thu Feb 01 22:16:54 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/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.core.databinding/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 59509e09..00000000 --- a/bundles/org.eclipse.core.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.core.databinding/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.core.databinding/.settings/org.eclipse.pde.prefs deleted file mode 100644 index fee4b048..00000000 --- a/bundles/org.eclipse.core.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.core.databinding/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF deleted file mode 100644 index 5d09dda3..00000000 --- a/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF +++ /dev/null @@ -1,31 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.core.databinding -Bundle-Version: 1.1.0.qualifier -Bundle-ClassPath: . -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Export-Package: org.eclipse.core.databinding, - org.eclipse.core.databinding.conversion;x-internal:=false, - org.eclipse.core.databinding.observable, - org.eclipse.core.databinding.observable.list;x-internal:=false, - org.eclipse.core.databinding.observable.map, - org.eclipse.core.databinding.observable.masterdetail, - org.eclipse.core.databinding.observable.set;x-internal:=false, - org.eclipse.core.databinding.observable.value;x-internal:=false, - org.eclipse.core.databinding.util, - org.eclipse.core.databinding.validation;x-internal:=false, - org.eclipse.core.internal.databinding;x-friends:="org.eclipse.core.databinding.beans", - org.eclipse.core.internal.databinding.conversion;x-friends:="org.eclipse.jface.tests.databinding", - org.eclipse.core.internal.databinding.observable;x-internal:=true, - org.eclipse.core.internal.databinding.observable.masterdetail;x-friends:="org.eclipse.jface.tests.databinding", - org.eclipse.core.internal.databinding.observable.tree;x-friends:="org.eclipse.jface.databinding,org.eclipse.jface.tests.databinding", - org.eclipse.core.internal.databinding.validation;x-friends:="org.eclipse.jface.tests.databinding" -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)";resolution:=optional, - org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)";resolution:=optional -Import-Package: com.ibm.icu.text -Bundle-RequiredExecutionEnvironment: J2SE-1.4, - CDC-1.0/Foundation-1.0 -Bundle-Activator: org.eclipse.core.internal.databinding.Activator -Eclipse-LazyStart: true diff --git a/bundles/org.eclipse.core.databinding/about.html b/bundles/org.eclipse.core.databinding/about.html deleted file mode 100644 index 46023304..00000000 --- a/bundles/org.eclipse.core.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.core.databinding/build.properties b/bundles/org.eclipse.core.databinding/build.properties deleted file mode 100644 index 67499e3d..00000000 --- a/bundles/org.eclipse.core.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.databinding.jar = bin/ -src.includes = about.html -source.. = src/ diff --git a/bundles/org.eclipse.core.databinding/component.xml b/bundles/org.eclipse.core.databinding/component.xml deleted file mode 100644 index 82e5e40a..00000000 --- a/bundles/org.eclipse.core.databinding/component.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<component xmlns="http://eclipse.org/component" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://eclipse.org/component ../component.xsd " - name="JFace Data Binding"> - <plugin id="org.eclipse.core.databinding" /> - - <package name="org.eclipse.jface.internal.provisional.databinding" > - <type name="BindingException" subclass="false"/> - <type name="BindSpec"/> - <type name="ChangeEvent" subclass="false"/> - <type name="ConditionalUpdatableValue"/> - <type name="Converter"/> - <type name="DataBinding" subclass="false"/> - <type name="DefaultCellModifier" subclass="false"/> - <type name="IBindSpec" implement="false"/> - <type name="IBindSupportFactory"/> - <type name="IChangeEvent" implement="false"/> - <type name="IChangeListener"/> - <type name="IConverter"/> - <type name="IDataBindingContext" implement="false"/> - <type name="IdentityConverter" subclass="false"/> - <type name="IUpdatable" implement="false"/> - <type name="IUpdatableCollection"/> - <type name="IUpdatableFactory"/> - <type name="IUpdatableValue"/> - <type name="IValidationContext" implement="false"/> - <type name="IValidator"/> - <type name="PropertyDescription" subclass="false"/> - <type name="SettableValue"/> - <type name="TableViewerDescription" subclass="false"/> - <type name="Updatable"/> - <type name="UpdatableValue"/> - </package> - - <component-depends unrestricted="true"/> - -</component> diff --git a/bundles/org.eclipse.core.databinding/plugin.properties b/bundles/org.eclipse.core.databinding/plugin.properties deleted file mode 100644 index e18f3957..00000000 --- a/bundles/org.eclipse.core.databinding/plugin.properties +++ /dev/null @@ -1,12 +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 -############################################################################### -pluginName = JFace Data Binding -providerName = Eclipse.org diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/AggregateValidationStatus.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/AggregateValidationStatus.java deleted file mode 100644 index 92592094..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/AggregateValidationStatus.java +++ /dev/null @@ -1,226 +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 182822 - *******************************************************************************/ -package org.eclipse.core.databinding; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.databinding.observable.IChangeListener; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.IStaleListener; -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.IValueChangeListener; -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; - -/** - * This class can be used to aggregate status values from a data binding context - * into a single status value. Instances of this class can be used as an - * observable value with a value type of {@link IStatus}, or the static methods - * can be called directly if an aggregated status result is only needed once. - * - * @since 1.0 - * - */ -public final class AggregateValidationStatus implements IObservableValue { - - private IObservableValue implementation; - - /** - * Constant denoting an aggregation strategy that merges multiple non-OK - * status objects in a {@link MultiStatus}. Returns an OK status result if - * all statuses from the given bindings are the an OK status. Returns a - * single status if there is only one non-OK status. - * - * @see #getStatusMerged(Collection) - */ - public static final int MERGED = 1; - - /** - * Constant denoting an aggregation strategy that always returns the most - * severe status from the given bindings. If there is more than one status - * at the same severity level, it picks the first one it encounters. - * - * @see #getStatusMaxSeverity(Collection) - */ - public static final int MAX_SEVERITY = 2; - - /** - * @param bindings - * an observable collection containing elements of type IStatus - * @param strategy - * a strategy constant, one of {@link #MERGED} or - * {@link #MAX_SEVERITY}. - */ - public AggregateValidationStatus(final IObservableCollection bindings, - int strategy) { - this(Realm.getDefault(), bindings, strategy); - } - - /** - * @param realm - * Realm - * @param bindings - * an observable collection containing elements of type IStatus - * @param strategy - * a strategy constant, one of {@link #MERGED} or - * {@link #MAX_SEVERITY}. - */ - public AggregateValidationStatus(final Realm realm, final IObservableCollection bindings, - int strategy) { - if (strategy == MERGED) { - implementation = new ComputedValue(realm, IStatus.class) { - protected Object calculate() { - return getStatusMerged(bindings); - } - }; - } else { - implementation = new ComputedValue(realm, IStatus.class) { - protected Object calculate() { - return getStatusMaxSeverity(bindings); - } - }; - } - } - - /** - * @param listener - * @see org.eclipse.core.databinding.observable.IObservable#addChangeListener(org.eclipse.core.databinding.observable.IChangeListener) - */ - public void addChangeListener(IChangeListener listener) { - implementation.addChangeListener(listener); - } - - /** - * @param listener - * @see org.eclipse.core.databinding.observable.IObservable#addStaleListener(org.eclipse.core.databinding.observable.IStaleListener) - */ - public void addStaleListener(IStaleListener listener) { - implementation.addStaleListener(listener); - } - - /** - * @param listener - * @see org.eclipse.core.databinding.observable.value.IObservableValue#addValueChangeListener(org.eclipse.core.databinding.observable.value.IValueChangeListener) - */ - public void addValueChangeListener(IValueChangeListener listener) { - implementation.addValueChangeListener(listener); - } - - public void dispose() { - implementation.dispose(); - } - - public Realm getRealm() { - return implementation.getRealm(); - } - - public Object getValue() { - return implementation.getValue(); - } - - public Object getValueType() { - return implementation.getValueType(); - } - - public boolean isStale() { - return implementation.isStale(); - } - - public void removeChangeListener(IChangeListener listener) { - implementation.removeChangeListener(listener); - } - - public void removeStaleListener(IStaleListener listener) { - implementation.removeStaleListener(listener); - } - - public void removeValueChangeListener(IValueChangeListener listener) { - implementation.removeValueChangeListener(listener); - } - - public void setValue(Object value) { - implementation.setValue(value); - } - - /** - * Returns a status object that merges multiple non-OK status objects in a - * {@link MultiStatus}. Returns an OK status result if all statuses from - * the given bindings are the an OK status. Returns a single status if there - * is only one non-OK status. - * - * @param bindings - * a collection of bindings - * @return a merged status - */ - public static IStatus getStatusMerged(Collection bindings) { - List statuses = new ArrayList(); - for (Iterator it = bindings.iterator(); it.hasNext();) { - Binding binding = (Binding) it.next(); - IStatus status = (IStatus) binding - .getValidationStatus().getValue(); - if (!status.isOK()) { - statuses.add(status); - } - } - if (statuses.size() == 1) { - return (IStatus) statuses.get(0); - } - if (!statuses.isEmpty()) { - MultiStatus result = new MultiStatus( - Policy.JFACE_DATABINDING, - 0, - BindingMessages - .getString(BindingMessages.MULTIPLE_PROBLEMS), - null); - for (Iterator it = statuses.iterator(); it.hasNext();) { - IStatus status = (IStatus) it.next(); - result.merge(status); - } - return result; - } - return Status.OK_STATUS; - } - - /** - * Returns a status that always returns the most severe status from the - * given bindings. If there is more than one status at the same severity - * level, it picks the first one it encounters. - * - * @param bindings - * a collection of bindings - * @return a single status reflecting the most severe status from the given - * bindings - */ - public static IStatus getStatusMaxSeverity(Collection bindings) { - int maxSeverity = IStatus.OK; - IStatus maxStatus = Status.OK_STATUS; - for (Iterator it = bindings.iterator(); it.hasNext();) { - Binding binding = (Binding) it.next(); - IStatus status = (IStatus) binding - .getValidationStatus().getValue(); - if (status.getSeverity() > maxSeverity) { - maxSeverity = status.getSeverity(); - maxStatus = status; - } - } - return maxStatus; - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/Binding.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/Binding.java deleted file mode 100644 index 0bc7b4ff..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/Binding.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 159768 - *******************************************************************************/ - -package org.eclipse.core.databinding; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.value.IObservableValue; - -/** - * This abstract class represents a binding between a model and a target. Newly - * created instances need to be added to a data binding context using - * {@link #init(DataBindingContext)}. - * - * @since 1.0 - */ -public abstract class Binding { - - protected DataBindingContext context; - private IObservable target; - private IObservable model; - - /** - * Creates a new binding. - * - * @param target target observable - * @param model model observable - */ - public Binding(IObservable target, IObservable model) { - this.target = target; - this.model = model; - } - - /** - * Initializes this binding with the given context and adds it to the list - * of bindings of the context. - * <p> - * Subclasses may extend, but must call the super implementation. - * </p> - * - * @param context - */ - public final void init(DataBindingContext context) { - this.context = context; - preInit(); - context.addBinding(this); - postInit(); - } - - /** - * Called by {@link #init(DataBindingContext)} after setting - * {@link #context} but before adding this binding to the context. - * Subclasses may use this method to perform initialization that could not - * be done in the constructor. Care should be taken not to cause any events - * while running this method. - */ - protected abstract void preInit(); - - /** - * Called by {@link #init(DataBindingContext)} after adding this binding to - * the context. Subclasses may use this method to perform initialization - * that may cause events to be fired, including BindingEvents that are - * forwarded to the data binding context. - */ - protected abstract void postInit(); - - /** - * @return an observable value containing the current validation status - */ - public abstract IObservableValue getValidationStatus(); - - /** - * Updates the model's state from the target's state at the next reasonable - * opportunity. There is no guarantee that the state will have been updated - * by the time this call returns. - */ - public abstract void updateTargetToModel(); - - /** - * Updates the target's state from the model's state at the next reasonable - * opportunity. There is no guarantee that the state will have been updated - * by the time this call returns. - */ - public abstract void updateModelToTarget(); - - /** - * Validates the target's state at the next reasonable - * opportunity. There is no guarantee that the validation status will have been updated - * by the time this call returns. - */ - public abstract void validateTargetToModel(); - - /** - * Validates the model's state at the next reasonable - * opportunity. There is no guarantee that the validation status will have been updated - * by the time this call returns. - */ - public abstract void validateModelToTarget(); - - /** - * Disposes of this Binding. Subclasses may extend, but must call super.dispose(). - */ - public void dispose() { - if (context != null) { - context.removeBinding(this); - } - context = null; - target = null; - model = null; - disposed = true; - } - - protected boolean disposed = false; - - /** - * @return true if the binding has been disposed. false otherwise. - */ - public boolean isDisposed() { - return disposed; - } - - /** - * @param context - */ - /* package */ void setDataBindingContext(DataBindingContext context) { - this.context = context; - } - - /** - * @return target observable - */ - public IObservable getTarget() { - return target; - } - - /** - * @return model observable - */ - public IObservable getModel() { - return model; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/BindingException.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/BindingException.java deleted file mode 100644 index ebe86240..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/BindingException.java +++ /dev/null @@ -1,64 +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.databinding; - -import java.io.PrintStream; -import java.io.PrintWriter; - -/** - * An unchecked exception indicating a binding problem. - * - * @since 1.0 - */ -public class BindingException extends RuntimeException { - - /* - * Needed because all Throwables are Serializable. - */ - private static final long serialVersionUID = -4092828452936724217L; - private Throwable cause; - - /** - * Creates a new BindingException with the given message. - * - * @param message - */ - public BindingException(String message) { - super(message); - } - - /** - * Creates a new BindingException with the given message and cause. - * - * @param message - * @param cause - */ - public BindingException(String message, Throwable cause) { - super(message); - this.cause = cause; - } - - public void printStackTrace(PrintStream err) { - super.printStackTrace(err); - if (cause != null) { - err.println("caused by:"); //$NON-NLS-1$ - cause.printStackTrace(err); - } - } - - public void printStackTrace(PrintWriter err) { - super.printStackTrace(err); - if (cause != null) { - err.println("caused by:"); //$NON-NLS-1$ - cause.printStackTrace(err); - } - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/DataBindingContext.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/DataBindingContext.java deleted file mode 100644 index d92e193c..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/DataBindingContext.java +++ /dev/null @@ -1,307 +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.core.databinding; - -import java.util.Iterator; - -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.list.WritableList; -import org.eclipse.core.databinding.observable.map.IObservableMap; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.core.internal.databinding.ValidationStatusMap; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.IStatus; - -/** - * A DataBindingContext is the point of contact for the creation and management of - * {@link Binding bindings}. - * <p> - * A DataBindingContext provides the following abilities: - * <ul> - * <li>Ability to create bindings between - * {@link IObservableValue observable values}.</li> - * <li>Ability to create bindings between - * {@link IObservableList observable lists}.</li> - * <li>Access to the bindings created by the instance.</li> - * <li>Access to the validation status of its bindings.</li> - * </ul> - * </p> - * <p> - * Multiple contexts can be used at any point in time. One strategy for the - * management of contexts is the aggregation of validation statuses. For example - * an <code>IWizardPage</code> could use a single context and the statuses - * could be aggregated to set the page status and fulfillment. Each page in the - * <code>IWizard</code> would have its own context instance. - * </p> - * - * @since 1.0 - */ -public class DataBindingContext { - private WritableList bindings; - - /** - * Unmodifiable version of {@link #bindings} for public exposure. - */ - private IObservableList unmodifiableBindings; - - private IObservableMap validationStatusMap; - - private Realm validationRealm; - - /** - * Creates a data binding context, using the current default realm for the - * validation observables. - * - * @see Realm - */ - public DataBindingContext() { - this(Realm.getDefault()); - } - - /** - * Creates a data binding context using the given realm for the validation - * observables. - * - * @param validationRealm - * the realm to be used for the validation observables - * - * @see Realm - */ - public DataBindingContext(Realm validationRealm) { - Assert.isNotNull(validationRealm); - this.validationRealm = validationRealm; - bindings = new WritableList(validationRealm); - - unmodifiableBindings = Observables.unmodifiableObservableList(bindings); - validationStatusMap = new ValidationStatusMap(validationRealm, - bindings); - } - - /** - * Creates a {@link Binding} to synchronize the values of two - * {@link IObservableValue observable values}. During synchronization - * validation and conversion can be employed to customize the process. For - * specifics on the customization of the process see - * {@link UpdateValueStrategy}. - * - * @param targetObservableValue - * target value, commonly a UI widget - * @param modelObservableValue - * model value - * @param targetToModel - * strategy to employ when the target is the source of the change - * and the model is the destination - * @param modelToTarget - * strategy to employ when the model is the source of the change - * and the target is the destination - * @return created binding - * - * @see UpdateValueStrategy - */ - public final Binding bindValue(IObservableValue targetObservableValue, - IObservableValue modelObservableValue, - UpdateValueStrategy targetToModel, UpdateValueStrategy modelToTarget) { - UpdateValueStrategy targetToModelStrategy = targetToModel != null ? targetToModel - : createTargetToModelUpdateValueStrategy(targetObservableValue, modelObservableValue); - UpdateValueStrategy modelToTargetStrategy = modelToTarget != null ? modelToTarget - : createModelToTargetUpdateValueStrategy(modelObservableValue, targetObservableValue); - targetToModelStrategy.fillDefaults(targetObservableValue, modelObservableValue); - modelToTargetStrategy.fillDefaults(modelObservableValue, targetObservableValue); - ValueBinding result = new ValueBinding(targetObservableValue, - modelObservableValue, targetToModelStrategy, - modelToTargetStrategy); - result.init(this); - return result; - } - - /** - * Returns an update value strategy to be used for copying values from the - * from value to the to value. Clients may override. - * - * @param fromValue - * @param toValue - * @return a update value strategy - */ - protected UpdateValueStrategy createModelToTargetUpdateValueStrategy( - IObservableValue fromValue, IObservableValue toValue) { - return new UpdateValueStrategy(); - } - - /** - * Returns an update value strategy to be used for copying values from the - * from value to the to value. Clients may override. - * - * @param fromValue - * @param toValue - * @return a update value strategy - */ - protected UpdateValueStrategy createTargetToModelUpdateValueStrategy( - IObservableValue fromValue, IObservableValue toValue) { - return new UpdateValueStrategy(); - } - - /** - * Creates a {@link Binding} to synchronize the values of two - * {@link IObservableList observable lists}. During synchronization - * validation and conversion can be employed to customize the process. For - * specifics on the customization of the process see - * {@link UpdateListStrategy}. - * - * @param targetObservableList - * target list, commonly a list representing a list in the UI - * @param modelObservableList - * model list - * @param targetToModel - * strategy to employ when the target is the source of the change - * and the model is the destination - * @param modelToTarget - * strategy to employ when the model is the source of the change - * and the target is the destination - * @return created binding - * - * @see UpdateListStrategy - */ - public final Binding bindList(IObservableList targetObservableList, - IObservableList modelObservableList, - UpdateListStrategy targetToModel, UpdateListStrategy modelToTarget) { - UpdateListStrategy targetToModelStrategy = targetToModel != null ? targetToModel - : createTargetToModelUpdateListStrategy(targetObservableList, - modelObservableList); - UpdateListStrategy modelToTargetStrategy = modelToTarget != null ? modelToTarget - : createModelToTargetUpdateListStrategy(modelObservableList, - targetObservableList); - targetToModelStrategy.fillDefaults(targetObservableList, - modelObservableList); - modelToTargetStrategy.fillDefaults(modelObservableList, - targetObservableList); - ListBinding result = new ListBinding(targetObservableList, - modelObservableList, targetToModelStrategy, - modelToTargetStrategy); - result.init(this); - return result; - } - - /** - * @param modelObservableList - * @param targetObservableList - * @return an update list strategy - */ - protected UpdateListStrategy createModelToTargetUpdateListStrategy( - IObservableList modelObservableList, - IObservableList targetObservableList) { - return new UpdateListStrategy(); - } - - /** - * @param targetObservableList - * @param modelObservableList - * @return an update list strategy - */ - protected UpdateListStrategy createTargetToModelUpdateListStrategy( - IObservableList targetObservableList, - IObservableList modelObservableList) { - return new UpdateListStrategy(); - } - - /** - * Disposes of this data binding context and all bindings that were added to - * this context. - */ - public final void dispose() { - Binding[] bindingArray = (Binding[]) bindings.toArray(new Binding[bindings.size()]); - for (int i = 0; i < bindingArray.length; i++) { - bindingArray[i].dispose(); - } - } - - /** - * Returns an unmodifiable observable list with elements of type - * {@link Binding}, ordered by time of addition. - * - * @return the observable list containing all bindings - */ - public final IObservableList getBindings() { - return unmodifiableBindings; - } - - /** - * Returns an observable map from bindings (type: {@link Binding}) to - * statuses (type: {@link IStatus}). The keys of the map are the bindings - * returned by {@link #getBindings()}, and the values are the current - * validaion status objects for each binding. - * - * @return the observable map from bindings to status objects. - */ - public final IObservableMap getValidationStatusMap() { - return validationStatusMap; - } - - /** - * Adds the given binding to this data binding context. - * - * @param binding - * The binding to add. - */ - public void addBinding(Binding binding) { - bindings.add(binding); - } - - /** - * Updates all model observable objects to reflect the current state of the - * target observable objects. - * - */ - public final void updateModels() { - for (Iterator it = bindings.iterator(); it.hasNext();) { - Binding binding = (Binding) it.next(); - binding.updateTargetToModel(); - } - } - - /** - * Updates all target observable objects to reflect the current state of the - * model observable objects. - * - */ - public final void updateTargets() { - for (Iterator it = bindings.iterator(); it.hasNext();) { - Binding binding = (Binding) it.next(); - binding.updateModelToTarget(); - } - } - - /** - * Removes the given binding. - * - * @param binding - * @return <code>true</code> if was associated with the context, - * <code>false</code> if not - */ - public boolean removeBinding(Binding binding) { - return bindings.remove(binding); - } - - /** - * Returns the validation realm. - * - * @return the realm for the validation observables - * @see Realm - */ - public final Realm getValidationRealm() { - return validationRealm; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ListBinding.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ListBinding.java deleted file mode 100644 index 459c5248..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ListBinding.java +++ /dev/null @@ -1,222 +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.databinding; - -import java.util.Collections; - -import org.eclipse.core.databinding.observable.Diffs; -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.value.IObservableValue; -import org.eclipse.core.databinding.observable.value.WritableValue; -import org.eclipse.core.internal.databinding.BindingStatus; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; - -/** - * @since 1.0 - * - */ -public class ListBinding extends Binding { - - private UpdateListStrategy targetToModel; - private UpdateListStrategy modelToTarget; - private IObservableValue validationStatusObservable; - private boolean updatingTarget; - private boolean updatingModel; - - private IListChangeListener targetChangeListener = new IListChangeListener() { - public void handleListChange(ListChangeEvent event) { - if (!updatingTarget) { - doUpdate((IObservableList) getTarget(), - (IObservableList) getModel(), event.diff, - targetToModel, false, false); - } - } - }; - private IListChangeListener modelChangeListener = new IListChangeListener() { - public void handleListChange(ListChangeEvent event) { - if (!updatingModel) { - doUpdate((IObservableList) getModel(), - (IObservableList) getTarget(), event.diff, - modelToTarget, false, false); - } - } - }; - - /** - * @param target - * @param model - * @param modelToTargetStrategy - * @param targetToModelStrategy - */ - public ListBinding(IObservableList target, IObservableList model, - UpdateListStrategy targetToModelStrategy, - UpdateListStrategy modelToTargetStrategy) { - super(target, model); - this.targetToModel = targetToModelStrategy; - this.modelToTarget = modelToTargetStrategy; - if ((targetToModel.getUpdatePolicy() & UpdateValueStrategy.POLICY_UPDATE) != 0) { - target.addListChangeListener(targetChangeListener); - } else { - targetChangeListener = null; - } - if ((modelToTarget.getUpdatePolicy() & UpdateValueStrategy.POLICY_UPDATE) != 0) { - model.addListChangeListener(modelChangeListener); - } else { - modelChangeListener = null; - } - } - - public IObservableValue getValidationStatus() { - return validationStatusObservable; - } - - protected void preInit() { - validationStatusObservable = new WritableValue(context - .getValidationRealm(), Status.OK_STATUS, IStatus.class); - } - - protected void postInit() { - if (modelToTarget.getUpdatePolicy() == UpdateListStrategy.POLICY_UPDATE) { - updateModelToTarget(); - } - if (targetToModel.getUpdatePolicy() != UpdateListStrategy.POLICY_NEVER) { - validateTargetToModel(); - } - } - - public void updateModelToTarget() { - final IObservableList modelList = (IObservableList) getModel(); - modelList.getRealm().exec(new Runnable() { - public void run() { - ListDiff diff = Diffs.computeListDiff(Collections.EMPTY_LIST, - modelList); - doUpdate(modelList, (IObservableList) getTarget(), diff, - modelToTarget, true, true); - } - }); - } - - public void updateTargetToModel() { - final IObservableList targetList = (IObservableList) getTarget(); - targetList.getRealm().exec(new Runnable() { - public void run() { - ListDiff diff = Diffs.computeListDiff(Collections.EMPTY_LIST, - targetList); - doUpdate(targetList, (IObservableList) getModel(), diff, - targetToModel, true, true); - } - }); - } - - public void validateModelToTarget() { - // nothing for now - } - - public void validateTargetToModel() { - // nothing for now - } - - /* - * This method may be moved to UpdateListStrategy in the future if clients - * need more control over how the two lists are kept in sync. - */ - private void doUpdate(final IObservableList source, - final IObservableList destination, final ListDiff diff, - final UpdateListStrategy updateListStrategy, - final boolean explicit, final boolean clearDestination) { - final int policy = updateListStrategy.getUpdatePolicy(); - if (policy != UpdateListStrategy.POLICY_NEVER) { - if (policy != UpdateListStrategy.POLICY_ON_REQUEST || explicit) { - destination.getRealm().exec(new Runnable() { - public void run() { - if (destination == getTarget()) { - updatingTarget = true; - } else { - updatingModel = true; - } - MultiStatus multiStatus = BindingStatus.ok(); - - try { - if (clearDestination) { - destination.clear(); - } - ListDiffEntry[] diffEntries = diff.getDifferences(); - for (int i = 0; i < diffEntries.length; i++) { - ListDiffEntry listDiffEntry = diffEntries[i]; - if (listDiffEntry.isAddition()) { - IStatus setterStatus = updateListStrategy - .doAdd( - destination, - updateListStrategy - .convert(listDiffEntry - .getElement()), - listDiffEntry.getPosition()); - - mergeStatus(multiStatus, setterStatus); - // TODO - at this point, the two lists - // will be out of sync if an error occurred... - } else { - IStatus setterStatus = updateListStrategy - .doRemove(destination, - listDiffEntry.getPosition()); - - mergeStatus(multiStatus, setterStatus); - // TODO - at this point, the two lists - // will be out of sync if an error occurred... - } - } - } finally { - validationStatusObservable.setValue(multiStatus); - - if (destination == getTarget()) { - updatingTarget = false; - } else { - updatingModel = false; - } - } - } - }); - } - } - } - - /** - * Merges the provided <code>newStatus</code> into the - * <code>multiStatus</code>. - * - * @param multiStatus - * @param newStatus - */ - /* package */void mergeStatus(MultiStatus multiStatus, IStatus newStatus) { - if (!newStatus.isOK()) { - multiStatus.add(newStatus); - } - } - - public void dispose() { - if (targetChangeListener != null) { - ((IObservableList)getTarget()).removeListChangeListener(targetChangeListener); - targetChangeListener = null; - } - if (modelChangeListener != null) { - ((IObservableList)getModel()).removeListChangeListener(modelChangeListener); - modelChangeListener = null; - } - super.dispose(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ObservablesManager.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ObservablesManager.java deleted file mode 100644 index afb5866b..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ObservablesManager.java +++ /dev/null @@ -1,116 +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 - * Bob Smith - bug 198880 - ******************************************************************************/ - -package org.eclipse.core.databinding; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.internal.databinding.Pair; - -/** - * An observables manager can be used for lifecycle management of - * {@link IObservable} objects. - * - * This class is not intended to be extended by clients. - * - * @since 1.0 - * - */ -public class ObservablesManager { - - private Set managedObservables = new HashSet(); - private Set excludedObservables = new HashSet(); - private Map contexts = new HashMap(); - - /** - * Create a new observables manager. - */ - public ObservablesManager() { - } - - /** - * Adds the given observable to this manager. - * - * @param observable - * the observable - */ - public void addObservable(IObservable observable) { - managedObservables.add(observable); - } - - /** - * Adds the given observable to this manager's exclusion list. The given - * observable will not be disposed of by this manager. - * - * @param observable - * the observable - */ - public void excludeObservable(IObservable observable) { - excludedObservables.add(observable); - } - - /** - * Adds the given data binding context's target and/or model observables to - * this manager. - * - * @param context - * the data binding context - * @param trackTargets - * <code>true</code> if the target observables of the context - * should be managed - * @param trackModels - * <code>true</code> if the model observables of the context - * should be managed - */ - public void addObservablesFromContext(DataBindingContext context, - boolean trackTargets, boolean trackModels) { - if (trackTargets || trackModels) { - contexts.put(context, new Pair(new Boolean(trackTargets), - new Boolean(trackModels))); - } - } - - /** - * Disposes of this manager and all observables that it manages. - */ - public void dispose() { - Set observables = new HashSet(); - observables.addAll(managedObservables); - for (Iterator it = contexts.keySet().iterator(); it.hasNext();) { - DataBindingContext context = (DataBindingContext) it.next(); - Pair trackModelsOrTargets = (Pair) contexts.get(context); - boolean disposeTargets = ((Boolean) trackModelsOrTargets.a) - .booleanValue(); - boolean disposeModels = ((Boolean) trackModelsOrTargets.b) - .booleanValue(); - for (Iterator it2 = context.getBindings().iterator(); it2.hasNext();) { - Binding binding = (Binding) it2.next(); - if (disposeTargets) { - observables.add(binding.getTarget()); - } - if (disposeModels) { - observables.add(binding.getModel()); - } - } - } - observables.removeAll(excludedObservables); - for (Iterator it = observables.iterator(); it.hasNext();) { - IObservable observable = (IObservable) it.next(); - observable.dispose(); - } - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateListStrategy.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateListStrategy.java deleted file mode 100644 index d2ed6d97..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateListStrategy.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.core.databinding; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * Customizes a {@link Binding} between two - * {@link IObservableList observable lists}. The following behaviors can be - * customized via the strategy: - * <ul> - * <li>Conversion</li> - * <li>Automatic processing</li> - * </ul> - * <p> - * Conversion:<br/> When elements are added they can be - * {@link #convert(Object) converted} to the destination element type. - * </p> - * <p> - * Automatic processing:<br/> The processing to perform when the source - * observable changes. This behavior is configured via policies provided on - * construction of the strategy (e.g. {@link #POLICY_NEVER}, - * {@link #POLICY_ON_REQUEST}, {@link #POLICY_UPDATE}). - * </p> - * - * - * @see DataBindingContext#bindList(IObservableList, IObservableList, - * UpdateListStrategy, UpdateListStrategy) - * @see IConverter - * @since 1.0 - */ -public class UpdateListStrategy extends UpdateStrategy { - - /** - * Policy constant denoting that the source observable's state should not be - * tracked and that the destination observable's state should never be - * updated. - */ - public static int POLICY_NEVER = notInlined(1); - - /** - * Policy constant denoting that the source observable's state should not be - * tracked, but that conversion and updating the destination observable's - * state should be performed when explicitly requested. - */ - public static int POLICY_ON_REQUEST = notInlined(2); - - /** - * Policy constant denoting that the source observable's state should be - * tracked, and that conversion and updating the destination observable's - * state should be performed automatically on every change of the source - * observable state. - */ - public static int POLICY_UPDATE = notInlined(8); - - /** - * Helper method allowing API evolution of the above constant values. The - * compiler will not inline constant values into client code if values are - * "computed" using this helper. - * - * @param i - * an integer - * @return the same integer - */ - private static int notInlined(int i) { - return i; - } - - protected IConverter converter; - - private int updatePolicy; - - protected boolean provideDefaults; - - /** - * Creates a new update list strategy for automatically updating the - * destination observable list whenever the source observable list changes. - * A default converter will be provided. The defaults can be changed by - * calling one of the setter methods. - */ - public UpdateListStrategy() { - this(true, POLICY_UPDATE); - } - - /** - * Creates a new update list strategy with a configurable update policy. A - * default converter will be provided. The defaults can be changed by - * calling one of the setter methods. - * - * @param updatePolicy - * one of {@link #POLICY_NEVER}, {@link #POLICY_ON_REQUEST}, or - * {@link #POLICY_UPDATE} - */ - public UpdateListStrategy(int updatePolicy) { - this(true, updatePolicy); - } - - /** - * Creates a new update list strategy with a configurable update policy. A - * default converter will be provided if <code>provideDefaults</code> is - * <code>true</code>. The defaults can be changed by calling one of the - * setter methods. - * - * @param provideDefaults - * if <code>true</code>, default validators and a default - * converter will be provided based on the observable list's - * type. - * @param updatePolicy - * one of {@link #POLICY_NEVER}, {@link #POLICY_ON_REQUEST}, or - * {@link #POLICY_UPDATE} - */ - public UpdateListStrategy(boolean provideDefaults, int updatePolicy) { - this.provideDefaults = provideDefaults; - this.updatePolicy = updatePolicy; - } - - /** - * When an element is added to the destination converts the element from the - * source element type to the destination element type. - * <p> - * Default implementation will use the - * {@link #setConverter(IConverter) converter} if one exists. If no - * converter exists no conversion occurs. - * </p> - * - * @param element - * @return the converted element - */ - public Object convert(Object element) { - return converter == null ? element : converter.convert(element); - } - - /** - * - * @param source - * @param destination - */ - protected void fillDefaults(IObservableList source, - IObservableList destination) { - Object sourceType = source.getElementType(); - Object destinationType = destination.getElementType(); - if (provideDefaults && sourceType != null && destinationType != null) { - if (converter == null) { - setConverter(createConverter(sourceType, destinationType)); - } - } - if (converter != null) { - if (sourceType != null) { - checkAssignable(converter.getFromType(), sourceType, - "converter does not convert from type " + sourceType); //$NON-NLS-1$ - } - if (destinationType != null) { - checkAssignable(converter.getToType(), destinationType, - "converter does not convert to type " + destinationType); //$NON-NLS-1$ - } - } - } - - /** - * @return the update policy - */ - public int getUpdatePolicy() { - return updatePolicy; - } - - /** - * Sets the converter to be invoked when converting added elements from the - * source element type to the destination element type. - * - * @param converter - * @return the receiver, to enable method call chaining - */ - public UpdateListStrategy setConverter(IConverter converter) { - this.converter = converter; - return this; - } - - /** - * Adds the given element at the given index to the given observable list. - * Clients may extend but must call the super implementation. - * - * @param observableList - * @param element - * @param index - * @return a status - */ - protected IStatus doAdd(IObservableList observableList, Object element, - int index) { - try { - observableList.add(index, element); - } catch (Exception ex) { - return ValidationStatus.error(BindingMessages - .getString("ValueBinding_ErrorWhileSettingValue"), //$NON-NLS-1$ - ex); - } - return Status.OK_STATUS; - } - - /** - * Removes the element at the given index from the given observable list. - * Clients may extend but must call the super implementation. - * - * @param observableList - * @param index - * @return a status - */ - protected IStatus doRemove(IObservableList observableList, int index) { - try { - observableList.remove(index); - } catch (Exception ex) { - return ValidationStatus.error(BindingMessages - .getString("ValueBinding_ErrorWhileSettingValue"), //$NON-NLS-1$ - ex); - } - return Status.OK_STATUS; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateStrategy.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateStrategy.java deleted file mode 100644 index d3fd7449..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateStrategy.java +++ /dev/null @@ -1,679 +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.databinding; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.HashMap; -import java.util.Map; - -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.util.Policy; -import org.eclipse.core.internal.databinding.ClassLookupSupport; -import org.eclipse.core.internal.databinding.Pair; -import org.eclipse.core.internal.databinding.conversion.IdentityConverter; -import org.eclipse.core.internal.databinding.conversion.IntegerToStringConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToBigDecimalConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToBigIntegerConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToByteConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToDoubleConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToFloatConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToIntegerConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToLongConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToShortConverter; -import org.eclipse.core.internal.databinding.conversion.ObjectToStringConverter; -import org.eclipse.core.internal.databinding.conversion.StringToByteConverter; -import org.eclipse.core.internal.databinding.conversion.StringToShortConverter; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.0 - * - */ -/* package */class UpdateStrategy { - - private static final String BOOLEAN_TYPE = "java.lang.Boolean.TYPE"; //$NON-NLS-1$ - - private static final String SHORT_TYPE = "java.lang.Short.TYPE"; //$NON-NLS-1$ - - private static final String BYTE_TYPE = "java.lang.Byte.TYPE"; //$NON-NLS-1$ - - private static final String DOUBLE_TYPE = "java.lang.Double.TYPE"; //$NON-NLS-1$ - - private static final String FLOAT_TYPE = "java.lang.Float.TYPE"; //$NON-NLS-1$ - - private static final String INTEGER_TYPE = "java.lang.Integer.TYPE"; //$NON-NLS-1$ - - private static final String LONG_TYPE = "java.lang.Long.TYPE"; //$NON-NLS-1$ - - private static Map converterMap; - - private static Class autoboxed(Class clazz) { - if (clazz == Float.TYPE) - return Float.class; - else if (clazz == Double.TYPE) - return Double.class; - else if (clazz == Short.TYPE) - return Short.class; - else if (clazz == Integer.TYPE) - return Integer.class; - else if (clazz == Long.TYPE) - return Long.class; - else if (clazz == Byte.TYPE) - return Byte.class; - else if (clazz == Boolean.TYPE) - return Boolean.class; - return clazz; - } - - final protected void checkAssignable(Object toType, Object fromType, - String errorString) { - Boolean assignableFromModelToModelConverter = isAssignableFromTo( - fromType, toType); - if (assignableFromModelToModelConverter != null - && !assignableFromModelToModelConverter.booleanValue()) { - throw new BindingException(errorString - + " Expected: " + fromType + ", actual: " + toType); //$NON-NLS-1$//$NON-NLS-2$ - } - } - - /** - * Tries to create a converter that can convert from values of type - * fromType. Returns <code>null</code> if no converter could be created. - * Either toType or modelDescription can be <code>null</code>, but not - * both. - * - * @param fromType - * @param toType - * @return an IConverter, or <code>null</code> if unsuccessful - */ - protected IConverter createConverter(Object fromType, Object toType) { - if (!(fromType instanceof Class) || !(toType instanceof Class)) { - return new DefaultConverter(fromType, toType); - } - Class toClass = (Class) toType; - Class originalToClass = toClass; - if (toClass.isPrimitive()) { - toClass = autoboxed(toClass); - } - Class fromClass = (Class) fromType; - Class originalFromClass = fromClass; - if (fromClass.isPrimitive()) { - fromClass = autoboxed(fromClass); - } - if (!((Class) toType).isPrimitive() - && toClass.isAssignableFrom(fromClass)) { - return new IdentityConverter(originalFromClass, originalToClass); - } - if (((Class) fromType).isPrimitive() && ((Class) toType).isPrimitive() - && fromType.equals(toType)) { - return new IdentityConverter(originalFromClass, originalToClass); - } - Map converterMap = getConverterMap(); - Class[] supertypeHierarchyFlattened = ClassLookupSupport - .getTypeHierarchyFlattened(fromClass); - for (int i = 0; i < supertypeHierarchyFlattened.length; i++) { - Class currentFromClass = supertypeHierarchyFlattened[i]; - if (currentFromClass == toType) { - // converting to toType is just a widening - return new IdentityConverter(fromClass, toClass); - } - Pair key = new Pair(getKeyForClass(fromType, currentFromClass), - getKeyForClass(toType, toClass)); - Object converterOrClassname = converterMap.get(key); - if (converterOrClassname instanceof IConverter) { - return (IConverter) converterOrClassname; - } else if (converterOrClassname instanceof String) { - String classname = (String) converterOrClassname; - Class converterClass; - try { - converterClass = Class.forName(classname); - IConverter result = (IConverter) converterClass - .newInstance(); - converterMap.put(key, result); - return result; - } catch (Exception e) { - Policy - .getLog() - .log( - new Status( - IStatus.ERROR, - Policy.JFACE_DATABINDING, - 0, - "Error while instantiating default converter", e)); //$NON-NLS-1$ - } - } - } - // Since we found no converter yet, try a "downcast" converter; - // the IdentityConverter will automatically check the actual types at - // runtime. - if (fromClass.isAssignableFrom(toClass)) { - return new IdentityConverter(originalFromClass, originalToClass); - } - return new DefaultConverter(fromType, toType); - } - - private static Map getConverterMap() { - // using string-based lookup avoids loading of too many classes - if (converterMap == null) { - // NumberFormat to be shared across converters for the formatting of - // integer values - NumberFormat integerFormat = NumberFormat.getIntegerInstance(); - // NumberFormat to be shared across converters for formatting non - // integer values - NumberFormat numberFormat = NumberFormat.getNumberInstance(); - - converterMap = new HashMap(); - converterMap - .put( - new Pair("java.util.Date", "java.lang.String"), "org.eclipse.core.internal.databinding.conversion.DateToStringConverter"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - converterMap - .put( - new Pair("java.lang.String", "java.lang.Boolean"), "org.eclipse.core.internal.databinding.conversion.StringToBooleanConverter"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - converterMap - .put( - new Pair("java.lang.String", "java.lang.Byte"), StringToByteConverter.toByte(integerFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.String", "java.lang.Character"), "org.eclipse.core.internal.databinding.conversion.StringToCharacterConverter"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - converterMap - .put( - new Pair("java.lang.String", "java.util.Date"), "org.eclipse.core.internal.databinding.conversion.StringToDateConverter"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - converterMap - .put( - new Pair("java.lang.String", "java.lang.Short"), StringToShortConverter.toShort(integerFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - - converterMap - .put( - new Pair("java.lang.String", "java.lang.Integer"), StringToNumberConverter.toInteger(integerFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.String", "java.lang.Double"), StringToNumberConverter.toDouble(numberFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.String", "java.lang.Long"), StringToNumberConverter.toLong(integerFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.String", "java.lang.Float"), StringToNumberConverter.toFloat(numberFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.String", "java.math.BigInteger"), StringToNumberConverter.toBigInteger(integerFormat)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.Integer", "java.lang.String"), NumberToStringConverter.fromInteger(integerFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.Long", "java.lang.String"), NumberToStringConverter.fromLong(integerFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.Double", "java.lang.String"), NumberToStringConverter.fromDouble(numberFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.Float", "java.lang.String"), NumberToStringConverter.fromFloat(numberFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.math.BigInteger", "java.lang.String"), NumberToStringConverter.fromBigInteger(integerFormat)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.Byte", "java.lang.String"), IntegerToStringConverter.fromByte(integerFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - converterMap - .put( - new Pair("java.lang.Short", "java.lang.String"), IntegerToStringConverter.fromShort(integerFormat, false)); //$NON-NLS-1$//$NON-NLS-2$ - - converterMap - .put( - new Pair("java.lang.Object", "java.lang.String"), "org.eclipse.core.internal.databinding.conversion.ObjectToStringConverter"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - - // Integer.TYPE - converterMap - .put( - new Pair("java.lang.String", INTEGER_TYPE), StringToNumberConverter.toInteger(integerFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(INTEGER_TYPE, "java.lang.Integer"), new IdentityConverter(Integer.TYPE, Integer.class)); //$NON-NLS-1$ - converterMap - .put( - new Pair(INTEGER_TYPE, "java.lang.Object"), new IdentityConverter(Integer.TYPE, Object.class)); //$NON-NLS-1$ - converterMap - .put( - new Pair(INTEGER_TYPE, "java.lang.String"), NumberToStringConverter.fromInteger(integerFormat, true)); //$NON-NLS-1$ - - // Byte.TYPE - converterMap - .put( - new Pair("java.lang.String", BYTE_TYPE), StringToByteConverter.toByte(integerFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(BYTE_TYPE, "java.lang.Byte"), new IdentityConverter(Byte.TYPE, Byte.class)); //$NON-NLS-1$ - converterMap - .put( - new Pair(BYTE_TYPE, "java.lang.String"), IntegerToStringConverter.fromByte(integerFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(BYTE_TYPE, "java.lang.Object"), new IdentityConverter(Byte.TYPE, Object.class)); //$NON-NLS-1$ - - // Double.TYPE - converterMap - .put( - new Pair("java.lang.String", DOUBLE_TYPE), StringToNumberConverter.toDouble(numberFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(DOUBLE_TYPE, "java.lang.String"), NumberToStringConverter.fromDouble(numberFormat, true)); //$NON-NLS-1$ - - converterMap - .put( - new Pair(DOUBLE_TYPE, "java.lang.Double"), new IdentityConverter(Double.TYPE, Double.class)); //$NON-NLS-1$ - converterMap - .put( - new Pair(DOUBLE_TYPE, "java.lang.Object"), new IdentityConverter(Double.TYPE, Object.class)); //$NON-NLS-1$ - - // Boolean.TYPE - converterMap - .put( - new Pair("java.lang.String", BOOLEAN_TYPE), "org.eclipse.core.internal.databinding.conversion.StringToBooleanPrimitiveConverter"); //$NON-NLS-1$ //$NON-NLS-2$ - converterMap - .put( - new Pair(BOOLEAN_TYPE, "java.lang.Boolean"), new IdentityConverter(Boolean.TYPE, Boolean.class)); //$NON-NLS-1$ - converterMap - .put( - new Pair(BOOLEAN_TYPE, "java.lang.String"), new ObjectToStringConverter(Boolean.TYPE)); //$NON-NLS-1$ - converterMap - .put( - new Pair(BOOLEAN_TYPE, "java.lang.Object"), new IdentityConverter(Boolean.TYPE, Object.class)); //$NON-NLS-1$ - - // Float.TYPE - converterMap - .put( - new Pair("java.lang.String", FLOAT_TYPE), StringToNumberConverter.toFloat(numberFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(FLOAT_TYPE, "java.lang.String"), NumberToStringConverter.fromFloat(numberFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(FLOAT_TYPE, "java.lang.Float"), new IdentityConverter(Float.TYPE, Float.class)); //$NON-NLS-1$ - converterMap - .put( - new Pair(FLOAT_TYPE, "java.lang.Object"), new IdentityConverter(Float.TYPE, Object.class)); //$NON-NLS-1$ - - // Short.TYPE - converterMap - .put( - new Pair("java.lang.String", SHORT_TYPE), StringToShortConverter.toShort(integerFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(SHORT_TYPE, "java.lang.Short"), new IdentityConverter(Short.TYPE, Short.class)); //$NON-NLS-1$ - converterMap - .put( - new Pair(SHORT_TYPE, "java.lang.String"), IntegerToStringConverter.fromShort(integerFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(SHORT_TYPE, "java.lang.Object"), new IdentityConverter(Short.TYPE, Object.class)); //$NON-NLS-1$ - - // Long.TYPE - converterMap - .put( - new Pair("java.lang.String", LONG_TYPE), StringToNumberConverter.toLong(integerFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(LONG_TYPE, "java.lang.String"), NumberToStringConverter.fromLong(integerFormat, true)); //$NON-NLS-1$ - converterMap - .put( - new Pair(LONG_TYPE, "java.lang.Long"), new IdentityConverter(Long.TYPE, Long.class)); //$NON-NLS-1$ - converterMap - .put( - new Pair(LONG_TYPE, "java.lang.Object"), new IdentityConverter(Long.TYPE, Object.class)); //$NON-NLS-1$ - - converterMap - .put( - new Pair( - "org.eclipse.core.runtime.IStatus", "java.lang.String"), "org.eclipse.core.internal.databinding.conversion.StatusToStringConverter"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - - addNumberToByteConverters(converterMap, integerFormat, - integerClasses); - addNumberToByteConverters(converterMap, numberFormat, floatClasses); - - addNumberToShortConverters(converterMap, integerFormat, - integerClasses); - addNumberToShortConverters(converterMap, numberFormat, floatClasses); - - addNumberToIntegerConverters(converterMap, integerFormat, - integerClasses); - addNumberToIntegerConverters(converterMap, numberFormat, - floatClasses); - - addNumberToLongConverters(converterMap, integerFormat, - integerClasses); - addNumberToLongConverters(converterMap, numberFormat, floatClasses); - - addNumberToFloatConverters(converterMap, integerFormat, - integerClasses); - addNumberToFloatConverters(converterMap, numberFormat, floatClasses); - - addNumberToDoubleConverters(converterMap, integerFormat, - integerClasses); - addNumberToDoubleConverters(converterMap, numberFormat, - floatClasses); - - addNumberToBigIntegerConverters(converterMap, integerFormat, - integerClasses); - addNumberToBigIntegerConverters(converterMap, numberFormat, - floatClasses); - - addNumberToBigDecimalConverters(converterMap, integerFormat, - integerClasses); - addNumberToBigDecimalConverters(converterMap, numberFormat, - floatClasses); - } - - return converterMap; - } - - private static final Class[] integerClasses = new Class[] { Byte.TYPE, - Byte.class, Short.TYPE, Short.class, Integer.TYPE, Integer.class, - Long.TYPE, Long.class, BigInteger.class }; - - private static final Class[] floatClasses = new Class[] { Float.TYPE, - Float.class, Double.TYPE, Double.class, BigDecimal.class }; - - /** - * Registers converters to boxed and unboxed types from a list of from - * classes. - * - * @param map - * @param numberFormat - * @param fromTypes - */ - private static void addNumberToByteConverters(Map map, - NumberFormat numberFormat, Class[] fromTypes) { - - for (int i = 0; i < fromTypes.length; i++) { - Class fromType = fromTypes[i]; - if (!fromType.equals(Byte.class) && !fromType.equals(Byte.TYPE)) { - String fromName = (fromType.isPrimitive()) ? getKeyForClass( - fromType, null) : fromType.getName(); - - map - .put(new Pair(fromName, BYTE_TYPE), - new NumberToByteConverter(numberFormat, - fromType, true)); - map - .put(new Pair(fromName, Byte.class.getName()), - new NumberToByteConverter(numberFormat, - fromType, false)); - } - } - } - - /** - * Registers converters to boxed and unboxed types from a list of from - * classes. - * - * @param map - * @param numberFormat - * @param fromTypes - */ - private static void addNumberToShortConverters(Map map, - NumberFormat numberFormat, Class[] fromTypes) { - for (int i = 0; i < fromTypes.length; i++) { - Class fromType = fromTypes[i]; - if (!fromType.equals(Short.class) && !fromType.equals(Short.TYPE)) { - String fromName = (fromType.isPrimitive()) ? getKeyForClass( - fromType, null) : fromType.getName(); - - map - .put(new Pair(fromName, SHORT_TYPE), - new NumberToShortConverter(numberFormat, - fromType, true)); - map.put(new Pair(fromName, Short.class.getName()), - new NumberToShortConverter(numberFormat, fromType, - false)); - } - } - } - - /** - * Registers converters to boxed and unboxed types from a list of from - * classes. - * - * @param map - * @param numberFormat - * @param fromTypes - */ - private static void addNumberToIntegerConverters(Map map, - NumberFormat numberFormat, Class[] fromTypes) { - for (int i = 0; i < fromTypes.length; i++) { - Class fromType = fromTypes[i]; - if (!fromType.equals(Integer.class) - && !fromType.equals(Integer.TYPE)) { - String fromName = (fromType.isPrimitive()) ? getKeyForClass( - fromType, null) : fromType.getName(); - - map.put(new Pair(fromName, INTEGER_TYPE), - new NumberToIntegerConverter(numberFormat, fromType, - true)); - map.put(new Pair(fromName, Integer.class.getName()), - new NumberToIntegerConverter(numberFormat, fromType, - false)); - } - } - } - - /** - * Registers converters to boxed and unboxed types from a list of from - * classes. - * - * @param map - * @param numberFormat - * @param fromTypes - */ - private static void addNumberToLongConverters(Map map, - NumberFormat numberFormat, Class[] fromTypes) { - for (int i = 0; i < fromTypes.length; i++) { - Class fromType = fromTypes[i]; - if (!fromType.equals(Long.class) && !fromType.equals(Long.TYPE)) { - String fromName = (fromType.isPrimitive()) ? getKeyForClass( - fromType, null) : fromType.getName(); - - map - .put(new Pair(fromName, LONG_TYPE), - new NumberToLongConverter(numberFormat, - fromType, true)); - map - .put(new Pair(fromName, Long.class.getName()), - new NumberToLongConverter(numberFormat, - fromType, false)); - } - } - } - - /** - * Registers converters to boxed and unboxed types from a list of from - * classes. - * - * @param map - * @param numberFormat - * @param fromTypes - */ - private static void addNumberToFloatConverters(Map map, - NumberFormat numberFormat, Class[] fromTypes) { - for (int i = 0; i < fromTypes.length; i++) { - Class fromType = fromTypes[i]; - if (!fromType.equals(Float.class) && !fromType.equals(Float.TYPE)) { - String fromName = (fromType.isPrimitive()) ? getKeyForClass( - fromType, null) : fromType.getName(); - - map - .put(new Pair(fromName, FLOAT_TYPE), - new NumberToFloatConverter(numberFormat, - fromType, true)); - map.put(new Pair(fromName, Float.class.getName()), - new NumberToFloatConverter(numberFormat, fromType, - false)); - } - } - } - - /** - * Registers converters to boxed and unboxed types from a list of from - * classes. - * - * @param map - * @param numberFormat - * @param fromTypes - */ - private static void addNumberToDoubleConverters(Map map, - NumberFormat numberFormat, Class[] fromTypes) { - for (int i = 0; i < fromTypes.length; i++) { - Class fromType = fromTypes[i]; - if (!fromType.equals(Double.class) && !fromType.equals(Double.TYPE)) { - String fromName = (fromType.isPrimitive()) ? getKeyForClass( - fromType, null) : fromType.getName(); - - map.put(new Pair(fromName, DOUBLE_TYPE), - new NumberToDoubleConverter(numberFormat, fromType, - true)); - map.put(new Pair(fromName, Double.class.getName()), - new NumberToDoubleConverter(numberFormat, fromType, - false)); - } - } - } - - /** - * Registers converters to boxed and unboxed types from a list of from - * classes. - * - * @param map - * @param numberFormat - * @param fromTypes - */ - private static void addNumberToBigIntegerConverters(Map map, - NumberFormat numberFormat, Class[] fromTypes) { - for (int i = 0; i < fromTypes.length; i++) { - Class fromType = fromTypes[i]; - if (!fromType.equals(BigInteger.class)) { - String fromName = (fromType.isPrimitive()) ? getKeyForClass( - fromType, null) : fromType.getName(); - - map - .put(new Pair(fromName, BigInteger.class.getName()), - new NumberToBigIntegerConverter(numberFormat, - fromType)); - } - } - } - - /** - * Registers converters to boxed and unboxed types from a list of from - * classes. - * - * @param map - * @param numberFormat - * @param fromTypes - */ - private static void addNumberToBigDecimalConverters(Map map, - NumberFormat numberFormat, Class[] fromTypes) { - for (int i = 0; i < fromTypes.length; i++) { - Class fromType = fromTypes[i]; - if (!fromType.equals(BigDecimal.class)) { - String fromName = (fromType.isPrimitive()) ? getKeyForClass( - fromType, null) : fromType.getName(); - - map - .put(new Pair(fromName, BigDecimal.class.getName()), - new NumberToBigDecimalConverter(numberFormat, - fromType)); - } - } - } - - private static String getKeyForClass(Object originalValue, - Class filteredValue) { - if (originalValue instanceof Class) { - Class originalClass = (Class) originalValue; - if (originalClass.equals(Integer.TYPE)) { - return INTEGER_TYPE; - } else if (originalClass.equals(Byte.TYPE)) { - return BYTE_TYPE; - } else if (originalClass.equals(Boolean.TYPE)) { - return BOOLEAN_TYPE; - } else if (originalClass.equals(Double.TYPE)) { - return DOUBLE_TYPE; - } else if (originalClass.equals(Float.TYPE)) { - return FLOAT_TYPE; - } else if (originalClass.equals(Long.TYPE)) { - return LONG_TYPE; - } else if (originalClass.equals(Short.TYPE)) { - return SHORT_TYPE; - } - } - return filteredValue.getName(); - } - - /** - * @param fromType - * @param toType - * @return whether fromType is assignable to toType - */ - protected Boolean isAssignableFromTo(Object fromType, Object toType) { - if (fromType instanceof Class && toType instanceof Class) { - Class toClass = (Class) toType; - if (toClass.isPrimitive()) { - toClass = autoboxed(toClass); - } - Class fromClass = (Class) fromType; - if (fromClass.isPrimitive()) { - fromClass = autoboxed(fromClass); - } - return toClass.isAssignableFrom(fromClass) ? Boolean.TRUE - : Boolean.FALSE; - } - return null; - } - - /* - * Default converter implementation, does not perform any conversion. - */ - protected static final class DefaultConverter implements IConverter { - - private final Object toType; - - private final Object fromType; - - /** - * @param fromType - * @param toType - */ - DefaultConverter(Object fromType, Object toType) { - this.toType = toType; - this.fromType = fromType; - } - - public Object convert(Object fromObject) { - return fromObject; - } - - public Object getFromType() { - return fromType; - } - - public Object getToType() { - return toType; - } - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateValueStrategy.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateValueStrategy.java deleted file mode 100644 index a4695cbf..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateValueStrategy.java +++ /dev/null @@ -1,557 +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.databinding; - -import java.util.Date; -import java.util.HashMap; - -import org.eclipse.core.databinding.conversion.IConverter; -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.BindingMessages; -import org.eclipse.core.internal.databinding.Pair; -import org.eclipse.core.internal.databinding.conversion.NumberToBigDecimalConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToBigIntegerConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToByteConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToDoubleConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToFloatConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToIntegerConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToLongConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToShortConverter; -import org.eclipse.core.internal.databinding.conversion.StringToDateConverter; -import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; -import org.eclipse.core.internal.databinding.validation.NumberToByteValidator; -import org.eclipse.core.internal.databinding.validation.NumberToDoubleValidator; -import org.eclipse.core.internal.databinding.validation.NumberToFloatValidator; -import org.eclipse.core.internal.databinding.validation.NumberToIntegerValidator; -import org.eclipse.core.internal.databinding.validation.NumberToLongValidator; -import org.eclipse.core.internal.databinding.validation.NumberToShortValidator; -import org.eclipse.core.internal.databinding.validation.NumberToUnboundedNumberValidator; -import org.eclipse.core.internal.databinding.validation.ObjectToPrimitiveValidator; -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.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * Customizes a {@link Binding} between two - * {@link IObservableValue observable values}. The following behaviors can be - * customized via the strategy: - * <ul> - * <li>Validation</li> - * <li>Conversion</li> - * <li>Automatic processing</li> - * </ul> - * <p> - * The update phases are: - * <ol> - * <li>Validate after get - {@link #validateAfterGet(Object)}</li> - * <li>Conversion - {@link #convert(Object)}</li> - * <li>Validate after conversion - {@link #validateAfterConvert(Object)}</li> - * <li>Validate before set - {@link #validateBeforeSet(Object)}</li> - * <li>Value set - {@link #doSet(IObservableValue, Object)}</li> - * </ol> - * </p> - * <p> - * Validation:<br/> {@link IValidator Validators} validate the value at - * multiple phases in the update process. Statuses returned from validators are - * aggregated into a <code>MultiStatus</code> until a status of - * <code>ERROR</code> or <code>CANCEL</code> is encountered. Either of these - * statuses will abort the update process. These statuses are available as the - * {@link Binding#getValidationStatus() binding validation status}. - * </p> - * <p> - * Conversion:<br/> A {@link IConverter converter} will convert the value from - * the type of the source observable into the type of the destination. The - * strategy has the ability to default converters for common scenarios. - * </p> - * <p> - * Automatic processing:<br/> The processing to perform when the source - * observable changes. This behavior is configured via policies provided on - * construction of the strategy (e.g. {@link #POLICY_NEVER}, - * {@link #POLICY_CONVERT}, {@link #POLICY_ON_REQUEST}, {@link #POLICY_UPDATE}). - * </p> - * - * @see DataBindingContext#bindValue(IObservableValue, IObservableValue, - * UpdateValueStrategy, UpdateValueStrategy) - * @see Binding#getValidationStatus() - * @see IValidator - * @see IConverter - * @since 1.0 - */ -public class UpdateValueStrategy extends UpdateStrategy { - - /** - * Policy constant denoting that the source observable's state should not be - * tracked and that the destination observable's value should never be - * updated. - */ - public static int POLICY_NEVER = notInlined(1); - - /** - * Policy constant denoting that the source observable's state should not be - * tracked, but that validation, conversion and updating the destination - * observable's value should be performed when explicitly requested. - */ - public static int POLICY_ON_REQUEST = notInlined(2); - - /** - * Policy constant denoting that the source observable's state should be - * tracked, including validating changes except for - * {@link #validateBeforeSet(Object)}, but that the destination - * observable's value should only be updated on request. - */ - public static int POLICY_CONVERT = notInlined(4); - - /** - * Policy constant denoting that the source observable's state should be - * tracked, and that validation, conversion and updating the destination - * observable's value should be performed automaticlly on every change of - * the source observable value. - */ - public static int POLICY_UPDATE = notInlined(8); - - /** - * Helper method allowing API evolution of the above constant values. The - * compiler will not inline constant values into client code if values are - * "computed" using this helper. - * - * @param i - * an integer - * @return the same integer - */ - private static int notInlined(int i) { - return i; - } - - protected IValidator afterGetValidator; - protected IValidator afterConvertValidator; - protected IValidator beforeSetValidator; - protected IConverter converter; - - private int updatePolicy; - - private static ValidatorRegistry validatorRegistry = new ValidatorRegistry(); - private static HashMap validatorsByConverter = new HashMap(); - - protected boolean provideDefaults; - - /** - * <code>true</code> if we defaulted the converter - */ - private boolean defaultedConverter = false; - - /** - * Creates a new update value strategy for automatically updating the - * destination observable value whenever the source observable value - * changes. Default validators and a default converter will be provided. The - * defaults can be changed by calling one of the setter methods. - */ - public UpdateValueStrategy() { - this(true, POLICY_UPDATE); - } - - /** - * Creates a new update value strategy with a configurable update policy. - * Default validators and a default converter will be provided. The defaults - * can be changed by calling one of the setter methods. - * - * @param updatePolicy - * one of {@link #POLICY_NEVER}, {@link #POLICY_ON_REQUEST}, - * {@link #POLICY_CONVERT}, or {@link #POLICY_UPDATE} - */ - public UpdateValueStrategy(int updatePolicy) { - this(true, updatePolicy); - } - - /** - * Creates a new update value strategy with a configurable update policy. - * Default validators and a default converter will be provided if - * <code>provideDefaults</code> is <code>true</code>. The defaults can - * be changed by calling one of the setter methods. - * - * @param provideDefaults - * if <code>true</code>, default validators and a default - * converter will be provided based on the observable value's - * type. - * @param updatePolicy - * one of {@link #POLICY_NEVER}, {@link #POLICY_ON_REQUEST}, - * {@link #POLICY_CONVERT}, or {@link #POLICY_UPDATE} - */ - public UpdateValueStrategy(boolean provideDefaults, int updatePolicy) { - this.provideDefaults = provideDefaults; - this.updatePolicy = updatePolicy; - } - - /** - * Converts the value from the source type to the destination type. - * <p> - * Default implementation will use the - * {@link #setConverter(IConverter) converter} if one exists. If no - * converter exists no conversion occurs. - * </p> - * - * @param value - * @return the converted value - */ - public Object convert(Object value) { - return converter == null ? value : converter.convert(value); - } - - /** - * Tries to create a validator that can validate values of type fromType. - * Returns <code>null</code> if no validator could be created. Either - * toType or modelDescription can be <code>null</code>, but not both. - * - * @param fromType - * @param toType - * @return an IValidator, or <code>null</code> if unsuccessful - */ - protected IValidator createValidator(Object fromType, Object toType) { - if (fromType == null || toType == null) { - return new IValidator() { - - public IStatus validate(Object value) { - return Status.OK_STATUS; - } - }; - } - - return findValidator(fromType, toType); - } - - /** - * Fills out default values based upon the provided <code>source</code> - * and <code>destination</code>. If the strategy is to default values it - * will attempt to default a converter. If the converter can be defaulted an - * attempt is made to default the - * {@link #validateAfterGet(Object) after get validator}. If a validator - * cannot be defaulted it will be <code>null</code>. - * - * @param source - * @param destination - */ - protected void fillDefaults(IObservableValue source, - IObservableValue destination) { - Object sourceType = source.getValueType(); - Object destinationType = destination.getValueType(); - if (provideDefaults && sourceType != null && destinationType != null) { - if (converter == null) { - IConverter converter = createConverter(sourceType, - destinationType); - defaultedConverter = (converter != null); - setConverter(converter); - } - - if (afterGetValidator == null) { - afterGetValidator = createValidator(sourceType, destinationType); - } - } - if (converter != null) { - if (sourceType != null) { - checkAssignable(converter.getFromType(), sourceType, - "converter does not convert from type " + sourceType); //$NON-NLS-1$ - } - if (destinationType != null) { - checkAssignable(converter.getToType(), destinationType, - "converter does not convert to type " + destinationType); //$NON-NLS-1$ - } - } - } - - private IValidator findValidator(Object fromType, Object toType) { - IValidator result = null; - - // We only default the validator if we defaulted the converter since the - // two are tightly coupled. - if (defaultedConverter) { - if (String.class.equals(fromType)) { - result = (IValidator) validatorsByConverter.get(converter); - - if (result == null) { - // TODO sring based lookup - if (Integer.class.equals(toType) - || Integer.TYPE.equals(toType)) { - result = new StringToIntegerValidator((NumberFormatConverter) converter); - } else if (Long.class.equals(toType) - || Long.TYPE.equals(toType)) { - result = new StringToLongValidator((NumberFormatConverter) converter); - } else if (Float.class.equals(toType) - || Float.TYPE.equals(toType)) { - result = new StringToFloatValidator((NumberFormatConverter) converter); - } else if (Double.class.equals(toType) - || Double.TYPE.equals(toType)) { - result = new StringToDoubleValidator((NumberFormatConverter) converter); - } else if (Byte.class.equals(toType) - || Byte.TYPE.equals(toType)) { - result = new StringToByteValidator((NumberFormatConverter) converter); - } else if (Short.class.equals(toType) - || Short.TYPE.equals(toType)) { - result = new StringToShortValidator((NumberFormatConverter) converter); - } else if (Date.class.equals(toType) - && converter instanceof StringToDateConverter) { - result = new StringToDateValidator( - (StringToDateConverter) converter); - } - - if (result != null) { - validatorsByConverter.put(converter, result); - } - } - } else if (converter instanceof NumberToNumberConverter) { - result = (IValidator) validatorsByConverter.get(converter); - - if (result == null) { - if (converter instanceof NumberToByteConverter) { - result = new NumberToByteValidator((NumberToByteConverter) converter); - } else if (converter instanceof NumberToShortConverter) { - result = new NumberToShortValidator((NumberToShortConverter) converter); - } else if (converter instanceof NumberToIntegerConverter) { - result = new NumberToIntegerValidator((NumberToIntegerConverter) converter); - } else if (converter instanceof NumberToLongConverter) { - result = new NumberToLongValidator((NumberToLongConverter) converter); - } else if (converter instanceof NumberToFloatConverter) { - result = new NumberToFloatValidator((NumberToFloatConverter) converter); - } else if (converter instanceof NumberToDoubleConverter) { - result = new NumberToDoubleValidator((NumberToDoubleConverter) converter); - } else if (converter instanceof NumberToBigIntegerConverter || converter instanceof NumberToBigDecimalConverter) { - result = new NumberToUnboundedNumberValidator((NumberToNumberConverter) converter); - } - } - } - - if (result == null) { - // TODO string based lookup - result = validatorRegistry.get(fromType, toType); - } - } - - return result; - } - - /** - * @return the update policy - */ - public int getUpdatePolicy() { - return updatePolicy; - } - - /** - * Sets the validator to be invoked after the source value is converted to - * the type of the destination observable. - * - * @param validator - * @return the receiver, to enable method call chaining - */ - public UpdateValueStrategy setAfterConvertValidator(IValidator validator) { - this.afterConvertValidator = validator; - return this; - } - - /** - * Sets the validator to be invoked after the source value is retrieved at - * the beginning of the synchronization process. - * - * @param validator - * @return the receiver, to enable method call chaining - */ - public UpdateValueStrategy setAfterGetValidator(IValidator validator) { - this.afterGetValidator = validator; - return this; - } - - /** - * Sets the validator to be invoked before the value is to be set on the - * destination at the end of the synchronization process. - * - * @param validator - * @return the receiver, to enable method call chaining - */ - public UpdateValueStrategy setBeforeSetValidator(IValidator validator) { - this.beforeSetValidator = validator; - return this; - } - - /** - * Sets the converter to be invoked when converting from the source type to - * the destination type. - * - * @param converter - * @return the receiver, to enable method call chaining - */ - public UpdateValueStrategy setConverter(IConverter converter) { - this.converter = converter; - return this; - } - - /** - * Validates the value after it is converted. - * <p> - * Default implementation will use the - * {@link #setAfterConvertValidator(IValidator) validator} if one exists. If - * one does not exist no validation will occur. - * </p> - * - * @param value - * @return an ok status - */ - public IStatus validateAfterConvert(Object value) { - return afterConvertValidator == null ? Status.OK_STATUS - : afterConvertValidator.validate(value); - } - - /** - * Validates the value after it is retrieved from the source. - * <p> - * Default implementation will use the - * {@link #setAfterGetValidator(IValidator) validator} if one exists. If one - * does not exist no validation will occur. - * </p> - * - * @param value - * @return an ok status - */ - public IStatus validateAfterGet(Object value) { - return afterGetValidator == null ? Status.OK_STATUS : afterGetValidator - .validate(value); - } - - /** - * Validates the value before it is set on the destination. - * <p> - * Default implementation will use the - * {@link #setBeforeSetValidator(IValidator) validator} if one exists. If - * one does not exist no validation will occur. - * </p> - * - * @param value - * @return an ok status - */ - public IStatus validateBeforeSet(Object value) { - return beforeSetValidator == null ? Status.OK_STATUS - : beforeSetValidator.validate(value); - } - - /** - * Sets the current value of the given observable to the given value. - * Clients may extend but must call the super implementation. - * - * @param observableValue - * @param value - * @return status - */ - protected IStatus doSet(IObservableValue observableValue, Object value) { - try { - observableValue.setValue(value); - } catch (Exception ex) { - return ValidationStatus.error(BindingMessages - .getString("ValueBinding_ErrorWhileSettingValue"), //$NON-NLS-1$ - ex); - } - return Status.OK_STATUS; - } - - private static class ValidatorRegistry { - - private HashMap validators = new HashMap(); - - /** - * Adds the system-provided validators to the current validator - * registry. This is done automatically for the validator registry - * singleton. - */ - private ValidatorRegistry() { - // Standalone validators here... - associate(Integer.class, Integer.TYPE, - new ObjectToPrimitiveValidator(Integer.TYPE)); - associate(Byte.class, Byte.TYPE, new ObjectToPrimitiveValidator( - Byte.TYPE)); - associate(Short.class, Short.TYPE, new ObjectToPrimitiveValidator( - Short.TYPE)); - associate(Long.class, Long.TYPE, new ObjectToPrimitiveValidator( - Long.TYPE)); - associate(Float.class, Float.TYPE, new ObjectToPrimitiveValidator( - Float.TYPE)); - associate(Double.class, Double.TYPE, - new ObjectToPrimitiveValidator(Double.TYPE)); - associate(Boolean.class, Boolean.TYPE, - new ObjectToPrimitiveValidator(Boolean.TYPE)); - - associate(Object.class, Integer.TYPE, - new ObjectToPrimitiveValidator(Integer.TYPE)); - associate(Object.class, Byte.TYPE, new ObjectToPrimitiveValidator( - Byte.TYPE)); - associate(Object.class, Short.TYPE, new ObjectToPrimitiveValidator( - Short.TYPE)); - associate(Object.class, Long.TYPE, new ObjectToPrimitiveValidator( - Long.TYPE)); - associate(Object.class, Float.TYPE, new ObjectToPrimitiveValidator( - Float.TYPE)); - associate(Object.class, Double.TYPE, - new ObjectToPrimitiveValidator(Double.TYPE)); - associate(Object.class, Boolean.TYPE, - new ObjectToPrimitiveValidator(Boolean.TYPE)); - } - - /** - * Associate a particular validator that can validate the conversion - * (fromClass, toClass) - * - * @param fromClass - * The Class to convert from - * @param toClass - * The Class to convert to - * @param validator - * The IValidator - */ - private void associate(Object fromClass, Object toClass, - IValidator validator) { - validators.put(new Pair(fromClass, toClass), validator); - } - - /** - * Return an IValidator for a specific fromClass and toClass. - * - * @param fromClass - * The Class to convert from - * @param toClass - * The Class to convert to - * @return An appropriate IValidator - */ - private IValidator get(Object fromClass, Object toClass) { - IValidator result = (IValidator) validators.get(new Pair(fromClass, - toClass)); - if (result != null) - return result; - if (fromClass != null && toClass != null && fromClass == toClass) { - return new IValidator() { - public IStatus validate(Object value) { - return Status.OK_STATUS; - } - }; - } - return new IValidator() { - public IStatus validate(Object value) { - return Status.OK_STATUS; - } - }; - } - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ValueBinding.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ValueBinding.java deleted file mode 100644 index 5538e99d..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ValueBinding.java +++ /dev/null @@ -1,238 +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.databinding; - -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.util.Policy; -import org.eclipse.core.internal.databinding.BindingStatus; -import org.eclipse.core.internal.databinding.Util; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; - -/** - * @since 1.0 - * - */ -class ValueBinding extends Binding { - private final UpdateValueStrategy targetToModel; - private final UpdateValueStrategy modelToTarget; - private WritableValue validationStatusObservable; - private IObservableValue target; - private IObservableValue model; - - private boolean updatingTarget; - private boolean updatingModel; - private IValueChangeListener targetChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - if (!updatingTarget && !Util.equals(event.diff.getOldValue(), event.diff.getNewValue())) { - doUpdate(target, model, targetToModel, false, false); - } - } - }; - private IValueChangeListener modelChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - if (!updatingModel && !Util.equals(event.diff.getOldValue(), event.diff.getNewValue())) { - doUpdate(model, target, modelToTarget, false, false); - } - } - }; - - /** - * @param targetObservableValue - * @param modelObservableValue - * @param targetToModel - * @param modelToTarget - */ - public ValueBinding(IObservableValue targetObservableValue, - IObservableValue modelObservableValue, - UpdateValueStrategy targetToModel, UpdateValueStrategy modelToTarget) { - super(targetObservableValue, modelObservableValue); - this.target = targetObservableValue; - this.model = modelObservableValue; - this.targetToModel = targetToModel; - this.modelToTarget = modelToTarget; - if ((targetToModel.getUpdatePolicy() & (UpdateValueStrategy.POLICY_CONVERT | UpdateValueStrategy.POLICY_UPDATE)) != 0) { - target.addValueChangeListener(targetChangeListener); - } else { - targetChangeListener = null; - } - if ((modelToTarget.getUpdatePolicy() & (UpdateValueStrategy.POLICY_CONVERT | UpdateValueStrategy.POLICY_UPDATE)) != 0) { - model.addValueChangeListener(modelChangeListener); - } else { - modelChangeListener = null; - } - } - - protected void preInit() { - validationStatusObservable = new WritableValue(context - .getValidationRealm(), Status.OK_STATUS, IStatus.class); - } - - protected void postInit() { - if (modelToTarget.getUpdatePolicy() == UpdateValueStrategy.POLICY_UPDATE) { - updateModelToTarget(); - } - if (targetToModel.getUpdatePolicy() != UpdateValueStrategy.POLICY_NEVER) { - validateTargetToModel(); - } - } - - public IObservableValue getValidationStatus() { - return validationStatusObservable; - } - - public void updateTargetToModel() { - doUpdate(target, model, targetToModel, true, false); - } - - public void updateModelToTarget() { - doUpdate(model, target, modelToTarget, true, false); - } - - /** - * Incorporates the provided <code>newStats</code> into the - * <code>multieStatus</code>. - * - * @param multiStatus - * @param newStatus - * @return <code>true</code> if the update should proceed - */ - /* package */boolean mergeStatus(MultiStatus multiStatus, IStatus newStatus) { - if (!newStatus.isOK()) { - multiStatus.add(newStatus); - return multiStatus.getSeverity() < IStatus.ERROR; - } - return true; - } - - /* - * This method may be moved to UpdateValueStrategy in the future if clients - * need more control over how the source value is copied to the destination - * observable. - */ - private void doUpdate(final IObservableValue source, - final IObservableValue destination, - final UpdateValueStrategy updateValueStrategy, - final boolean explicit, final boolean validateOnly) { - final int policy = updateValueStrategy.getUpdatePolicy(); - final MultiStatus[] statusHolder = { BindingStatus.ok() }; - if (policy != UpdateValueStrategy.POLICY_NEVER) { - if (policy != UpdateValueStrategy.POLICY_ON_REQUEST || explicit) { - source.getRealm().exec(new Runnable() { - public void run() { - boolean destinationRealmReached = false; - try { - Object value = source.getValue(); - IStatus status = updateValueStrategy - .validateAfterGet(value); - if (mergeStatus(statusHolder[0], status)) { - final Object convertedValue = updateValueStrategy - .convert(value); - status = updateValueStrategy - .validateAfterConvert(convertedValue); - if (mergeStatus(statusHolder[0], status)) { - if (policy == UpdateValueStrategy.POLICY_CONVERT - && !explicit) { - } else { - status = updateValueStrategy - .validateBeforeSet(convertedValue); - if (mergeStatus(statusHolder[0], status)) { - if (!validateOnly) { - destinationRealmReached = true; - destination.getRealm().exec( - new Runnable() { - public void run() { - if (destination == target) { - updatingTarget = true; - } else { - updatingModel = true; - } - try { - IStatus setterStatus = updateValueStrategy - .doSet( - destination, - convertedValue); - - mergeStatus( - statusHolder[0], - setterStatus); - } finally { - if (destination == target) { - updatingTarget = false; - } else { - updatingModel = false; - } - setValidationStatus(statusHolder[0]); - } - } - }); - } - } - } - } - } - } catch (Exception ex) { - // This check is necessary as in 3.2.2 Status - // doesn't accept a null message (bug 177264). - String message = (ex.getMessage() != null) ? ex - .getMessage() : ""; //$NON-NLS-1$ - - mergeStatus(statusHolder[0], new Status( - IStatus.ERROR, Policy.JFACE_DATABINDING, - IStatus.ERROR, message, ex)); - } finally { - if (!destinationRealmReached) { - setValidationStatus(statusHolder[0]); - } - - } - } - }); - } - } - } - - public void validateModelToTarget() { - doUpdate(model, target, modelToTarget, true, true); - } - - public void validateTargetToModel() { - doUpdate(target, model, targetToModel, true, true); - } - - private void setValidationStatus(final IStatus status) { - validationStatusObservable.getRealm().exec(new Runnable() { - public void run() { - validationStatusObservable.setValue(status); - } - }); - } - - public void dispose() { - if (targetChangeListener != null) { - target.removeValueChangeListener(targetChangeListener); - targetChangeListener = null; - } - if (modelChangeListener != null) { - model.removeValueChangeListener(modelChangeListener); - modelChangeListener = null; - } - target = null; - model = null; - super.dispose(); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/Converter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/Converter.java deleted file mode 100644 index 5a344e49..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/Converter.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.core.databinding.conversion; - - -/** - * Abstract base class for converters. - * - * @since 1.0 - * - */ -public abstract class Converter implements IConverter { - - private Object fromType; - private Object toType; - - /** - * @param fromType - * @param toType - */ - public Converter(Object fromType, Object toType) { - this.fromType = fromType; - this.toType = toType; - } - - public Object getFromType() { - return fromType; - } - - public Object getToType() { - return toType; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/IConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/IConverter.java deleted file mode 100644 index d6b4532a..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/IConverter.java +++ /dev/null @@ -1,52 +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.databinding.conversion; - -/** - * A one-way converter. - * - * This interface is not intended to be implemented by clients; clients should - * subclass {@link Converter}. - * - * @since 1.0 - * - */ -public interface IConverter { - - /** - * Returns the type whose instances can be converted by this converter. The - * return type is Object rather than Class to optionally support richer type - * systems than the one provided by Java reflection. - * - * @return the type whose instances can be converted, or null if this - * converter is untyped - */ - public Object getFromType(); - - /** - * Returns the type to which this converter can convert. The return type is - * Object rather than Class to optionally support richer type systems than - * the one provided by Java reflection. - * - * @return the type to which this converter can convert, or null if this - * converter is untyped - */ - public Object getToType(); - - /** - * Returns the result of the conversion of the given object. - * - * @param fromObject - * the object to convert, of type {@link #getFromType()} - * @return the converted object, of type {@link #getToType()} - */ - public Object convert(Object fromObject); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.java deleted file mode 100644 index ee9a00b5..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.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: - * IBM Corporation - initial API and implementation - ******************************************************************************/ - -package org.eclipse.core.databinding.conversion; - -import java.math.BigInteger; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts a Number to a String using <code>NumberFormat.format(...)</code>. - * This class is thread safe. - * - * @since 1.0 - */ -public class NumberToStringConverter extends Converter { - private final NumberFormat numberFormat; - private final Class fromType; - private boolean fromTypeIsLong; - private boolean fromTypeIsDecimalType; - private boolean fromTypeIsBigInteger; - - /** - * Constructs a new instance. - * <p> - * Private to restrict public instantiation. - * </p> - * - * @param numberFormat - * @param fromType - */ - private NumberToStringConverter(NumberFormat numberFormat, Class fromType) { - super(fromType, String.class); - - this.numberFormat = numberFormat; - this.fromType = fromType; - - if (Integer.class.equals(fromType) || Integer.TYPE.equals(fromType) - || Long.class.equals(fromType) || Long.TYPE.equals(fromType)) { - fromTypeIsLong = true; - } else if (Float.class.equals(fromType) || Float.TYPE.equals(fromType) - || Double.class.equals(fromType) - || Double.TYPE.equals(fromType)) { - fromTypeIsDecimalType = true; - } else if (BigInteger.class.equals(fromType)) { - fromTypeIsBigInteger = true; - } - } - - /** - * Converts the provided <code>fromObject</code> to a <code>String</code>. - * If the converter was constructed for an object type, non primitive, a - * <code>fromObject</code> of <code>null</code> will be converted to an - * empty string. - * - * @param fromObject - * value to convert. May be <code>null</code> if the converter - * was constructed for a non primitive type. - * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object) - */ - public Object convert(Object fromObject) { - // Null is allowed when the type is not primitve. - if (fromObject == null && !fromType.isPrimitive()) { - return ""; //$NON-NLS-1$ - } - - Number number = (Number) fromObject; - String result = null; - if (fromTypeIsLong) { - synchronized (numberFormat) { - result = numberFormat.format(number.longValue()); - } - } else if (fromTypeIsDecimalType) { - synchronized (numberFormat) { - result = numberFormat.format(number.doubleValue()); - } - } else if (fromTypeIsBigInteger) { - synchronized (numberFormat) { - result = numberFormat.format((BigInteger) number); - } - } - - return result; - } - - /** - * @param primitive - * <code>true</code> if the type is a double - * @return Double converter for the default locale - */ - public static NumberToStringConverter fromDouble(boolean primitive) { - return fromDouble(NumberFormat.getNumberInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return Double converter with the provided numberFormat - */ - public static NumberToStringConverter fromDouble(NumberFormat numberFormat, - boolean primitive) { - return new NumberToStringConverter(numberFormat, - (primitive) ? Double.TYPE : Double.class); - } - - /** - * @param primitive - * <code>true</code> if the type is a long - * @return Long converter for the default locale - */ - public static NumberToStringConverter fromLong(boolean primitive) { - return fromLong(NumberFormat.getIntegerInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return Long convert with the provided numberFormat - */ - public static NumberToStringConverter fromLong(NumberFormat numberFormat, - boolean primitive) { - return new NumberToStringConverter(numberFormat, - (primitive) ? Long.TYPE : Long.class); - } - - /** - * @param primitive - * <code>true</code> if the type is a float - * @return Float converter for the default locale - */ - public static NumberToStringConverter fromFloat(boolean primitive) { - return fromFloat(NumberFormat.getNumberInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return Float converter with the provided numberFormat - */ - public static NumberToStringConverter fromFloat(NumberFormat numberFormat, - boolean primitive) { - return new NumberToStringConverter(numberFormat, - (primitive) ? Float.TYPE : Float.class); - } - - /** - * @param primitive - * <code>true</code> if the type is a int - * @return Integer converter for the default locale - */ - public static NumberToStringConverter fromInteger(boolean primitive) { - return fromInteger(NumberFormat.getIntegerInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return Integer converter with the provided numberFormat - */ - public static NumberToStringConverter fromInteger( - NumberFormat numberFormat, boolean primitive) { - return new NumberToStringConverter(numberFormat, - (primitive) ? Integer.TYPE : Integer.class); - } - - /** - * @return BigInteger convert for the default locale - */ - public static NumberToStringConverter fromBigInteger() { - return fromBigInteger(NumberFormat.getIntegerInstance()); - } - - /** - * @param numberFormat - * @return BigInteger converter with the provided numberFormat - */ - public static NumberToStringConverter fromBigInteger( - NumberFormat numberFormat) { - return new NumberToStringConverter(numberFormat, BigInteger.class); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java deleted file mode 100644 index 104ec661..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java +++ /dev/null @@ -1,255 +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.databinding.conversion; - -import java.math.BigDecimal; -import java.math.BigInteger; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser.ParseResult; -import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts a String to a Number using <code>NumberFormat.parse(...)</code>. - * This class is thread safe. - * - * @since 1.0 - */ -public class StringToNumberConverter extends NumberFormatConverter { - private Class toType; - /** - * NumberFormat instance to use for conversion. Access must be synchronized. - */ - private NumberFormat numberFormat; - - /** - * Minimum possible value for the type. Can be <code>null</code> as - * BigInteger doesn't have bounds. - */ - private final Number min; - /** - * Maximum possible value for the type. Can be <code>null</code> as - * BigInteger doesn't have bounds. - */ - private final Number max; - - /** - * The boxed type of the toType; - */ - private final Class boxedType; - - private static final Integer MIN_INTEGER = new Integer(Integer.MIN_VALUE); - private static final Integer MAX_INTEGER = new Integer(Integer.MAX_VALUE); - - private static final Double MIN_DOUBLE = new Double(-Double.MAX_VALUE); - private static final Double MAX_DOUBLE = new Double(Double.MAX_VALUE); - - private static final Long MIN_LONG = new Long(Long.MIN_VALUE); - private static final Long MAX_LONG = new Long(Long.MIN_VALUE); - - private static final Float MIN_FLOAT = new Float(-Float.MAX_VALUE); - private static final Float MAX_FLOAT = new Float(Float.MAX_VALUE); - - /** - * @param numberFormat - * @param toType - * @param min - * minimum possible value for the type, can be <code>null</code> - * as BigInteger doesn't have bounds - * @param max - * maximum possible value for the type, can be <code>null</code> - * as BigInteger doesn't have bounds - * @param boxedType - * a convenience that allows for the checking against one type - * rather than boxed and unboxed types - */ - private StringToNumberConverter(NumberFormat numberFormat, Class toType, - Number min, Number max, Class boxedType) { - super(String.class, toType, numberFormat); - - this.toType = toType; - this.numberFormat = numberFormat; - this.min = min; - this.max = max; - this.boxedType = boxedType; - } - - /** - * Converts the provided <code>fromObject</code> to the requested - * {@link #getToType() to type}. - * - * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object) - * @throws IllegalArgumentException - * if the value isn't in the format required by the NumberFormat - * or the value is out of range for the - * {@link #getToType() to type}. - * @throws IllegalArgumentException - * if conversion was not possible - */ - public Object convert(Object fromObject) { - ParseResult result = StringToNumberParser.parse(fromObject, - numberFormat, toType.isPrimitive()); - - if (result.getPosition() != null) { - // this shouldn't happen in the pipeline as validation should catch - // it but anyone can call convert so we should return a properly - // formatted message in an exception - throw new IllegalArgumentException(StringToNumberParser - .createParseErrorMessage((String) fromObject, result - .getPosition())); - } else if (result.getNumber() == null) { - // if an error didn't occur and the number is null then it's a boxed - // type and null should be returned - return null; - } - - /* - * Technically the checks for ranges aren't needed here because the - * validator should have validated this already but we shouldn't assume - * this has occurred. - */ - if (Integer.class.equals(boxedType)) { - if (StringToNumberParser.inIntegerRange(result.getNumber())) { - return new Integer(result.getNumber().intValue()); - } - } else if (Double.class.equals(boxedType)) { - if (StringToNumberParser.inDoubleRange(result.getNumber())) { - return new Double(result.getNumber().doubleValue()); - } - } else if (Long.class.equals(boxedType)) { - if (StringToNumberParser.inLongRange(result.getNumber())) { - return new Long(result.getNumber().longValue()); - } - } else if (Float.class.equals(boxedType)) { - if (StringToNumberParser.inFloatRange(result.getNumber())) { - return new Float(result.getNumber().floatValue()); - } - } else if (BigInteger.class.equals(boxedType)) { - return new BigDecimal(result.getNumber().doubleValue()) - .toBigInteger(); - } - - if (min != null && max != null) { - throw new IllegalArgumentException(StringToNumberParser - .createOutOfRangeMessage(min, max, numberFormat)); - } - - /* - * Fail safe. I don't think this could even be thrown but throwing the - * exception is better than returning null and hiding the error. - */ - throw new IllegalArgumentException( - "Could not convert [" + fromObject + "] to type [" + toType + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - - /** - * @param primitive - * <code>true</code> if the convert to type is an int - * @return to Integer converter for the default locale - */ - public static StringToNumberConverter toInteger(boolean primitive) { - return toInteger(NumberFormat.getIntegerInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return to Integer converter with the provided numberFormat - */ - public static StringToNumberConverter toInteger(NumberFormat numberFormat, - boolean primitive) { - return new StringToNumberConverter(numberFormat, - (primitive) ? Integer.TYPE : Integer.class, MIN_INTEGER, - MAX_INTEGER, Integer.class); - } - - /** - * @param primitive - * <code>true</code> if the convert to type is a double - * @return to Double converter for the default locale - */ - public static StringToNumberConverter toDouble(boolean primitive) { - return toDouble(NumberFormat.getNumberInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return to Double converter with the provided numberFormat - */ - public static StringToNumberConverter toDouble(NumberFormat numberFormat, - boolean primitive) { - return new StringToNumberConverter(numberFormat, - (primitive) ? Double.TYPE : Double.class, MIN_DOUBLE, - MAX_DOUBLE, Double.class); - } - - /** - * @param primitive - * <code>true</code> if the convert to type is a long - * @return to Long converter for the default locale - */ - public static StringToNumberConverter toLong(boolean primitive) { - return toLong(NumberFormat.getIntegerInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return to Long converter with the provided numberFormat - */ - public static StringToNumberConverter toLong(NumberFormat numberFormat, - boolean primitive) { - return new StringToNumberConverter(numberFormat, - (primitive) ? Long.TYPE : Long.class, MIN_LONG, MAX_LONG, - Long.class); - } - - /** - * @param primitive - * <code>true</code> if the convert to type is a float - * @return to Float converter for the default locale - */ - public static StringToNumberConverter toFloat(boolean primitive) { - return toFloat(NumberFormat.getNumberInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return to Float converter with the provided numberFormat - */ - public static StringToNumberConverter toFloat(NumberFormat numberFormat, - boolean primitive) { - return new StringToNumberConverter(numberFormat, - (primitive) ? Float.TYPE : Float.class, MIN_FLOAT, MAX_FLOAT, - Float.class); - } - - /** - * @return to BigInteger converter for the default locale - */ - public static StringToNumberConverter toBigInteger() { - return toBigInteger(NumberFormat.getIntegerInstance()); - } - - /** - * @param numberFormat - * @return to BigInteger converter with the provided numberFormat - */ - public static StringToNumberConverter toBigInteger(NumberFormat numberFormat) { - return new StringToNumberConverter(numberFormat, BigInteger.class, - null, null, BigInteger.class); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/package.html deleted file mode 100644 index 06a1b53e..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/package.html +++ /dev/null @@ -1,18 +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> -Provides interfaces and classes for data type conversion. -<h2> -Package Specification</h2> -<p> -This package provides the <tt>IConverter</tt> interface along with classes -that implement the interface to convert between common data types. -<p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/AbstractObservable.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/AbstractObservable.java deleted file mode 100644 index 98ceb05f..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/AbstractObservable.java +++ /dev/null @@ -1,72 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.AssertionFailedException; - -/** - * @since 1.0 - */ -public abstract class AbstractObservable extends ChangeManager implements IObservable { - - /** - * @param realm - */ - public AbstractObservable(Realm realm) { - super(realm); - } - - public synchronized void addChangeListener(IChangeListener listener) { - addListener(ChangeEvent.TYPE, listener); - } - - public synchronized void removeChangeListener(IChangeListener listener) { - removeListener(ChangeEvent.TYPE, listener); - } - - public synchronized void addStaleListener(IStaleListener listener) { - addListener(StaleEvent.TYPE, listener); - } - - public synchronized void removeStaleListener(IStaleListener listener) { - removeListener(StaleEvent.TYPE, listener); - } - - protected void fireChange() { - checkRealm(); - fireEvent(new ChangeEvent(this)); - } - - protected void fireStale() { - checkRealm(); - fireEvent(new StaleEvent(this)); - } - - /** - * - */ - public synchronized void dispose() { - super.dispose(); - } - - /** - * Asserts that the realm is the current realm. - * - * @see Realm#isCurrent() - * @throws AssertionFailedException if the realm is not the current realm - */ - protected void checkRealm() { - Assert.isTrue(getRealm().isCurrent()); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeEvent.java deleted file mode 100644 index 60950cf2..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeEvent.java +++ /dev/null @@ -1,48 +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.databinding.observable; - -/** - * Generic change event denoting that the state of an {@link IObservable} object - * has changed. This event does not carry information about the kind of change - * that occurred. - * - * @since 1.0 - * - */ -public class ChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = -3241193109844979384L; - static final Object TYPE = new Object(); - - /** - * Creates a new change event object. - * - * @param source - * the observable that changed state - */ - public ChangeEvent(IObservable source) { - super(source); - } - - protected void dispatch(IObservablesListener listener) { - ((IChangeListener) listener).handleChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeManager.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeManager.java deleted file mode 100644 index 788cb4b1..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeManager.java +++ /dev/null @@ -1,161 +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.databinding.observable; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.ListenerList; - -/** - * Listener management implementation. Exposed to subclasses in form of - * {@link AbstractObservable} and {@link ChangeSupport}. - * - * @since 1.0 - * - */ -/* package */ class ChangeManager { - - ListenerList[] listenerLists = null; - Object listenerTypes[] = null; - private Realm realm; - - /** - * @param realm - * - */ - /* package */ ChangeManager(Realm realm) { - Assert.isNotNull(realm); - this.realm = realm; - } - - /** - * @param listenerType - * @param listener - */ - protected void addListener(Object listenerType, - IObservablesListener listener) { - int listenerTypeIndex = findListenerTypeIndex(listenerType); - if (listenerTypeIndex == -1) { - int length; - if (listenerTypes == null) { - length = 0; - listenerTypes = new Object[1]; - listenerLists = new ListenerList[1]; - } else { - length = listenerTypes.length; - System.arraycopy(listenerTypes, 0, - listenerTypes = new Object[length + 1], 0, length); - System - .arraycopy(listenerLists, 0, - listenerLists = new ListenerList[length + 1], - 0, length); - } - listenerTypes[length] = listenerType; - listenerLists[length] = new ListenerList(); - boolean hadListeners = hasListeners(); - listenerLists[length].add(listener); - if (!hadListeners) { - this.firstListenerAdded(); - } - return; - } - ListenerList listenerList = listenerLists[listenerTypeIndex]; - boolean hadListeners = true; - if (listenerList.size() == 0) { - hadListeners = hasListeners(); - } - listenerList.add(listener); - if (!hadListeners) { - firstListenerAdded(); - } - } - - /** - * @param listenerType - * @param listener - */ - protected void removeListener(Object listenerType, - IObservablesListener listener) { - int listenerTypeIndex = findListenerTypeIndex(listenerType); - if (listenerTypeIndex != -1) { - listenerLists[listenerTypeIndex].remove(listener); - if (listenerLists[listenerTypeIndex].size() == 0) { - if (!hasListeners()) { - this.lastListenerRemoved(); - } - } - } - } - - protected boolean hasListeners() { - if (listenerTypes == null) { - return false; - } - for (int i = 0; i < listenerTypes.length; i++) { - if (listenerLists[i].size() > 0) { - return true; - } - } - return false; - } - - private int findListenerTypeIndex(Object listenerType) { - if (listenerTypes != null) { - for (int i = 0; i < listenerTypes.length; i++) { - if (listenerTypes[i] == listenerType) { - return i; - } - } - } - return -1; - } - - protected void fireEvent(ObservableEvent event) { - Object listenerType = event.getListenerType(); - int listenerTypeIndex = findListenerTypeIndex(listenerType); - if (listenerTypeIndex != -1) { - Object[] listeners = listenerLists[listenerTypeIndex] - .getListeners(); - for (int i = 0; i < listeners.length; i++) { - event.dispatch((IObservablesListener) listeners[i]); - } - } - } - - /** - * - */ - protected void firstListenerAdded() { - } - - /** - * - */ - protected void lastListenerRemoved() { - } - - /** - * - */ - public void dispose() { - listenerLists = null; - listenerTypes = null; - realm = null; - } - - /** - * @return Returns the realm. - */ - public Realm getRealm() { - return realm; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeSupport.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeSupport.java deleted file mode 100644 index e91daeb3..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ChangeSupport.java +++ /dev/null @@ -1,79 +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.databinding.observable; - -/** - * @since 1.0 - * - */ -public abstract class ChangeSupport extends ChangeManager { - - /** - * @param realm - */ - public ChangeSupport(Realm realm) { - super(realm); - } - - public void addListener(Object listenerType, - IObservablesListener listener) { - super.addListener(listenerType, listener); - } - - public void removeListener(Object listenerType, - IObservablesListener listener) { - super.removeListener(listenerType, listener); - } - - public void fireEvent(ObservableEvent event) { - super.fireEvent(event); - } - - /** - * - */ - protected abstract void firstListenerAdded(); - - /** - * - */ - protected abstract void lastListenerRemoved(); - - /** - * @param listener - */ - public void addChangeListener(IChangeListener listener) { - addListener(ChangeEvent.TYPE, listener); - } - - /** - * @param listener - */ - public void removeChangeListener(IChangeListener listener) { - removeListener(ChangeEvent.TYPE, listener); - } - - /** - * @param listener - */ - public void addStaleListener(IStaleListener listener) { - addListener(StaleEvent.TYPE, listener); - } - - /** - * @param listener - */ - public void removeStaleListener(IStaleListener listener) { - removeListener(StaleEvent.TYPE, listener); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Diffs.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Diffs.java deleted file mode 100644 index e971ffdc..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Diffs.java +++ /dev/null @@ -1,460 +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.databinding.observable; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.list.ListDiff; -import org.eclipse.core.databinding.observable.list.ListDiffEntry; -import org.eclipse.core.databinding.observable.map.MapDiff; -import org.eclipse.core.databinding.observable.set.SetDiff; -import org.eclipse.core.databinding.observable.value.ValueDiff; -import org.eclipse.core.internal.databinding.Util; - -/** - * @since 1.0 - * - */ -public class Diffs { - - /** - * @param oldList - * @param newList - * @return the differences between oldList and newList - */ - public static ListDiff computeListDiff(List oldList, List newList) { - List diffEntries = new ArrayList(); - createListDiffs(new ArrayList(oldList), newList, diffEntries); - ListDiff listDiff = createListDiff((ListDiffEntry[]) diffEntries - .toArray(new ListDiffEntry[diffEntries.size()])); - return listDiff; - } - - /** - * adapted from EMF's ListDifferenceAnalyzer - */ - private static void createListDiffs(List oldList, List newList, - List listDiffs) { - int index = 0; - for (Iterator it = newList.iterator(); it.hasNext();) { - Object newObject = it.next(); - if (oldList.size() <= index) { - listDiffs.add(createListDiffEntry(index, true, newObject)); - } else { - boolean done; - do { - done = true; - Object targetObject = oldList.get(index); - if (targetObject == null ? newObject != null - : !targetObject.equals(newObject)) { - int position = listIndexOf(oldList, newObject, index); - if (position != -1) { - int targetIndex = listIndexOf(newList, - targetObject, index); - if (targetIndex == -1) { - listDiffs.add(createListDiffEntry(index, false, targetObject)); - oldList.remove(index); - done = false; - } else if (targetIndex > position) { - if (oldList.size() <= targetIndex) { - targetIndex = oldList.size() - 1; - } - listDiffs.add(createListDiffEntry(index, false, newObject)); - oldList.remove(index); - listDiffs.add(createListDiffEntry(targetIndex, true, newObject)); - oldList.add(targetIndex, newObject); - done = false; - } else { - listDiffs.add(createListDiffEntry(position, false, newObject)); - oldList.remove(position); - listDiffs.add(createListDiffEntry(index, true, newObject)); - oldList.add(index, newObject); - } - } else { - oldList.add(index, newObject); - listDiffs.add(createListDiffEntry(index, true, newObject)); - } - } - } while (!done); - } - ++index; - } - for (int i = oldList.size(); i > index;) { - listDiffs.add(createListDiffEntry(--i, false, oldList.get(i))); - } - } - - /** - * @param list - * @param object - * @param index - * @return the index, or -1 if not found - */ - private static int listIndexOf(List list, Object object, int index) { - int size = list.size(); - for (int i=index; i<size;i++) { - Object candidate = list.get(i); - if (candidate==null ? object==null : candidate.equals(object)) { - return i; - } - } - return -1; - } - - /** - * Checks whether the two objects are <code>null</code> -- allowing for - * <code>null</code>. - * - * @param left - * The left object to compare; may be <code>null</code>. - * @param right - * The right object to compare; may be <code>null</code>. - * @return <code>true</code> if the two objects are equivalent; - * <code>false</code> otherwise. - */ - public static final boolean equals(final Object left, final Object right) { - return left == null ? right == null : ((right != null) && left - .equals(right)); - } - - /** - * @param oldSet - * @param newSet - * @return a set diff - */ - public static SetDiff computeSetDiff(Set oldSet, Set newSet) { - Set additions = new HashSet(newSet); - additions.removeAll(oldSet); - Set removals = new HashSet(oldSet); - removals.removeAll(newSet); - return createSetDiff(additions, removals); - } - - /** - * Computes the difference between two maps. - * - * @param oldMap - * @param newMap - * @return a map diff representing the changes needed to turn oldMap into - * newMap - */ - public static MapDiff computeMapDiff(Map oldMap, Map newMap) { - // starts out with all keys from the new map, we will remove keys from - // the old map as we go - final Set addedKeys = new HashSet(newMap.keySet()); - final Set removedKeys = new HashSet(); - final Set changedKeys = new HashSet(); - final Map oldValues = new HashMap(); - final Map newValues = new HashMap(); - for (Iterator it = oldMap.keySet().iterator(); it.hasNext();) { - Object oldKey = it.next(); - if (addedKeys.remove(oldKey)) { - // potentially changed key since it is in oldMap and newMap - Object oldValue = oldMap.get(oldKey); - Object newValue = newMap.get(oldKey); - if (!Util.equals(oldValue, newValue)) { - changedKeys.add(oldKey); - oldValues.put(oldKey, oldValue); - newValues.put(oldKey, newValue); - } - } else { - removedKeys.add(oldKey); - oldValues.put(oldKey, oldMap.get(oldKey)); - } - } - for (Iterator it = addedKeys.iterator(); it.hasNext();) { - Object newKey = it.next(); - newValues.put(newKey, newMap.get(newKey)); - } - return new MapDiff() { - public Set getAddedKeys() { - return addedKeys; - } - - public Set getChangedKeys() { - return changedKeys; - } - - public Set getRemovedKeys() { - return removedKeys; - } - - public Object getNewValue(Object key) { - return newValues.get(key); - } - - public Object getOldValue(Object key) { - return oldValues.get(key); - } - }; - } - - /** - * @param oldValue - * @param newValue - * @return a value diff - */ - public static ValueDiff createValueDiff(final Object oldValue, - final Object newValue) { - return new ValueDiff() { - - public Object getOldValue() { - return oldValue; - } - - public Object getNewValue() { - return newValue; - } - }; - } - - /** - * @param additions - * @param removals - * @return a set diff - */ - public static SetDiff createSetDiff(Set additions, Set removals) { - final Set unmodifiableAdditions = Collections - .unmodifiableSet(additions); - final Set unmodifiableRemovals = Collections.unmodifiableSet(removals); - return new SetDiff() { - - public Set getAdditions() { - return unmodifiableAdditions; - } - - public Set getRemovals() { - return unmodifiableRemovals; - } - }; - } - - /** - * @param difference - * @return a list diff with one differing entry - */ - public static ListDiff createListDiff(ListDiffEntry difference) { - return createListDiff(new ListDiffEntry[] { difference }); - } - - /** - * @param difference1 - * @param difference2 - * @return a list diff with two differing entries - */ - public static ListDiff createListDiff(ListDiffEntry difference1, - ListDiffEntry difference2) { - return createListDiff(new ListDiffEntry[] { difference1, difference2 }); - } - - /** - * @param differences - * @return a list diff with the given entries - */ - public static ListDiff createListDiff(final ListDiffEntry[] differences) { - return new ListDiff() { - public ListDiffEntry[] getDifferences() { - return differences; - } - }; - } - - /** - * @param position - * @param isAddition - * @param element - * @return a list diff entry - */ - public static ListDiffEntry createListDiffEntry(final int position, - final boolean isAddition, final Object element) { - return new ListDiffEntry() { - - public int getPosition() { - return position; - } - - public boolean isAddition() { - return isAddition; - } - - public Object getElement() { - return element; - } - }; - } - - /** - * @param addedKey - * @param newValue - * @return a map diff - */ - public static MapDiff createMapDiffSingleAdd(final Object addedKey, - final Object newValue) { - return new MapDiff() { - - public Set getAddedKeys() { - return Collections.singleton(addedKey); - } - - public Set getChangedKeys() { - return Collections.EMPTY_SET; - } - - public Object getNewValue(Object key) { - return newValue; - } - - public Object getOldValue(Object key) { - return null; - } - - public Set getRemovedKeys() { - return Collections.EMPTY_SET; - } - }; - } - - /** - * @param existingKey - * @param oldValue - * @param newValue - * @return a map diff - */ - public static MapDiff createMapDiffSingleChange(final Object existingKey, - final Object oldValue, final Object newValue) { - return new MapDiff() { - - public Set getAddedKeys() { - return Collections.EMPTY_SET; - } - - public Set getChangedKeys() { - return Collections.singleton(existingKey); - } - - public Object getNewValue(Object key) { - return newValue; - } - - public Object getOldValue(Object key) { - return oldValue; - } - - public Set getRemovedKeys() { - return Collections.EMPTY_SET; - } - }; - } - - /** - * @param removedKey - * @param oldValue - * @return a map diff - */ - public static MapDiff createMapDiffSingleRemove(final Object removedKey, - final Object oldValue) { - return new MapDiff() { - - public Set getAddedKeys() { - return Collections.EMPTY_SET; - } - - public Set getChangedKeys() { - return Collections.EMPTY_SET; - } - - public Object getNewValue(Object key) { - return null; - } - - public Object getOldValue(Object key) { - return oldValue; - } - - public Set getRemovedKeys() { - return Collections.singleton(removedKey); - } - }; - } - - /** - * @param copyOfOldMap - * @return a map diff - */ - public static MapDiff createMapDiffRemoveAll(final Map copyOfOldMap) { - return new MapDiff() { - - public Set getAddedKeys() { - return Collections.EMPTY_SET; - } - - public Set getChangedKeys() { - return Collections.EMPTY_SET; - } - - public Object getNewValue(Object key) { - return null; - } - - public Object getOldValue(Object key) { - return copyOfOldMap.get(key); - } - - public Set getRemovedKeys() { - return copyOfOldMap.keySet(); - } - }; - } - - /** - * @param addedKeys - * @param removedKeys - * @param changedKeys - * @param oldValues - * @param newValues - * @return a map diff - */ - public static MapDiff createMapDiff(final Set addedKeys, - final Set removedKeys, final Set changedKeys, final Map oldValues, - final Map newValues) { - return new MapDiff() { - - public Set getAddedKeys() { - return addedKeys; - } - - public Set getChangedKeys() { - return changedKeys; - } - - public Object getNewValue(Object key) { - return newValues.get(key); - } - - public Object getOldValue(Object key) { - return oldValues.get(key); - } - - public Set getRemovedKeys() { - return removedKeys; - } - }; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IChangeListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IChangeListener.java deleted file mode 100644 index d0a5cee9..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IChangeListener.java +++ /dev/null @@ -1,42 +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.databinding.observable; - -import org.eclipse.core.databinding.observable.list.IListChangeListener; -import org.eclipse.core.databinding.observable.map.IMapChangeListener; -import org.eclipse.core.databinding.observable.set.ISetChangeListener; -import org.eclipse.core.databinding.observable.value.IValueChangeListener; - -/** - * Listener for generic change events. Note that the change events do not carry - * information about the change, they only specify the affected observable. To - * listen for specific change events, use more specific change listeners. - * - * @see IValueChangeListener - * @see IListChangeListener - * @see ISetChangeListener - * @see IMapChangeListener - * - * @since 1.0 - */ -public interface IChangeListener extends IObservablesListener { - - /** - * Handle a generic change to the given observable. The given event object - * must only be used locally in this method because it may be reused for - * other change notifications. - * - * @param event - */ - public void handleChange(ChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservable.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservable.java deleted file mode 100644 index 4445fbde..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservable.java +++ /dev/null @@ -1,108 +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.databinding.observable; - -/** - * An object with state that allows to listen for state changes. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes in the framework that implement this - * interface. Note that direct implementers of this interface outside of the - * framework will be broken in future releases when methods are added to this - * interface. - * </p> - * <p> - * Implementations must not manage listeners themselves, listener management - * must be delegated to a private instance of type {@link ChangeSupport} if - * it is not inherited from {@link AbstractObservable}. - * </p> - * - * @since 1.0 - * - */ -public interface IObservable { - - /** - * Returns the realm for this observable. Unless otherwise specified, - * getters and setters must be accessed from within this realm. Listeners - * will be within this realm when they receive events from this observable. - * <p> - * Because observables can only be accessed from within one realm, and they - * always fire events on that realm, their state can be observed in an - * incremental way. It is always safe to call getters of an observable from - * within a change listener attached to that observable. - * </p> - * - * @return the realm - */ - public Realm getRealm(); - - /** - * Adds the given change listener to the list of change listeners. Change - * listeners are notified about changes of the state of this observable in a - * generic way, without specifying the change that happened. To get the - * changed state, a change listener needs to query for the current state of - * this observable. - * - * @param listener - */ - public void addChangeListener(IChangeListener listener); - - /** - * Removes the given change listener from the list of change listeners. Has - * no effect if the given listener is not registered as a change listener. - * - * @param listener - */ - public void removeChangeListener(IChangeListener listener); - - /** - * Adds the given stale listener to the list of stale listeners. Stale - * listeners are notified when an observable object becomes stale, not when - * is becomes non-stale. - * - * @param listener - * - * @see #isStale() - */ - public void addStaleListener(IStaleListener listener); - - /** - * Removes the given stale listener from the list of stale listeners. Has no - * effect if the given listener is not registered as a stale listener. - * - * @param listener - */ - public void removeStaleListener(IStaleListener listener); - - /** - * Returns whether the state of this observable is stale and is expected to - * change soon. A non-stale observable that becomes stale will notify its - * stale listeners. A stale object that becomes non-stale does so by - * changing its state and notifying its change listeners, it does <b>not</b> - * notify its stale listeners about becoming non-stale. Clients that do not - * expect asynchronous changes may ignore staleness of observable objects. - * - * @return true if this observable's state is stale and will change soon. - * - * @TrackedGetter - implementers must call - * {@link ObservableTracker#getterCalled(IObservable)}. - */ - public boolean isStale(); - - /** - * Disposes of this observable object, removing all listeners registered - * with this object, and all listeners this object might have registered on - * other objects. - */ - public void dispose(); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservableCollection.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservableCollection.java deleted file mode 100644 index 38685b20..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservableCollection.java +++ /dev/null @@ -1,42 +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.databinding.observable; - -import java.util.Collection; - -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.set.IObservableSet; - -/** - * Interface for observable collections. Only general change listeners can be - * added to an observable collection. Listeners interested in incremental - * changes have to be added using more concrete subtypes such as - * {@link IObservableList} or {@link IObservableSet}. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - */ -public interface IObservableCollection extends IObservable, Collection { - - /** - * @return the element type of this observable value, or <code>null</code> - * if this observable collection is untyped. - */ - Object getElementType(); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservablesListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservablesListener.java deleted file mode 100644 index ac63bb17..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObservablesListener.java +++ /dev/null @@ -1,23 +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.databinding.observable; - -/** - * Marker interface for all listener types in the observables framework. Not - * intended to be directly implemented by clients. - * - * @since 1.0 - * - */ -public interface IObservablesListener { - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObserving.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObserving.java deleted file mode 100644 index 1c9fc139..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IObserving.java +++ /dev/null @@ -1,31 +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.databinding.observable; - -/** - * - * Mixin interface for IObservables that observe other objects. - * - * @since 1.0 - * - */ -public interface IObserving { - - /** - * Returns the observed object, or <code>null</code> if this observing - * object does not currently observe an object. - * - * @return the observed object, or <code>null</code> - */ - public Object getObserved(); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IStaleListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IStaleListener.java deleted file mode 100644 index 57291983..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/IStaleListener.java +++ /dev/null @@ -1,31 +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.databinding.observable; - -/** - * Listener for staleness events. An observable object is stale if its state - * will change eventually. - * - * @since 1.0 - */ -public interface IStaleListener extends IObservablesListener { - - /** - * Handle the event that the given observable object is now stale. The given - * event object must only be used locally in this method because it may be - * reused for other change notifications. - * - * @param staleEvent - */ - public void handleStale(StaleEvent staleEvent); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ObservableEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ObservableEvent.java deleted file mode 100644 index 38a865c5..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ObservableEvent.java +++ /dev/null @@ -1,67 +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.databinding.observable; - -import java.util.EventObject; - -/** - * Abstract event object for events fired by {@link IObservable} objects. All - * events fired by observables must be derived from this class so that the way - * of dispatching events can be improved in later versions of the framework. - * - * @since 1.0 - * - */ -public abstract class ObservableEvent extends EventObject { - - /** - * Creates a new observable event. - * - * @param source - */ - public ObservableEvent(IObservable source) { - super(source); - } - - /** - * - */ - private static final long serialVersionUID = 7693906965267871813L; - - /** - * Returns the observable that generated this event. - * - * @return the observable that generated this event - */ - public IObservable getObservable() { - return (IObservable) getSource(); - } - - /** - * Dispatch this event to the given listener. Subclasses must implement this - * method by calling the appropriate type-safe event handling method on the - * given listener according to the type of this event. - * - * @param listener - * the listener that should handle the event - */ - protected abstract void dispatch(IObservablesListener listener); - - /** - * Returns a unique object used for distinguishing this event type from - * others. - * - * @return a unique object representing the concrete type of this event. - */ - protected abstract Object getListenerType(); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ObservableTracker.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ObservableTracker.java deleted file mode 100644 index dbebe433..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/ObservableTracker.java +++ /dev/null @@ -1,180 +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.core.databinding.observable; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.internal.databinding.IdentityWrapper; -import org.eclipse.core.runtime.Assert; - -/** - * This class makes it possible to monitor whenever an IObservable is read from. - * This can be used to automatically attach and remove listeners. How to use it: - * - * <p> - * If you are implementing an IObservable, invoke getterCalled(this) whenever a - * getter is called - that is, whenever your observable is read from. You only - * need to do this once per method call. If one getter delegates to another, the - * outer getter doesn't need to call the method since the inner one will. - * </p> - * - * <p> - * If you want to determine what observables were used in a particular block of - * code, call runAndMonitor(Runnable). This will execute the given runnable and - * return the set of observables that were read from. - * </p> - * - * <p> - * This can be used to automatically attach listeners. For example, imagine you - * have a block of code that updates some widget by reading from a bunch of - * observables. Whenever one of those observables changes, you want to re-run - * the code and cause the widget to be refreshed. You could do this in the - * traditional manner by attaching one listener to each observable and - * re-running your widget update code whenever one of them changes, but this - * code is repetitive and requires updating the listener code whenever you - * refactor the widget updating code. - * </p> - * - * <p> - * Alternatively, you could use a utility class that runs the code in a - * runAndMonitor block and automatically attach listeners to any observable used - * in updating the widget. The advantage of the latter approach is that it, - * eliminates the code for attaching and detaching listeners and will always - * stay in synch with changes to the widget update logic. - * </p> - * - * @since 1.0 - */ -public class ObservableTracker { - - /** - * Threadlocal storage pointing to the current Set of IObservables, or null - * if none. Note that this is actually the top of a stack. Whenever a method - * changes the current value, it remembers the old value as a local variable - * and restores the old value when the method exits. - */ - private static ThreadLocal currentChangeListener = new ThreadLocal(); - - private static ThreadLocal currentStaleListener = new ThreadLocal(); - - private static ThreadLocal currentObservableSet = new ThreadLocal(); - - /** - * Invokes the given runnable, and returns the set of IObservables that were - * read by the runnable. If the runnable calls this method recursively, the - * result will not contain IObservables that were used within the inner - * runnable. - * - * @param runnable - * runnable to execute - * @param changeListener - * listener to register with all accessed observables - * @param staleListener - * listener to register with all accessed observables, or - * <code>null</code> if no stale listener is to be registered - * @return an array of unique observable objects - */ - public static IObservable[] runAndMonitor(Runnable runnable, - IChangeListener changeListener, IStaleListener staleListener) { - // Remember the previous value in the listener stack - Set lastObservableSet = (Set) currentObservableSet.get(); - IChangeListener lastChangeListener = (IChangeListener) currentChangeListener - .get(); - IStaleListener lastStaleListener = (IStaleListener) currentStaleListener - .get(); - - Set observableSet = new HashSet(); - // Push the new listeners to the top of the stack - currentObservableSet.set(observableSet); - currentChangeListener.set(changeListener); - currentStaleListener.set(staleListener); - try { - runnable.run(); - } finally { - // Pop the new listener off the top of the stack (by restoring the - // previous listener) - currentObservableSet.set(lastObservableSet); - currentChangeListener.set(lastChangeListener); - currentStaleListener.set(lastStaleListener); - } - - int i = 0; - IObservable[] result = new IObservable[observableSet.size()]; - for (Iterator it = observableSet.iterator(); it.hasNext();) { - IdentityWrapper wrapper = (IdentityWrapper) it.next(); - result[i++] = (IObservable) wrapper.unwrap(); - } - - return result; - } - - /** - * Runs the given runnable without tracking dependencies. - * @param runnable - */ - public static void runAndIgnore(Runnable runnable) { - // Remember the previous value in the listener stack - Set lastObservableSet = (Set) currentObservableSet.get(); - IChangeListener lastChangeListener = (IChangeListener) currentChangeListener - .get(); - IStaleListener lastStaleListener = (IStaleListener) currentStaleListener - .get(); - currentObservableSet.set(null); - currentChangeListener.set(null); - currentStaleListener.set(null); - try { - runnable.run(); - } finally { - // Pop the new listener off the top of the stack (by restoring the - // previous listener) - currentObservableSet.set(lastObservableSet); - currentChangeListener.set(lastChangeListener); - currentStaleListener.set(lastStaleListener); - } - } - - /** - * Notifies the ObservableTracker that an observable was read from. The - * JavaDoc for methods that invoke this method should include the following - * tag: "@TrackedGetter This method will notify ObservableTracker that the - * receiver has been read from". This lets callers know that they can rely - * on automatic updates from the object without explicitly attaching a - * listener. - * - * @param observable - */ - public static void getterCalled(IObservable observable) { - Assert.isTrue(observable.getRealm().isCurrent()); - Set lastObservableSet = (Set) currentObservableSet.get(); - if (lastObservableSet == null) { - return; - } - IChangeListener lastChangeListener = (IChangeListener) currentChangeListener - .get(); - IStaleListener lastStaleListener = (IStaleListener) currentStaleListener - .get(); - - boolean added = false; - if (lastObservableSet != null) { - added = lastObservableSet.add(new IdentityWrapper(observable)); - } - - // If anyone is listening for observable usage... - if (added && lastChangeListener != null) { - observable.addChangeListener(lastChangeListener); - } - if (added && lastStaleListener != null) { - observable.addStaleListener(lastStaleListener); - } - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.java deleted file mode 100644 index 9a5abfa3..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.java +++ /dev/null @@ -1,165 +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.core.databinding.observable; - -import java.util.List; -import java.util.Set; - -import org.eclipse.core.databinding.observable.list.IListChangeListener; -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.list.ObservableList; -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.internal.databinding.observable.EmptyObservableList; -import org.eclipse.core.internal.databinding.observable.EmptyObservableSet; -import org.eclipse.core.internal.databinding.observable.ProxyObservableSet; -import org.eclipse.core.internal.databinding.observable.UnmodifiableObservableList; - -/** - * Contains static methods to operate on or return - * {@link IObservable Observables}. - * - * @since 3.2 - */ -public class Observables { - /** - * @param list - * @return list Returns an unmodifiable view of the provided - * <code>list</code>. - */ - public static IObservableList unmodifiableObservableList( - IObservableList list) { - if (list == null) { - throw new IllegalArgumentException( - "Parameter " + list + " was null."); //$NON-NLS-1$ //$NON-NLS-2$ - } - - return new UnmodifiableObservableList(list); - } - - /** - * Returns an empty observable list. The returned list continues to work - * after it has been disposed of and can be disposed of multiple times. - * - * @return an empty observable list. - */ - public static IObservableList emptyObservableList() { - return new EmptyObservableList(Realm.getDefault()); - } - - /** - * Returns an empty observable list. The returned list continues to work - * after it has been disposed of and can be disposed of multiple times. - * - * @param realm - * @return an empty observable list. - */ - public static IObservableList emptyObservableList(Realm realm) { - return new EmptyObservableList(realm); - } - - /** - * Returns an empty observable set. The returned set continues to work after - * it has been disposed of and can be disposed of multiple times. - * - * @return an empty observable set. - */ - public static IObservableSet emptyObservableSet() { - return new EmptyObservableSet(Realm.getDefault()); - } - - /** - * Returns an empty observable set. The returned set continues to work after - * it has been disposed of and can be disposed of multiple times. - * - * @param realm - * @return an empty observable set. - */ - public static IObservableSet emptyObservableSet(Realm realm) { - return new EmptyObservableSet(realm); - } - - /** - * @param set - * @return Returns an observableSet backed by the given set - */ - public static IObservableSet staticObservableSet(Set set) { - return new ObservableSet(Realm.getDefault(), set, Object.class) { - public void addChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void addSetChangeListener(ISetChangeListener listener) { - } - }; - } - - /** - * @param realm - * @param set - * @return Returns an observableSet backed by the given set - */ - public static IObservableSet staticObservableSet(Realm realm, Set set) { - return new ObservableSet(realm, set, Object.class) { - public void addChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void addSetChangeListener(ISetChangeListener listener) { - } - }; - } - - /** - * Returns an observable set that contains the same elements as the given - * set, and fires the same events as the given set, but can be disposed of - * without disposing of the wrapped set. - * - * @param target - * the set to wrap - * @return a proxy observable set - */ - public static IObservableSet proxyObservableSet(IObservableSet target) { - return new ProxyObservableSet(target); - } - - /** - * @param list - * @return an observable list that never fires events - */ - public static IObservableList staticObservableList(List list) { - return staticObservableList(Realm.getDefault(), list); - } - - /** - * @param realm - * @param list - * @return an observable list that never fires events - */ - public static IObservableList staticObservableList(Realm realm, List list) { - return new ObservableList(realm, list, Object.class) { - public void addChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void addListChangeListener(IListChangeListener listener) { - } - }; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Realm.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Realm.java deleted file mode 100644 index 27d08ff7..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Realm.java +++ /dev/null @@ -1,293 +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 168153 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable; - -import org.eclipse.core.databinding.Binding; -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.internal.databinding.Queue; -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.core.runtime.Status; - -/** - * A realm defines a context from which objects implementing {@link IObservable} - * must be accessed, and on which these objects will notify their listeners. To - * bridge between observables from different realms, subclasses of - * {@link Binding} can be used. - * <p> - * A block of code is said to be executing within a realm if calling - * {@link #isCurrent()} from that block returns true. Code reached by calling - * methods from that block will execute within the same realm, with the - * exception of methods on this class that can be used to execute code within a - * specific realm. Clients can use {@link #syncExec(Runnable)}, - * {@link #asyncExec(Runnable)}, or {@link #exec(Runnable)} to execute a - * runnable within this realm. Note that using {@link #syncExec(Runnable)} can - * lead to deadlocks and should be avoided if the current thread holds any - * locks. - * </p> - * <p> - * It is instructive to think about possible implementations of Realm: It can be - * based on executing on a designated thread such as a UI thread, or based on - * holding a lock. In the former case, calling syncExec on a realm that is not - * the current realm will execute the given runnable on a different thread (the - * designated thread). In the latter case, calling syncExec may execute the - * given runnable on the calling thread, but calling - * {@link #asyncExec(Runnable)} will execute the given runnable on a different - * thread. Therefore, no assumptions can be made about the thread that will - * execute arguments to {@link #asyncExec(Runnable)}, - * {@link #syncExec(Runnable)}, or {@link #exec(Runnable)}. - * </p> - * <p> - * It is possible that a block of code is executing within more than one realm. - * This can happen for implementations of Realm that are based on holding a lock - * but don't use a separate thread to run runnables given to - * {@link #syncExec(Runnable)}. Realm implementations of this kind should be - * appropriately documented because it increases the opportunity for deadlock. - * </p> - * <p> - * Some implementations of {@link IObservable} provide constructors which do not - * take a Realm argument and are specified to create the observable instance - * with the current default realm. The default realm can be set for the - * currently executing thread by using {@link #runWithDefault(Realm, Runnable)}. - * Note that the default realm does not have to be the current realm. - * </p> - * <p> - * Subclasses must override at least one of asyncExec()/syncExec(). For realms - * based on a designated thread, it may be easier to implement asyncExec and - * keep the default implementation of syncExec. For realms based on holding a - * lock, it may be easier to implement syncExec and keep the default - * implementation of asyncExec. - * </p> - * - * @since 1.0 - * - * @see IObservable - */ -public abstract class Realm { - - private static ThreadLocal defaultRealm = new ThreadLocal(); - - /** - * Returns the default realm for the calling thread, or <code>null</code> - * if no default realm has been set. - * - * @return the default realm, or <code>null</code> - */ - public static Realm getDefault() { - return (Realm) defaultRealm.get(); - } - - /** - * Sets the default realm for the calling thread, returning the current - * default thread. This method is inherently unsafe, it is recommended to - * use {@link #runWithDefault(Realm, Runnable)} instead. This method is - * exposed to subclasses to facilitate testing. - * - * @param realm - * the new default realm, or <code>null</code> - * @return the previous default realm, or <code>null</code> - */ - protected static Realm setDefault(Realm realm) { - Realm oldValue = getDefault(); - defaultRealm.set(realm); - return oldValue; - } - - /** - * @return true if the caller is executing in this realm. This method must - * not have side-effects (such as, for example, implicitly placing - * the caller in this realm). - */ - abstract public boolean isCurrent(); - - private Thread workerThread; - - Queue workQueue = new Queue(); - - /** - * Runs the given runnable. If an exception occurs within the runnable, it - * is logged and not re-thrown. If the runnable implements - * {@link ISafeRunnable}, the exception is passed to its - * <code>handleException<code> method. - * - * @param runnable - */ - protected static void safeRun(final Runnable runnable) { - ISafeRunnable safeRunnable; - if (runnable instanceof ISafeRunnable) { - safeRunnable = (ISafeRunnable) runnable; - } else { - safeRunnable = new ISafeRunnable() { - public void handleException(Throwable exception) { - Policy - .getLog() - .log( - new Status( - IStatus.ERROR, - Policy.JFACE_DATABINDING, - IStatus.OK, - "Unhandled exception: " + exception.getMessage(), exception)); //$NON-NLS-1$ - } - public void run() throws Exception { - runnable.run(); - } - }; - } - SafeRunner.run(safeRunnable); - } - - /** - * Causes the <code>run()</code> method of the runnable to be invoked from - * within this realm. If the caller is executing in this realm, the - * runnable's run method is invoked directly, otherwise it is run at the - * next reasonable opportunity using asyncExec. - * <p> - * If the given runnable is an instance of {@link ISafeRunnable}, its - * exception handler method will be called if any exceptions occur while - * running it. Otherwise, the exception will be logged. - * </p> - * - * @param runnable - */ - public void exec(Runnable runnable) { - if (isCurrent()) { - safeRun(runnable); - } else { - asyncExec(runnable); - } - } - - /** - * Causes the <code>run()</code> method of the runnable to be invoked from - * within this realm at the next reasonable opportunity. The caller of this - * method continues to run in parallel, and is not notified when the - * runnable has completed. - * <p> - * If the given runnable is an instance of {@link ISafeRunnable}, its - * exception handler method will be called if any exceptions occur while - * running it. Otherwise, the exception will be logged. - * </p> - * <p> - * Subclasses should use {@link #safeRun(Runnable)} to run the runnable. - * </p> - * - * @param runnable - */ - public void asyncExec(Runnable runnable) { - synchronized (workQueue) { - ensureWorkerThreadIsRunning(); - workQueue.enqueue(runnable); - workQueue.notifyAll(); - } - } - - /** - * - */ - private void ensureWorkerThreadIsRunning() { - if (workerThread == null) { - workerThread = new Thread() { - public void run() { - try { - while (true) { - Runnable work = null; - synchronized (workQueue) { - while (workQueue.isEmpty()) { - workQueue.wait(); - } - work = (Runnable) workQueue.dequeue(); - } - syncExec(work); - } - } catch (InterruptedException e) { - // exit - } - } - }; - workerThread.start(); - } - } - - /** - * Causes the <code>run()</code> method of the runnable to be invoked from - * within this realm at the next reasonable opportunity. This method is - * blocking the caller until the runnable completes. - * <p> - * If the given runnable is an instance of {@link ISafeRunnable}, its - * exception handler method will be called if any exceptions occur while - * running it. Otherwise, the exception will be logged. - * </p> - * <p> - * Subclasses should use {@link #safeRun(Runnable)} to run the runnable. - * </p> - * <p> - * Note: This class is not meant to be called by clients and therefore has - * only protected access. - * </p> - * - * @param runnable - */ - protected void syncExec(Runnable runnable) { - SyncRunnable syncRunnable = new SyncRunnable(runnable); - asyncExec(syncRunnable); - synchronized (syncRunnable) { - while (!syncRunnable.hasRun) { - try { - syncRunnable.wait(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - } - } - - static class SyncRunnable implements Runnable { - boolean hasRun = false; - - private Runnable runnable; - - SyncRunnable(Runnable runnable) { - this.runnable = runnable; - } - - public void run() { - try { - safeRun(runnable); - } finally { - synchronized (this) { - hasRun = true; - this.notifyAll(); - } - } - } - } - - /** - * Sets the provided <code>realm</code> as the default for the duration of - * {@link Runnable#run()} and resets the previous realm after completion. - * Note that this will not set the given realm as the current realm. - * - * @param realm - * @param runnable - */ - public static void runWithDefault(Realm realm, Runnable runnable) { - Realm oldRealm = Realm.getDefault(); - try { - defaultRealm.set(realm); - runnable.run(); - } finally { - defaultRealm.set(oldRealm); - } - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/StaleEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/StaleEvent.java deleted file mode 100644 index 14e8c76b..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/StaleEvent.java +++ /dev/null @@ -1,54 +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.databinding.observable; - -/** - * Generic event denoting that the state of an {@link IObservable} object is - * about to change. Note that this event is only fired when an observable - * becomes stale, not when it becomes unstale; an observable that becomes - * unstale should always fire a change event. Staleness can be used (for - * example) to notify listeners when an observable has started a background - * thread for updating its state. Clients can safely ignore staleness. - * - * @see IObservable#isStale() - * - * @since 1.0 - * - */ -public class StaleEvent extends ObservableEvent { - - /** - * Creates a new stale event. - * - * @param source - * the source observable - */ - public StaleEvent(IObservable source) { - super(source); - } - - /** - * - */ - private static final long serialVersionUID = 3491012225431471077L; - - static final Object TYPE = new Object(); - - protected void dispatch(IObservablesListener listener) { - ((IStaleListener) listener).handleStale(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.java deleted file mode 100644 index c4e054c2..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.java +++ /dev/null @@ -1,270 +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 - * Brad Reynolds - bug 167204 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.list; - -import java.util.AbstractList; -import java.util.Collection; -import java.util.Iterator; - -import org.eclipse.core.databinding.observable.ChangeEvent; -import org.eclipse.core.databinding.observable.ChangeSupport; -import org.eclipse.core.databinding.observable.IChangeListener; -import org.eclipse.core.databinding.observable.IStaleListener; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.StaleEvent; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.AssertionFailedException; - -/** - * Subclasses should override at least get(int index) and size(). - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - * - */ -public abstract class AbstractObservableList extends AbstractList implements - IObservableList { - - private ChangeSupport changeSupport; - - /** - * @param realm - * - */ - public AbstractObservableList(Realm realm) { - Assert.isNotNull(realm); - changeSupport = new ChangeSupport(realm){ - protected void firstListenerAdded() { - AbstractObservableList.this.firstListenerAdded(); - } - protected void lastListenerRemoved() { - AbstractObservableList.this.lastListenerRemoved(); - } - }; - } - - /** - * - */ - public AbstractObservableList() { - this(Realm.getDefault()); - } - - public boolean isStale() { - return false; - } - - public synchronized void addListChangeListener(IListChangeListener listener) { - changeSupport.addListener(ListChangeEvent.TYPE, listener); - } - - public synchronized void removeListChangeListener(IListChangeListener listener) { - changeSupport.removeListener(ListChangeEvent.TYPE, listener); - } - - protected void fireListChange(ListDiff diff) { - // fire general change event first - fireChange(); - changeSupport.fireEvent(new ListChangeEvent(this, diff)); - } - - public synchronized void addChangeListener(IChangeListener listener) { - changeSupport.addChangeListener(listener); - } - - public synchronized void removeChangeListener(IChangeListener listener) { - changeSupport.removeChangeListener(listener); - } - - public synchronized void addStaleListener(IStaleListener listener) { - changeSupport.addStaleListener(listener); - } - - public synchronized void removeStaleListener(IStaleListener listener) { - changeSupport.removeStaleListener(listener); - } - - /** - * Fires change event. Must be invoked from the current realm. - */ - protected void fireChange() { - checkRealm(); - changeSupport.fireEvent(new ChangeEvent(this)); - } - - /** - * Fires stale event. Must be invoked from the current realm. - */ - protected void fireStale() { - checkRealm(); - changeSupport.fireEvent(new StaleEvent(this)); - } - - /** - * - */ - protected void firstListenerAdded() { - } - - /** - * - */ - protected void lastListenerRemoved() { - } - - /** - * - */ - public synchronized void dispose() { - changeSupport = null; - lastListenerRemoved(); - } - - public final int size() { - getterCalled(); - return doGetSize(); - } - - /** - * @return the size - */ - protected abstract int doGetSize(); - - /** - * - */ - private void getterCalled() { - ObservableTracker.getterCalled(this); - } - - public boolean isEmpty() { - getterCalled(); - return super.isEmpty(); - } - - public boolean contains(Object o) { - getterCalled(); - return super.contains(o); - } - - public Iterator iterator() { - getterCalled(); - final Iterator wrappedIterator = super.iterator(); - return new Iterator() { - public void remove() { - wrappedIterator.remove(); - } - - public boolean hasNext() { - return wrappedIterator.hasNext(); - } - - public Object next() { - return wrappedIterator.next(); - } - }; - } - - public Object[] toArray() { - getterCalled(); - return super.toArray(); - } - - public Object[] toArray(Object a[]) { - getterCalled(); - return super.toArray(a); - } - - // Modification Operations - - public boolean add(Object o) { - getterCalled(); - return super.add(o); - } - - public boolean remove(Object o) { - getterCalled(); - return super.remove(o); - } - - // Bulk Modification Operations - - public boolean containsAll(Collection c) { - getterCalled(); - return super.containsAll(c); - } - - public boolean addAll(Collection c) { - getterCalled(); - return super.addAll(c); - } - - public boolean addAll(int index, Collection c) { - getterCalled(); - return super.addAll(c); - } - - public boolean removeAll(Collection c) { - getterCalled(); - return super.removeAll(c); - } - - public boolean retainAll(Collection c) { - getterCalled(); - return super.retainAll(c); - } - - // Comparison and hashing - - public boolean equals(Object o) { - getterCalled(); - return super.equals(o); - } - - public int hashCode() { - getterCalled(); - return super.hashCode(); - } - - public int indexOf(Object o) { - getterCalled(); - return super.indexOf(o); - } - - public int lastIndexOf(Object o) { - getterCalled(); - return super.lastIndexOf(o); - } - - public Realm getRealm() { - return changeSupport.getRealm(); - } - - /** - * Asserts that the realm is the current realm. - * - * @see Realm#isCurrent() - * @throws AssertionFailedException - * if the realm is not the current realm - */ - protected void checkRealm() { - Assert.isTrue(getRealm().isCurrent()); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java deleted file mode 100644 index 83727299..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IListChangeListener.java +++ /dev/null @@ -1,33 +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.databinding.observable.list; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for changes to observable lists. - * - * @since 1.0 - */ -public interface IListChangeListener extends IObservablesListener { - - /** - * Handle a change to an observable list. The change is described by the - * diff object. The given event object must only be used locally in this - * method because it may be reused for other change notifications. The diff - * object referenced by the event is immutable and may be used non-locally. - * - * @param event - */ - void handleListChange(ListChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IObservableList.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IObservableList.java deleted file mode 100644 index 27589e98..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/IObservableList.java +++ /dev/null @@ -1,169 +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.core.databinding.observable.list; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.core.databinding.observable.IObservableCollection; - -/** - * A list whose changes can be tracked by list change listeners. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the framework classes that implement this interface. - * Note that direct implementers of this interface outside of the framework will - * be broken in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - */ -public interface IObservableList extends List, IObservableCollection { - - /** - * Adds the given list change listener to the list of list change listeners. - * @param listener - */ - public void addListChangeListener(IListChangeListener listener); - - /** - * Removes the given list change listener from the list of list change listeners. - * Has no effect if the given listener is not registered as a list change listener. - * - * @param listener - */ - public void removeListChangeListener(IListChangeListener listener); - - /** - * @TrackedGetter - */ - public int size(); - - /** - * @TrackedGetter - */ - public boolean isEmpty(); - - /** - * @TrackedGetter - */ - public boolean contains(Object o); - - /** - * @TrackedGetter - */ - public Iterator iterator(); - - /** - * @TrackedGetter - */ - public Object[] toArray(); - - /** - * @TrackedGetter - */ - public Object[] toArray(Object a[]); - - /** - * - */ - public boolean add(Object o); - - /** - * - */ - public boolean remove(Object o); - - /** - * @TrackedGetter - */ - public boolean containsAll(Collection c); - - /** - * - */ - public boolean addAll(Collection c); - - /** - * - */ - public boolean addAll(int index, Collection c); - - /** - * - */ - public boolean removeAll(Collection c); - - /** - * - */ - public boolean retainAll(Collection c); - - /** - * @TrackedGetter - */ - public boolean equals(Object o); - - /** - * @TrackedGetter - */ - public int hashCode(); - - /** - * @TrackedGetter - */ - public Object get(int index); - - /** - * - */ - public Object set(int index, Object element); - - /** - * - */ - public Object remove(int index); - - /** - * @TrackedGetter - */ - public int indexOf(Object o); - - /** - * @TrackedGetter - */ - public int lastIndexOf(Object o); - - /** - * @TrackedGetter - */ - public ListIterator listIterator(); - - /** - * @TrackedGetter - */ - public ListIterator listIterator(int index); - - /** - * @TrackedGetter - */ - public List subList(int fromIndex, int toIndex); - - /** - * @return the type of the elements or <code>null</code> if untyped - */ - Object getElementType(); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.java deleted file mode 100644 index 1b2ce4d7..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.java +++ /dev/null @@ -1,68 +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.databinding.observable.list; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * List change event describing an incremental change of an - * {@link IObservableList} object. - * - * @since 1.0 - */ -public class ListChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = -9154315534258776672L; - - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable list. Listeners must - * not change this field. - */ - public ListDiff diff; - - /** - * Creates a new list change event. - * - * @param source - * the source observable list - * @param diff - * the list change - */ - public ListChangeEvent(IObservableList source, ListDiff diff) { - super(source); - this.diff = diff; - } - - /** - * Returns the observable list from which this event originated. - * - * @return the observable list from which this event originated - */ - public IObservableList getObservableList() { - return (IObservableList) getSource(); - } - - protected void dispatch(IObservablesListener listener) { - ((IListChangeListener) listener).handleListChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiff.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiff.java deleted file mode 100644 index b87edadf..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiff.java +++ /dev/null @@ -1,60 +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.databinding.observable.list; - - -/** - * Object describing a diff between two lists. - * - * @since 1.0 - */ -public abstract class ListDiff { - - /** - * Returns a list of ListDiffEntry - * - * @return a list of ListDiffEntry - */ - public abstract ListDiffEntry[] getDifferences(); - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - ListDiffEntry[] differences = getDifferences(); - StringBuffer buffer = new StringBuffer(); - buffer.append(getClass().getName()); - - if (differences == null || differences.length == 0) { - buffer - .append("{}"); //$NON-NLS-1$ - } else { - buffer - .append("{"); //$NON-NLS-1$ - - for (int i = 0; i < differences.length; i++) { - if (i > 0) - buffer.append(", "); //$NON-NLS-1$ - - buffer - .append("difference[") //$NON-NLS-1$ - .append(i) - .append("] [") //$NON-NLS-1$ - .append(differences[i] != null ? differences[i].toString() : "null") //$NON-NLS-1$ - .append("]"); //$NON-NLS-1$ - } - buffer.append("}"); //$NON-NLS-1$ - } - - return buffer.toString(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiffEntry.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiffEntry.java deleted file mode 100644 index da2e79ff..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiffEntry.java +++ /dev/null @@ -1,53 +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.core.databinding.observable.list; - -/** - * A single addition of an element to a list or removal of an element from a list. - * - * @since 1.0 - */ -public abstract class ListDiffEntry { - - /** - * @return the 0-based position of the addition or removal - */ - public abstract int getPosition(); - - /** - * @return true if this represents an addition, false if this represents a removal - */ - public abstract boolean isAddition(); - - /** - * @return the element that was added or removed - */ - public abstract Object getElement(); - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer - .append(this.getClass().getName()) - .append("{position [") //$NON-NLS-1$ - .append(getPosition()) - .append("], isAddition [") //$NON-NLS-1$ - .append(isAddition()) - .append("], element [") //$NON-NLS-1$ - .append(getElement() != null ? getElement().toString() : "null") //$NON-NLS-1$ - .append("]}"); //$NON-NLS-1$ - - return buffer.toString(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ObservableList.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ObservableList.java deleted file mode 100644 index 7ce5417d..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ObservableList.java +++ /dev/null @@ -1,316 +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 - * Brad Reynolds - bug 167204 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.list; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * Abstract implementation of {@link IObservableList}, based on an underlying regular list. - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - * - */ -public abstract class ObservableList extends AbstractObservable implements - IObservableList { - - protected List wrappedList; - - /** - * Stale state of the list. Access must occur in the current realm. - */ - private boolean stale = false; - - private Object elementType; - - protected ObservableList(List wrappedList, Object elementType) { - this(Realm.getDefault(), wrappedList, elementType); - } - - protected ObservableList(Realm realm, List wrappedList, Object elementType) { - super(realm); - this.wrappedList = wrappedList; - this.elementType = elementType; - } - - public synchronized void addListChangeListener(IListChangeListener listener) { - addListener(ListChangeEvent.TYPE, listener); - } - - public synchronized void removeListChangeListener(IListChangeListener listener) { - removeListener(ListChangeEvent.TYPE, listener); - } - - protected void fireListChange(ListDiff diff) { - // fire general change event first - super.fireChange(); - fireEvent(new ListChangeEvent(this, diff)); - } - - public boolean contains(Object o) { - getterCalled(); - return wrappedList.contains(o); - } - - public boolean containsAll(Collection c) { - getterCalled(); - return wrappedList.containsAll(c); - } - - public boolean equals(Object o) { - getterCalled(); - return wrappedList.equals(o); - } - - public int hashCode() { - getterCalled(); - return wrappedList.hashCode(); - } - - public boolean isEmpty() { - getterCalled(); - return wrappedList.isEmpty(); - } - - public Iterator iterator() { - getterCalled(); - final Iterator wrappedIterator = wrappedList.iterator(); - return new Iterator() { - - public void remove() { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - return wrappedIterator.hasNext(); - } - - public Object next() { - return wrappedIterator.next(); - } - }; - } - - public int size() { - getterCalled(); - return wrappedList.size(); - } - - public Object[] toArray() { - getterCalled(); - return wrappedList.toArray(); - } - - public Object[] toArray(Object[] a) { - getterCalled(); - return wrappedList.toArray(a); - } - - public String toString() { - getterCalled(); - return wrappedList.toString(); - } - - /** - * @TrackedGetter - */ - public Object get(int index) { - getterCalled(); - return wrappedList.get(index); - } - - /** - * @TrackedGetter - */ - public int indexOf(Object o) { - getterCalled(); - return wrappedList.indexOf(o); - } - - /** - * @TrackedGetter - */ - public int lastIndexOf(Object o) { - getterCalled(); - return wrappedList.lastIndexOf(o); - } - - // List Iterators - - /** - * @TrackedGetter - */ - public ListIterator listIterator() { - return listIterator(0); - } - - /** - * @TrackedGetter - */ - public ListIterator listIterator(int index) { - getterCalled(); - final ListIterator wrappedIterator = wrappedList.listIterator(index); - return new ListIterator() { - - public int nextIndex() { - return wrappedIterator.nextIndex(); - } - - public int previousIndex() { - return wrappedIterator.previousIndex(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - return wrappedIterator.hasNext(); - } - - public boolean hasPrevious() { - return wrappedIterator.hasPrevious(); - } - - public Object next() { - return wrappedIterator.next(); - } - - public Object previous() { - return wrappedIterator.previous(); - } - - public void add(Object o) { - throw new UnsupportedOperationException(); - } - - public void set(Object o) { - throw new UnsupportedOperationException(); - } - }; - } - - - public List subList(int fromIndex, int toIndex) { - getterCalled(); - return wrappedList.subList(fromIndex, toIndex); - } - - protected void getterCalled() { - ObservableTracker.getterCalled(this); - } - - public Object set(int index, Object element) { - throw new UnsupportedOperationException(); - } - - public Object remove(int index) { - throw new UnsupportedOperationException(); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public void add(int index, Object element) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(int index, Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - /** - * Returns the stale state. Must be invoked from the current realm. - * - * @return stale state - */ - public boolean isStale() { - checkRealm(); - return stale; - } - - /** - * Sets the stale state. Must be invoked from the current realm. - * - * @param stale - * The stale state to list. This will fire a stale event if the - * given boolean is true and this observable list was not already - * stale. - */ - public void setStale(boolean stale) { - checkRealm(); - - boolean wasStale = this.stale; - this.stale = stale; - if (!wasStale && stale) { - fireStale(); - } - } - - protected void fireChange() { - throw new RuntimeException("fireChange should not be called, use fireListChange() instead"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.jface.provisional.databinding.observable.AbstractObservable#dispose() - */ - public synchronized void dispose() { - super.dispose(); - } - - public Object getElementType() { - return elementType; - } - - protected void updateWrappedList(List newList) { - List oldList = wrappedList; - ListDiff listDiff = Diffs.computeListDiff(oldList, newList); - wrappedList = newList; - fireListChange(listDiff); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/WritableList.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/WritableList.java deleted file mode 100644 index 4158ce6e..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/WritableList.java +++ /dev/null @@ -1,214 +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 167204 - * Gautam Saggar - bug 169529 - * Brad Reynolds - bug 147515 - *******************************************************************************/ -package org.eclipse.core.databinding.observable.list; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; - -/** - * Mutable observable list backed by an ArrayList. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - */ -public class WritableList extends ObservableList { - - /** - * Creates an empty writable list in the default realm with a - * <code>null</code> element type. - * - */ - public WritableList() { - this(Realm.getDefault()); - } - - /** - * Creates an empty writable list with a <code>null</code> element type. - * - * @param realm - */ - public WritableList(Realm realm) { - this(realm, new ArrayList(), null); - } - - /** - * Construts a new instance with the default realm. - * - * @param toWrap - * @param elementType - * can be <code>null</code> - */ - public WritableList(List toWrap, Object elementType) { - this(Realm.getDefault(), toWrap, elementType); - } - - /** - * Creates a writable list containing elements of the given type, wrapping - * an existing client-supplied list. - * - * @param realm - * @param toWrap - * The java.utilList to wrap - * @param elementType - * can be <code>null</code> - */ - public WritableList(Realm realm, List toWrap, Object elementType) { - super(realm, toWrap, elementType); - } - - public Object set(int index, Object element) { - checkRealm(); - Object oldElement = wrappedList.set(index, element); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index, - false, oldElement), Diffs.createListDiffEntry(index, true, - element))); - return oldElement; - } - - public Object remove(int index) { - checkRealm(); - Object oldElement = wrappedList.remove(index); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index, - false, oldElement))); - return oldElement; - } - - public boolean add(Object element) { - checkRealm(); - boolean added = wrappedList.add(element); - if (added) { - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry( - wrappedList.size() - 1, true, element))); - } - return added; - } - - public void add(int index, Object element) { - checkRealm(); - wrappedList.add(index, element); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index, - true, element))); - } - - public boolean addAll(Collection c) { - checkRealm(); - ListDiffEntry[] entries = new ListDiffEntry[c.size()]; - int i = 0; - int addIndex = wrappedList.size(); - for (Iterator it = c.iterator(); it.hasNext();) { - Object element = it.next(); - entries[i++] = Diffs.createListDiffEntry(addIndex++, true, element); - } - boolean added = wrappedList.addAll(c); - fireListChange(Diffs.createListDiff(entries)); - return added; - } - - public boolean addAll(int index, Collection c) { - checkRealm(); - ListDiffEntry[] entries = new ListDiffEntry[c.size()]; - int i = 0; - int addIndex = index; - for (Iterator it = c.iterator(); it.hasNext();) { - Object element = it.next(); - entries[i++] = Diffs.createListDiffEntry(addIndex++, true, element); - } - boolean added = wrappedList.addAll(index, c); - fireListChange(Diffs.createListDiff(entries)); - return added; - } - - public boolean remove(Object o) { - checkRealm(); - int index = wrappedList.indexOf(o); - if (index == -1) { - return false; - } - wrappedList.remove(index); - fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index, - false, o))); - return true; - } - - public boolean removeAll(Collection c) { - checkRealm(); - List entries = new ArrayList(); - for (Iterator it = c.iterator(); it.hasNext();) { - Object element = it.next(); - int removeIndex = wrappedList.indexOf(element); - if (removeIndex != -1) { - wrappedList.remove(removeIndex); - entries.add(Diffs.createListDiffEntry(removeIndex, false, - element)); - } - } - fireListChange(Diffs.createListDiff((ListDiffEntry[]) entries - .toArray(new ListDiffEntry[entries.size()]))); - return entries.size() > 0; - } - - public boolean retainAll(Collection c) { - checkRealm(); - List entries = new ArrayList(); - int removeIndex = 0; - for (Iterator it = wrappedList.iterator(); it.hasNext();) { - Object element = it.next(); - if (!c.contains(element)) { - entries.add(Diffs.createListDiffEntry(removeIndex, false, - element)); - it.remove(); - } else { - // only increment if we haven't removed the current element - removeIndex++; - } - } - fireListChange(Diffs.createListDiff((ListDiffEntry[]) entries - .toArray(new ListDiffEntry[entries.size()]))); - return entries.size() > 0; - } - - public void clear() { - checkRealm(); - List entries = new ArrayList(); - for (Iterator it = wrappedList.iterator(); it.hasNext();) { - Object element = it.next(); - // always report 0 as the remove index - entries.add(Diffs.createListDiffEntry(0, false, element)); - it.remove(); - } - fireListChange(Diffs.createListDiff((ListDiffEntry[]) entries - .toArray(new ListDiffEntry[entries.size()]))); - } - - /** - * @param elementType - * can be <code>null</code> - * @return new list with the default realm. - */ - public static WritableList withElementType(Object elementType) { - return new WritableList(Realm.getDefault(), new ArrayList(), - elementType); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/package.html deleted file mode 100644 index 2c2f1db6..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/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> -Provides classes for observing changes in lists. -<h2> -Package Specification</h2> -<p> -This package provides classes for observing changes in lists.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java deleted file mode 100644 index 29248b13..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java +++ /dev/null @@ -1,162 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.map; - -import java.util.AbstractMap; - -import org.eclipse.core.databinding.observable.ChangeEvent; -import org.eclipse.core.databinding.observable.ChangeSupport; -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.StaleEvent; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.AssertionFailedException; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public abstract class AbstractObservableMap extends AbstractMap implements - IObservableMap { - - private ChangeSupport changeSupport; - - private boolean stale; - - /** - */ - public AbstractObservableMap() { - this(Realm.getDefault()); - } - - /** - * - */ - protected void lastListenerRemoved() { - } - - /** - * - */ - protected void firstListenerAdded() { - } - - /** - * @param realm - */ - public AbstractObservableMap(Realm realm) { - Assert.isNotNull(realm); - changeSupport = new ChangeSupport(realm){ - protected void firstListenerAdded() { - AbstractObservableMap.this.firstListenerAdded(); - } - protected void lastListenerRemoved() { - AbstractObservableMap.this.lastListenerRemoved(); - } - }; - } - - public synchronized void addMapChangeListener(IMapChangeListener listener) { - changeSupport.addListener(MapChangeEvent.TYPE, listener); - } - - public synchronized void removeMapChangeListener(IMapChangeListener listener) { - changeSupport.removeListener(MapChangeEvent.TYPE, listener); - } - - public synchronized void addChangeListener(IChangeListener listener) { - changeSupport.addChangeListener(listener); - } - - public synchronized void addStaleListener(IStaleListener listener) { - changeSupport.addStaleListener(listener); - } - - public synchronized void dispose() { - changeSupport.dispose(); - changeSupport = null; - } - - public Realm getRealm() { - return changeSupport.getRealm(); - } - - public boolean isStale() { - checkRealm(); - return stale; - } - - public synchronized void removeChangeListener(IChangeListener listener) { - changeSupport.removeChangeListener(listener); - } - - public synchronized void removeStaleListener(IStaleListener listener) { - changeSupport.removeStaleListener(listener); - } - - /** - * Sets the stale state. Must be invoked from the current realm. - * - * @param stale - */ - public void setStale(boolean stale) { - checkRealm(); - this.stale = stale; - if (stale) { - fireStale(); - } - } - - /** - * Fires stale events. Must be invoked from current realm. - */ - protected void fireStale() { - checkRealm(); - changeSupport.fireEvent(new StaleEvent(this)); - } - - /** - * Fires change events. Must be invoked from current realm. - */ - protected void fireChange() { - checkRealm(); - changeSupport.fireEvent(new ChangeEvent(this)); - } - - /** - * Fires map change events. Must be invoked from current realm. - * - * @param diff - */ - protected void fireMapChange(MapDiff diff) { - checkRealm(); - changeSupport.fireEvent(new MapChangeEvent(this, diff)); - } - - /** - * Asserts that the realm is the current realm. - * - * @see Realm#isCurrent() - * @throws AssertionFailedException - * if the realm is not the current realm - */ - protected void checkRealm() { - Assert.isTrue(getRealm().isCurrent()); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/BidirectionalMap.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/BidirectionalMap.java deleted file mode 100644 index c83f6eef..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/BidirectionalMap.java +++ /dev/null @@ -1,104 +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.databinding.observable.map; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - * - */ -public class BidirectionalMap extends ObservableMap { - - private Map valueToElements = new HashMap(); - - private IMapChangeListener mapListener = new IMapChangeListener() { - - public void handleMapChange(MapChangeEvent event) { - MapDiff diff = event.diff; - for (Iterator it = diff.getAddedKeys().iterator(); it.hasNext();) { - Object addedKey = it.next(); - addMapping(addedKey, diff.getNewValue(addedKey)); - } - for (Iterator it = diff.getChangedKeys().iterator(); it.hasNext();) { - Object changedKey = it.next(); - removeMapping(changedKey, diff.getOldValue(changedKey)); - addMapping(changedKey, diff.getNewValue(changedKey)); - } - for (Iterator it = diff.getRemovedKeys().iterator(); it.hasNext();) { - Object removedKey = it.next(); - removeMapping(removedKey, diff.getOldValue(removedKey)); - } - fireMapChange(diff); - } - }; - - /** - * @param wrappedMap - */ - public BidirectionalMap(IObservableMap wrappedMap) { - super(wrappedMap.getRealm(), wrappedMap); - wrappedMap.addMapChangeListener(mapListener); - for (Iterator it = wrappedMap.entrySet().iterator(); it.hasNext();) { - Map.Entry entry = (Entry) it.next(); - addMapping(entry.getKey(), entry.getValue()); - } - } - - /** - * @param key - * @param value - */ - private void addMapping(Object key, Object value) { - Object elementOrSet = valueToElements.get(value); - if (elementOrSet == null) { - valueToElements.put(value, key); - return; - } - if (!(elementOrSet instanceof Set)) { - elementOrSet = new HashSet(Collections.singleton(elementOrSet)); - valueToElements.put(value, elementOrSet); - } - Set set = (Set) elementOrSet; - set.add(key); - } - - /** - * @param functionValue - * @param element - */ - private void removeMapping(Object functionValue, Object element) { - Object elementOrSet = valueToElements.get(functionValue); - if (elementOrSet instanceof Set) { - Set set = (Set) elementOrSet; - set.remove(element); - if (set.size() == 0) { - valueToElements.remove(functionValue); - } - } else { - valueToElements.remove(functionValue); - } - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java deleted file mode 100644 index f7438926..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.java +++ /dev/null @@ -1,161 +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.databinding.observable.map; - -import java.util.AbstractSet; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.observable.set.ISetChangeListener; -import org.eclipse.core.databinding.observable.set.SetChangeEvent; - -/** - * Maps objects to one of their attributes. Tracks changes to the underlying - * observable set of objects (keys), as well as changes to attribute values. - */ -public abstract class ComputedObservableMap extends AbstractObservableMap { - - private final IObservableSet keySet; - - private ISetChangeListener setChangeListener = new ISetChangeListener() { - public void handleSetChange(SetChangeEvent event) { - Set addedKeys = new HashSet(event.diff.getAdditions()); - Set removedKeys = new HashSet(event.diff.getRemovals()); - Map oldValues = new HashMap(); - Map newValues = new HashMap(); - for (Iterator it = removedKeys.iterator(); it.hasNext();) { - Object removedKey = it.next(); - Object oldValue = doGet(removedKey); - unhookListener(removedKey); - if (oldValue != null) { - oldValues.put(removedKey, oldValue); - } - } - for (Iterator it = addedKeys.iterator(); it.hasNext();) { - Object addedKey = it.next(); - hookListener(addedKey); - Object newValue = doGet(addedKey); - newValues.put(addedKey, newValue); - } - fireMapChange(Diffs.createMapDiff(addedKeys, removedKeys, - Collections.EMPTY_SET, oldValues, newValues)); - } - }; - - private Set entrySet = new EntrySet(); - - private class EntrySet extends AbstractSet { - - public Iterator iterator() { - final Iterator keyIterator = keySet.iterator(); - return new Iterator() { - - public boolean hasNext() { - return keyIterator.hasNext(); - } - - public Object next() { - final Object key = keyIterator.next(); - return new Map.Entry() { - - public Object getKey() { - return key; - } - - public Object getValue() { - return get(getKey()); - } - - public Object setValue(Object value) { - return put(getKey(), value); - } - }; - } - - public void remove() { - keyIterator.remove(); - } - }; - } - - public int size() { - return keySet.size(); - } - - } - - /** - * @param keySet - */ - public ComputedObservableMap(IObservableSet keySet) { - super(keySet.getRealm()); - this.keySet = keySet; - this.keySet.addSetChangeListener(setChangeListener); - } - - protected void init() { - for (Iterator it = this.keySet.iterator(); it.hasNext();) { - Object key = it.next(); - hookListener(key); - } - } - - protected final void fireSingleChange(Object key, Object oldValue, - Object newValue) { - fireMapChange(Diffs.createMapDiffSingleChange(key, oldValue, newValue)); - } - - public Set entrySet() { - return entrySet; - } - - public Set keySet() { - return keySet; - } - - final public Object get(Object key) { - return doGet(key); - } - - final public Object put(Object key, Object value) { - return doPut(key, value); - } - - /** - * @param removedKey - */ - protected abstract void unhookListener(Object removedKey); - - /** - * @param addedKey - */ - protected abstract void hookListener(Object addedKey); - - /** - * @param key - * @return the value for the given key - */ - protected abstract Object doGet(Object key); - - /** - * @param key - * @param value - * @return the old value for the given key - */ - protected abstract Object doPut(Object key, Object value); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/IMapChangeListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/IMapChangeListener.java deleted file mode 100644 index 3bc829e9..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/IMapChangeListener.java +++ /dev/null @@ -1,35 +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.databinding.observable.map; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for changes to observable maps. - * - * @since 1.0 - * - */ -public interface IMapChangeListener extends IObservablesListener { - - /** - * Handle a change an observable map. The given event object must only be - * used locally in this method because it may be reused for other change - * notifications. The diff object referenced by the event is immutable and - * may be used non-locally. - * - * @param event - * the event - */ - void handleMapChange(MapChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/IObservableMap.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/IObservableMap.java deleted file mode 100644 index 17d06649..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/IObservableMap.java +++ /dev/null @@ -1,104 +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 164653 - ******************************************************************************/ - -package org.eclipse.core.databinding.observable.map; - -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.IObservable; - -/** - * Observable Map. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.1 - */ -public interface IObservableMap extends Map, IObservable { - - /** - * @param listener - */ - public void addMapChangeListener(IMapChangeListener listener); - - /** - * @param listener - */ - public void removeMapChangeListener(IMapChangeListener listener); - - /** - * @TrackedGetter - */ - public int size(); - - /** - * @TrackedGetter - */ - public boolean isEmpty(); - - /** - * @TrackedGetter - */ - public boolean containsKey(Object key); - - /** - * @TrackedGetter - */ - public boolean containsValue(Object value); - - /** - * @TrackedGetter - */ - public Object get(Object key); - - /** - * - */ - public Object put(Object key, Object value); - - /** - * - */ - public Object remove(Object key); - - /** - * @TrackedGetter - */ - public Set keySet(); - - /** - * @TrackedGetter - */ - public Collection values(); - - /** - * @TrackedGetter - */ - public Set entrySet(); - - /** - * @TrackedGetter - */ - public boolean equals(Object o); - - /** - * @TrackedGetter - */ - public int hashCode(); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.java deleted file mode 100644 index 90bfef93..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.java +++ /dev/null @@ -1,68 +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.databinding.observable.map; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * Map change event describing an incremental change of an - * {@link IObservableMap} object. - * - * @since 1.0 - * - */ -public class MapChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = -8092347212410548463L; - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable map. Listeners must - * not change this field. - */ - public MapDiff diff; - - /** - * Creates a new map change event - * - * @param source - * the source observable map - * @param diff - * the map change - */ - public MapChangeEvent(IObservableMap source, MapDiff diff) { - super(source); - this.diff = diff; - } - - /** - * Returns the observable map from which this event originated. - * - * @return the observable map from which this event originated - */ - public IObservableMap getObservableMap() { - return (IObservableMap) getSource(); - } - - protected void dispatch(IObservablesListener listener) { - ((IMapChangeListener) listener).handleMapChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapDiff.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapDiff.java deleted file mode 100644 index f54c37cd..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapDiff.java +++ /dev/null @@ -1,54 +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.databinding.observable.map; - -import java.util.Set; - -/** - * @since 1.1 - * - */ -public abstract class MapDiff { - - /** - * @return the set of keys which were added - */ - public abstract Set getAddedKeys(); - - /** - * @return the set of keys which were removed - */ - public abstract Set getRemovedKeys(); - - /** - * @return the set of keys for which the value has changed - */ - public abstract Set getChangedKeys(); - - /** - * Returns the old value for the given key, which must be an element of - * {@link #getRemovedKeys()} or {@link #getChangedKeys()}. - * - * @param key - * @return the old value for the given key. - */ - public abstract Object getOldValue(Object key); - - /** - * Returns the new value for the given key, which must be an element of - * {@link #getChangedKeys()} or {@link #getAddedKeys()}. - * - * @param key - * @return the new value for the given key. - */ - public abstract Object getNewValue(Object key); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ObservableMap.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ObservableMap.java deleted file mode 100644 index 59883b12..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ObservableMap.java +++ /dev/null @@ -1,161 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.map; - -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public class ObservableMap extends AbstractObservable implements IObservableMap { - - protected Map wrappedMap; - - private boolean stale = false; - - /** - * @param wrappedMap - */ - public ObservableMap(Map wrappedMap) { - this(Realm.getDefault(), wrappedMap); - } - - /** - * @param realm - * @param wrappedMap - */ - public ObservableMap(Realm realm, Map wrappedMap) { - super(realm); - this.wrappedMap = wrappedMap; - } - - public synchronized void addMapChangeListener(IMapChangeListener listener) { - addListener(MapChangeEvent.TYPE, listener); - } - - public synchronized void removeMapChangeListener(IMapChangeListener listener) { - removeListener(MapChangeEvent.TYPE, listener); - } - - protected void getterCalled() { - ObservableTracker.getterCalled(this); - } - - protected void fireMapChange(MapDiff diff) { - checkRealm(); - - // fire general change event first - super.fireChange(); - - fireEvent(new MapChangeEvent(this, diff)); - } - - public boolean containsKey(Object key) { - getterCalled(); - return wrappedMap.containsKey(key); - } - - public boolean containsValue(Object value) { - getterCalled(); - return wrappedMap.containsValue(value); - } - - public Set entrySet() { - getterCalled(); - return wrappedMap.entrySet(); - } - - public Object get(Object key) { - getterCalled(); - return wrappedMap.get(key); - } - - public boolean isEmpty() { - getterCalled(); - return wrappedMap.isEmpty(); - } - - public Set keySet() { - getterCalled(); - return wrappedMap.keySet(); - } - - public int size() { - getterCalled(); - return wrappedMap.size(); - } - - public Collection values() { - getterCalled(); - return wrappedMap.values(); - } - - /** - * Returns the stale state. Must be invoked from the current realm. - * - * @return stale state - */ - public boolean isStale() { - checkRealm(); - return stale; - } - - /** - * Sets the stale state. Must be invoked from the current realm. - * - * @param stale - * The stale state to set. This will fire a stale event if the - * given boolean is true and this observable set was not already - * stale. - */ - public void setStale(boolean stale) { - checkRealm(); - boolean wasStale = this.stale; - this.stale = stale; - if (!wasStale && stale) { - fireStale(); - } - } - - public Object put(Object key, Object value) { - throw new UnsupportedOperationException(); - } - - public Object remove(Object key) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - public void putAll(Map arg0) { - throw new UnsupportedOperationException(); - } - - public synchronized void dispose() { - super.dispose(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/WritableMap.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/WritableMap.java deleted file mode 100644 index e61a22f0..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/WritableMap.java +++ /dev/null @@ -1,106 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.map; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public class WritableMap extends ObservableMap { - - /** - * - */ - public WritableMap() { - this(Realm.getDefault()); - } - - /** - * @param realm - */ - public WritableMap(Realm realm) { - super(realm, new HashMap()); - } - - /** - * Associates the provided <code>value</code> with the <code>key</code>. Must be invoked from the current realm. - */ - public Object put(Object key, Object value) { - checkRealm(); - Object result = wrappedMap.put(key, value); - if (result==null) { - fireMapChange(Diffs.createMapDiffSingleAdd(key, value)); - } else { - fireMapChange(Diffs.createMapDiffSingleChange(key, result, value)); - } - return result; - } - - /** - * Removes the value with the provide <code>key</code>. Must be invoked from the current realm. - */ - public Object remove(Object key) { - checkRealm(); - Object result = wrappedMap.remove(key); - if (result!=null) { - fireMapChange(Diffs.createMapDiffSingleRemove(key, result)); - } - return result; - } - - /** - * Clears the map. Must be invoked from the current realm. - */ - public void clear() { - checkRealm(); - Map copy = new HashMap(wrappedMap.size()); - copy.putAll(wrappedMap); - wrappedMap.clear(); - fireMapChange(Diffs.createMapDiffRemoveAll(copy)); - } - - /** - * Adds the provided <code>map</code>'s contents to this map. Must be invoked from the current realm. - */ - public void putAll(Map map) { - checkRealm(); - Set addedKeys = new HashSet(map.size()); - Map changes = new HashMap(map.size()); - for (Iterator it = map.entrySet().iterator(); it.hasNext();) { - Map.Entry entry = (Entry) it.next(); - Object previousValue = wrappedMap.put(entry.getKey(), entry.getValue()); - if (previousValue==null) { - addedKeys.add(entry.getKey()); - } else { - changes.put(entry.getKey(), previousValue); - } - } - fireMapChange(Diffs.createMapDiff(addedKeys, Collections.EMPTY_SET, changes.keySet(), changes, wrappedMap)); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/package.html deleted file mode 100644 index 22107ea3..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/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> -Provides classes that can be used to observe changes in maps. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe changes in maps.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/IObservableFactory.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/IObservableFactory.java deleted file mode 100644 index e113f141..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/IObservableFactory.java +++ /dev/null @@ -1,31 +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.databinding.observable.masterdetail; - -import org.eclipse.core.databinding.observable.IObservable; - -/** - * Generates an {@link IObservable} when passed a target instance. - * - * @since 1.0 - */ -public interface IObservableFactory { - - /** - * Creates an observable for the given target object. - * - * @param target - * @return the new observable - */ - public IObservable createObservable(Object target); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/MasterDetailObservables.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/MasterDetailObservables.java deleted file mode 100644 index 54334b22..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/MasterDetailObservables.java +++ /dev/null @@ -1,97 +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 147515 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.masterdetail; - -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableList; -import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableSet; -import org.eclipse.core.internal.databinding.observable.masterdetail.DetailObservableValue; - -/** - * Allows for the observation of an attribute, the detail, of an observable - * representing selection or another transient instance, the master. - * - * @since 1.0 - */ -public class MasterDetailObservables { - - /** - * Creates a detail observable value from a master observable value and a - * factory. This can be used to create observable values that represent a - * property of a selected object in a table. - * - * @param master - * the observable value to track - * @param detailFactory - * a factory for creating {@link IObservableValue} instances - * given a current value of the master - * @param detailType - * the value type of the detail observable value, typically of - * type java.lang.Class and can be <code>null</code> - * @return an observable value of the given value type that, for any current - * value of the given master value, behaves like the observable - * value created by the factory for that current value. - */ - public static IObservableValue detailValue(IObservableValue master, - IObservableFactory detailFactory, Object detailType) { - return new DetailObservableValue(master, detailFactory, detailType); - } - - /** - * Creates a detail observable list from a master observable value and a - * factory. This can be used to create observable lists that represent a - * list property of a selected object in a table. - * - * @param master - * the observable value to track - * @param detailFactory - * a factory for creating {@link IObservableList} instances given - * a current value of the master - * @param detailElementType - * the element type of the detail observable list, typically of - * type java.lang.Class and can be <code>null</code> - * @return an observable list with the given element type that, for any - * current value of the given master value, behaves like the - * observable list created by the factory for that current value. - */ - public static IObservableList detailList(IObservableValue master, - IObservableFactory detailFactory, Object detailElementType) { - return new DetailObservableList(detailFactory, master, - detailElementType); - } - - /** - * Creates a detail observable set from a master observable value and a - * factory. This can be used to create observable sets that represent a set - * property of a selected object in a table. - * - * @param master - * the observable value to track - * @param detailFactory - * a factory for creating {@link IObservableSet} instances given - * a current value of the master - * @param detailElementType - * the element type of the detail observable set, typically of - * type java.lang.Class and can be <code>null</code> - * @return an observable set with the given element type that, for any - * current value of the given master value, behaves like the - * observable set created by the factory for that current value. - */ - public static IObservableSet detailSet(IObservableValue master, - IObservableFactory detailFactory, Object detailElementType) { - return new DetailObservableSet(detailFactory, master, detailElementType); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/package.html deleted file mode 100644 index 07b72e5b..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/masterdetail/package.html +++ /dev/null @@ -1,17 +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> -Provides classes that can be used to observe a detail of a master object. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe a detail of a master object. -A common use case for master detail is observing the detail (e.g. name) of a master (e.g. selected Person) of a list of elements.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/package.html deleted file mode 100644 index 0739c1ca..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/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> -Provides the core APIs for observing changes in objects. -<h2> -Package Specification</h2> -<p> -This package provides the core APIs for observing changes in objects.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/AbstractObservableSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/AbstractObservableSet.java deleted file mode 100644 index 24528069..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/AbstractObservableSet.java +++ /dev/null @@ -1,217 +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.databinding.observable.set; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.ChangeSupport; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * Abstract implementation of {@link IObservableSet}. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - */ -public abstract class AbstractObservableSet extends AbstractObservable implements - IObservableSet { - - private ChangeSupport changeSupport; - - private boolean stale = false; - - protected AbstractObservableSet() { - this(Realm.getDefault()); - } - - protected void firstListenerAdded() { - super.firstListenerAdded(); - } - - protected void lastListenerRemoved() { - super.lastListenerRemoved(); - } - - protected AbstractObservableSet(Realm realm) { - super(realm); - changeSupport = new ChangeSupport(realm){ - protected void firstListenerAdded() { - AbstractObservableSet.this.firstListenerAdded(); - } - protected void lastListenerRemoved() { - AbstractObservableSet.this.lastListenerRemoved(); - } - }; - } - - public synchronized void addSetChangeListener(ISetChangeListener listener) { - changeSupport.addListener(SetChangeEvent.TYPE, listener); - } - - public synchronized void removeSetChangeListener(ISetChangeListener listener) { - changeSupport.removeListener(SetChangeEvent.TYPE, listener); - } - - protected abstract Set getWrappedSet(); - - protected void fireSetChange(SetDiff diff) { - // fire general change event first - super.fireChange(); - - changeSupport.fireEvent(new SetChangeEvent(this, diff)); - } - - public boolean contains(Object o) { - getterCalled(); - return getWrappedSet().contains(o); - } - - public boolean containsAll(Collection c) { - getterCalled(); - return getWrappedSet().containsAll(c); - } - - public boolean equals(Object o) { - getterCalled(); - return getWrappedSet().equals(o); - } - - public int hashCode() { - getterCalled(); - return getWrappedSet().hashCode(); - } - - public boolean isEmpty() { - getterCalled(); - return getWrappedSet().isEmpty(); - } - - public Iterator iterator() { - getterCalled(); - final Iterator wrappedIterator = getWrappedSet().iterator(); - return new Iterator() { - - public void remove() { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - ObservableTracker.getterCalled(AbstractObservableSet.this); - return wrappedIterator.hasNext(); - } - - public Object next() { - ObservableTracker.getterCalled(AbstractObservableSet.this); - return wrappedIterator.next(); - } - }; - } - - public int size() { - getterCalled(); - return getWrappedSet().size(); - } - - public Object[] toArray() { - getterCalled(); - return getWrappedSet().toArray(); - } - - public Object[] toArray(Object[] a) { - getterCalled(); - return getWrappedSet().toArray(a); - } - - public String toString() { - getterCalled(); - return getWrappedSet().toString(); - } - - protected void getterCalled() { - ObservableTracker.getterCalled(this); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - /** - * @return Returns the stale state. - */ - public boolean isStale() { - checkRealm(); - return stale; - } - - /** - * @param stale - * The stale state to set. This will fire a stale event if the - * given boolean is true and this observable set was not already - * stale. - */ - public void setStale(boolean stale) { - checkRealm(); - boolean wasStale = this.stale; - this.stale = stale; - if (!wasStale && stale) { - fireStale(); - } - } - - - protected void fireChange() { - throw new RuntimeException("fireChange should not be called, use fireSetChange() instead"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.jface.provisional.databinding.observable.AbstractObservable#dispose() - */ - public synchronized void dispose() { - super.dispose(); - - if (changeSupport != null) { - changeSupport.dispose(); - changeSupport = null; - } - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/IObservableSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/IObservableSet.java deleted file mode 100644 index 324033a4..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/IObservableSet.java +++ /dev/null @@ -1,126 +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.databinding.observable.set; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.databinding.observable.IObservableCollection; - -/** - * A set whose changes can be tracked by set change listeners. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - * - */ -public interface IObservableSet extends Set, IObservableCollection { - - /** - * @param listener - */ - public void addSetChangeListener(ISetChangeListener listener); - - /** - * @param listener - */ - public void removeSetChangeListener(ISetChangeListener listener); - - /** - * @return the element type or <code>null</code> if untyped - */ - public Object getElementType(); - - /** - * @TrackedGetter - */ - int size(); - - /** - * @TrackedGetter - */ - boolean isEmpty(); - - /** - * @TrackedGetter - */ - boolean contains(Object o); - - /** - * @TrackedGetter - */ - Iterator iterator(); - - /** - * @TrackedGetter - */ - Object[] toArray(); - - /** - * @TrackedGetter - */ - Object[] toArray(Object a[]); - - // Modification Operations - - /** - * @TrackedGetter - */ - boolean add(Object o); - - /** - * @TrackedGetter - */ - boolean remove(Object o); - - // Bulk Operations - - /** - * @TrackedGetter - */ - boolean containsAll(Collection c); - - /** - * @TrackedGetter - */ - boolean addAll(Collection c); - - /** - * @TrackedGetter - */ - boolean retainAll(Collection c); - - /** - * @TrackedGetter - */ - boolean removeAll(Collection c); - - // Comparison and hashing - - /** - * @TrackedGetter - */ - boolean equals(Object o); - - /** - * @TrackedGetter - */ - int hashCode(); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ISetChangeListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ISetChangeListener.java deleted file mode 100644 index 51c429a3..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ISetChangeListener.java +++ /dev/null @@ -1,35 +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.databinding.observable.set; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for changes to observable sets. - * - * @since 1.0 - * - */ -public interface ISetChangeListener extends IObservablesListener { - - /** - * Handle a change to an observable set. The given event object must only be - * used locally in this method because it may be reused for other change - * notifications. The diff object referenced by the event is immutable and - * may be used non-locally. - * - * @param event - * the event - */ - void handleSetChange(SetChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java deleted file mode 100644 index e145fb3c..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ListToSetAdapter.java +++ /dev/null @@ -1,84 +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.databinding.observable.set; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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; - -/** - * Observable set backed by an observable list. The wrapped list must not - * contain duplicate elements. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - * - */ -public class ListToSetAdapter extends ObservableSet { - - private final IObservableList list; - - private IListChangeListener listener = new IListChangeListener() { - - public void handleListChange(ListChangeEvent event) { - Set added = new HashSet(); - Set removed = new HashSet(); - ListDiffEntry[] differences = event.diff.getDifferences(); - for (int i = 0; i < differences.length; i++) { - ListDiffEntry entry = differences[i]; - Object element = entry.getElement(); - if (entry.isAddition()) { - if (wrappedSet.add(element)) { - if (!removed.remove(element)) - added.add(element); - } - } else { - if (wrappedSet.remove(element)) { - removed.add(element); - added.remove(element); - } - } - } - fireSetChange(Diffs.createSetDiff(added, removed)); - } - }; - - /** - * @param list - */ - public ListToSetAdapter(IObservableList list) { - super(list.getRealm(), new HashSet(), list.getElementType()); - this.list = list; - wrappedSet.addAll(list); - this.list.addListChangeListener(listener); - } - - public synchronized void dispose() { - super.dispose(); - if (list != null && listener != null) { - list.removeListChangeListener(listener); - listener = null; - } - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/MappedSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/MappedSet.java deleted file mode 100644 index c51c0c5c..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/MappedSet.java +++ /dev/null @@ -1,157 +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.databinding.observable.set; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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.core.databinding.observable.map.MapDiff; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - * - */ -public class MappedSet extends ObservableSet { - - private final IObservableMap wrappedMap; - - /* - * Map from values (range elements) to Integer ref counts - */ - private Map valueCounts = new HashMap(); - - private ISetChangeListener domainListener = new ISetChangeListener() { - public void handleSetChange(SetChangeEvent event) { - Set additions = new HashSet(); - for (Iterator it = event.diff.getAdditions().iterator(); it.hasNext();) { - Object added = it.next(); - Object mapValue = wrappedMap.get(added); - if (handleAddition(mapValue)) { - additions.add(mapValue); - } - } - Set removals = new HashSet(); - for (Iterator it = event.diff.getRemovals().iterator(); it.hasNext();) { - Object removed = it.next(); - Object mapValue = wrappedMap.get(removed); - if (handleRemoval(mapValue)) { - removals.add(mapValue); - } - } - fireSetChange(Diffs.createSetDiff(additions, removals)); - } - }; - - private IMapChangeListener mapChangeListener = new IMapChangeListener() { - public void handleMapChange(MapChangeEvent event) { - MapDiff diff = event.diff; - Set additions = new HashSet(); - Set removals = new HashSet(); - for (Iterator it = diff.getRemovedKeys().iterator(); it.hasNext();) { - Object key = it.next(); - Object oldValue = diff.getOldValue(key); - if (handleRemoval(oldValue)) { - removals.add(oldValue); - } - } - for (Iterator it = diff.getChangedKeys().iterator(); it.hasNext();) { - Object key = it.next(); - Object oldValue = diff.getOldValue(key); - Object newValue = diff.getNewValue(key); - if (handleRemoval(oldValue)) { - removals.add(oldValue); - } - if (handleAddition(newValue)) { - additions.add(newValue); - } - } - for (Iterator it = diff.getAddedKeys().iterator(); it.hasNext();) { - Object key = it.next(); - Object newValue = diff.getNewValue(key); - if (handleAddition(newValue)) { - additions.add(newValue); - } - } - fireSetChange(Diffs.createSetDiff(additions, removals)); - } - }; - - private IObservableSet input; - - /** - * @param input - * @param map - */ - public MappedSet(IObservableSet input, IObservableMap map) { - super(input.getRealm(), Collections.EMPTY_SET, Object.class); - setWrappedSet(valueCounts.keySet()); - this.wrappedMap = map; - this.input = input; - for (Iterator it = input.iterator(); it.hasNext();) { - Object element = it.next(); - Object functionValue = wrappedMap.get(element); - handleAddition(functionValue); - } - input.addSetChangeListener(domainListener); - map.addMapChangeListener(mapChangeListener); - } - - /** - * @param mapValue - * @return true if the given mapValue was an addition - */ - protected boolean handleAddition(Object mapValue) { - Integer count = (Integer) valueCounts.get(mapValue); - if (count == null) { - valueCounts.put(mapValue, new Integer(1)); - return true; - } - valueCounts.put(mapValue, new Integer(count.intValue() + 1)); - return false; - } - - /** - * @param mapValue - * @return true if the given mapValue has been removed - */ - protected boolean handleRemoval(Object mapValue) { - Integer count = (Integer) valueCounts.get(mapValue); - if (count.intValue() <= 1) { - valueCounts.remove(mapValue); - return true; - } - valueCounts.put(mapValue, new Integer(count.intValue() - 1)); - return false; - } - - public synchronized void dispose() { - wrappedMap.removeMapChangeListener(mapChangeListener); - input.removeSetChangeListener(domainListener); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ObservableSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ObservableSet.java deleted file mode 100644 index 4b3a6df0..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/ObservableSet.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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.set; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * Abstract implementation of {@link IObservableSet}. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - * - */ -public abstract class ObservableSet extends AbstractObservable implements - IObservableSet { - - protected Set wrappedSet; - - private boolean stale = false; - - protected Object elementType; - - protected ObservableSet(Set wrappedSet, Object elementType) { - this(Realm.getDefault(), wrappedSet, elementType); - } - - protected ObservableSet(Realm realm, Set wrappedSet, Object elementType) { - super(realm); - this.wrappedSet = wrappedSet; - this.elementType = elementType; - } - - public synchronized void addSetChangeListener(ISetChangeListener listener) { - addListener(SetChangeEvent.TYPE, listener); - } - - public synchronized void removeSetChangeListener(ISetChangeListener listener) { - removeListener(SetChangeEvent.TYPE, listener); - } - - protected void fireSetChange(SetDiff diff) { - // fire general change event first - super.fireChange(); - - fireEvent(new SetChangeEvent(this, diff)); - } - - public boolean contains(Object o) { - getterCalled(); - return wrappedSet.contains(o); - } - - public boolean containsAll(Collection c) { - getterCalled(); - return wrappedSet.containsAll(c); - } - - public boolean equals(Object o) { - getterCalled(); - return wrappedSet.equals(o); - } - - public int hashCode() { - getterCalled(); - return wrappedSet.hashCode(); - } - - public boolean isEmpty() { - getterCalled(); - return wrappedSet.isEmpty(); - } - - public Iterator iterator() { - getterCalled(); - final Iterator wrappedIterator = wrappedSet.iterator(); - return new Iterator() { - - public void remove() { - throw new UnsupportedOperationException(); - } - - public boolean hasNext() { - ObservableTracker.getterCalled(ObservableSet.this); - return wrappedIterator.hasNext(); - } - - public Object next() { - ObservableTracker.getterCalled(ObservableSet.this); - return wrappedIterator.next(); - } - }; - } - - public int size() { - getterCalled(); - return wrappedSet.size(); - } - - public Object[] toArray() { - getterCalled(); - return wrappedSet.toArray(); - } - - public Object[] toArray(Object[] a) { - getterCalled(); - return wrappedSet.toArray(a); - } - - public String toString() { - getterCalled(); - return wrappedSet.toString(); - } - - protected void getterCalled() { - ObservableTracker.getterCalled(this); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - /** - * @return Returns the stale state. - */ - public boolean isStale() { - checkRealm(); - return stale; - } - - /** - * @param stale - * The stale state to set. This will fire a stale event if the - * given boolean is true and this observable set was not already - * stale. - */ - public void setStale(boolean stale) { - checkRealm(); - boolean wasStale = this.stale; - this.stale = stale; - if (!wasStale && stale) { - fireStale(); - } - } - - /** - * @param wrappedSet The wrappedSet to set. - */ - protected void setWrappedSet(Set wrappedSet) { - this.wrappedSet = wrappedSet; - } - - protected void fireChange() { - throw new RuntimeException("fireChange should not be called, use fireSetChange() instead"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.jface.provisional.databinding.observable.AbstractObservable#dispose() - */ - public synchronized void dispose() { - super.dispose(); - } - - public Object getElementType() { - return elementType; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java deleted file mode 100644 index 4873885e..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java +++ /dev/null @@ -1,68 +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.databinding.observable.set; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * List change event describing an incremental change of an - * {@link IObservableSet} object. - * - * @since 1.0 - * - */ -public class SetChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = 7436547103857482256L; - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable set. Listeners must - * not change this field. - */ - public SetDiff diff; - - /** - * Creates a new set change event. - * - * @param source - * the source observable set - * @param diff - * the set change - */ - public SetChangeEvent(IObservableSet source, SetDiff diff) { - super(source); - this.diff = diff; - } - - /** - * Returns the observable set from which this event originated. - * - * @return the observable set from which this event originated - */ - public IObservableSet getObservableSet() { - return (IObservableSet) getSource(); - } - - protected void dispatch(IObservablesListener listener) { - ((ISetChangeListener) listener).handleSetChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetDiff.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetDiff.java deleted file mode 100644 index d1a2f138..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetDiff.java +++ /dev/null @@ -1,47 +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.databinding.observable.set; - -import java.util.Set; - -/** - * @since 1.0 - * - */ -public abstract class SetDiff { - - /** - * @return the set of added elements - */ - public abstract Set getAdditions(); - - /** - * @return the set of removed elements - */ - public abstract Set getRemovals(); - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer - .append(getClass().getName()) - .append("{additions [") //$NON-NLS-1$ - .append(getAdditions() != null ? getAdditions().toString() : "null") //$NON-NLS-1$ - .append("], removals [") //$NON-NLS-1$ - .append(getRemovals() != null ? getRemovals().toString() : "null") //$NON-NLS-1$ - .append("]}"); //$NON-NLS-1$ - - return buffer.toString(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/UnionSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/UnionSet.java deleted file mode 100644 index 082a0f6e..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/UnionSet.java +++ /dev/null @@ -1,209 +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.databinding.observable.set; - -import java.util.ArrayList; -import java.util.Collection; -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.Realm; -import org.eclipse.core.internal.databinding.observable.IStalenessConsumer; -import org.eclipse.core.internal.databinding.observable.StalenessTracker; - -/** - * Represents a set consisting of the union of elements from one or more other - * sets. This object does not need to be explicitly disposed. If nobody is - * listening to the UnionSet, the set will remove its listeners. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - */ -public final class UnionSet extends ObservableSet { - - /** - * child sets - */ - private IObservableSet[] childSets; - - private boolean stale = false; - - /** - * Map of elements onto Integer reference counts. This map is constructed - * when the first listener is added to the union set. Null if nobody is - * listening to the UnionSet. - */ - private HashMap refCounts = null; - - private StalenessTracker stalenessTracker; - - /** - * @param childSets - */ - public UnionSet(IObservableSet[] childSets) { - super(childSets[0].getRealm(), null, childSets[0].getElementType()); - this.childSets = childSets; - this.stalenessTracker = new StalenessTracker(childSets, - stalenessConsumer); - } - - private ISetChangeListener childSetChangeListener = new ISetChangeListener() { - public void handleSetChange(SetChangeEvent event) { - processAddsAndRemoves(event.diff.getAdditions(), event.diff.getRemovals()); - } - }; - - private IStalenessConsumer stalenessConsumer = new IStalenessConsumer() { - public void setStale(boolean stale) { - boolean oldStale = UnionSet.this.stale; - UnionSet.this.stale = stale; - if (stale && !oldStale) { - fireStale(); - } - } - }; - - public boolean isStale() { - checkRealm(); - if (refCounts != null) { - return stale; - } - - for (int i = 0; i < childSets.length; i++) { - IObservableSet childSet = childSets[i]; - - if (childSet.isStale()) { - return true; - } - } - return false; - } - - private void processAddsAndRemoves(Set adds, Set removes) { - Set addsToFire = new HashSet(); - Set removesToFire = new HashSet(); - - for (Iterator iter = adds.iterator(); iter.hasNext();) { - Object added = iter.next(); - - Integer refCount = (Integer) refCounts.get(added); - if (refCount == null) { - refCounts.put(added, new Integer(1)); - addsToFire.add(added); - } else { - int refs = refCount.intValue(); - refCount = new Integer(refs + 1); - refCounts.put(added, refCount); - } - } - - for (Iterator iter = removes.iterator(); iter.hasNext();) { - Object removed = iter.next(); - - Integer refCount = (Integer) refCounts.get(removed); - if (refCount != null) { - int refs = refCount.intValue(); - if (refs <= 1) { - removesToFire.add(removed); - refCounts.remove(removed); - } else { - refCount = new Integer(refCount.intValue() - 1); - refCounts.put(removed, refCount); - } - } - } - - // just in case the removes overlapped with the adds - addsToFire.removeAll(removesToFire); - - if (addsToFire.size() > 0 || removesToFire.size() > 0) { - fireSetChange(Diffs.createSetDiff(addsToFire, removesToFire)); - } - } - - protected void firstListenerAdded() { - super.firstListenerAdded(); - - refCounts = new HashMap(); - for (int i = 0; i < childSets.length; i++) { - IObservableSet next = childSets[i]; - next.addSetChangeListener(childSetChangeListener); - incrementRefCounts(next); - } - stalenessTracker = new StalenessTracker(childSets, stalenessConsumer); - setWrappedSet(refCounts.keySet()); - } - - protected void lastListenerRemoved() { - super.lastListenerRemoved(); - - for (int i = 0; i < childSets.length; i++) { - IObservableSet next = childSets[i]; - - next.removeSetChangeListener(childSetChangeListener); - stalenessTracker.removeObservable(next); - } - refCounts = null; - stalenessTracker = null; - setWrappedSet(null); - } - - private ArrayList incrementRefCounts(Collection added) { - ArrayList adds = new ArrayList(); - - for (Iterator iter = added.iterator(); iter.hasNext();) { - Object next = iter.next(); - - Integer refCount = (Integer) refCounts.get(next); - if (refCount == null) { - adds.add(next); - refCount = new Integer(1); - refCounts.put(next, refCount); - } else { - refCount = new Integer(refCount.intValue() + 1); - refCounts.put(next, refCount); - } - } - return adds; - } - - protected void getterCalled() { - super.getterCalled(); - if (refCounts == null) { - // no listeners, recompute - setWrappedSet(computeElements()); - } - } - - private Set computeElements() { - // If there is no cached value, compute the union from scratch - if (refCounts == null) { - Set result = new HashSet(); - for (int i = 0; i < childSets.length; i++) { - result.addAll(childSets[i]); - } - return result; - } - - // Else there is a cached value. Return it. - return refCounts.keySet(); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/WritableSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/WritableSet.java deleted file mode 100644 index bbf11cea..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/WritableSet.java +++ /dev/null @@ -1,164 +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 147515 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.set; - -import java.util.Collection; -import java.util.Collections; -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.Realm; - -/** - * Mutable (writable) implementation of {@link IObservableSet}. - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * - * @since 1.0 - */ -public class WritableSet extends ObservableSet { - - /** - * Constructs a new instance with the default realm, empty list, and a - * <code>null</code> element type. - * - */ - public WritableSet() { - this(Realm.getDefault()); - } - - /** - * Construts a new instance with the default realm. - * - * @param c - * @param elementType - * can be <code>null</code> - */ - public WritableSet(Collection c, Object elementType) { - this(Realm.getDefault(), new HashSet(c), elementType); - } - - /** - * Constructs a new instance with an empty list and a <code>null</code> element type. - * - * @param realm - */ - public WritableSet(Realm realm) { - this(realm, new HashSet(), null); - } - - /** - * Constructs a new instance. - * - * @param realm - * @param c - * @param elementType - * can be <code>null</code> - */ - public WritableSet(Realm realm, Collection c, Object elementType) { - super(realm, new HashSet(c), elementType); - this.elementType = elementType; - } - - public boolean add(Object o) { - checkRealm(); - boolean added = wrappedSet.add(o); - if (added) { - fireSetChange(Diffs.createSetDiff(Collections.singleton(o), Collections.EMPTY_SET)); - } - return added; - } - - public boolean addAll(Collection c) { - checkRealm(); - Set adds = new HashSet(); - Iterator it = c.iterator(); - while (it.hasNext()) { - Object element = it.next(); - if (wrappedSet.add(element)) { - adds.add(element); - } - } - if (adds.size() > 0) { - fireSetChange(Diffs.createSetDiff(adds, Collections.EMPTY_SET)); - return true; - } - return false; - } - - public boolean remove(Object o) { - checkRealm(); - boolean removed = wrappedSet.remove(o); - if (removed) { - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, Collections - .singleton(o))); - } - return removed; - } - - public boolean removeAll(Collection c) { - checkRealm(); - Set removes = new HashSet(); - Iterator it = c.iterator(); - while (it.hasNext()) { - Object element = it.next(); - if (wrappedSet.remove(element)) { - removes.add(element); - } - } - if (removes.size() > 0) { - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, removes)); - return true; - } - return false; - } - - public boolean retainAll(Collection c) { - checkRealm(); - Set removes = new HashSet(); - Iterator it = wrappedSet.iterator(); - while (it.hasNext()) { - Object element = it.next(); - if (!c.contains(element)) { - it.remove(); - removes.add(element); - } - } - if (removes.size() > 0) { - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, removes)); - return true; - } - return false; - } - - public void clear() { - checkRealm(); - Set removes = new HashSet(wrappedSet); - wrappedSet.clear(); - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, removes)); - } - - /** - * @param elementType can be <code>null</code> - * @return new instance with the default realm - */ - public static WritableSet withElementType(Object elementType) { - return new WritableSet(Realm.getDefault(), new HashSet(), elementType); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/package.html deleted file mode 100644 index 5a57448a..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/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> -Provides classes that can be used to observe changes in sets. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe changes in sets.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/AbstractObservableValue.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/AbstractObservableValue.java deleted file mode 100644 index be67adc4..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/AbstractObservableValue.java +++ /dev/null @@ -1,92 +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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - * - */ -abstract public class AbstractObservableValue extends AbstractObservable implements IObservableValue { - /** - * Constructs a new instance with the default realm. - */ - public AbstractObservableValue() { - this(Realm.getDefault()); - } - - /** - * @param realm - */ - public AbstractObservableValue(Realm realm) { - super(realm); - } - - public synchronized void addValueChangeListener(IValueChangeListener listener) { - addListener(ValueChangeEvent.TYPE, listener); - } - - public synchronized void removeValueChangeListener(IValueChangeListener listener) { - removeListener(ValueChangeEvent.TYPE, listener); - } - - final public void setValue(Object value) { - checkRealm(); - doSetValue(value); - } - - /** - * Template method for setting the value of the observable. By default the - * method throws an {@link UnsupportedOperationException}. - * - * @param value - */ - protected void doSetValue(Object value) { - throw new UnsupportedOperationException(); - } - - protected void fireValueChange(ValueDiff diff) { - // fire general change event first - super.fireChange(); - fireEvent(new ValueChangeEvent(this, diff)); - } - - public final Object getValue() { - ObservableTracker.getterCalled(this); - return doGetValue(); - } - - abstract protected Object doGetValue(); - - public boolean isStale() { - return false; - } - - protected void fireChange() { - throw new RuntimeException( - "fireChange should not be called, use fireValueChange() instead"); //$NON-NLS-1$ - } - - public synchronized void dispose() { - super.dispose(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/AbstractVetoableValue.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/AbstractVetoableValue.java deleted file mode 100644 index d3cff74b..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/AbstractVetoableValue.java +++ /dev/null @@ -1,95 +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.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.internal.databinding.Util; - -/** - * - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - * - */ -public abstract class AbstractVetoableValue extends AbstractObservableValue - implements IVetoableValue { - - /** - * Creates a new vetoable value. - */ - public AbstractVetoableValue() { - this(Realm.getDefault()); - } - - /** - * @param realm - */ - public AbstractVetoableValue(Realm realm) { - super(realm); - } - - final protected void doSetValue(Object value) { - Object currentValue = doGetValue(); - ValueDiff diff = Diffs.createValueDiff(currentValue, value); - boolean okToProceed = fireValueChanging(diff); - if (!okToProceed) { - throw new ChangeVetoException("Change not permitted"); //$NON-NLS-1$ - } - doSetApprovedValue(value); - - if (!Util.equals(diff.getOldValue(), diff.getNewValue())) { - fireValueChange(diff); - } - } - - /** - * Sets the value. Invoked after performing veto checks. Should not fire change events. - * - * @param value - */ - protected abstract void doSetApprovedValue(Object value); - - public synchronized void addValueChangingListener( - IValueChangingListener listener) { - addListener(ValueChangingEvent.TYPE, listener); - } - - public synchronized void removeValueChangingListener( - IValueChangingListener listener) { - removeListener(ValueChangingEvent.TYPE, listener); - } - - /** - * Notifies listeners about a pending change, and returns true if no - * listener vetoed the change. - * - * @param diff - * @return false if the change was vetoed, true otherwise - */ - protected boolean fireValueChanging(ValueDiff diff) { - checkRealm(); - - ValueChangingEvent event = new ValueChangingEvent(this, diff); - fireEvent(event); - return !event.veto; - } - - public synchronized void dispose() { - super.dispose(); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ChangeVetoException.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ChangeVetoException.java deleted file mode 100644 index 3c9261ff..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ChangeVetoException.java +++ /dev/null @@ -1,28 +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.core.databinding.observable.value; - -/** - * @since 1.0 - * - */ -public class ChangeVetoException extends RuntimeException { - - /** - * @param string - */ - public ChangeVetoException(String string) { - super(string); - } - - private static final long serialVersionUID = 1L; - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ComputedValue.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ComputedValue.java deleted file mode 100644 index 18168098..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ComputedValue.java +++ /dev/null @@ -1,249 +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 147515 - *******************************************************************************/ -package org.eclipse.core.databinding.observable.value; - -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.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.StaleEvent; - -/** - * A Lazily calculated value that automatically computes and registers listeners - * on its dependencies as long as all of its dependencies are IObservable - * objects - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public abstract class ComputedValue extends AbstractObservableValue { - - private boolean dirty = true; - - private boolean stale = false; - - private Object cachedValue = null; - - /** - * Array of observables this computed value depends on. This field has - * a value of <code>null</code> if we are not currently listening. - */ - private IObservable[] dependencies = null; - - /** - * - */ - public ComputedValue() { - this(Realm.getDefault(), null); - } - - /** - * @param valueType can be <code>null</code> - */ - public ComputedValue(Object valueType) { - this(Realm.getDefault(), valueType); - } - - /** - * @param realm - * - */ - public ComputedValue(Realm realm) { - this(realm, null); - } - - /** - * @param realm - * @param valueType - */ - public ComputedValue(Realm realm, Object valueType) { - super(realm); - this.valueType = valueType; - } - - /** - * Inner class that implements interfaces that we don't want to expose as - * public API. Each interface could have been implemented using a separate - * anonymous class, but we combine them here to reduce the memory overhead - * and number of classes. - * - * <p> - * The Runnable calls computeValue and stores the result in cachedValue. - * </p> - * - * <p> - * The IChangeListener stores each observable in the dependencies list. - * This is registered as the listener when calling ObservableTracker, to - * detect every observable that is used by computeValue. - * </p> - * - * <p> - * The IChangeListener is attached to every dependency. - * </p> - * - */ - private class PrivateInterface implements Runnable, IChangeListener, - IStaleListener { - public void run() { - cachedValue = calculate(); - } - - public void handleStale(StaleEvent event) { - if (!dirty && !stale) { - stale = true; - fireStale(); - } - } - - public void handleChange(ChangeEvent event) { - makeDirty(); - } - } - - private PrivateInterface privateInterface = new PrivateInterface(); - - private Object valueType; - - protected final Object doGetValue() { - if (dirty) { - // This line will do the following: - // - Run the calculate method - // - While doing so, add any observable that is touched to the - // dependencies list - IObservable[] newDependencies = ObservableTracker.runAndMonitor( - privateInterface, privateInterface, null); - - stale = false; - for (int i = 0; i < newDependencies.length; i++) { - IObservable observable = newDependencies[i]; - // Add a change listener to the new dependency. - if (observable.isStale()) { - stale = true; - } else { - observable.addStaleListener(privateInterface); - } - } - - dependencies = newDependencies; - - dirty = false; - } - - return cachedValue; - } - - /** - * Subclasses must override this method to provide the object's value. - * - * @return the object's value - */ - protected abstract Object calculate(); - - protected final void makeDirty() { - if (!dirty) { - dirty = true; - - stopListening(); - - // copy the old value - final Object oldValue = cachedValue; - // Fire the "dirty" event. This implementation recomputes the new - // value lazily. - fireValueChange(new ValueDiff() { - - public Object getOldValue() { - return oldValue; - } - - public Object getNewValue() { - return getValue(); - } - }); - } - } - - /** - * - */ - private void stopListening() { - // Stop listening for dependency changes. - if (dependencies != null) { - for (int i = 0; i < dependencies.length; i++) { - IObservable observable = dependencies[i]; - - observable.removeChangeListener(privateInterface); - observable.removeStaleListener(privateInterface); - } - dependencies = null; - } - } - - public boolean isStale() { - // we need to recompute, otherwise staleness wouldn't mean anything - getValue(); - return stale; - } - - public Object getValueType() { - return valueType; - } - - // this method exists here so that we can call it from the runnable below. - protected boolean hasListeners() { - return super.hasListeners(); - } - - public synchronized void addChangeListener(IChangeListener listener) { - super.addChangeListener(listener); - // Some clients just add a listener and expect to get notified even if - // they never called getValue(), so we have to call getValue() ourselves - // here to be sure. Need to be careful about realms though, this method - // can be called outside of our realm. - // See also bug 198211. If a client calls this outside of our realm, - // they may receive change notifications before the runnable below has - // been executed. It is their job to figure out what to do with those - // notifications. - getRealm().exec(new Runnable() { - public void run() { - if (dependencies == null) { - // We are not currently listening. - if (hasListeners()) { - // But someone is listening for changes. Call getValue() - // to make sure we start listening to the observables we - // depend on. - getValue(); - } - } - } - }); - getValue(); - } - - public synchronized void addValueChangeListener(IValueChangeListener listener) { - super.addValueChangeListener(listener); - // If somebody is listening, we need to make sure we attach our own - // listeners - getValue(); - } - - public synchronized void dispose() { - super.dispose(); - stopListening(); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IObservableValue.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IObservableValue.java deleted file mode 100644 index ecff44f5..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IObservableValue.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.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; - -/** - * A value whose changes can be tracked by value change listeners. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - * - */ -public interface IObservableValue extends IObservable { - - /** - * The value type of this observable value, or <code>null</code> if this - * observable value is untyped. - * - * @return the value type, or <code>null</null> - */ - public Object getValueType(); - - /** - * Returns the value. Must be invoked in the {@link Realm} of the observable. - * - * @return the current value - * @TrackedGetter - */ - public Object getValue(); - - /** - * Sets the value. Must be invoked in the {@link Realm} of the observable. - * - * @param value - * the value to set - * @throws UnsupportedOperationException - * if this observable value cannot be set. - */ - public void setValue(Object value); - - /** - * - * @param listener - */ - public void addValueChangeListener(IValueChangeListener listener); - - /** - * @param listener - */ - public void removeValueChangeListener(IValueChangeListener listener); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IValueChangeListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IValueChangeListener.java deleted file mode 100644 index 7af53822..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IValueChangeListener.java +++ /dev/null @@ -1,35 +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.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for changes to observable values. - * - * @since 1.0 - * - */ -public interface IValueChangeListener extends IObservablesListener { - - /** - * Handles a change to an observable value. The given event object must only - * be used locally in this method because it may be reused for other change - * notifications. The diff object referenced by the event is immutable and - * may be used non-locally. - * - * @param event - * the event - */ - void handleValueChange(ValueChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IValueChangingListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IValueChangingListener.java deleted file mode 100644 index ceb07b74..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IValueChangingListener.java +++ /dev/null @@ -1,34 +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.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservablesListener; - -/** - * Listener for pre-change events for observable values. - * - * @since 1.0 - * - */ -public interface IValueChangingListener extends IObservablesListener { - - /** - * This method is called when the value is about to change and provides an - * opportunity to veto the change. The given event object must only be used - * locally in this method because it may be reused for other change - * notifications. The diff object referenced by the event is immutable and - * may be used non-locally. - * - * @param event - */ - public void handleValueChanging(ValueChangingEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IVetoableValue.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IVetoableValue.java deleted file mode 100644 index 15cdee48..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/IVetoableValue.java +++ /dev/null @@ -1,38 +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.core.databinding.observable.value; - -/** - * An observable value whose changes can be vetoed by listeners. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.0 - * - */ -public interface IVetoableValue extends IObservableValue { - - /** - * @param listener - */ - public void addValueChangingListener(IValueChangingListener listener); - - /** - * @param listener - */ - public void removeValueChangingListener(IValueChangingListener listener); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.java deleted file mode 100644 index 3d4fba90..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.java +++ /dev/null @@ -1,69 +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.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * Value change event describing a change of an {@link IObservableValue} - * object's current value. - * - * @since 1.0 - * - */ -public class ValueChangeEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = 2305345286999701156L; - - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable value. Listeners must - * not change this field. - */ - public ValueDiff diff; - - /** - * Creates a new value change event. - * - * @param source - * the source observable value - * @param diff - * the value change - */ - public ValueChangeEvent(IObservableValue source, ValueDiff diff) { - super(source); - this.diff = diff; - } - - /** - * Returns the observable value from which this event originated. - * - * @return returns the observable value from which this event originated - */ - public IObservableValue getObservableValue() { - return (IObservableValue) source; - } - - protected void dispatch(IObservablesListener listener) { - ((IValueChangeListener) listener).handleValueChange(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueChangingEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueChangingEvent.java deleted file mode 100644 index f92cde7b..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueChangingEvent.java +++ /dev/null @@ -1,74 +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.databinding.observable.value; - -import org.eclipse.core.databinding.observable.IObservablesListener; -import org.eclipse.core.databinding.observable.ObservableEvent; - -/** - * Value changing event describing a pending change of an - * {@link IObservableValue} object's current value. Listeners can veto the - * pending change by setting {@link #veto} to <code>true</code>. - * - * @since 1.0 - * - */ -public class ValueChangingEvent extends ObservableEvent { - - /** - * - */ - private static final long serialVersionUID = 2305345286999701156L; - - static final Object TYPE = new Object(); - - /** - * Description of the change to the source observable value. Listeners must - * not change this field. - */ - public ValueDiff diff; - - /** - * Flag for vetoing this change. Default value is <code>false</code>, can - * be set to <code>true</code> by listeners to veto this change. - */ - public boolean veto = false; - - /** - * Creates a new value changing event. - * - * @param source - * the source observable value - * @param diff - * the value change - */ - public ValueChangingEvent(IObservableValue source, ValueDiff diff) { - super(source); - this.diff = diff; - } - - /** - * @return the observable value from which this event originated - */ - public IObservableValue getObservableValue() { - return (IObservableValue) source; - } - - protected void dispatch(IObservablesListener listener) { - ((IValueChangingListener) listener).handleValueChanging(this); - } - - protected Object getListenerType() { - return TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueDiff.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueDiff.java deleted file mode 100644 index 62a2f866..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueDiff.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 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.Diffs; - -/** - * @since 1.0 - * - */ -public abstract class ValueDiff { - /** - * Creates a value diff. - */ - public ValueDiff() { - } - - /** - * @return the old value - */ - public abstract Object getOldValue(); - - /** - * @return the new value - */ - public abstract Object getNewValue(); - - public boolean equals(Object obj) { - if (obj instanceof ValueDiff) { - ValueDiff val = (ValueDiff) obj; - - return Diffs.equals(val.getNewValue(), getNewValue()) - && Diffs.equals(val.getOldValue(), getOldValue()); - - } - return false; - } - - public int hashCode() { - final int prime = 31; - int result = 1; - Object nv = getNewValue(); - Object ov = getOldValue(); - result = prime * result + ((nv == null) ? 0 : nv.hashCode()); - result = prime * result + ((ov == null) ? 0 : ov.hashCode()); - return result; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer - .append(getClass().getName()) - .append("{oldValue [") //$NON-NLS-1$ - .append(getOldValue() != null ? getOldValue().toString() : "null") //$NON-NLS-1$ - .append("], newValue [") //$NON-NLS-1$ - .append(getNewValue() != null ? getNewValue().toString() : "null") //$NON-NLS-1$ - .append("]}"); //$NON-NLS-1$ - - return buffer.toString(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/WritableValue.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/WritableValue.java deleted file mode 100644 index 5d794f1a..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/WritableValue.java +++ /dev/null @@ -1,113 +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 158687 - * Brad Reynolds - bug 164653, 147515 - *******************************************************************************/ - -package org.eclipse.core.databinding.observable.value; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; - -/** - * Mutable (writable) implementation of {@link IObservableValue} that will maintain a value and fire - * change events when the value changes. - * <p> - * This class is thread safe. All state accessing methods must be invoked from - * the {@link Realm#isCurrent() current realm}. Methods for adding and removing - * listeners may be invoked from any thread. - * </p> - * @since 1.0 - */ -public class WritableValue extends AbstractObservableValue { - - private final Object valueType; - - /** - * Constructs a new instance with the default realm, a <code>null</code> - * value type, and a <code>null</code> value. - */ - public WritableValue() { - this(null, null); - } - - /** - * Constructs a new instance with the default realm. - * - * @param initialValue - * can be <code>null</code> - * @param valueType - * can be <code>null</code> - */ - public WritableValue(Object initialValue, Object valueType) { - this(Realm.getDefault(), initialValue, valueType); - } - - /** - * Constructs a new instance with the provided <code>realm</code>, a - * <code>null</code> value type, and a <code>null</code> initial value. - * - * @param realm - */ - public WritableValue(Realm realm) { - this(realm, null, null); - } - - /** - * Constructs a new instance. - * - * @param realm - * @param initialValue - * can be <code>null</code> - * @param valueType - * can be <code>null</code> - */ - public WritableValue(Realm realm, Object initialValue, Object valueType) { - super(realm); - this.valueType = valueType; - this.value = initialValue; - } - - private Object value = null; - - public Object doGetValue() { - return value; - } - - /** - * @param value - * The value to set. - */ - public void doSetValue(Object value) { - boolean changed = false; - - if (this.value == null && value != null) { - changed = true; - } else if (this.value != null && !this.value.equals(value)) { - changed = true; - } - - if (changed) { - fireValueChange(Diffs.createValueDiff(this.value, this.value = value)); - } - } - - public Object getValueType() { - return valueType; - } - - /** - * @param elementType can be <code>null</code> - * @return new instance with the default realm and a value of <code>null</code> - */ - public static WritableValue withValueType(Object elementType) { - return new WritableValue(Realm.getDefault(), null, elementType); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/package.html deleted file mode 100644 index 4ce13df5..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/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> -Provides classes that can be used to observe changes in discrete values. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe changes in discrete values.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/package.html deleted file mode 100644 index 9087bbfb..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/package.html +++ /dev/null @@ -1,42 +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> -Provides classes for binding observable objects, for example UI widgets and model objects. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to synchronize state between pairs of -observable objects with optional data type conversion and validation. -<p> -A <tt>DataBindingContext</tt> is used to manage a list of <tt>Bindings</tt> -with their validation results. -</p> -<p> -Concrete subclasses of <tt>Binding</tt> synchronize state between two observables, -called the target observable and the model observable. Usually, the binding will -first copy the current state of the model observable to the target observable and -from then on track changes on both sides, reacting to changes on one side by -performing the corresponding change on the other side. -</p> -<p> -For each binding, two <tt>UpdateValueStrategy</tt> or <tt>UpdateListStrategy</tt> objects (one -for each direction) is used to control how the binding should synchronize, and can be used to -specify data type converters and validators. -</p> -<p> -<tt>AggregateValidationStatus</tt> allows clients to aggregate the current validation -statuses of a list of bindings, typically obtained from a data binding context. -</p> -<p> -For advanced validation, conversion, or similar requirements that affect the way -state is copied from one side to the other, subclasses of <tt>UpdateValueStrategy</tt> -or <tt>UpdateListStrategy</tt> can be created. -</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/ILogger.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/ILogger.java deleted file mode 100644 index 652d7193..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/ILogger.java +++ /dev/null @@ -1,38 +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: - * Chris Gross (schtoo@schtoo.com) - initial API and implementation - * (bug 49497 [RCP] JFace dependency on org.eclipse.core.runtime enlarges standalone JFace applications) - *******************************************************************************/ - -package org.eclipse.core.databinding.util; - -import org.eclipse.core.runtime.IStatus; - -/** - * A mechanism to log errors throughout JFace Data Binding. - * <p> - * Clients may provide their own implementation to change how errors are logged - * from within JFace Data Binding. - * </p> - * - * @see Policy#getLog() - * @see Policy#setLog(ILogger) - * @since 1.1 - */ -public interface ILogger { - - /** - * Logs the given status. - * - * @param status - * the status to log - */ - public void log(IStatus status); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/Policy.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/Policy.java deleted file mode 100644 index e081da00..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/Policy.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 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 - * Chris Gross (schtoo@schtoo.com) - support for ILogger added - * (bug 49497 [RCP] JFace dependency on org.eclipse.core.runtime enlarges standalone JFace applications) - * Brad Reynolds - bug 164653 - * Tom Schindl <tom.schindl@bestsolution.at> - bug 194587 - *******************************************************************************/ -package org.eclipse.core.databinding.util; - -import org.eclipse.core.runtime.IStatus; - -/** - * The Policy class handles settings for behaviour, debug flags and logging - * within JFace Data Binding. - * - * @since 1.1 - */ -public class Policy { - - /** - * Constant for the the default setting for debug options. - */ - public static final boolean DEFAULT = false; - - /** - * The unique identifier of the JFace plug-in. - */ - public static final String JFACE_DATABINDING = "org.eclipse.core.databinding";//$NON-NLS-1$ - - private static ILogger log; - - /** - * Returns the dummy log to use if none has been set - */ - private static ILogger getDummyLog() { - return new ILogger() { - public void log(IStatus status) { - System.err.println(status.getPlugin() + " - " + status.getCode() + " - " + status.getMessage()); //$NON-NLS-1$//$NON-NLS-2$ - if( status.getException() != null ) { - status.getException().printStackTrace(System.err); - } - } - }; - } - - /** - * Sets the logger used by JFace Data Binding to log errors. - * - * @param logger - * the logger to use, or <code>null</code> to use the default - * logger - */ - public static synchronized void setLog(ILogger logger) { - log = logger; - } - - /** - * Returns the logger used by JFace Data Binding to log errors. - * <p> - * The default logger prints the status to <code>System.err</code>. - * </p> - * - * @return the logger - */ - public static synchronized ILogger getLog() { - if (log == null) { - log = getDummyLog(); - } - return log; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/package.html deleted file mode 100644 index 0b186a7b..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/util/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> -Provides general utilities for data binding. -<h2> -Package Specification</h2> -<p> -This package provides general utilities for data binding.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/IValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/IValidator.java deleted file mode 100644 index a9c4b8b1..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/IValidator.java +++ /dev/null @@ -1,37 +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.databinding.validation; - -import org.eclipse.core.runtime.IStatus; - -/** - * A validator. This validator is responsible for determining if a given value - * is valid. Validators can be used on target or model values. For example, a - * String2IntValidator would only accept source Strings that can successfully be - * converted to an integer value, and a PositiveIntegerValidator would only - * accept positive integers. - * - * @since 1.0 - * - */ -public interface IValidator { - - /** - * Determines if the given value is valid. - * - * @param value - * the value to validate - * @return a status object indicating whether the validation succeeded - * {@link IStatus#isOK()} or not. Never null. - */ - public IStatus validate(Object value); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/ValidationStatus.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/ValidationStatus.java deleted file mode 100644 index d61cb196..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/ValidationStatus.java +++ /dev/null @@ -1,157 +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 164134 - *******************************************************************************/ -package org.eclipse.core.databinding.validation; - -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * Convenience class for creating status objects. - * - * @since 3.3 - * - */ -public class ValidationStatus extends Status { - - /** - * Creates a new validation status with the given severity, message, and - * exception. - * - * @param severity - * @param message - * @param exception - */ - private ValidationStatus(int severity, String message, Throwable exception) { - super(severity, Policy.JFACE_DATABINDING, IStatus.OK, message, exception); - } - - /** - * Creates a new validation status with the given severity and message. - * - * @param severity - * @param message - */ - private ValidationStatus(int severity, String message) { - super(severity, Policy.JFACE_DATABINDING,IStatus.OK, message, null); - } - - /** - * Creates a new validation error status with the given message. - * - * @param message - * @return a new error status with the given message - */ - public static IStatus error(String message) { - return new ValidationStatus(IStatus.ERROR, message); - } - - /** - * Creates a new validation cancel status with the given message. - * - * @param message - * @return a new cancel status with the given message - */ - public static IStatus cancel(String message) { - return new ValidationStatus(IStatus.CANCEL, message); - } - - /** - * Creates a new validation error status with the given message and - * exception. - * - * @param message - * @param exception - * @return a new error status with the given message and exception - */ - public static IStatus error(String message, Throwable exception) { - return new ValidationStatus(IStatus.ERROR, message, exception); - } - - /** - * Creates a new validation warning status with the given message. - * - * @param message - * @return a new warning status with the given message - */ - public static IStatus warning(String message) { - return new ValidationStatus(IStatus.WARNING, message); - } - - /** - * Creates a new validation info status with the given message. - * - * @param message - * @return a new info status with the given message - */ - public static IStatus info(String message) { - return new ValidationStatus(IStatus.INFO, message); - } - - /** - * Returns an OK status. - * - * @return an ok status - */ - public static IStatus ok() { - return Status.OK_STATUS; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - final int prime = 31; - int result = 1; - - String message = getMessage(); - int severity = getSeverity(); - Throwable throwable = getException(); - - result = prime * result + ((message == null) ? 0 : message.hashCode()); - result = prime * result + severity; - result = prime * result - + ((throwable == null) ? 0 : throwable.hashCode()); - return result; - } - - /** - * Equality is based upon instance equality rather than identity. - * - * @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 ValidationStatus other = (ValidationStatus) obj; - - if (getSeverity() != other.getSeverity()) - return false; - if (getMessage() == null) { - if (other.getMessage() != null) - return false; - } else if (!getMessage().equals(other.getMessage())) - return false; - if (getException() == null) { - if (other.getException() != null) - return false; - } else if (!getException().equals(other.getException())) - return false; - return true; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/package.html deleted file mode 100644 index 3d98b2e4..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/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> -Provides the core APIs for validation. -<h2> -Package Specification</h2> -<p> -This package provides the core APIs for validation.</p> -</body> -</html> diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Activator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Activator.java deleted file mode 100644 index 5b1f7fef..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Activator.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Tom Schindl 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: - * Tom Schindl - initial API and implementation - ******************************************************************************/ - -package org.eclipse.core.internal.databinding; - -import org.eclipse.core.databinding.util.ILogger; -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * @since 3.3 - * - */ -public class Activator extends Plugin { - /** - * The plug-in ID - */ - public static final String PLUGIN_ID = "org.eclipse.core.databinding"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - - Policy.setLog(new ILogger() { - - public void log(IStatus status) { - getLog().log(status); - } - - }); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingMessages.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingMessages.java deleted file mode 100644 index 85ded4be..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingMessages.java +++ /dev/null @@ -1,72 +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; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import com.ibm.icu.text.MessageFormat; - -/** - * @since 1.0 - * - */ -public class BindingMessages { - - /** - * The Binding resource bundle; eagerly initialized. - */ - private static final ResourceBundle bundle = ResourceBundle - .getBundle("org.eclipse.core.internal.databinding.messages"); //$NON-NLS-1$ - - /** - * Key to be used for an index out of range message. - */ - public static final String INDEX_OUT_OF_RANGE = "IndexOutOfRange"; //$NON-NLS-1$ - - /** - * Key to be used for a "Multiple Problems." message. - */ - public static final String MULTIPLE_PROBLEMS = "MultipleProblems"; //$NON-NLS-1$ - - /** - * Returns the resource object with the given key in the resource bundle for - * JFace Data Binding. If there isn't any value under the given key, the key - * is returned. - * - * @param key - * the resource name - * @return the string - */ - public static String getString(String key) { - try { - return bundle.getString(key); - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns a formatted string with the given key in the resource bundle for - * JFace Data Binding. - * - * @param key - * @param arguments - * @return formatted string, the key if the key is invalid - */ - public static String formatString(String key, Object[] arguments) { - try { - return MessageFormat.format(bundle.getString(key), arguments); - } catch (MissingResourceException e) { - return key; - } - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingStatus.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingStatus.java deleted file mode 100644 index 025b82c4..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/BindingStatus.java +++ /dev/null @@ -1,104 +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.internal.databinding; - -import java.util.Arrays; - -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; - -/** - * A <code>MultiStatus</code> implementation that copies that state of the - * added status to this instance if it is >= the current severity. - * - * @since 1.0 - */ -public class BindingStatus extends MultiStatus { - /** - * Constructs a new instance. - * - * @param pluginId - * @param code - * @param message - * @param exception - */ - public BindingStatus(String pluginId, int code, String message, - Throwable exception) { - super(pluginId, code, message, exception); - } - - /** - * Adds the status to the multi status. The details of the status will be - * copied to the multi status if the severity is >= the current severity. - * - * @see org.eclipse.core.runtime.MultiStatus#add(org.eclipse.core.runtime.IStatus) - */ - public void add(IStatus status) { - if (status.getSeverity() >= getSeverity()) { - setMessage((status.getMessage() != null) ? status.getMessage() : ""); //$NON-NLS-1$ - setException(status.getException()); - setPlugin(status.getPlugin()); - setCode(status.getCode()); - } - - super.add(status); - } - - /** - * Instance initialized with the following values: - * <ul> - * <li>plugin = Policy.JFACE_DATABINDING</li> - * <li>severity = 0</li> - * <li>code = 0</li> - * <li>message = ""</li> - * <li>exception = null</li> - * </ul> - * - * @return status - */ - public static BindingStatus ok() { - return new BindingStatus(Policy.JFACE_DATABINDING, 0, "", null); //$NON-NLS-1$ - } - - private static int hashCode(Object[] array) { - final int prime = 31; - if (array == null) - return 0; - int result = 1; - for (int index = 0; index < array.length; index++) { - result = prime * result - + (array[index] == null ? 0 : array[index].hashCode()); - } - return result; - } - - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + BindingStatus.hashCode(getChildren()); - return result; - } - - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final BindingStatus other = (BindingStatus) obj; - if (!Arrays.equals(getChildren(), other.getChildren())) - return false; - return true; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ClassLookupSupport.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ClassLookupSupport.java deleted file mode 100644 index 7b3e04ae..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ClassLookupSupport.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 - ******************************************************************************/ - -package org.eclipse.core.internal.databinding; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -/** - * @since 1.0 - * - */ -public class ClassLookupSupport { - - /* - * code copied from AdapterManager.java - */ - private static HashMap classSearchOrderLookup; - - /** - * For a given class or interface, return an array containing the given type and all its direct and indirect supertypes. - * @param type - * @return an array containing the given type and all its direct and indirect supertypes - */ - public static Class[] getTypeHierarchyFlattened(Class type) { - List classes = null; - //cache reference to lookup to protect against concurrent flush - HashMap lookup = classSearchOrderLookup; - if (lookup != null) - classes = (List) lookup.get(type); - // compute class order only if it hasn't been cached before - if (classes == null) { - classes = new ArrayList(); - computeClassOrder(type, classes); - if (lookup == null) - classSearchOrderLookup = lookup = new HashMap(); - lookup.put(type, classes); - } - return (Class[]) classes.toArray(new Class[classes.size()]); - } - - /** - * Builds and returns a table of adapters for the given adaptable type. - * The table is keyed by adapter class name. The - * value is the <b>sole<b> factory that defines that adapter. Note that - * if multiple adapters technically define the same property, only the - * first found in the search order is considered. - * - * Note that it is important to maintain a consistent class and interface - * lookup order. See the class comment for more details. - */ - private static void computeClassOrder(Class adaptable, Collection classes) { - Class clazz = adaptable; - Set seen = new HashSet(4); - while (clazz != null) { - classes.add(clazz); - computeInterfaceOrder(clazz.getInterfaces(), classes, seen); - clazz = clazz.isInterface() ? Object.class : clazz.getSuperclass(); - } - } - - private static void computeInterfaceOrder(Class[] interfaces, Collection classes, Set seen) { - List newInterfaces = new ArrayList(interfaces.length); - for (int i = 0; i < interfaces.length; i++) { - Class interfac = interfaces[i]; - if (seen.add(interfac)) { - //note we cannot recurse here without changing the resulting interface order - classes.add(interfac); - newInterfaces.add(interfac); - } - } - for (Iterator it = newInterfaces.iterator(); it.hasNext();) - computeInterfaceOrder(((Class) it.next()).getInterfaces(), classes, seen); - } - - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/IdentityWrapper.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/IdentityWrapper.java deleted file mode 100644 index 978c9962..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/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; - -/** - * 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/src/org/eclipse/core/internal/databinding/Pair.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Pair.java deleted file mode 100644 index 74be767b..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Pair.java +++ /dev/null @@ -1,57 +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.core.internal.databinding; - -/** - * Class Pair. Represents a mathematical pair of objects (a, b). - * @since 1.0 - */ -public class Pair { - - /** - * a in the pair (a, b) - */ - public final Object a; - - /** - * b in the pair (a, b) - */ - public final Object b; - - /** - * Construct a Pair(a, b) - * - * @param a a in the pair (a, b) - * @param b b in the pair (a, b) - */ - public Pair(Object a, Object b) { - this.a = a; - this.b = b; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - if (obj.getClass() != Pair.class) { - return false; - } - Pair other = (Pair) obj; - return a.equals(other.a) && b.equals(other.b); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return a.hashCode() + b.hashCode(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Queue.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Queue.java deleted file mode 100644 index 90f35eff..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Queue.java +++ /dev/null @@ -1,80 +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.internal.databinding; - -/** - * Created to avoid a dependency on java.util.LinkedList, see bug 205224. - * - * @since 1.1 - * - */ -public class Queue { - - static class Entry { - Object object; - - Entry(Object o) { - this.object = o; - } - - Entry next; - Entry previous; - } - - Entry first; - Entry last; - - /** - * Adds the given object to the end of the queue. - * - * @param o - */ - public void enqueue(Object o) { - Entry oldLast = last; - last = new Entry(o); - last.previous = oldLast; - if (oldLast != null) { - oldLast.next = last; - } else { - first = last; - } - } - - /** - * Returns the first object in the queue. The queue must not be empty. - * - * @return the first object - */ - public Object dequeue() { - Entry oldFirst = first; - if (oldFirst == null) { - throw new IllegalStateException(); - } - first = oldFirst.next; - if (first == null) { - last = null; - } else { - first.previous = null; - } - oldFirst.next = null; - oldFirst.previous = null; - return oldFirst.object; - } - - /** - * Returns <code>true</code> if the list is empty. - * - * @return <code>true</code> if the list is empty - */ - public boolean isEmpty() { - return first == null; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/RandomAccessListIterator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/RandomAccessListIterator.java deleted file mode 100644 index 8a560ad7..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/RandomAccessListIterator.java +++ /dev/null @@ -1,135 +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.core.internal.databinding; - -import java.util.List; -import java.util.ListIterator; - -/** - * Class RandomAccessListIterator. A ListIterator implementation that also - * provides access to individual elements based on the element's index. - * - * @since 3.3 - */ -public class RandomAccessListIterator implements ListIterator { - private ListIterator delegate = null; - - /** - * @param iterator - */ - public RandomAccessListIterator(ListIterator iterator) { - this.delegate = iterator; - } - - /** - * @param list - */ - public RandomAccessListIterator(List list) { - if (list == null) { - throw new IllegalArgumentException("list is null"); //$NON-NLS-1$ - } - this.delegate = list.listIterator(); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#add(java.lang.Object) - */ - public void add(Object arg0) { - delegate.add(arg0); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#hasNext() - */ - public boolean hasNext() { - return delegate.hasNext(); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#hasPrevious() - */ - public boolean hasPrevious() { - return delegate.hasPrevious(); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#next() - */ - public Object next() { - return delegate.next(); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#nextIndex() - */ - public int nextIndex() { - return delegate.nextIndex(); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#previous() - */ - public Object previous() { - return delegate.previous(); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#previousIndex() - */ - public int previousIndex() { - return delegate.previousIndex(); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#remove() - */ - public void remove() { - delegate.remove(); - } - - /* (non-Javadoc) - * @see java.util.ListIterator#set(java.lang.Object) - */ - public void set(Object arg0) { - delegate.set(arg0); - } - - /** - * Return the element at the specified position by moving the iterator - * forward or backward in the list until it reaches the correct element. - * The iterator's position after returning the element will be one after - * the element returned. - * - * @param index The (0-based) index of the element to return. - * @return the Object at index - */ - public Object get(int index) { - if (delegate.nextIndex() == 0 && !delegate.hasNext()) { - throw new IndexOutOfBoundsException("Request for element from empty list"); //$NON-NLS-1$ - } - if (index < 0) { - throw new IndexOutOfBoundsException("Request for negative element index"); //$NON-NLS-1$ - } - - while (nextIndex() < index && hasNext()) { - next(); - } - while (previousIndex() > index-1) { - previous(); - } - if (!hasNext()) { - throw new IndexOutOfBoundsException("Request for element past end of list"); //$NON-NLS-1$ - } - return next(); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Util.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Util.java deleted file mode 100644 index d0271773..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Util.java +++ /dev/null @@ -1,35 +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.core.internal.databinding; - -/** - * @since 3.3 - * - */ -public class Util { - - /** - * Checks whether the two objects are <code>null</code> -- allowing for - * <code>null</code>. - * - * @param left - * The left object to compare; may be <code>null</code>. - * @param right - * The right object to compare; may be <code>null</code>. - * @return <code>true</code> if the two objects are equivalent; - * <code>false</code> otherwise. - */ - public static final boolean equals(final Object left, final Object right) { - return left == null ? right == null : ((right != null) && left - .equals(right)); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ValidationStatusMap.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ValidationStatusMap.java deleted file mode 100644 index 07efa93f..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ValidationStatusMap.java +++ /dev/null @@ -1,159 +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.internal.databinding; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.databinding.Binding; -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.Realm; -import org.eclipse.core.databinding.observable.list.WritableList; -import org.eclipse.core.databinding.observable.map.IMapChangeListener; -import org.eclipse.core.databinding.observable.map.MapDiff; -import org.eclipse.core.databinding.observable.map.ObservableMap; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.core.runtime.IStatus; - -/** - * @since 1.0 - * - */ -public class ValidationStatusMap extends ObservableMap { - - private boolean isDirty = true; - - private final WritableList bindings; - - private List dependencies = new ArrayList(); - - private IChangeListener markDirtyChangeListener = new IChangeListener() { - public void handleChange(ChangeEvent event) { - markDirty(); - } - }; - - /** - * @param realm - * @param bindings - */ - public ValidationStatusMap(Realm realm, WritableList bindings) { - super(realm, new HashMap()); - this.bindings = bindings; - bindings.addChangeListener(markDirtyChangeListener); - } - - protected void getterCalled() { - recompute(); - super.getterCalled(); - } - - private void markDirty() { - // since we are dirty, we don't need to listen anymore - removeElementChangeListener(); - final Map oldMap = wrappedMap; - // lazy computation of diff - MapDiff mapDiff = new MapDiff() { - private MapDiff cachedDiff = null; - - private void ensureCached() { - if (cachedDiff == null) { - recompute(); - cachedDiff = Diffs.computeMapDiff(oldMap, wrappedMap); - } - } - - public Set getAddedKeys() { - ensureCached(); - return cachedDiff.getAddedKeys(); - } - - public Set getChangedKeys() { - ensureCached(); - return cachedDiff.getChangedKeys(); - } - - public Object getNewValue(Object key) { - ensureCached(); - return cachedDiff.getNewValue(key); - } - - public Object getOldValue(Object key) { - ensureCached(); - return cachedDiff.getOldValue(key); - } - - public Set getRemovedKeys() { - ensureCached(); - return cachedDiff.getRemovedKeys(); - } - }; - wrappedMap = new HashMap(); - isDirty = true; - fireMapChange(mapDiff); - } - - private void recompute() { - if (isDirty) { - Map newContents = new HashMap(); - for (Iterator it = bindings.iterator(); it.hasNext();) { - Binding binding = (Binding) it.next(); - IObservableValue validationError = binding - .getValidationStatus(); - dependencies.add(validationError); - validationError.addChangeListener(markDirtyChangeListener); - IStatus validationStatusValue = (IStatus) validationError - .getValue(); - newContents.put(binding, validationStatusValue); - } - wrappedMap.putAll(newContents); - isDirty = false; - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.list.ObservableList#dispose() - */ - public void dispose() { - bindings.removeChangeListener(markDirtyChangeListener); - removeElementChangeListener(); - super.dispose(); - } - - private void removeElementChangeListener() { - for (Iterator it = dependencies.iterator(); it.hasNext();) { - IObservableValue observableValue = (IObservableValue) it.next(); - observableValue.removeChangeListener(markDirtyChangeListener); - } - } - - public synchronized void addChangeListener(IChangeListener listener) { - // this ensures that the next change will be seen by the new listener. - recompute(); - super.addChangeListener(listener); - } - - public synchronized void addMapChangeListener(IMapChangeListener listener) { - // this ensures that the next change will be seen by the new listener. - recompute(); - super.addMapChangeListener(listener); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateConversionSupport.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateConversionSupport.java deleted file mode 100755 index 8c7c8d63..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateConversionSupport.java +++ /dev/null @@ -1,128 +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.core.internal.databinding.conversion; - -import java.text.ParsePosition; -import java.util.Date; - -import org.eclipse.core.internal.databinding.BindingMessages; - -import com.ibm.icu.text.DateFormat; -import com.ibm.icu.text.SimpleDateFormat; - -/** - * Base support for date/string conversion handling according to the default - * locale or in plain long milliseconds. - * <p> - * NOTE: parse(format(date)) will generally *not* be equal to date, since the - * string representation may not cover the sub-second range, time-only string - * representations will be counted from the beginning of the era, etc. - * </p> - */ -public abstract class DateConversionSupport { - private final static int DATE_FORMAT=DateFormat.SHORT; - private final static int DEFAULT_FORMATTER_INDEX=0; - - private final static int NUM_VIRTUAL_FORMATTERS=1; - - /** - * Alternative formatters for date, time and date/time. - * Raw milliseconds are covered as a special case. - */ - // TODO: These could be shared, but would have to be synchronized. - private DateFormat[] formatters = { - new SimpleDateFormat(BindingMessages.getString("DateFormat_DateTime")), //$NON-NLS-1$ - new SimpleDateFormat(BindingMessages.getString("DateFormat_Time")), //$NON-NLS-1$ - DateFormat.getDateTimeInstance(DATE_FORMAT, DateFormat.SHORT), - DateFormat.getDateInstance(DATE_FORMAT), - DateFormat.getTimeInstance(DateFormat.SHORT), - DateFormat.getDateTimeInstance(DATE_FORMAT,DateFormat.MEDIUM), - DateFormat.getTimeInstance(DateFormat.MEDIUM) - }; - - /** - * Tries all available formatters to parse the given string according to the - * default locale or as a raw millisecond value and returns the result of the - * first successful run. - * - * @param str A string specifying a date according to the default locale or in raw milliseconds - * @return The parsed date, or null, if no available formatter could interpret the input string - */ - protected Date parse(String str) { - for (int formatterIdx = 0; formatterIdx < formatters.length; formatterIdx++) { - Date parsed=parse(str,formatterIdx); - if(parsed!=null) { - return parsed; - } - } - return null; - } - - protected Date parse(String str,int formatterIdx) { - if(formatterIdx>=0) { - ParsePosition pos=new ParsePosition(0); - if (str == null) { - return null; - } - Date date=formatters[formatterIdx].parse(str,pos); - if(pos.getErrorIndex()!=-1||pos.getIndex()!=str.length()) { - return null; - } - return date; - } - try { - long millisecs=Long.parseLong(str); - return new Date(millisecs); - } - catch(NumberFormatException exc) { - } - return null; - } - - /** - * Formats the given date with the default formatter according to the default locale. - * @param date a date - * @return a string representation of the given date according to the default locale - */ - protected String format(Date date) { - return format(date,DEFAULT_FORMATTER_INDEX); - } - - protected String format(Date date,int formatterIdx) { - if(formatterIdx>=0) { - return formatters[formatterIdx].format(date); - } - return String.valueOf(date.getTime()); - } - - protected int numFormatters() { - return formatters.length+NUM_VIRTUAL_FORMATTERS; - } - - /** - * Returns the date format for the provided <code>index</code>. - * <p> - * This is for testing purposes only and should not be a part of the API if - * this class was to be exposed. - * </p> - * - * @param index - * @return date format - */ - protected DateFormat getDateFormat(int index) { - if (index < 0 || index >= formatters.length) { - throw new IllegalArgumentException("'index' [" + index + "] is out of bounds."); //$NON-NLS-1$//$NON-NLS-2$ - } - - return formatters[index]; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.java deleted file mode 100755 index 95a3e295..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.java +++ /dev/null @@ -1,39 +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.core.internal.databinding.conversion; - -import java.util.Date; - -import org.eclipse.core.databinding.conversion.IConverter; - - -/** - * Converts a Java.util.Date to a String using the current locale. Null date - * values are converted to an empty string. - * - * @since 1.0 - */ -public class DateToStringConverter extends DateConversionSupport implements IConverter { - public Object convert(Object source) { - if (source != null) - return format((Date)source); - return ""; //$NON-NLS-1$ - } - - public Object getFromType() { - return Date.class; - } - - public Object getToType() { - return String.class; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IdentityConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IdentityConverter.java deleted file mode 100644 index a582c607..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IdentityConverter.java +++ /dev/null @@ -1,108 +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.core.internal.databinding.conversion; - -import org.eclipse.core.databinding.BindingException; -import org.eclipse.core.databinding.conversion.IConverter; - -/** - * TheIdentityConverter. Returns the source value (the identity function). - */ -public class IdentityConverter implements IConverter { - - private Class fromType; - - private Class toType; - - /** - * @param type - */ - public IdentityConverter(Class type) { - this.fromType = type; - this.toType = type; - } - - /** - * @param fromType - * @param toType - */ - public IdentityConverter(Class fromType, Class toType) { - this.fromType = fromType; - this.toType = toType; - } - - private Class[][] primitiveMap = new Class[][] { - { Integer.TYPE, Integer.class }, { Short.TYPE, Short.class }, - { Long.TYPE, Long.class }, { Double.TYPE, Double.class }, - { Byte.TYPE, Byte.class }, { Float.TYPE, Float.class }, - { Boolean.TYPE, Boolean.class }, }; - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.binding.converter.IConverter#convert(java.lang.Object) - */ - public Object convert(Object source) { - if (toType.isPrimitive()) { - if (source == null) { - throw new BindingException("Cannot convert null to a primitive"); //$NON-NLS-1$ - } - } - if (source != null) { - Class sourceClass = source.getClass(); - if (toType.isPrimitive() || sourceClass.isPrimitive()) { - if (sourceClass.equals(toType) - || isPrimitiveTypeMatchedWithBoxed(sourceClass, toType)) { - return source; - } - throw new BindingException( - "Boxed and unboxed types do not match"); //$NON-NLS-1$ - } - if (!toType.isAssignableFrom(sourceClass)) { - throw new BindingException(sourceClass.getName() - + " is not assignable to " + toType.getName()); //$NON-NLS-1$ - } - } - return source; - } - - /** - * (Non-API) isPrimitiveTypeMatchedWithBoxed. - * - * @param sourceClass - * @param toClass - * @return true if sourceClass and toType are matched primitive/boxed types - */ - public boolean isPrimitiveTypeMatchedWithBoxed(Class sourceClass, - Class toClass) { - for (int i = 0; i < primitiveMap.length; i++) { - if (toClass.equals(primitiveMap[i][0]) - && sourceClass.equals(primitiveMap[i][1])) { - return true; - } - if (sourceClass.equals(primitiveMap[i][0]) - && toClass.equals(primitiveMap[i][1])) { - return true; - } - } - return false; - } - - public Object getFromType() { - return fromType; - } - - public Object getToType() { - return toType; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IntegerToStringConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IntegerToStringConverter.java deleted file mode 100644 index c8b177c8..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IntegerToStringConverter.java +++ /dev/null @@ -1,102 +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.internal.databinding.conversion; - -import org.eclipse.core.databinding.conversion.Converter; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts a value that is an integer, non decimal, to a String using a - * NumberFormat. - * <p> - * This class is a temporary as this ability exists in NumberToStringConverter - * except that short and byte are missing. - * </p> - * - * @since 1.0 - */ -public class IntegerToStringConverter extends Converter { - private final boolean primitive; - private final NumberFormat numberFormat; - private final Class boxedType; - - /** - * @param numberFormat - * @param fromType - * @param boxedType - */ - private IntegerToStringConverter(NumberFormat numberFormat, Class fromType, - Class boxedType) { - super(fromType, String.class); - this.primitive = fromType.isPrimitive(); - this.numberFormat = numberFormat; - this.boxedType = boxedType; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object) - */ - public Object convert(Object fromObject) { - // Null is allowed when the type is not primitve. - if (fromObject == null && !primitive) { - return ""; //$NON-NLS-1$ - } - - if (!boxedType.isInstance(fromObject)) { - throw new IllegalArgumentException( - "'fromObject' is not of type [" + boxedType + "]."); //$NON-NLS-1$//$NON-NLS-2$ - } - - return numberFormat.format(((Number) fromObject).longValue()); - } - - /** - * @param primitive - * @return converter - */ - public static IntegerToStringConverter fromShort(boolean primitive) { - return fromShort(NumberFormat.getIntegerInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return converter - */ - public static IntegerToStringConverter fromShort(NumberFormat numberFormat, - boolean primitive) { - return new IntegerToStringConverter(numberFormat, - primitive ? Short.TYPE : Short.class, Short.class); - } - - /** - * @param primitive - * @return converter - */ - public static IntegerToStringConverter fromByte(boolean primitive) { - return fromByte(NumberFormat.getIntegerInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return converter - */ - public static IntegerToStringConverter fromByte(NumberFormat numberFormat, - boolean primitive) { - return new IntegerToStringConverter(numberFormat, primitive ? Byte.TYPE - : Byte.class, Byte.class); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java deleted file mode 100644 index 2d3e38a0..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java +++ /dev/null @@ -1,46 +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.internal.databinding.conversion; - -import java.math.BigDecimal; -import java.math.BigInteger; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts from a Number to a BigDecimal. - * <p> - * Class is thread safe. - * </p> - * - * @since 1.0 - */ -public class NumberToBigDecimalConverter extends NumberToNumberConverter { - /** - * @param numberFormat - * @param fromType - */ - public NumberToBigDecimalConverter(NumberFormat numberFormat, Class fromType) { - super(numberFormat, fromType, BigDecimal.class); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter#doConvert(java.lang.Number) - */ - protected Number doConvert(Number number) { - if (number instanceof BigInteger) { - return new BigDecimal((BigInteger) number); - } - - return new BigDecimal(number.doubleValue()); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java deleted file mode 100644 index 23f4261a..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java +++ /dev/null @@ -1,50 +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.internal.databinding.conversion; - -import java.math.BigDecimal; -import java.math.BigInteger; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts from a Number to a BigInteger. - * <p> - * Class is thread safe. - * </p> - * - * @since 1.0 - */ -public class NumberToBigIntegerConverter extends NumberToNumberConverter { - /** - * @param numberFormat - * @param fromType - */ - public NumberToBigIntegerConverter(NumberFormat numberFormat, Class fromType) { - super(numberFormat, fromType, BigInteger.class); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter#doConvert(java.lang.Number) - */ - protected Number doConvert(Number number) { - return toBigDecimal(number).toBigInteger(); - } - - private static BigDecimal toBigDecimal(Number number) { - if (number instanceof BigDecimal) { - return (BigDecimal) number; - } - - return new BigDecimal(number.doubleValue()); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToByteConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToByteConverter.java deleted file mode 100644 index 88bf643a..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToByteConverter.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.core.internal.databinding.conversion; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts from a Number to a Byte. - * <p> - * Class is thread safe. - * </p> - * - * @since 1.0 - */ -public class NumberToByteConverter extends NumberToNumberConverter { - /** - * @param numberFormat - * @param fromType - * @param primitive - */ - public NumberToByteConverter(NumberFormat numberFormat, Class fromType, - boolean primitive) { - super(numberFormat, fromType, (primitive) ? Byte.TYPE : Byte.class); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter#doConvert(java.lang.Number) - */ - protected Number doConvert(Number number) { - if (StringToNumberParser.inByteRange(number)) { - return new Byte(number.byteValue()); - } - - return null; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToDoubleConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToDoubleConverter.java deleted file mode 100644 index 4e30390a..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToDoubleConverter.java +++ /dev/null @@ -1,46 +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.internal.databinding.conversion; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts from a Number to a Double. - * <p> - * Class is thread safe. - * </p> - * - * @since 1.0 - */ -public class NumberToDoubleConverter extends NumberToNumberConverter { - - /** - * @param numberFormat - * @param fromType - * @param primitive - */ - public NumberToDoubleConverter(NumberFormat numberFormat, Class fromType, - boolean primitive) { - super(numberFormat, fromType, (primitive) ? Double.TYPE : Double.class); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter#doConvert(java.lang.Number) - */ - protected Number doConvert(Number number) { - if (StringToNumberParser.inDoubleRange(number)) { - return new Double(number.doubleValue()); - } - - return null; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToFloatConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToFloatConverter.java deleted file mode 100644 index 64745a57..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToFloatConverter.java +++ /dev/null @@ -1,44 +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.internal.databinding.conversion; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts from a Number to a Float. - * <p> - * Class is thread safe. - * </p> - * @since 1.0 - */ -public class NumberToFloatConverter extends NumberToNumberConverter { - /** - * @param numberFormat - * @param fromType - * @param primitive - */ - public NumberToFloatConverter(NumberFormat numberFormat, Class fromType, - boolean primitive) { - super(numberFormat, fromType, (primitive) ? Float.TYPE : Float.class); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter#doConvert(java.lang.Number) - */ - protected Number doConvert(Number number) { - if (StringToNumberParser.inFloatRange(number)) { - return new Float(number.floatValue()); - } - - return null; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToIntegerConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToIntegerConverter.java deleted file mode 100644 index fdcf23aa..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToIntegerConverter.java +++ /dev/null @@ -1,48 +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.internal.databinding.conversion; - -import org.eclipse.core.databinding.conversion.IConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts from a Number to a Integer. - * <p> - * Class is thread safe. - * </p> - * @since 1.0 - */ -public class NumberToIntegerConverter extends NumberToNumberConverter implements - IConverter { - - /** - * @param numberFormat - * @param fromType - * @param primitive - */ - public NumberToIntegerConverter(NumberFormat numberFormat, - Class fromType, boolean primitive) { - super(numberFormat, fromType, (primitive) ? Integer.TYPE : Integer.class); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter#doConvert(java.lang.Number) - */ - protected Number doConvert(Number number) { - if (StringToNumberParser.inIntegerRange(number)) { - return new Integer(number.intValue()); - } - - return null; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToLongConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToLongConverter.java deleted file mode 100644 index 6addb0e8..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToLongConverter.java +++ /dev/null @@ -1,44 +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.internal.databinding.conversion; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts from a Number to a Long. - * <p> - * Class is thread safe. - * </p> - * @since 1.0 - */ -public class NumberToLongConverter extends NumberToNumberConverter { - /** - * @param numberFormat - * @param fromType - * @param primitive - */ - public NumberToLongConverter(NumberFormat numberFormat, Class fromType, - boolean primitive) { - super(numberFormat, fromType, (primitive) ? Long.TYPE : Long.class); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter#doConvert(java.lang.Number) - */ - protected Number doConvert(Number number) { - if (StringToNumberParser.inLongRange(number)) { - return new Long(number.longValue()); - } - - return null; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToNumberConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToNumberConverter.java deleted file mode 100644 index 89f763bd..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToNumberConverter.java +++ /dev/null @@ -1,96 +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.internal.databinding.conversion; - -import org.eclipse.core.databinding.conversion.Converter; - -import com.ibm.icu.text.NumberFormat; - -/** - * Base class for number to number converters. - * <p> - * This class is thread safe. - * </p> - * - * @since 1.0 - */ -public abstract class NumberToNumberConverter extends Converter { - private NumberFormat numberFormat; - - private boolean primitive; - - private String outOfRangeMessage; - - protected NumberToNumberConverter(NumberFormat numberFormat, - Class fromType, Class toType) { - super(fromType, toType); - this.numberFormat = numberFormat; - this.primitive = toType.isPrimitive(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object) - */ - public final Object convert(Object fromObject) { - if (fromObject == null) { - if (primitive) { - throw new IllegalArgumentException( - "Parameter 'fromObject' cannot be null."); //$NON-NLS-1$ - } - - return null; - } - - if (!(fromObject instanceof Number)) { - throw new IllegalArgumentException( - "Parameter 'fromObject' must be of type Number."); //$NON-NLS-1$ - } - - Number number = (Number) fromObject; - Number result = doConvert(number); - - if (result != null) { - return result; - } - - synchronized (this) { - if (outOfRangeMessage == null) { - outOfRangeMessage = StringToNumberParser - .createOutOfRangeMessage(new Short(Short.MIN_VALUE), - new Short(Short.MAX_VALUE), numberFormat); - } - - throw new IllegalArgumentException(outOfRangeMessage); - } - } - - /** - * Invoked when the number should converted. - * - * @param number - * @return number if conversion was successfule, <code>null</code> if the - * number was out of range - */ - protected abstract Number doConvert(Number number); - - /** - * NumberFormat being used by the converter. Access to the format must be - * synchronized on the number format instance. - * - * @return number format - */ - public NumberFormat getNumberFormat() { - return numberFormat; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToShortConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToShortConverter.java deleted file mode 100644 index badb8c05..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToShortConverter.java +++ /dev/null @@ -1,47 +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.internal.databinding.conversion; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converts from a Number to a Short. - * <p> - * Class is thread safe. - * </p> - * @since 1.0 - */ -public class NumberToShortConverter extends NumberToNumberConverter { - /** - * @param numberFormat - * @param fromType - * @param primitive - */ - public NumberToShortConverter(NumberFormat numberFormat, Class fromType, - boolean primitive) { - - super(numberFormat, fromType, (primitive) ? Short.TYPE : Short.class); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter#doConvert(java.lang.Number) - */ - protected Number doConvert(Number number) { - if (StringToNumberParser.inShortRange(number)) { - return new Short(number.shortValue()); - } - - return null; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/ObjectToStringConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/ObjectToStringConverter.java deleted file mode 100644 index 76b69d45..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/ObjectToStringConverter.java +++ /dev/null @@ -1,56 +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.core.internal.databinding.conversion; - -import org.eclipse.core.databinding.conversion.IConverter; - -/** - * Converts any object to a string by calling its toString() method. - */ -public class ObjectToStringConverter implements IConverter { - private final Class fromClass; - - /** - * - */ - public ObjectToStringConverter() { - this(Object.class); - } - - /** - * @param fromClass - */ - public ObjectToStringConverter(Class fromClass) { - this.fromClass = fromClass; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.binding.converter.IConverter#convert(java.lang.Object) - */ - public Object convert(Object source) { - if (source == null) { - return ""; //$NON-NLS-1$ - } - return source.toString(); - } - - public Object getFromType() { - return fromClass; - } - - public Object getToType() { - return String.class; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StatusToStringConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StatusToStringConverter.java deleted file mode 100644 index 72d77165..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StatusToStringConverter.java +++ /dev/null @@ -1,42 +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.internal.databinding.conversion; - -import org.eclipse.core.databinding.conversion.Converter; -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.runtime.IStatus; - -/** - * Converts an IStatus into a String. The message of the status is the returned value. - * - * @since 1.0 - */ -public class StatusToStringConverter extends Converter implements IConverter { - /** - * Constructs a new instance. - */ - public StatusToStringConverter() { - super(IStatus.class, String.class); - } - - /* (non-Javadoc) - * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object) - */ - public Object convert(Object fromObject) { - if (fromObject == null) { - throw new IllegalArgumentException("Parameter 'fromObject' was null."); //$NON-NLS-1$ - } - - IStatus status = (IStatus) fromObject; - return status.getMessage(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanConverter.java deleted file mode 100755 index 7f67e768..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanConverter.java +++ /dev/null @@ -1,36 +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.core.internal.databinding.conversion; - -/** - * StringToBooleanConverter. - */ -public class StringToBooleanConverter extends StringToBooleanPrimitiveConverter { - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.binding.converter.IConverter#convert(java.lang.Object) - */ - public Object convert(Object source) { - String sourceString = (String) source; - if ("".equals(sourceString.trim())) { //$NON-NLS-1$ - return null; - } - return super.convert(source); - } - - public Object getToType() { - return Boolean.class; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanPrimitiveConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanPrimitiveConverter.java deleted file mode 100644 index 352cc8a8..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanPrimitiveConverter.java +++ /dev/null @@ -1,87 +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.core.internal.databinding.conversion; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.BindingMessages; - -/** - * StringToBooleanPrimitiveConverter. - */ -public class StringToBooleanPrimitiveConverter implements IConverter { - private static final String[] trueValues; - - private static final String[] falseValues; - - static { - String delimiter = BindingMessages.getString("ValueDelimiter"); //$NON-NLS-1$ - String values = BindingMessages.getString("TrueStringValues"); //$NON-NLS-1$ - trueValues = valuesToSortedArray(delimiter, values); - - values = BindingMessages.getString("FalseStringValues"); //$NON-NLS-1$ - falseValues = valuesToSortedArray(delimiter, values); - } - - /** - * Returns a sorted array with all values converted to upper case. - * - * @param delimiter - * @param values - * @return sorted array of values - */ - private static String[] valuesToSortedArray(String delimiter, String values) { - List list = new LinkedList(); - StringTokenizer tokenizer = new StringTokenizer(values, delimiter); - while (tokenizer.hasMoreTokens()) { - list.add(tokenizer.nextToken().toUpperCase()); - } - - String[] array = (String[]) list.toArray(new String[list.size()]); - Arrays.sort(array); - - return array; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.binding.converter.IConverter#convert(java.lang.Object) - */ - public Object convert(Object source) { - String s = (String) source; - s = s.toUpperCase(); - - if (Arrays.binarySearch(trueValues, s) > -1) { - return Boolean.TRUE; - } - - if (Arrays.binarySearch(falseValues, s) > -1) { - return Boolean.FALSE; - } - - throw new IllegalArgumentException(s + " is not a legal boolean value"); //$NON-NLS-1$ - } - - public Object getFromType() { - return String.class; - } - - public Object getToType() { - return Boolean.TYPE; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToByteConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToByteConverter.java deleted file mode 100755 index eef131d2..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToByteConverter.java +++ /dev/null @@ -1,88 +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.core.internal.databinding.conversion; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser.ParseResult; -import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.0 - */ -public class StringToByteConverter extends NumberFormatConverter { - private String outOfRangeMessage; - private NumberFormat numberFormat; - private boolean primitive; - - /** - * @param numberFormat - * @param toType - */ - private StringToByteConverter(NumberFormat numberFormat, Class toType) { - super(String.class, toType, numberFormat); - primitive = toType.isPrimitive(); - this.numberFormat = numberFormat; - } - - /** - * @param numberFormat - * @param primitive - * @return converter - */ - public static StringToByteConverter toByte(NumberFormat numberFormat, - boolean primitive) { - return new StringToByteConverter(numberFormat, (primitive) ? Byte.TYPE : Byte.class); - } - - /** - * @param primitive - * @return converter - */ - public static StringToByteConverter toByte(boolean primitive) { - return toByte(NumberFormat.getIntegerInstance(), primitive); - } - - /* (non-Javadoc) - * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object) - */ - public Object convert(Object fromObject) { - ParseResult result = StringToNumberParser.parse(fromObject, - numberFormat, primitive); - - if (result.getPosition() != null) { - // this shouldn't happen in the pipeline as validation should catch - // it but anyone can call convert so we should return a properly - // formatted message in an exception - throw new IllegalArgumentException(StringToNumberParser - .createParseErrorMessage((String) fromObject, result - .getPosition())); - } else if (result.getNumber() == null) { - // if an error didn't occur and the number is null then it's a boxed - // type and null should be returned - return null; - } - - if (StringToNumberParser.inByteRange(result.getNumber())) { - return new Byte(result.getNumber().byteValue()); - } - - synchronized (this) { - if (outOfRangeMessage == null) { - outOfRangeMessage = StringToNumberParser - .createOutOfRangeMessage(new Byte(Byte.MIN_VALUE), new Byte(Byte.MAX_VALUE), numberFormat); - } - - throw new IllegalArgumentException(outOfRangeMessage); - } - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToCharacterConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToCharacterConverter.java deleted file mode 100644 index 10065b58..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToCharacterConverter.java +++ /dev/null @@ -1,52 +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.core.internal.databinding.conversion; - -import org.eclipse.core.databinding.conversion.IConverter; - -/** - * StringToCharacterConverter. - */ -public class StringToCharacterConverter implements IConverter { - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.binding.converter.IConverter#convert(java.lang.Object) - */ - public Object convert(Object source) { - String s = (String) source; - Character result; - - if (s.length() > 1) - throw new IllegalArgumentException( - "String2Character: string too long: " + s); //$NON-NLS-1$ - - try { - result = new Character(s.charAt(0)); - } catch (Exception e) { - throw new IllegalArgumentException( - "String2Character: " + e.getMessage() + ": " + s); //$NON-NLS-1$ //$NON-NLS-2$ - } - - return result; - } - - public Object getFromType() { - return String.class; - } - - public Object getToType() { - return Character.class; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToDateConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToDateConverter.java deleted file mode 100644 index 47b55cee..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToDateConverter.java +++ /dev/null @@ -1,36 +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.core.internal.databinding.conversion; - -import java.util.Date; - -import org.eclipse.core.databinding.conversion.IConverter; - - -/** - * Convert a String to a java.util.Date, respecting the current locale - * - * @since 1.0 - */ -public class StringToDateConverter extends DateConversionSupport implements IConverter { - public Object convert(Object source) { - return parse(source.toString()); - } - - public Object getFromType() { - return String.class; - } - - public Object getToType() { - return Date.class; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java deleted file mode 100644 index 4b550eb9..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java +++ /dev/null @@ -1,307 +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.internal.databinding.conversion; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.text.ParsePosition; - -import org.eclipse.core.internal.databinding.BindingMessages; - -import com.ibm.icu.text.NumberFormat; - -/** - * Utility class for the parsing of strings to numbers. - * - * @since 1.0 - */ -public class StringToNumberParser { - private static final BigDecimal FLOAT_MAX_BIG_DECIMAL = new BigDecimal( - Float.MAX_VALUE); - private static final BigDecimal FLOAT_MIN_BIG_DECIMAL = new BigDecimal( - -Float.MAX_VALUE); - - private static final BigDecimal DOUBLE_MAX_BIG_DECIMAL = new BigDecimal( - Double.MAX_VALUE); - private static final BigDecimal DOUBLE_MIN_BIG_DECIMAL = new BigDecimal( - -Double.MAX_VALUE); - - /** - * @param value - * @param numberFormat - * @param primitive - * @return result - */ - public static ParseResult parse(Object value, NumberFormat numberFormat, - boolean primitive) { - if (!(value instanceof String)) { - throw new IllegalArgumentException( - "Value to convert is not a String"); //$NON-NLS-1$ - } - - String source = (String) value; - ParseResult result = new ParseResult(); - if (!primitive && source.trim().length() == 0) { - return result; - } - - synchronized (numberFormat) { - ParsePosition position = new ParsePosition(0); - Number parseResult = null; - parseResult = numberFormat.parse(source, position); - - if (position.getIndex() != source.length() - || position.getErrorIndex() > -1) { - - result.position = position; - } else { - result.number = parseResult; - } - } - - return result; - } - - /** - * The result of a parse operation. - * - * @since 1.0 - */ - public static class ParseResult { - /* package */Number number; - /* package */ParsePosition position; - - /** - * The number as a result of the conversion. <code>null</code> if the - * value could not be converted or if the type is not a primitive and - * the value was an empty string. - * - * @return number - */ - public Number getNumber() { - return number; - } - - /** - * ParsePosition if an error occurred while parsing. <code>null</code> - * if no error occurred. - * - * @return parse position - */ - public ParsePosition getPosition() { - return position; - } - } - - /** - * Formats an appropriate message for a parsing error. - * - * @param value - * @param position - * @return message - */ - public static String createParseErrorMessage(String value, - ParsePosition position) { - int errorIndex = (position.getErrorIndex() > -1) ? position - .getErrorIndex() : position.getIndex(); - - return BindingMessages.formatString("Validate_NumberParseError", //$NON-NLS-1$ - new Object[] { value, new Integer(errorIndex + 1), - new Character(value.charAt(errorIndex)) }); - } - - /** - * Formats an appropriate message for an out of range error. - * - * @param minValue - * @param maxValue - * @param numberFormat when accessed method synchronizes on instance - * @return message - */ - public static String createOutOfRangeMessage(Number minValue, - Number maxValue, NumberFormat numberFormat) { - String min = null; - String max = null; - - synchronized (numberFormat) { - min = numberFormat.format(minValue); - max = numberFormat.format(maxValue); - } - - return BindingMessages.formatString( - "Validate_NumberOutOfRangeError", new Object[] { min, max }); //$NON-NLS-1$ - } - - /** - * Returns <code>true</code> if the provided <code>number</code> is in - * the range of a integer. - * - * @param number - * @return <code>true</code> if a valid integer - * @throws IllegalArgumentException - * if the number type is unsupported - */ - public static boolean inIntegerRange(Number number) { - return checkInteger(number, 31); - } - - /** - * Validates the range of the provided <code>number</code>. - * - * @param number - * @param bitLength number of bits allowed to be in range - * @return <code>true</code> if in range - */ - private static boolean checkInteger(Number number, int bitLength) { - BigInteger bigInteger = null; - - if (number instanceof Integer || number instanceof Long) { - bigInteger = BigInteger.valueOf(number.longValue()); - } else if (number instanceof Float || number instanceof Double) { - double doubleValue = number.doubleValue(); - /* - * doubleValue == doubleValue is used to check for NaN because NaN != - * NaN. The only way to check for NaN is to compare that the value - * is equal to itself. - */ - if (doubleValue == doubleValue - && doubleValue != Double.NEGATIVE_INFINITY - && doubleValue != Double.POSITIVE_INFINITY) { - bigInteger = new BigDecimal(doubleValue).toBigInteger(); - } else { - return false; - } - } else if (number instanceof BigInteger) { - bigInteger = (BigInteger) number; - } else if (number instanceof BigDecimal) { - bigInteger = ((BigDecimal) number).toBigInteger(); - } else { - /* - * The else is necessary as the ICU4J plugin has it's own BigDecimal - * implementation which isn't part of the replacement plugin. So - * that this will work we fall back on the double value of the - * number. - */ - bigInteger = new BigDecimal(number.doubleValue()).toBigInteger(); - } - - if (bigInteger != null) { - return bigInteger.bitLength() <= bitLength; - } - - throw new IllegalArgumentException( - "Number of type [" + number.getClass().getName() + "] is not supported."); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * Returns <code>true</code> if the provided <code>number</code> is in - * the range of a long. - * - * @param number - * @return <code>true</code> if in range - * @throws IllegalArgumentException - * if the number type is unsupported - */ - public static boolean inLongRange(Number number) { - return checkInteger(number, 63); - } - - /** - * Returns <code>true</code> if the provided <code>number</code> is in - * the range of a float. - * - * @param number - * @return <code>true</code> if in range - * @throws IllegalArgumentException - * if the number type is unsupported - */ - public static boolean inFloatRange(Number number) { - return checkDecimal(number, FLOAT_MIN_BIG_DECIMAL, FLOAT_MAX_BIG_DECIMAL); - } - - private static boolean checkDecimal(Number number, BigDecimal min, BigDecimal max) { - BigDecimal bigDecimal = null; - if (number instanceof Integer || number instanceof Long) { - bigDecimal = new BigDecimal(number.doubleValue()); - } else if (number instanceof Float || number instanceof Double) { - double doubleValue = number.doubleValue(); - - /* - * doubleValue == doubleValue is used to check for NaN because NaN != - * NaN. The only way to check for NaN is to compare that the value - * is equal to itself. - */ - if (doubleValue == doubleValue - && doubleValue != Double.NEGATIVE_INFINITY - && doubleValue != Double.POSITIVE_INFINITY) { - bigDecimal = new BigDecimal(doubleValue); - } else { - return false; - } - } else if (number instanceof BigInteger) { - bigDecimal = new BigDecimal((BigInteger) number); - } else if (number instanceof BigDecimal) { - bigDecimal = (BigDecimal) number; - } else { - /* - * The else is necessary as the ICU4J plugin has it's own BigDecimal - * implementation which isn't part of the replacement plugin. So - * that this will work we fall back on the double value of the - * number. - */ - bigDecimal = new BigDecimal(number.doubleValue()); - } - - if (bigDecimal != null) { - return max.compareTo(bigDecimal) >= 0 - && min.compareTo(bigDecimal) <= 0; - } - - throw new IllegalArgumentException( - "Number of type [" + number.getClass().getName() + "] is not supported."); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * Returns <code>true</code> if the provided <code>number</code> is in - * the range of a double. - * - * @param number - * @return <code>true</code> if in range - * @throws IllegalArgumentException - * if the number type is unsupported - */ - public static boolean inDoubleRange(Number number) { - return checkDecimal(number, DOUBLE_MIN_BIG_DECIMAL, DOUBLE_MAX_BIG_DECIMAL); - } - - /** - * Returns <code>true</code> if the provided <code>number</code> is in - * the range of a short. - * - * @param number - * @return <code>true</code> if in range - */ - public static boolean inShortRange(Number number) { - return checkInteger(number, 15); - } - - /** - * Returns <code>true</code> if the provided <code>number</code> is in - * the range of a byte. - * - * @param number - * @return <code>true</code> if in range - */ - public static boolean inByteRange(Number number) { - return checkInteger(number, 7); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToShortConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToShortConverter.java deleted file mode 100755 index 3c05a5c7..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToShortConverter.java +++ /dev/null @@ -1,92 +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.internal.databinding.conversion; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser.ParseResult; -import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.0 - */ -public class StringToShortConverter extends NumberFormatConverter { - private final NumberFormat numberFormat; - private final boolean primitive; - - private String outOfRangeMessage; - - /** - * Constructs a new instance. - */ - private StringToShortConverter(NumberFormat numberFormat, Class toType) { - super(String.class, toType, numberFormat); - this.numberFormat = numberFormat; - primitive = toType.isPrimitive(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object) - */ - public Object convert(Object fromObject) { - ParseResult result = StringToNumberParser.parse(fromObject, - numberFormat, primitive); - - if (result.getPosition() != null) { - // this shouldn't happen in the pipeline as validation should catch - // it but anyone can call convert so we should return a properly - // formatted message in an exception - throw new IllegalArgumentException(StringToNumberParser - .createParseErrorMessage((String) fromObject, result - .getPosition())); - } else if (result.getNumber() == null) { - // if an error didn't occur and the number is null then it's a boxed - // type and null should be returned - return null; - } - - if (StringToNumberParser.inShortRange(result.getNumber())) { - return new Short(result.getNumber().shortValue()); - } - - synchronized (this) { - if (outOfRangeMessage == null) { - outOfRangeMessage = StringToNumberParser - .createOutOfRangeMessage(new Short(Short.MIN_VALUE), new Short(Short.MAX_VALUE), numberFormat); - } - - throw new IllegalArgumentException(outOfRangeMessage); - } - } - - /** - * @param primitive - * <code>true</code> if the convert to type is a short - * @return to Short converter for the default locale - */ - public static StringToShortConverter toShort(boolean primitive) { - return toShort(NumberFormat.getIntegerInstance(), primitive); - } - - /** - * @param numberFormat - * @param primitive - * @return to Short converter with the provided numberFormat - */ - public static StringToShortConverter toShort(NumberFormat numberFormat, - boolean primitive) { - return new StringToShortConverter(numberFormat, - (primitive) ? Short.TYPE : Short.class); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/messages.properties b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/messages.properties deleted file mode 100644 index 92003df6..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/messages.properties +++ /dev/null @@ -1,49 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 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 -############################################################################### -# NLS file for JFace Data Binding -############################################################################### -Yes=Yes -yes=yes -No=No -no=no -True=True -true=true -False=False -false=false -and=and -or=or -Examples=Examples -ValueBinding_ErrorWhileSettingValue=An error occurred while setting the value. -Validate_BooleanHelp=Please type "Yes", "No", "True", or "False" -Validate_ConversionToPrimitive="Null object values can not be converted to primitives." -Validate_ConversionFromClassToPrimitive="Wrong object type to convert to primitive." -Validate_CharacterHelp=Please type a character -Validate_NoChangeAllowedHelp=Changes are not allowed in this field - -Validate_NumberOutOfRangeError=Please enter a value between [{0}] and [{1}] and with a similar format. -Validate_NumberParseError=Invalid character for value [{0}] at position [{1}] character [{2}]. - -Validate_RangeStart=Please enter a number between -Validate_Like=Please enter a number like -Validate_Number_Examples= 1.234, 256E-15, 42 - -IndexOutOfRange=Index out of Range. -MultipleProblems=Multiple Problems. - -DateFormat_DateTime=dd.MM.yyyy HH:mm:ss.SSS Z -DateFormat_Time=HH:mm:ss.SSS - -#ValueDelimiter should be used to separate multiple values that are stored in one key -ValueDelimiter=, - -#Values must be separated by ValueDelimiter -TrueStringValues=yes,true -FalseStringValues=no,false
\ No newline at end of file diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/EmptyObservableList.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/EmptyObservableList.java deleted file mode 100644 index 4b061e9c..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/EmptyObservableList.java +++ /dev/null @@ -1,170 +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.internal.databinding.observable; - -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -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; - -/** - * Singleton empty list - */ -public class EmptyObservableList implements IObservableList { - - private static final List emptyList = Collections.EMPTY_LIST; - - private Realm realm; - - /** - * Creates a singleton empty list. This list may be disposed multiple times - * without any side-effects. - * - * @param realm - */ - public EmptyObservableList(Realm realm) { - this.realm = realm; - } - - public void addListChangeListener(IListChangeListener listener) { - } - - public void removeListChangeListener(IListChangeListener listener) { - } - - public Object getElementType() { - return null; - } - - public int size() { - return 0; - } - - public boolean isEmpty() { - return true; - } - - public boolean contains(Object o) { - return false; - } - - public Iterator iterator() { - return emptyList.iterator(); - } - - public Object[] toArray() { - return emptyList.toArray(); - } - - public Object[] toArray(Object[] a) { - return emptyList.toArray(a); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean containsAll(Collection c) { - return c.isEmpty(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - public void addChangeListener(IChangeListener listener) { - } - - public void removeChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void removeStaleListener(IStaleListener listener) { - } - - public boolean isStale() { - return false; - } - - public void dispose() { - } - - public boolean addAll(int index, Collection c) { - throw new UnsupportedOperationException(); - } - - public Object get(int index) { - return emptyList.get(index); - } - - public int indexOf(Object o) { - return -1; - } - - public int lastIndexOf(Object o) { - return -1; - } - - public ListIterator listIterator() { - return emptyList.listIterator(); - } - - public ListIterator listIterator(int index) { - return emptyList.listIterator(index); - } - - public Object remove(int index) { - throw new UnsupportedOperationException(); - } - - public Object set(int index, Object element) { - throw new UnsupportedOperationException(); - } - - public List subList(int fromIndex, int toIndex) { - return emptyList.subList(fromIndex, toIndex); - } - - public void add(int arg0, Object arg1) { - throw new UnsupportedOperationException(); - } - - public Realm getRealm() { - return realm; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/EmptyObservableSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/EmptyObservableSet.java deleted file mode 100644 index a425a282..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/EmptyObservableSet.java +++ /dev/null @@ -1,129 +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.internal.databinding.observable; - -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.Set; - -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; - -/** - * Singleton empty set - */ -public class EmptyObservableSet implements IObservableSet { - - private static final Set emptySet = Collections.EMPTY_SET; - - private Realm realm; - - /** - * Creates a singleton empty set. This set may be disposed multiple times - * without any side-effects. - * - * @param realm - */ - public EmptyObservableSet(Realm realm) { - this.realm = realm; - } - - public void addSetChangeListener(ISetChangeListener listener) { - } - - public void removeSetChangeListener(ISetChangeListener listener) { - } - - public Object getElementType() { - return null; - } - - public int size() { - return 0; - } - - public boolean isEmpty() { - return true; - } - - public boolean contains(Object o) { - return false; - } - - public Iterator iterator() { - return emptySet.iterator(); - } - - public Object[] toArray() { - return emptySet.toArray(); - } - - public Object[] toArray(Object[] a) { - return emptySet.toArray(a); - } - - public boolean add(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean containsAll(Collection c) { - return c.isEmpty(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - public void addChangeListener(IChangeListener listener) { - } - - public void removeChangeListener(IChangeListener listener) { - } - - public void addStaleListener(IStaleListener listener) { - } - - public void removeStaleListener(IStaleListener listener) { - } - - public boolean isStale() { - return false; - } - - public void dispose() { - } - - public Realm getRealm() { - return realm; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/IStalenessConsumer.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/IStalenessConsumer.java deleted file mode 100644 index cfe5c612..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/IStalenessConsumer.java +++ /dev/null @@ -1,24 +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.core.internal.databinding.observable; - -/** - * @since 1.0 - * - */ -public interface IStalenessConsumer { - /** - * @param stale - * - */ - public void setStale(boolean stale); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/ProxyObservableSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/ProxyObservableSet.java deleted file mode 100644 index 28c84549..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/ProxyObservableSet.java +++ /dev/null @@ -1,72 +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.internal.databinding.observable; - -import java.util.Set; - -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; - -/** - * Wraps an observable set. This object acts like an exact copy of the original - * set, and tracks all the changes in the original. The only difference is that - * disposing the wrapper will not dispose the original. You can use this whenever - * you need to return an IObservableSet from a method that expects the caller - * to dispose the set, but you have an IObservableSet that you don't want disposed. - */ -public final class ProxyObservableSet extends AbstractObservableSet { - - private IObservableSet toDelegateTo; - private ISetChangeListener listener = new ISetChangeListener() { - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.ISetChangeListener#handleSetChange(org.eclipse.jface.internal.databinding.provisional.observable.set.IObservableSet, org.eclipse.jface.internal.databinding.provisional.observable.set.SetDiff) - */ - public void handleSetChange(SetChangeEvent event) { - fireSetChange(event.diff); - } - }; - - /** - * Constructs a DelegatingObservableSet that tracks the state of the given set. - * - * @param toDelegate - */ - public ProxyObservableSet(IObservableSet toDelegate) { - super(toDelegate.getRealm()); - this.toDelegateTo = toDelegate; - toDelegate.addSetChangeListener(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.AbstractObservableSet#getWrappedSet() - */ - protected Set getWrappedSet() { - return toDelegateTo; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.IObservableSet#getElementType() - */ - public Object getElementType() { - return toDelegateTo.getElementType(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.AbstractObservableSet#dispose() - */ - public void dispose() { - toDelegateTo.removeSetChangeListener(listener); - super.dispose(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/StalenessTracker.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/StalenessTracker.java deleted file mode 100644 index 6324325e..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/StalenessTracker.java +++ /dev/null @@ -1,127 +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.core.internal.databinding.observable; - -import java.util.HashMap; -import java.util.Map; - -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.StaleEvent; -import org.eclipse.core.internal.databinding.IdentityWrapper; - -/** - * @since 1.0 - * - */ -public class StalenessTracker { - - private Map staleMap = new HashMap(); - - private int staleCount = 0; - - private final IStalenessConsumer stalenessConsumer; - - private class ChildListener implements IStaleListener, IChangeListener { - public void handleStale(StaleEvent event) { - processStalenessChange((IObservable) event.getSource(), true); - } - - public void handleChange(ChangeEvent event) { - processStalenessChange((IObservable) event.getSource(), true); - } - } - - private ChildListener childListener = new ChildListener(); - - /** - * @param observables - * @param stalenessConsumer - */ - public StalenessTracker(IObservable[] observables, - IStalenessConsumer stalenessConsumer) { - this.stalenessConsumer = stalenessConsumer; - for (int i = 0; i < observables.length; i++) { - IObservable observable = observables[i]; - doAddObservable(observable, false); - } - stalenessConsumer.setStale(staleCount > 0); - } - - /** - * @param child - * @param callback - */ - public void processStalenessChange(IObservable child, boolean callback) { - boolean oldStale = staleCount > 0; - IdentityWrapper wrappedChild = new IdentityWrapper(child); - boolean oldChildStale = getOldChildStale(wrappedChild); - boolean newChildStale = child.isStale(); - if (oldChildStale != newChildStale) { - if (oldChildStale) { - staleCount--; - } else { - staleCount++; - } - staleMap.put(wrappedChild, newChildStale ? Boolean.TRUE : Boolean.FALSE); - } - boolean newStale = staleCount > 0; - if (callback && (newStale != oldStale)) { - stalenessConsumer.setStale(newStale); - } - } - - /** - * @param wrappedChild - */ - private boolean getOldChildStale(IdentityWrapper wrappedChild) { - Object oldChildValue = staleMap.get(wrappedChild); - boolean oldChildStale = oldChildValue == null ? false - : ((Boolean) oldChildValue).booleanValue(); - return oldChildStale; - } - - /** - * @param observable - */ - public void addObservable(IObservable observable) { - doAddObservable(observable, true); - } - - private void doAddObservable(IObservable observable, boolean callback) { - processStalenessChange(observable, callback); - observable.addChangeListener(childListener); - observable.addStaleListener(childListener); - } - - /** - * @param observable - */ - public void removeObservable(IObservable observable) { - boolean oldStale = staleCount > 0; - IdentityWrapper wrappedChild = new IdentityWrapper(observable); - boolean oldChildStale = getOldChildStale(wrappedChild); - if (oldChildStale) { - staleCount--; - } - staleMap.remove(wrappedChild); - observable.removeChangeListener(childListener); - observable.removeStaleListener(childListener); - boolean newStale = staleCount > 0; - if (newStale != oldStale) { - stalenessConsumer.setStale(newStale); - } - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java deleted file mode 100644 index 87ab6eac..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableList.java +++ /dev/null @@ -1,71 +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.core.internal.databinding.observable; - -import org.eclipse.core.databinding.observable.IStaleListener; -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.ObservableList; - -/** - * ObservableList implementation that prevents modification by consumers. Events - * in the originating wrapped list are propagated and thrown from this instance - * when appropriate. All mutators throw an UnsupportedOperationException. - * - * @since 3.2 - */ -/* - * Implementation makes the assumption that the superclass (UnmodifiableList) is - * unmodifiable and that all modify methods throw an - * UnsupportedOperationException. - */ -public class UnmodifiableObservableList extends ObservableList { - /** - * List that is being made unmodifiable. - */ - private final IObservableList wrappedList; - - /** - * @param wrappedList - */ - public UnmodifiableObservableList(IObservableList wrappedList) { - super(wrappedList.getRealm(), wrappedList, wrappedList.getElementType()); - this.wrappedList = wrappedList; - - wrappedList.addListChangeListener(new IListChangeListener() { - public void handleListChange(ListChangeEvent event) { - // Fires a Change and then ListChange event. - fireListChange(event.diff); - } - }); - - wrappedList.addStaleListener(new IStaleListener() { - public void handleStale(StaleEvent event) { - fireStale(); - } - }); - } - - /** - * Because this instance is immutable staleness cannot be changed. - * - */ - public void setStale(boolean stale) { - throw new UnsupportedOperationException(); - } - - public boolean isStale() { - return wrappedList.isStale(); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableList.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableList.java deleted file mode 100755 index 07624b88..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableList.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 - * Brad Reynolds - bug 147515 - *******************************************************************************/ -package org.eclipse.core.internal.databinding.observable.masterdetail; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObserving; -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.ObservableList; -import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; -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.runtime.Assert; - -/** - * @since 3.2 - * - */ - -public class DetailObservableList extends ObservableList implements IObserving { - - private boolean updating = false; - - private IListChangeListener innerChangeListener = new IListChangeListener() { - public void handleListChange(ListChangeEvent event) { - if (!updating) { - fireListChange(event.diff); - } - } - }; - - private Object currentOuterValue; - - private IObservableList innerObservableList; - - private IObservableFactory factory; - - private IObservableValue outerObservableValue; - - private Object detailType; - - /** - * @param factory - * @param outerObservableValue - * @param detailType - */ - public DetailObservableList(IObservableFactory factory, - IObservableValue outerObservableValue, Object detailType) { - super(outerObservableValue.getRealm(), new ArrayList(), detailType); - this.factory = factory; - this.outerObservableValue = outerObservableValue; - this.detailType = detailType; - updateInnerObservableValue(outerObservableValue); - - outerObservableValue.addValueChangeListener(outerChangeListener); - } - - IValueChangeListener outerChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - List oldList = new ArrayList(wrappedList); - updateInnerObservableValue(outerObservableValue); - fireListChange(Diffs.computeListDiff(oldList, wrappedList)); - } - }; - - private void updateInnerObservableValue( - IObservableValue outerObservableValue) { - currentOuterValue = outerObservableValue.getValue(); - if (innerObservableList != null) { - innerObservableList.removeListChangeListener(innerChangeListener); - innerObservableList.dispose(); - } - if (currentOuterValue == null) { - innerObservableList = null; - wrappedList = new ArrayList(); - } else { - this.innerObservableList = (IObservableList) factory - .createObservable(currentOuterValue); - wrappedList = innerObservableList; - - if (detailType != null) { - Object innerValueType = innerObservableList.getElementType(); - Assert.isTrue(getElementType().equals(innerValueType), - "Cannot change value type in a nested observable list"); //$NON-NLS-1$ - } - innerObservableList.addListChangeListener(innerChangeListener); - } - } - - public void dispose() { - super.dispose(); - - if (outerObservableValue != null) { - outerObservableValue.removeValueChangeListener(outerChangeListener); - outerObservableValue.dispose(); - } - if (innerObservableList != null) { - innerObservableList.removeListChangeListener(innerChangeListener); - innerObservableList.dispose(); - } - currentOuterValue = null; - factory = null; - innerObservableList = null; - innerChangeListener = null; - } - - public Object getObserved() { - if (innerObservableList instanceof IObserving) { - return ((IObserving)innerObservableList).getObserved(); - } - return null; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableSet.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableSet.java deleted file mode 100755 index ee002789..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableSet.java +++ /dev/null @@ -1,125 +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.observable.masterdetail; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObserving; -import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; -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.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.runtime.Assert; - -/** - * @since 3.2 - * - */ -public class DetailObservableSet extends ObservableSet implements IObserving { - - private boolean updating = false; - - private ISetChangeListener innerChangeListener = new ISetChangeListener() { - public void handleSetChange(SetChangeEvent event) { - if (!updating) { - fireSetChange(event.diff); - } - } - }; - - private Object currentOuterValue; - - private IObservableSet innerObservableSet; - - private IObservableValue outerObservableValue; - - private IObservableFactory factory; - - /** - * @param factory - * @param outerObservableValue - * @param detailType - */ - public DetailObservableSet(IObservableFactory factory, - IObservableValue outerObservableValue, Object detailType) { - super(outerObservableValue.getRealm(), new HashSet(), detailType); - this.factory = factory; - this.outerObservableValue = outerObservableValue; - updateInnerObservableValue(outerObservableValue); - - outerObservableValue.addValueChangeListener(outerChangeListener); - } - - IValueChangeListener outerChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - Set oldSet = new HashSet(wrappedSet); - updateInnerObservableValue(outerObservableValue); - fireSetChange(Diffs.computeSetDiff(oldSet, wrappedSet)); - } - }; - - private void updateInnerObservableValue( - IObservableValue outerObservableValue) { - currentOuterValue = outerObservableValue.getValue(); - if (innerObservableSet != null) { - innerObservableSet.removeSetChangeListener(innerChangeListener); - innerObservableSet.dispose(); - } - if (currentOuterValue == null) { - innerObservableSet = null; - wrappedSet = new HashSet(); - } else { - this.innerObservableSet = (IObservableSet) factory - .createObservable(currentOuterValue); - wrappedSet = innerObservableSet; - - if (elementType != null) { - Object innerValueType = innerObservableSet.getElementType(); - - Assert.isTrue(elementType.equals(innerValueType), - "Cannot change value type in a nested observable set"); //$NON-NLS-1$ - } - - innerObservableSet.addSetChangeListener(innerChangeListener); - } - } - - public void dispose() { - super.dispose(); - - if (outerObservableValue != null) { - outerObservableValue.removeValueChangeListener(outerChangeListener); - outerObservableValue.dispose(); - } - if (innerObservableSet != null) { - innerObservableSet.removeSetChangeListener(innerChangeListener); - innerObservableSet.dispose(); - } - currentOuterValue = null; - factory = null; - innerObservableSet = null; - innerChangeListener = null; - } - - public Object getObserved() { - if (innerObservableSet instanceof IObserving) { - return ((IObserving)innerObservableSet).getObserved(); - } - return null; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableValue.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableValue.java deleted file mode 100755 index c1b1654d..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/masterdetail/DetailObservableValue.java +++ /dev/null @@ -1,136 +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 147515 - *******************************************************************************/ -package org.eclipse.core.internal.databinding.observable.masterdetail; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObserving; -import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; -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; -import org.eclipse.core.runtime.Assert; - -/** - * @since 1.0 - * - */ -public class DetailObservableValue extends AbstractObservableValue implements IObserving { - - private boolean updating = false; - - private IValueChangeListener innerChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - if (!updating) { - fireValueChange(event.diff); - } - } - }; - - private Object currentOuterValue; - - private IObservableValue innerObservableValue; - - private Object detailType; - - private IObservableValue outerObservableValue; - - private IObservableFactory factory; - - /** - * @param outerObservableValue - * @param factory - * @param detailType - */ - public DetailObservableValue(IObservableValue outerObservableValue, - IObservableFactory factory, Object detailType) { - super(outerObservableValue.getRealm()); - this.factory = factory; - this.detailType = detailType; - this.outerObservableValue = outerObservableValue; - updateInnerObservableValue(outerObservableValue); - - outerObservableValue.addValueChangeListener(outerChangeListener); - } - - IValueChangeListener outerChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - Object oldValue = doGetValue(); - updateInnerObservableValue(outerObservableValue); - fireValueChange(Diffs.createValueDiff(oldValue, doGetValue())); - } - }; - - private void updateInnerObservableValue( - IObservableValue outerObservableValue) { - currentOuterValue = outerObservableValue.getValue(); - if (innerObservableValue != null) { - innerObservableValue.removeValueChangeListener(innerChangeListener); - innerObservableValue.dispose(); - } - if (currentOuterValue == null) { - innerObservableValue = null; - } else { - this.innerObservableValue = (IObservableValue) factory - .createObservable(currentOuterValue); - Object innerValueType = innerObservableValue.getValueType(); - - if (detailType != null) { - Assert - .isTrue( - detailType.equals(innerValueType), - "Cannot change value type in a nested observable value, from " + innerValueType + " to " + detailType); //$NON-NLS-1$ //$NON-NLS-2$ - } - innerObservableValue.addValueChangeListener(innerChangeListener); - } - } - - public void doSetValue(Object value) { - if (innerObservableValue != null) - innerObservableValue.setValue(value); - } - - public Object doGetValue() { - return innerObservableValue == null ? null : innerObservableValue - .getValue(); - } - - public Object getValueType() { - return detailType; - } - - public void dispose() { - super.dispose(); - - if (outerObservableValue != null) { - outerObservableValue.removeValueChangeListener(outerChangeListener); - outerObservableValue.dispose(); - } - if (innerObservableValue != null) { - innerObservableValue.removeValueChangeListener(innerChangeListener); - innerObservableValue.dispose(); - } - currentOuterValue = null; - factory = null; - innerObservableValue = null; - innerChangeListener = null; - } - - public Object getObserved() { - if (innerObservableValue instanceof IObserving) { - return ((IObserving)innerObservableValue).getObserved(); - } - return null; - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.java deleted file mode 100644 index e1226c9d..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.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 164134 - *******************************************************************************/ - -package org.eclipse.core.internal.databinding.observable.tree; - -import org.eclipse.core.databinding.observable.AbstractObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.core.runtime.Status; - -/** - * @since 3.3 - * - */ -public abstract class AbstractObservableTree extends AbstractObservable - implements IObservableTree { - - private boolean stale; - - private ListenerList treeListeners = new ListenerList(ListenerList.IDENTITY); - - /** - * @param realm - */ - public AbstractObservableTree(Realm realm) { - super(realm); - } - - public void addChild(TreePath parentPath, Object childElement) { - throw new UnsupportedOperationException(); - } - - public void addTreeChangeListener(ITreeChangeListener listener) { - treeListeners.add(listener); - } - - public int getChildCount(TreePath parentPath) { - return getChildren(parentPath).length; - } - - public boolean hasChildren(TreePath parentPath) { - return getChildCount(parentPath) > 0; - } - - public void insertChild(TreePath parentPath, int index, Object childElement) { - throw new UnsupportedOperationException(); - } - - public boolean isLazy() { - return false; - } - - public boolean isOrdered() { - return false; - } - - public void removeChild(TreePath parentPath, Object childElement) { - throw new UnsupportedOperationException(); - } - - public void removeChild(TreePath parentPath, int index) { - throw new UnsupportedOperationException(); - } - - public void removeTreeChangeListener(ITreeChangeListener listener) { - treeListeners.remove(listener); - } - - public void setChildCount(TreePath parentPath, int count) { - throw new UnsupportedOperationException(); - } - - public void setChildren(TreePath parentPath, Object[] children) { - throw new UnsupportedOperationException(); - } - - public void updateChildren(IChildrenUpdate update) { - TreePath parent = update.getParent(); - Object[] children = getChildren(parent); - for (int i = 0; i < update.getLength(); i++) { - int targetIndex = update.getOffset() + i; - if (targetIndex < children.length) { - update.setChild(children[targetIndex], targetIndex); - } else { - update - .setStatus(new Status( - IStatus.WARNING, - Policy.JFACE_DATABINDING, - IStatus.OK, - BindingMessages - .getString(BindingMessages.INDEX_OUT_OF_RANGE), - null)); - } - } - update.done(); - } - - public void updateChildrenCount(IChildrenCountUpdate update) { - TreePath[] parents = update.getParents(); - for (int i = 0; i < parents.length; i++) { - update.setChildCount(parents[i], getChildCount(parents[i])); - } - update.done(); - } - - public void updateHasChildren(IHasChildrenUpdate update) { - TreePath[] parents = update.getElements(); - for (int i = 0; i < parents.length; i++) { - update.setHasChilren(parents[i], hasChildren(parents[i])); - } - update.done(); - } - - public boolean isStale() { - return stale; - } - - /** - * @param stale - */ - public void setStale(boolean stale) { - this.stale = stale; - if (stale) { - fireStale(); - } - } - - protected void fireTreeChange(TreeDiff diff) { - // fire general change event first - fireChange(); - - Object[] listeners = treeListeners.getListeners(); - TreeChangeEvent event = new TreeChangeEvent(this, diff); - for (int i = 0; i < listeners.length; i++) { - ((ITreeChangeListener) listeners[i]).handleTreeChange(event); - } - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenCountUpdate.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenCountUpdate.java deleted file mode 100644 index 331176a9..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenCountUpdate.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.core.internal.databinding.observable.tree; - -/** - * Request monitor used to collect the number of children for an element in a lazy - * observable tree. - * - * @since 3.3 - */ -public interface IChildrenCountUpdate extends IViewerUpdate { - - /** - * Returns the parent elements that children counts have been requested for - * as tree paths. An empty path identifies the root element. - * - * @return parent elements as tree paths - */ - public TreePath[] getParents(); - - /** - * Sets the number of children for the given parent. - * - * @param parentPath - * parent element or empty path for root element - * @param numChildren - * number of children - */ - public void setChildCount(TreePath parentPath, int numChildren); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenUpdate.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenUpdate.java deleted file mode 100644 index 8d4b961e..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IChildrenUpdate.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.core.internal.databinding.observable.tree; - -/** - * Context sensitive children update request for a parent and subrange of its - * children. - * - * @since 3.3 - */ -public interface IChildrenUpdate extends IViewerUpdate { - - /** - * Returns the parent element that children are being requested for - * as a tree path. An empty path identifies the root element. - * - * @return parent element as a tree path - */ - public TreePath getParent(); - - /** - * Returns the offset at which children have been requested for. This is - * the index of the first child being requested. - * - * @return offset at which children have been requested for - */ - public int getOffset(); - - /** - * Returns the number of children requested. - * - * @return number of children requested - */ - public int getLength(); - - /** - * Sets the child for this request's parent at the given offset. - * - * @param child child - * @param index child offset - * - * TODO: what to do with <code>null</code> - */ - public void setChild(Object child, int index); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IHasChildrenUpdate.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IHasChildrenUpdate.java deleted file mode 100644 index f3eadd65..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IHasChildrenUpdate.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.core.internal.databinding.observable.tree; - -/** - * Context sensitive update request for whether elements have children. - * - * @since 3.3 - */ -public interface IHasChildrenUpdate extends IViewerUpdate { - - /** - * The elements this request is for specified as tree paths. An empty path - * identifies the root element. - * - * @return elements as tree paths - */ - public TreePath[] getElements(); - - /** - * Sets whether the given element has children. - * - * @param element - * tree path to element, or empty for root element - * @param hasChildren - * whether it has children - */ - public void setHasChilren(TreePath element, boolean hasChildren); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IObservableTree.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IObservableTree.java deleted file mode 100644 index a8774528..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IObservableTree.java +++ /dev/null @@ -1,145 +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.internal.databinding.observable.tree; - -import org.eclipse.core.databinding.observable.IObservable; - -/** - * - * A tree whose changes can be tracked by tree change listeners. If the tree is - * ordered ({@link #isOrdered()}), the order of children for a given tree path - * matters, and tree change notifications will always specify indices. If the - * tree is unordered, the children of a tree path are an unordered set and - * indices in change notifications are not specified. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the framework classes that implement this interface. - * Note that direct implementers of this interface outside of the framework will - * be broken in future releases when methods are added to this interface. - * </p> - * - * @since 1.1 - */ -public interface IObservableTree extends IObservable { - - /** - * Element that can be returned from synchronous getters if this observable - * tree is lazy. - */ - public final static Object UNKNOWN_ELEMENT = new Object(); - - /** - * @param listener - */ - public void addTreeChangeListener(ITreeChangeListener listener); - - /** - * @param listener - */ - public void removeTreeChangeListener(ITreeChangeListener listener); - - /** - * Returns whether the order of children for a given parent is important. If - * this tree is ordered, tree change notifications will always specify - * indices. - * - * @return true if the order of children for a given parent is important - */ - public boolean isOrdered(); - - /** - * Returns whether this tree is optimized to fetch subsets of children - * lazily and possibly asynchronously. Implies {@link #isOrdered()}. - * - * @return true if this tree - */ - public boolean isLazy(); - - /** - * @param parentPath - * @return the children at the given parent path - */ - public Object[] getChildren(TreePath parentPath); - - /** - * @param parentPath - * @param children - */ - public void setChildren(TreePath parentPath, Object[] children); - - /** - * @param parentPath - * @param childElement - */ - public void addChild(TreePath parentPath, Object childElement); - - /** - * @param parentPath - * @param childElement - */ - public void removeChild(TreePath parentPath, Object childElement); - - /** - * @param parentPath - * @param index - * @param childElement - */ - public void insertChild(TreePath parentPath, int index, Object childElement); - - /** - * @param parentPath - * @param index - */ - public void removeChild(TreePath parentPath, int index); - - /** - * @param parentPath - * @return <code>true</code> if the element at the given path has children - */ - public boolean hasChildren(TreePath parentPath); - - /** - * @param parentPath - * @return the number of children of the element at the given path - */ - public int getChildCount(TreePath parentPath); - - /** - * @param parentPath - * @param count - */ - public void setChildCount(TreePath parentPath, int count); - - /** - * Updates the number of children for the given parent elements in the - * specified request. - * - * @param update specifies counts to update and stores result - */ - public void updateChildrenCount(IChildrenCountUpdate update); - - /** - * Updates children as requested by the update. - * - * @param update specifies children to update and stores result - */ - public void updateChildren(IChildrenUpdate update); - - /** - * Updates whether elements have children. - * - * @param update specifies elements to update and stores result - */ - public void updateHasChildren(IHasChildrenUpdate update); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IOrderedTreeProvider.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IOrderedTreeProvider.java deleted file mode 100644 index f60d5611..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IOrderedTreeProvider.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.core.internal.databinding.observable.tree; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.list.IObservableList; - -/** - * Objects that implement this interface are capable of describing a tree by - * returning the list of children of any given element in the tree. - * - * @since 3.3 - */ -public interface IOrderedTreeProvider { - /** - * Returns the children of the given element, or null if the element is a - * leaf node. The caller of this method is expected to dispose the result - * list when it is no longer needed. - * - * @param element - * the tree path of the element to query - * @return the children of the given element, or null if the element is a - * leaf node - */ - IObservableList createChildList(TreePath element); - - /** - * @return the realm shared by all child lists - */ - Realm getRealm(); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/ITreeChangeListener.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/ITreeChangeListener.java deleted file mode 100644 index 8fe9f8f5..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/ITreeChangeListener.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.core.internal.databinding.observable.tree; - -/** - * @since 3.3 - * - */ -public interface ITreeChangeListener { - /** - * @param event - */ - void handleTreeChange(TreeChangeEvent event); - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IUnorderedTreeProvider.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IUnorderedTreeProvider.java deleted file mode 100644 index 81941c80..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IUnorderedTreeProvider.java +++ /dev/null @@ -1,36 +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.internal.databinding.observable.tree; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.set.IObservableSet; - -/** - * @since 1.0 - * - */ -public interface IUnorderedTreeProvider { - /** - * @return the realm for the createChildSet method - */ - public Realm getRealm(); - - /** - * Returns the children of the given element, or null if the element is a leaf node. - * The caller of this method is expected to dispose the result set when it is no - * longer needed. - * - * @param element element to query - * @return the children of the given element, or null if the element is a leaf node - */ - IObservableSet createChildSet(Object element); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IViewerUpdate.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IViewerUpdate.java deleted file mode 100644 index 26cadab4..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/IViewerUpdate.java +++ /dev/null @@ -1,47 +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.internal.databinding.observable.tree; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; - -/** - * A context sensitive viewer update request. - * - * @since 3.3 - */ -public interface IViewerUpdate extends IProgressMonitor { - - /** - * Sets the status of this request, possibly <code>null</code>. - * When a request fails, the status indicates why the request failed. - * A <code>null</code> status is considered to be successful. - * - * @param status request status - */ - public void setStatus(IStatus status); - - /** - * Returns the status of this request, or <code>null</code>. - * - * @return request status or <code>null</code> - */ - public IStatus getStatus(); - - /** - * Returns the model element corresponding to the given tree path. - * Returns the root element for the empty path. - * - * @param path viewer tree path - * @return corresponding model element - */ - public Object getElement(TreePath path); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeChangeEvent.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeChangeEvent.java deleted file mode 100644 index b5051d5e..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeChangeEvent.java +++ /dev/null @@ -1,47 +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.internal.databinding.observable.tree; - -import java.util.EventObject; - -/** - * @since 3.3 - * - */ -public class TreeChangeEvent extends EventObject { - - /** - * - */ - private static final long serialVersionUID = -3198503763995528027L; - /** - * - */ - public TreeDiff diff; - - /** - * @param source - * @param diff - */ - public TreeChangeEvent(IObservableTree source, TreeDiff diff) { - super(source); - this.diff = diff; - } - - /** - * @return the observable tree from which this event originated - */ - public IObservableTree getObservable() { - return (IObservableTree) getSource(); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiff.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiff.java deleted file mode 100644 index 7c419ea5..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiff.java +++ /dev/null @@ -1,39 +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.internal.databinding.observable.tree; - -/** - * Describes the difference between two trees as a tree of tree diff nodes. - * - * @since 1.1 - * - */ -public abstract class TreeDiff extends TreeDiffNode { - - /** - * Returns the tree path (possibly empty) of the parent, or - * <code>null</code> if the underlying tree is not lazy and never contains - * duplicate elements. - * - * @return the tree path (possibly empty) of the unchanged parent, or - * <code>null</code> - */ - public abstract TreePath getParentPath(); - - /** - * @param visitor - */ - public void accept(TreeDiffVisitor visitor) { - doAccept(visitor, getParentPath()); - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffNode.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffNode.java deleted file mode 100644 index a8b8b8d9..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffNode.java +++ /dev/null @@ -1,91 +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.internal.databinding.observable.tree; - -/** - * @since 1.1 - * - */ -public abstract class TreeDiffNode { - - /** - * - */ - public final static int NO_CHANGE = 0x00; - - /** - * - */ - public final static int ADDED = 0x01; - - /** - * - */ - public final static int REMOVED = 0x02; - - /** - * - */ - public final static int REPLACED = 0x03; - - /** - * - */ - public static final TreeDiffNode[] NO_CHILDREN = new TreeDiffNode[0]; - - /** - * - */ - public static final int INDEX_UNKNOWN = -1; - - /** - * @return the change type - */ - public abstract int getChangeType(); - - /** - * @return the element that was removed, or the replaced element - */ - public abstract Object getOldElement(); - - /** - * @return the element that was not changed, added, or the replacement - * element - */ - public abstract Object getNewElement(); - - /** - * @return the index at which the element was added, removed, or replaced - */ - public abstract int getIndex(); - - /** - * Returns the child tree diff objects that describe changes to children. If - * the change type is REMOVED, there will be no children. - * - * @return the nodes representing changes to children - */ - public abstract TreeDiffNode[] getChildren(); - - protected void doAccept(TreeDiffVisitor visitor, TreePath parentPath) { - TreePath currentPath = parentPath.createChildPath(getNewElement()); - boolean recurse = visitor.visit(this, currentPath); - if (recurse) { - TreeDiffNode[] children = getChildren(); - for (int i = 0; i < children.length; i++) { - TreeDiffNode child = children[i]; - child.doAccept(visitor, currentPath); - } - } - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffVisitor.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffVisitor.java deleted file mode 100644 index 837464dc..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreeDiffVisitor.java +++ /dev/null @@ -1,33 +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.internal.databinding.observable.tree; - -/** - * @since 3.3 - * - */ -public abstract class TreeDiffVisitor { - - /** - * Visits the given tree diff. - * - * @param diff - * the diff to visit - * @param currentPath - * the current path (the diff's element is the last segment of - * the path) - * - * @return <code>true</code> if the tree diff's children should be - * visited; <code>false</code> if they should be skipped. - */ - public abstract boolean visit(TreeDiffNode diff, TreePath currentPath); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.java deleted file mode 100644 index 632b0137..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/TreePath.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.core.internal.databinding.observable.tree; - -import org.eclipse.core.runtime.Assert; - -/** - * A tree path denotes a model element in a tree viewer. Tree path objects have - * value semantics. A model element is represented by a path of elements in the - * tree from the root element to the leaf element. - * <p> - * Clients may instantiate this class. Not intended to be subclassed. - * </p> - * - * @since 3.2 - */ -public final class TreePath { - - /** - * Constant for representing an empty tree path. - */ - public static final TreePath EMPTY = new TreePath(new Object[0]); - - private Object[] segments; - - private int hash; - - /** - * Constructs a path identifying a leaf node in a tree. - * - * @param segments - * path of elements to a leaf node in a tree, starting with the - * root element - */ - public TreePath(Object[] segments) { - Assert.isNotNull(segments); - for (int i = 0; i < segments.length; i++) { - Assert.isNotNull(segments[i]); - } - this.segments = segments; - } - - /** - * Returns the element at the specified index in this path. - * - * @param index - * index of element to return - * @return element at the specified index - */ - public Object getSegment(int index) { - return segments[index]; - } - - /** - * Returns the number of elements in this path. - * - * @return the number of elements in this path - */ - public int getSegmentCount() { - return segments.length; - } - - /** - * Returns the first element in this path. - * - * @return the first element in this path - */ - public Object getFirstSegment() { - if (segments.length == 0) { - return null; - } - return segments[0]; - } - - /** - * Returns the last element in this path. - * - * @return the last element in this path - */ - public Object getLastSegment() { - if (segments.length == 0) { - return null; - } - return segments[segments.length - 1]; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - if (!(other instanceof TreePath)) { - return false; - } - TreePath otherPath = (TreePath) other; - if (segments.length != otherPath.segments.length) { - return false; - } - for (int i = 0; i < segments.length; i++) { - if (!segments[i].equals(otherPath.segments[i])) { - return false; - } - } - return true; - } - - public int hashCode() { - if (hash == 0) { - for (int i = 0; i < segments.length; i++) { - hash += segments[i].hashCode(); - } - } - return hash; - } - - /** - * Returns whether this path starts with the same segments as the given - * path, using the given comparer to compare segments. - * - * @param treePath - * path to compare to - * @return whether the given path is a prefix of this path, or the same as - * this path - */ - public boolean startsWith(TreePath treePath) { - int thisSegmentCount = getSegmentCount(); - int otherSegmentCount = treePath.getSegmentCount(); - if (otherSegmentCount == thisSegmentCount) { - return equals(treePath); - } - if (otherSegmentCount > thisSegmentCount) { - return false; - } - for (int i = 0; i < otherSegmentCount; i++) { - Object otherSegment = treePath.getSegment(i); - if (!otherSegment.equals(segments[i])) { - return false; - } - } - return true; - } - - /** - * Returns a copy of this tree path with one segment removed from the end, - * or <code>null</code> if this tree path has no segments. - * @return a tree path - */ - public TreePath getParentPath() { - int segmentCount = getSegmentCount(); - if (segmentCount <= 1) { - return null; - } - Object[] parentSegments = new Object[segmentCount - 1]; - System.arraycopy(segments, 0, parentSegments, 0, segmentCount - 1); - return new TreePath(parentSegments); - } - - /** - * Returns a copy of this tree path with the given segment added at the end. - * @param newSegment - * @return a tree path - */ - public TreePath createChildPath(Object newSegment) { - int segmentCount = getSegmentCount(); - Object[] childSegments = new Object[segmentCount + 1]; - if(segmentCount>0) { - System.arraycopy(segments, 0, childSegments, 0, segmentCount); - } - childSegments[segmentCount] = newSegment; - return new TreePath(childSegments); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/package.html b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/package.html deleted file mode 100644 index d720e2b4..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/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/src/org/eclipse/core/internal/databinding/validation/AbstractStringToNumberValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/AbstractStringToNumberValidator.java deleted file mode 100644 index 3cf8f0b2..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/AbstractStringToNumberValidator.java +++ /dev/null @@ -1,97 +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.internal.databinding.validation; - -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser.ParseResult; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * Validates a number that is to be converted by a {@link NumberFormatConverter}. - * Validation is comprised of parsing the String and range checks. - * - * @since 1.0 - */ -public abstract class AbstractStringToNumberValidator implements IValidator { - private final NumberFormatConverter converter; - private final boolean toPrimitive; - - private final Number min; - private final Number max; - - private String outOfRangeMessage; - - /** - * Constructs a new instance. - * - * @param converter converter and thus formatter to be used in validation - * @param min minimum value, used for reporting a range error to the user - * @param max maximum value, used for reporting a range error to the user - */ - protected AbstractStringToNumberValidator(NumberFormatConverter converter, - Number min, Number max) { - this.converter = converter; - this.min = min; - this.max = max; - - if (converter.getToType() instanceof Class) { - Class clazz = (Class) converter.getToType(); - toPrimitive = clazz.isPrimitive(); - } else { - toPrimitive = false; - } - } - - /** - * Validates the provided <code>value</code>. An error status is returned if: - * <ul> - * <li>The value cannot be parsed.</li> - * <li>The value is out of range.</li> - * </ul> - * - * @see org.eclipse.core.databinding.validation.IValidator#validate(java.lang.Object) - */ - public final IStatus validate(Object value) { - ParseResult result = StringToNumberParser.parse(value, converter - .getNumberFormat(), toPrimitive); - - if (result.getNumber() != null) { - if (!isInRange(result.getNumber())) { - if (outOfRangeMessage == null) { - outOfRangeMessage = StringToNumberParser - .createOutOfRangeMessage(min, max, converter - .getNumberFormat()); - } - - return ValidationStatus.error(outOfRangeMessage); - } - } else if (result.getPosition() != null) { - String parseErrorMessage = StringToNumberParser.createParseErrorMessage( - (String) value, result.getPosition()); - - return ValidationStatus.error(parseErrorMessage); - } - - return Status.OK_STATUS; - } - - /** - * Invoked by {@link #validate(Object)} when the range is to be validated. - * - * @param number - * @return <code>true</code> if in range - */ - protected abstract boolean isInRange(Number number); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberFormatConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberFormatConverter.java deleted file mode 100644 index f8493298..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberFormatConverter.java +++ /dev/null @@ -1,43 +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.internal.databinding.validation; - -import org.eclipse.core.databinding.conversion.Converter; - -import com.ibm.icu.text.NumberFormat; - -/** - * Converter that uses a number format for conversion. - * - * @since 1.0 - */ -public abstract class NumberFormatConverter extends Converter { - private final NumberFormat numberFormat; - - /** - * @param fromType - * @param toType - * @param numberFormat - */ - public NumberFormatConverter(Object fromType, Object toType, NumberFormat numberFormat) { - super(fromType, toType); - - this.numberFormat = numberFormat; - } - - /** - * @return number format - */ - /*package */ NumberFormat getNumberFormat() { - return numberFormat; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToByteValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToByteValidator.java deleted file mode 100644 index cdb16f5f..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToByteValidator.java +++ /dev/null @@ -1,42 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.NumberToByteConverter; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * Validates if a Number can fit in a Byte. - * <p> - * Class is thread safe. - * </p> - * - * @since 1.0 - */ -public class NumberToByteValidator extends NumberToNumberValidator { - private static final Byte MAX = new Byte(Byte.MAX_VALUE); - private static final Byte MIN = new Byte(Byte.MIN_VALUE); - - /** - * @param converter - */ - public NumberToByteValidator(NumberToByteConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.NumberToNumberValidator#inRange(java.lang.Number) - */ - protected boolean inRange(Number number) { - return StringToNumberParser.inByteRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToDoubleValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToDoubleValidator.java deleted file mode 100644 index 42065207..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToDoubleValidator.java +++ /dev/null @@ -1,41 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.NumberToDoubleConverter; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * Validates if a Number can fit in a Double. - * <p> - * Class is thread safe. - * </p> - * @since 1.0 - */ -public class NumberToDoubleValidator extends NumberToNumberValidator { - private static final Double MIN = new Double(Double.MIN_VALUE); - private static final Double MAX = new Double(Double.MAX_VALUE); - - /** - * @param converter - */ - public NumberToDoubleValidator(NumberToDoubleConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.NumberToNumberValidator#inRange(java.lang.Number) - */ - protected boolean inRange(Number number) { - return StringToNumberParser.inDoubleRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToFloatValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToFloatValidator.java deleted file mode 100644 index 4fe3b8e9..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToFloatValidator.java +++ /dev/null @@ -1,41 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.NumberToFloatConverter; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * Validates if a Number can fit in a Float. - * <p> - * Class is thread safe. - * </p> - * @since 1.0 - */ -public class NumberToFloatValidator extends NumberToNumberValidator { - private static final Float MIN = new Float(Float.MIN_VALUE); - private static final Float MAX = new Float(Float.MAX_VALUE); - - /** - * @param converter - */ - public NumberToFloatValidator(NumberToFloatConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.NumberToNumberValidator#inRange(java.lang.Number) - */ - protected boolean inRange(Number number) { - return StringToNumberParser.inFloatRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToIntegerValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToIntegerValidator.java deleted file mode 100644 index fe78bce6..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToIntegerValidator.java +++ /dev/null @@ -1,41 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.NumberToIntegerConverter; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * Validates if a Number can fit in a Integer. - * <p> - * Class is thread safe. - * </p> - * @since 1.0 - */ -public class NumberToIntegerValidator extends NumberToNumberValidator { - private static final Integer MIN = new Integer(Integer.MIN_VALUE); - private static final Integer MAX = new Integer(Integer.MAX_VALUE); - - /** - * @param converter - */ - public NumberToIntegerValidator(NumberToIntegerConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.NumberToNumberValidator#inRange(java.lang.Number) - */ - protected boolean inRange(Number number) { - return StringToNumberParser.inIntegerRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToLongValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToLongValidator.java deleted file mode 100644 index 2c2fdb88..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToLongValidator.java +++ /dev/null @@ -1,41 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.NumberToLongConverter; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * Validates if a Number can fit in a Long. - * <p> - * Class is thread safe. - * </p> - * @since 1.0 - */ -public class NumberToLongValidator extends NumberToNumberValidator { - private static final Long MIN = new Long(Long.MIN_VALUE); - private static final Long MAX = new Long(Long.MAX_VALUE); - - /** - * @param converter - */ - public NumberToLongValidator(NumberToLongConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.NumberToNumberValidator#inRange(java.lang.Number) - */ - protected boolean inRange(Number number) { - return StringToNumberParser.inLongRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToNumberValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToNumberValidator.java deleted file mode 100644 index 957e75b9..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToNumberValidator.java +++ /dev/null @@ -1,99 +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.internal.databinding.validation; - -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * Base class for validators that validate if a Number can fit in another Number type. - * <p> - * Class is thread safe. - * </p> - * - * @since 1.0 - */ -public abstract class NumberToNumberValidator implements IValidator { - private final NumberToNumberConverter converter; - - private final Number min; - - private final Number max; - - private String outOfRangeMessage; - - private final boolean primitive; - - /** - * @param converter - * @param min - * can be <code>null</code> - * @param max - * can be <code>null</code> - */ - protected NumberToNumberValidator(NumberToNumberConverter converter, - Number min, Number max) { - this.converter = converter; - this.min = min; - this.max = max; - - primitive = ((Class) converter.getToType()).isPrimitive(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.validation.IValidator#validate(java.lang.Object) - */ - public final IStatus validate(Object value) { - if (value == null) { - if (primitive) { - throw new IllegalArgumentException( - "Parameter 'value' cannot be null."); //$NON-NLS-1$ - } - - return Status.OK_STATUS; - } - - if (!(value instanceof Number)) { - throw new IllegalArgumentException( - "Parameter 'value' is not of type Number."); //$NON-NLS-1$ - } - - Number number = (Number) value; - if (inRange(number)) { - return Status.OK_STATUS; - } - - synchronized (this) { - if (outOfRangeMessage == null && min != null && max != null) { - outOfRangeMessage = StringToNumberParser - .createOutOfRangeMessage(min, max, converter - .getNumberFormat()); - } - - return ValidationStatus.error(outOfRangeMessage); - } - } - - /** - * Invoked to determine if the value is in range. - * - * @param number - * @return <code>true</code> if in range - */ - protected abstract boolean inRange(Number number); -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToShortValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToShortValidator.java deleted file mode 100644 index c7fa8d85..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToShortValidator.java +++ /dev/null @@ -1,42 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.NumberToShortConverter; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * Validates if a Number can fit in a Short. - * <p> - * Class is thread safe. - * </p> - * - * @since 1.0 - */ -public class NumberToShortValidator extends NumberToNumberValidator { - private static final Short MIN = new Short(Short.MIN_VALUE); - private static final Short MAX = new Short(Short.MAX_VALUE); - - /** - * @param converter - */ - public NumberToShortValidator(NumberToShortConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.NumberToNumberValidator#inRange(java.lang.Number) - */ - protected boolean inRange(Number number) { - return StringToNumberParser.inShortRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToUnboundedNumberValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToUnboundedNumberValidator.java deleted file mode 100644 index 7919c5a5..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToUnboundedNumberValidator.java +++ /dev/null @@ -1,40 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.NumberToNumberConverter; - -/** - * Validates if a Number can fit in an unbounded number (e.g. BigInteger, BigDecimal, etc.). - * <p> - * Class is thread safe. - * </p> - * - * @since 1.0 - */ -public class NumberToUnboundedNumberValidator extends NumberToNumberValidator { - /** - * @param converter - */ - public NumberToUnboundedNumberValidator(NumberToNumberConverter converter) { - super(converter, null, null); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.databinding.validation.NumberToNumberValidator#inRange(java.lang.Number) - */ - protected boolean inRange(Number number) { - return true; - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ObjectToPrimitiveValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ObjectToPrimitiveValidator.java deleted file mode 100755 index e219775e..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ObjectToPrimitiveValidator.java +++ /dev/null @@ -1,83 +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.internal.databinding.validation; - -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * @since 3.2 - * - */ -public class ObjectToPrimitiveValidator implements IValidator { - - private Class toType; - - private Class[][] primitiveMap = new Class[][] { - { Integer.TYPE, Integer.class }, { Short.TYPE, Short.class }, - { Long.TYPE, Long.class }, { Double.TYPE, Double.class }, - { Byte.TYPE, Byte.class }, { Float.TYPE, Float.class }, - { Boolean.TYPE, Boolean.class }, }; - - /** - * @param toType - */ - public ObjectToPrimitiveValidator(Class toType) { - this.toType = toType; - } - - protected Class getToType() { - return this.toType; - } - - public IStatus validate(Object value) { - return doValidate(value); - } - - private IStatus doValidate(Object value) { - if (value != null) { - if (!mapContainsValues(toType, value.getClass())) { - return ValidationStatus.error(getClassHint()); - } - return Status.OK_STATUS; - } - return ValidationStatus.error(getNullHint()); - } - - private boolean mapContainsValues(Class toType, Class fromType) { - for (int i = 0; i < primitiveMap.length; i++) { - if ((primitiveMap[i][0].equals(toType)) - && (primitiveMap[i][1].equals(fromType))) { - return true; - } - } - return false; - } - - /** - * @return a hint string - */ - public String getNullHint() { - return BindingMessages.getString("Validate_ConversionToPrimitive"); //$NON-NLS-1$ - } - - /** - * @return a hint string - */ - public String getClassHint() { - return BindingMessages - .getString("Validate_ConversionFromClassToPrimitive"); //$NON-NLS-1$ - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ReadOnlyValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ReadOnlyValidator.java deleted file mode 100755 index bd8150d8..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ReadOnlyValidator.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2005, 2006 db4objects Inc. (http://www.db4o.com) 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: - * db4objects - Initial API and implementation - * Boris Bokowski (IBM Corporation) - bug 118429 - */ -package org.eclipse.core.internal.databinding.validation; - -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.runtime.IStatus; - -/** - * ReadOnlyValidator. A validator that can be used as a partial validator for read-only fields. - */ -public class ReadOnlyValidator implements IValidator { - - private static ReadOnlyValidator singleton = null; - - /** - * Returns the ReadOnlyValidator - * - * @return the ReadOnlyValidator - */ - public static ReadOnlyValidator getDefault() { - if (singleton == null) { - singleton = new ReadOnlyValidator(); - } - return singleton; - } - - public IStatus validate(Object value) { - // No changes are allowed - return ValidationStatus.error(BindingMessages - .getString("Validate_NoChangeAllowedHelp")); //$NON-NLS-1$ - } - -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToByteValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToByteValidator.java deleted file mode 100644 index 2b7bdc4d..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToByteValidator.java +++ /dev/null @@ -1,36 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * @since 1.0 - */ -public class StringToByteValidator extends AbstractStringToNumberValidator { - private static final Byte MIN = new Byte(Byte.MIN_VALUE); - private static final Byte MAX = new Byte(Byte.MAX_VALUE); - - /** - * @param converter - */ - public StringToByteValidator(NumberFormatConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.AbstractStringToNumberValidator#isInRange(java.lang.Number) - */ - protected boolean isInRange(Number number) { - return StringToNumberParser.inByteRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToDateValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToDateValidator.java deleted file mode 100644 index 3b86d8b7..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToDateValidator.java +++ /dev/null @@ -1,107 +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.internal.databinding.validation; - -import java.util.Date; - -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.internal.databinding.conversion.DateConversionSupport; -import org.eclipse.core.internal.databinding.conversion.StringToDateConverter; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * @since 1.0 - */ -public class StringToDateValidator implements IValidator { - private final StringToDateConverter converter; - - /** - * @param converter - */ - public StringToDateValidator(StringToDateConverter converter) { - this.converter = converter; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.validation.IValidator#validate(java.lang.Object) - */ - public IStatus validate(Object value) { - if (value instanceof String && ((String)value).trim().length()==0) { - return Status.OK_STATUS; - } - Object convertedValue = converter.convert(value); - //The StringToDateConverter returns null if it can't parse the date. - if (convertedValue == null) { - return ValidationStatus.error(getErrorMessage()); - } - - return Status.OK_STATUS; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.databinding.validation.WrappedConverterValidator#getErrorMessage() - */ - protected String getErrorMessage() { - Date sampleDate = new Date(); - - // FIXME We need to use the information from the - // converter, not use another instance of DateConversionSupport. - FormatUtil util = new FormatUtil(); - StringBuffer samples = new StringBuffer(); - for (int formatterIdx = 1; formatterIdx < util.numFormatters() - 2; formatterIdx++) { - samples.append('\''); - samples.append(util.format(sampleDate, formatterIdx)); - samples.append("', "); //$NON-NLS-1$ - } - samples.append('\''); - samples.append(util.format(sampleDate, 0)); - samples.append('\''); - return BindingMessages.getString("Examples") + ": " + samples + ",..."; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - } - - private static class FormatUtil extends DateConversionSupport { - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.databinding.conversion.DateConversionSupport#numFormatters() - */ - protected int numFormatters() { - return super.numFormatters(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.databinding.conversion.DateConversionSupport#format(java.util.Date) - */ - protected String format(Date date) { - return super.format(date); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.databinding.conversion.DateConversionSupport#format(java.util.Date, - * int) - */ - protected String format(Date date, int formatterIdx) { - return super.format(date, formatterIdx); - } - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToDoubleValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToDoubleValidator.java deleted file mode 100644 index 2e0d0fc9..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToDoubleValidator.java +++ /dev/null @@ -1,38 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * @since 1.0 - */ -public class StringToDoubleValidator extends AbstractStringToNumberValidator { - private static final Double MIN = new Double(-Double.MAX_VALUE); - private static final Double MAX = new Double(Double.MAX_VALUE); - - /** - * @param converter - */ - public StringToDoubleValidator(NumberFormatConverter converter) { - super(converter, MIN, MAX); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.databinding.validation.AbstractStringToNumberValidator#inRange(java.lang.Number) - */ - protected boolean isInRange(Number number) { - return StringToNumberParser.inDoubleRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToFloatValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToFloatValidator.java deleted file mode 100644 index 6ce01e43..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToFloatValidator.java +++ /dev/null @@ -1,42 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * Validates that a string is of the appropriate format and is in the range of a - * float. - * - * @since 1.0 - */ -public class StringToFloatValidator extends AbstractStringToNumberValidator { - - private static final Float MIN = new Float(-Float.MAX_VALUE); - private static final Float MAX = new Float(Float.MAX_VALUE); - - /** - * @param converter - */ - public StringToFloatValidator(NumberFormatConverter converter) { - super(converter, MIN, MAX); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.databinding.validation.AbstractStringToNumberValidator#inRange(java.lang.Number) - */ - protected boolean isInRange(Number number) { - return StringToNumberParser.inFloatRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToIntegerValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToIntegerValidator.java deleted file mode 100644 index 6b8fb242..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToIntegerValidator.java +++ /dev/null @@ -1,40 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - - -/** - * Validates that a string is of the appropriate format and is in the range of - * an integer. - * - * @since 1.0 - */ -public class StringToIntegerValidator extends AbstractStringToNumberValidator { - private static final Integer MIN = new Integer(Integer.MIN_VALUE); - private static final Integer MAX = new Integer(Integer.MAX_VALUE); - - /** - * @param converter - */ - public StringToIntegerValidator(NumberFormatConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.AbstractStringToNumberValidator#inRange(java.lang.Number) - */ - protected boolean isInRange(Number number) { - return StringToNumberParser.inIntegerRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToLongValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToLongValidator.java deleted file mode 100644 index 10cd47f0..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToLongValidator.java +++ /dev/null @@ -1,39 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * Validates that a string is of the appropriate format and is in the range of - * an long. - * - * @since 1.0 - */ -public class StringToLongValidator extends AbstractStringToNumberValidator { - private static final Long MIN = new Long(Long.MIN_VALUE); - private static final Long MAX = new Long(Long.MAX_VALUE); - - /** - * @param converter - */ - public StringToLongValidator(NumberFormatConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.AbstractStringToNumberValidator#inRange(java.lang.Number) - */ - protected boolean isInRange(Number number) { - return StringToNumberParser.inLongRange(number); - } -} diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToShortValidator.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToShortValidator.java deleted file mode 100644 index eaf16b29..00000000 --- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/StringToShortValidator.java +++ /dev/null @@ -1,36 +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.internal.databinding.validation; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * @since 1.0 - */ -public class StringToShortValidator extends AbstractStringToNumberValidator { - private static final Short MIN = new Short(Short.MIN_VALUE); - private static final Short MAX = new Short(Short.MAX_VALUE); - - /** - * @param converter - */ - public StringToShortValidator(NumberFormatConverter converter) { - super(converter, MIN, MAX); - } - - /* (non-Javadoc) - * @see org.eclipse.core.internal.databinding.validation.AbstractStringToNumberValidator#inRange(java.lang.Number) - */ - protected boolean isInRange(Number number) { - return StringToNumberParser.inShortRange(number); - } -} diff --git a/bundles/org.eclipse.jface.databinding/.classpath b/bundles/org.eclipse.jface.databinding/.classpath deleted file mode 100644 index ce0c7a5d..00000000 --- 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 ba077a40..00000000 --- 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 e65e9851..00000000 --- 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 bc38b605..00000000 --- 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 59509e09..00000000 --- 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 fee4b048..00000000 --- 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 431a9d64..00000000 --- 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.2.0.qualifier -Bundle-ClassPath: . -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Export-Package: org.eclipse.jface.databinding.swt, - org.eclipse.jface.databinding.viewers, - org.eclipse.jface.databinding.wizard, - 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 46023304..00000000 --- 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 6f0a513e..00000000 --- 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 2880743c..00000000 --- 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 f3a74f85..00000000 --- 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 d25ba3a1..00000000 --- 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.1 - * - */ -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 beaed95d..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/SWTObservables.java +++ /dev/null @@ -1,412 +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.CComboSingleSelectionObservableValue; -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.ComboSingleSelectionObservableValue; -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.ListSingleSelectionObservableValue; -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.TableSingleSelectionObservableValue; -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> - * <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 value - * @throws IllegalArgumentException - * if <code>control</code> type is unsupported - */ - public static ISWTObservableValue observeSingleSelectionIndex( - Control control) { - if (control instanceof Table) { - return new TableSingleSelectionObservableValue((Table) control); - } else if (control instanceof Combo) { - return new ComboSingleSelectionObservableValue((Combo) control); - } else if (control instanceof CCombo) { - return new CComboSingleSelectionObservableValue((CCombo) control); - } else if (control instanceof List) { - return new ListSingleSelectionObservableValue((List) control); - } - - 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 139ca4fc..00000000 --- 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> -Provides classes that can be used to observe changes in SWT widgets. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe changes in SWT widgets.</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 f97f6d93..00000000 --- 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.1 - * - */ -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 a8437a57..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableListContentProvider.java +++ /dev/null @@ -1,142 +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.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.1 - * - */ -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).insert(entry.getElement(), entry.getPosition()); - } 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)) { - // use reflection to avoid 3.3 dependency: - Class abstractTableViewerClass = null; - try { - abstractTableViewerClass = Class.forName("org.eclipse.jface.viewers.AbstractTableViewer"); //$NON-NLS-1$ - } catch(Exception ex) { - // ignore, we might be running against 3.2 - } - if (abstractTableViewerClass == null || !abstractTableViewerClass.isInstance(viewer)) { - throw new IllegalArgumentException( - "This content provider only works with (Abstract)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 29822a84..00000000 --- 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 1.1 - * - */ -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 f9c87147..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ObservableSetContentProvider.java +++ /dev/null @@ -1,213 +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.1 - * - */ -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)) { - // use reflection to avoid 3.3 dependency: - Class abstractTableViewerClass = null; - try { - abstractTableViewerClass = Class.forName("org.eclipse.jface.viewers.AbstractTableViewer"); //$NON-NLS-1$ - } catch(Exception ex) { - // ignore, we might be running against 3.2 - } - if (abstractTableViewerClass == null || !abstractTableViewerClass.isInstance(viewer)) { - throw new IllegalArgumentException( - "This content provider only works with (Abstract)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 613ac33c..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/ViewersObservables.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 - *******************************************************************************/ - -package org.eclipse.jface.databinding.viewers; - -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.internal.viewers.SelectionProviderMultipleSelectionObservableList; -import org.eclipse.jface.internal.databinding.internal.viewers.SelectionProviderSingleSelectionObservableValue; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Display; - -/** - * @since 1.1 - * - */ -public class ViewersObservables { - - /** - * Returns an observable value that tracks the current selection of the - * given selection provider. If the selection provider provides selections - * of type {@link IStructuredSelection}, the observable value will be the - * first element of the structured selection as returned by - * {@link IStructuredSelection#getFirstElement()}. - * - * @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); - } - - /** - * Returns an observable value that tracks the current selection of the - * given selection provider. Assumes that the selection provider provides - * selections of type {@link IStructuredSelection}. Note that the - * observable list will not honor the full contract of - * <code>java.util.List</code> in that it may delete or reorder elements - * based on what the selection provider returns from - * {@link ISelectionProvider#getSelection()} after having called - * {@link ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)} - * based on the requested change to the observable list. The affected - * methods are <code>add</code>, <code>addAll</code>, and - * <code>set</code>. - * - * @param selectionProvider - * @return the observable value tracking the (multi) selection of the given - * selection provider - * - * @since 1.2 - */ - public static IObservableList observeMultiSelection( - ISelectionProvider selectionProvider) { - return new SelectionProviderMultipleSelectionObservableList( - SWTObservables.getRealm(Display.getDefault()), - selectionProvider, Object.class); - } - -} 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 2ebf7483..00000000 --- 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> -Provides classes that can be used to observe the JFace Viewer framework. -<h2> -Package Specification</h2> -<p> -This package provides classes that can be used to observe the JFace Viewer framework.</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 1d6e33d3..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/wizard/WizardPageSupport.java +++ /dev/null @@ -1,185 +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.AssertionFailedException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.dialogs.IMessageProvider; -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.setMessage(null); - wizardPage.setErrorMessage(uiChanged ? currentStatus.getMessage() - : null); - } else if (currentStatus != null - && currentStatus.getSeverity() != IStatus.OK) { - int severity = currentStatus.getSeverity(); - wizardPage.setPageComplete((severity & IStatus.CANCEL) != 0); - int type; - switch (severity) { - case IStatus.OK: - type = IMessageProvider.NONE; - break; - case IStatus.CANCEL: - type = IMessageProvider.NONE; - break; - case IStatus.INFO: - type = IMessageProvider.INFORMATION; - break; - case IStatus.WARNING: - type = IMessageProvider.WARNING; - break; - case IStatus.ERROR: - type = IMessageProvider.ERROR; - break; - default: - throw new AssertionFailedException( - "incomplete switch statement"); //$NON-NLS-1$ - } - wizardPage.setErrorMessage(null); - wizardPage.setMessage(currentStatus.getMessage(), type); - } else { - wizardPage.setPageComplete(true); - wizardPage.setMessage(null); - 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/databinding/wizard/package.html b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/wizard/package.html deleted file mode 100755 index b0949811..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/wizard/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> -Provides classes that bridge between data binding and the JFace Wizard framework. -<h2> -Package Specification</h2> -<p> -This package provides classes that bridge between data binding and the JFace Wizard framework.</p> -</body> -</html> 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 7d57e7ff..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ButtonObservableValue.java +++ /dev/null @@ -1,109 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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(); - - notifyIfChanged(oldSelectionValue, selectionValue); - } - }; - - /** - * @param button - */ - public ButtonObservableValue(Button button) { - super(button); - this.button = button; - init(); - } - - /** - * @param realm - * @param button - */ - public ButtonObservableValue(Realm realm, Button button) { - super(realm, button); - this.button = button; - init(); - } - - private void init() { - 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); - notifyIfChanged(oldSelectionValue, selectionValue); - } - - public Object doGetValue() { - return button.getSelection() ? Boolean.TRUE : Boolean.FALSE; - } - - public Object getValueType() { - return Boolean.TYPE; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - - if (!button.isDisposed()) { - button.removeListener(SWT.Selection, updateListener); - button.removeListener(SWT.DefaultSelection, updateListener); - } - } - - /** - * Notifies consumers with a value change event only if a change occurred. - * - * @param oldValue - * @param newValue - */ - private void notifyIfChanged(boolean oldValue, boolean newValue) { - if (oldValue != newValue) { - fireValueChange(Diffs.createValueDiff(oldValue ? Boolean.TRUE : Boolean.FALSE, - newValue ? Boolean.TRUE : Boolean.FALSE)); - } - } -} 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 3ec3cc3d..00000000 --- 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 af40f87e..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableValue.java +++ /dev/null @@ -1,162 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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; - - private ModifyListener modifyListener; - - /** - * @param ccombo - * @param attribute - */ - public CComboObservableValue(CCombo ccombo, String attribute) { - super(ccombo); - this.ccombo = ccombo; - this.attribute = attribute; - init(); - } - - /** - * @param realm - * @param ccombo - * @param attribute - */ - public CComboObservableValue(Realm realm, CCombo ccombo, String attribute) { - super(realm, ccombo); - this.ccombo = ccombo; - this.attribute = attribute; - init(); - } - - private void init() { - if (attribute.equals(SWTProperties.SELECTION) - || attribute.equals(SWTProperties.TEXT)) { - this.currentValue = ccombo.getText(); - modifyListener = new ModifyListener() { - - public void modifyText(ModifyEvent e) { - if (!updating) { - String oldValue = currentValue; - currentValue = CComboObservableValue.this.ccombo - .getText(); - - notifyIfChanged(oldValue, currentValue); - } - } - }; - ccombo.addModifyListener(modifyListener); - } 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; - currentValue = ccombo.getText(); - } - - notifyIfChanged(oldValue, currentValue); - } - - 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; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - - if (modifyListener != null && !ccombo.isDisposed()) { - ccombo.removeModifyListener(modifyListener); - } - } - - private void notifyIfChanged(String oldValue, String newValue) { - if (!oldValue.equals(newValue)) { - fireValueChange(Diffs.createValueDiff(oldValue, ccombo.getText())); - } - } -} diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboSingleSelectionObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboSingleSelectionObservableValue.java deleted file mode 100644 index 7d23a7ef..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboSingleSelectionObservableValue.java +++ /dev/null @@ -1,81 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; - -/** - * @since 1.0 - * - */ -public class CComboSingleSelectionObservableValue extends - SingleSelectionObservableValue { - - private SelectionListener selectionListener; - - /** - * @param combo - */ - public CComboSingleSelectionObservableValue(CCombo combo) { - super(combo); - } - - /** - * @param realm - * @param combo - */ - public CComboSingleSelectionObservableValue(Realm realm, CCombo combo) { - super(realm, combo); - } - - private CCombo getCCombo() { - return (CCombo) getWidget(); - } - - protected void doAddSelectionListener(final Runnable runnable) { - selectionListener = new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - runnable.run(); - } - - public void widgetSelected(SelectionEvent e) { - runnable.run(); - } - }; - getCCombo().addSelectionListener(selectionListener); - } - - protected int doGetSelectionIndex() { - return getCCombo().getSelectionIndex(); - } - - protected void doSetSelectionIndex(int index) { - getCCombo().setText(getCCombo().getItem(index)); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - if (selectionListener != null && !getCCombo().isDisposed()) { - getCCombo().removeSelectionListener(selectionListener); - } - - } -} 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 a18d076e..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CLabelObservableValue.java +++ /dev/null @@ -1,62 +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.core.databinding.observable.Realm; -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; - } - - /** - * @param realm - * @param label - */ - public CLabelObservableValue(Realm realm, CLabel label) { - super(realm, label); - this.label = label; - } - - public void doSetValue(final Object value) { - String oldValue = label.getText(); - String newValue = value == null ? "" : value.toString(); //$NON-NLS-1$ - label.setText(newValue); - - if (!newValue.equals(oldValue)) { - fireValueChange(Diffs.createValueDiff(oldValue, newValue)); - } - } - - 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 ab49b149..00000000 --- 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 e1a7b9dd..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboObservableValue.java +++ /dev/null @@ -1,154 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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; - private ModifyListener modifyListener; - - /** - * @param combo - * @param attribute - */ - public ComboObservableValue(Combo combo, String attribute) { - super(combo); - this.combo = combo; - this.attribute = attribute; - init(); - } - - /** - * @param realm - * @param combo - * @param attribute - */ - public ComboObservableValue(Realm realm, Combo combo, String attribute) { - super(realm, combo); - this.combo = combo; - this.attribute = attribute; - init(); - } - - private void init() { - if (attribute.equals(SWTProperties.SELECTION) - || attribute.equals(SWTProperties.TEXT)) { - this.currentValue = combo.getText(); - modifyListener = new ModifyListener() { - - public void modifyText(ModifyEvent e) { - if (!updating) { - String oldValue = currentValue; - currentValue = ComboObservableValue.this.combo - .getText(); - - notifyIfChanged(oldValue, currentValue); - } - } - }; - combo.addModifyListener(modifyListener); - } 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; - currentValue = combo.getText(); - } - - notifyIfChanged(oldValue, currentValue); - } - - 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; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - - if (modifyListener != null && !combo.isDisposed()) { - combo.removeModifyListener(modifyListener); - } - } - - private void notifyIfChanged(String oldValue, String newValue) { - if (!oldValue.equals(newValue)) { - fireValueChange(Diffs.createValueDiff(oldValue, newValue)); - } - } -} diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboSingleSelectionObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboSingleSelectionObservableValue.java deleted file mode 100644 index 7beef0fe..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ComboSingleSelectionObservableValue.java +++ /dev/null @@ -1,71 +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 - * Ashley Cambrell - bugs 198903, 198904 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Combo; - -/** - * @since 1.0 - * - */ -public class ComboSingleSelectionObservableValue extends - SingleSelectionObservableValue { - - private SelectionListener selectionListener; - - /** - * @param combo - */ - public ComboSingleSelectionObservableValue(Combo combo) { - super(combo); - } - - private Combo getCombo() { - return (Combo) getWidget(); - } - - protected void doAddSelectionListener(final Runnable runnable) { - selectionListener = new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - runnable.run(); - } - - public void widgetSelected(SelectionEvent e) { - runnable.run(); - } - }; - getCombo().addSelectionListener(selectionListener); - } - - protected int doGetSelectionIndex() { - return getCombo().getSelectionIndex(); - } - - protected void doSetSelectionIndex(int index) { - getCombo().select(index); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - if (selectionListener != null && !getCombo().isDisposed()) { - getCombo().removeSelectionListener(selectionListener); - } - } -} 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 49b77aa6..00000000 --- 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 2bd9012f..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/LabelObservableValue.java +++ /dev/null @@ -1,62 +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.core.databinding.observable.Realm; -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; - } - - /** - * @param realm - * @param label - */ - public LabelObservableValue(Realm realm, Label label) { - super(realm, label); - this.label = label; - } - - public void doSetValue(final Object value) { - String oldValue = label.getText(); - String newValue = value == null ? "" : value.toString(); //$NON-NLS-1$ - label.setText(newValue); - - if (!newValue.equals(oldValue)) { - fireValueChange(Diffs.createValueDiff(oldValue, newValue)); - } - } - - 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 2928c1ca..00000000 --- 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 ad14cc8e..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListObservableValue.java +++ /dev/null @@ -1,109 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ -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; - - private Listener listener; - - /** - * @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$ - - listener = new Listener() { - - public void handleEvent(Event event) { - if (!updating) { - Object oldValue = currentValue; - currentValue = (String) doGetValue(); - fireValueChange(Diffs.createValueDiff(oldValue, - currentValue)); - } - } - - }; - list.addListener(SWT.Selection, listener); - } - - 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; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - if (listener != null && !list.isDisposed()) { - list.removeListener(SWT.Selection, listener); - } - } -} diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListSingleSelectionObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListSingleSelectionObservableValue.java deleted file mode 100644 index 5604020c..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ListSingleSelectionObservableValue.java +++ /dev/null @@ -1,71 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.List; - -/** - * @since 1.0 - * - */ -public class ListSingleSelectionObservableValue extends - SingleSelectionObservableValue { - - private SelectionListener selectionListener; - - /** - * @param combo - */ - public ListSingleSelectionObservableValue(List combo) { - super(combo); - } - - private List getList() { - return (List) getWidget(); - } - - protected void doAddSelectionListener(final Runnable runnable) { - selectionListener = new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - runnable.run(); - } - - public void widgetSelected(SelectionEvent e) { - runnable.run(); - } - }; - getList().addSelectionListener(selectionListener); - } - - protected int doGetSelectionIndex() { - return getList().getSelectionIndex(); - } - - protected void doSetSelectionIndex(int index) { - getList().setSelection(index); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - if (selectionListener != null && !getList().isDisposed()) { - getList().removeSelectionListener(selectionListener); - } - } -} 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 09418794..00000000 --- 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 b5dfd1d8..00000000 --- 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 5683e4c6..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/ScaleObservableValue.java +++ /dev/null @@ -1,150 +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 - * Peter Centgraf - bug 175763 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.runtime.Assert; -import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Scale; - -/** - * @since 1.0 - * - */ -public class ScaleObservableValue extends AbstractSWTObservableValue { - - private final Scale scale; - - private final String attribute; - - private boolean updating = false; - - private int currentSelection; - - private SelectionListener listener; - - /** - * @param scale - * @param attribute - */ - public ScaleObservableValue(Scale scale, String attribute) { - super(scale); - this.scale = scale; - this.attribute = attribute; - init(); - } - - /** - * @param realm - * @param scale - * @param attribute - */ - public ScaleObservableValue(Realm realm, Scale scale, String attribute) { - super(realm, scale); - this.scale = scale; - this.attribute = attribute; - init(); - } - - private void init() { - if (attribute.equals(SWTProperties.SELECTION)) { - currentSelection = scale.getSelection(); - scale.addSelectionListener(listener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (!updating) { - int newSelection = ScaleObservableValue.this.scale - .getSelection(); - notifyIfChanged(currentSelection, 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 = scale.getSelection(); - scale.setSelection(newValue); - currentSelection = newValue; - } else if (attribute.equals(SWTProperties.MIN)) { - oldValue = scale.getMinimum(); - scale.setMinimum(newValue); - } else if (attribute.equals(SWTProperties.MAX)) { - oldValue = scale.getMaximum(); - scale.setMaximum(newValue); - } else { - Assert.isTrue(false, "invalid attribute name:" + attribute); //$NON-NLS-1$ - return; - } - - notifyIfChanged(oldValue, newValue); - } finally { - updating = false; - } - } - - public Object doGetValue() { - int value = 0; - if (attribute.equals(SWTProperties.SELECTION)) { - value = scale.getSelection(); - } else if (attribute.equals(SWTProperties.MIN)) { - value = scale.getMinimum(); - } else if (attribute.equals(SWTProperties.MAX)) { - value = scale.getMaximum(); - } - return new Integer(value); - } - - public Object getValueType() { - return Integer.TYPE; - } - - /** - * @return attribute being observed - */ - public String getAttribute() { - return attribute; - } - - /* (non-Javadoc) - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - - if (listener != null && !scale.isDisposed()) { - scale.removeSelectionListener(listener); - } - listener = null; - } - - private void notifyIfChanged(int oldValue, int newValue) { - if (oldValue != newValue) { - fireValueChange(Diffs.createValueDiff(new Integer(oldValue), - new Integer(newValue))); - } - } -} diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SingleSelectionObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SingleSelectionObservableValue.java deleted file mode 100644 index 9daa486b..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SingleSelectionObservableValue.java +++ /dev/null @@ -1,103 +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.core.databinding.observable.Realm; -import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTObservableValue; -import org.eclipse.swt.widgets.Control; - -/** - * @since 1.0 - * - */ -abstract public class SingleSelectionObservableValue extends - AbstractSWTObservableValue { - - private boolean updating = false; - - private int currentSelection; - - /** - * @param control - * the control - */ - public SingleSelectionObservableValue(Control control) { - super(control); - init(); - } - - /** - * @param realm - * @param control - */ - public SingleSelectionObservableValue(Realm realm, Control control) { - super(realm, control); - init(); - } - - private void init() { - currentSelection = doGetSelectionIndex(); - doAddSelectionListener(new Runnable(){ - public void run() { - if (!updating) { - int newSelection = doGetSelectionIndex(); - notifyIfChanged(currentSelection, newSelection); - currentSelection = newSelection; - } - } - }); - } - - /** - * @param runnable - */ - protected abstract void doAddSelectionListener(Runnable runnable); - - public void doSetValue(Object value) { - try { - updating = true; - int intValue = ((Integer) value).intValue(); - doSetSelectionIndex(intValue); - notifyIfChanged(currentSelection, intValue); - currentSelection = intValue; - } finally { - updating = false; - } - } - - /** - * @param intValue - * the selection index - */ - protected abstract void doSetSelectionIndex(int intValue); - - public Object doGetValue() { - return new Integer(doGetSelectionIndex()); - } - - /** - * @return the selection index - */ - protected abstract int doGetSelectionIndex(); - - public Object getValueType() { - return Integer.TYPE; - } - - private void notifyIfChanged(int oldValue, int newValue) { - if (oldValue != newValue) { - fireValueChange(Diffs.createValueDiff(new Integer( - oldValue), new Integer(newValue))); - } - } -} 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 7c1416cf..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/SpinnerObservableValue.java +++ /dev/null @@ -1,150 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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; - - private ModifyListener modifyListener; - - /** - * @param spinner - * @param attribute - */ - public SpinnerObservableValue(Spinner spinner, String attribute) { - super(spinner); - this.spinner = spinner; - this.attribute = attribute; - init(); - } - - /** - * @param realm - * @param spinner - * @param attribute - */ - public SpinnerObservableValue(Realm realm, Spinner spinner, String attribute) { - super(realm, spinner); - this.spinner = spinner; - this.attribute = attribute; - init(); - } - - private void init() { - if (attribute.equals(SWTProperties.SELECTION)) { - currentSelection = spinner.getSelection(); - modifyListener = new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (!updating) { - int newSelection = SpinnerObservableValue.this.spinner - .getSelection(); - notifyIfChanged(currentSelection, newSelection); - currentSelection = newSelection; - } - } - }; - spinner.addModifyListener(modifyListener); - } 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; - } - notifyIfChanged(oldValue, 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; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - if (modifyListener != null && !spinner.isDisposed()) { - spinner.removeModifyListener(modifyListener); - } - } - - private void notifyIfChanged(int oldValue, int newValue) { - if (oldValue != newValue) { - fireValueChange(Diffs.createValueDiff(new Integer(oldValue), - new Integer(newValue))); - } - } -} diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TableSingleSelectionObservableValue.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TableSingleSelectionObservableValue.java deleted file mode 100644 index b10cf19f..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TableSingleSelectionObservableValue.java +++ /dev/null @@ -1,80 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.internal.swt; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Table; - -/** - * @since 1.0 - * - */ -public class TableSingleSelectionObservableValue extends - SingleSelectionObservableValue { - - private SelectionListener selectionListener; - - /** - * @param table - */ - public TableSingleSelectionObservableValue(Table table) { - super(table); - } - - /** - * @param realm - * @param table - */ - public TableSingleSelectionObservableValue(Realm realm, Table table) { - super(realm, table); - } - - private Table getTable() { - return (Table) getWidget(); - } - - protected void doAddSelectionListener(final Runnable runnable) { - selectionListener = new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - runnable.run(); - } - - public void widgetSelected(SelectionEvent e) { - runnable.run(); - } - }; - getTable().addSelectionListener(selectionListener); - } - - protected int doGetSelectionIndex() { - return getTable().getSelectionIndex(); - } - - protected void doSetSelectionIndex(int index) { - getTable().setSelection(index); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - super.dispose(); - if (selectionListener != null && !getTable().isDisposed()) { - getTable().removeSelectionListener(selectionListener); - } - } -} 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 703372fa..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextEditableObservableValue.java +++ /dev/null @@ -1,75 +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.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -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; - } - - /** - * @param realm - * @param text - */ - public TextEditableObservableValue(Realm realm, Text text) { - super(realm, 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 (value == null) { - throw new IllegalArgumentException("Parameter value was null."); //$NON-NLS-1$ - } - - Boolean oldValue = new Boolean(text.getEditable()); - Boolean newValue = (Boolean) value; - - text.setEditable(newValue.booleanValue()); - - if (!oldValue.equals(newValue)) { - fireValueChange(Diffs.createValueDiff(oldValue, newValue)); - } - } -} 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 ac8a64b1..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/TextObservableValue.java +++ /dev/null @@ -1,198 +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 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.core.databinding.observable.Realm; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.provisional.swt.AbstractSWTVetoableValue; -import org.eclipse.swt.SWT; -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 final int updateEventType; - - /** - * Valid types for the {@link #updateEventType}. - */ - private static final int[] validUpdateEventTypes = new int[] { SWT.Modify, - SWT.FocusOut, SWT.None }; - - /** - * Previous value of the Text. - */ - private String oldValue; - - private Listener updateListener = new Listener() { - public void handleEvent(Event event) { - if (!updating) { - String newValue = text.getText(); - - if (!newValue.equals(oldValue)) { - fireValueChange(Diffs.createValueDiff(oldValue, newValue)); - oldValue = newValue; - } - } - } - }; - - private VerifyListener verifyListener; - - /** - * 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) { - this(SWTObservables.getRealm(text.getDisplay()), text, updateEventType); - } - - /** - * Constructs a new instance. - * - * @param realm can not be <code>null</code> - * @param text - * @param updateEventType - */ - public TextObservableValue(final Realm realm, Text text, int updateEventType) { - super(realm, 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); - } - - oldValue = 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); - } - - /** - * 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 - */ - protected void doSetApprovedValue(final Object value) { - try { - updating = true; - text.setText(value == null ? "" : value.toString()); //$NON-NLS-1$ - oldValue = text.getText(); - } finally { - updating = false; - } - } - - /** - * Returns the current value of the {@link Text}. - * - * @see org.eclipse.core.databinding.observable.value.AbstractVetoableValue#doGetValue() - */ - public Object doGetValue() { - return oldValue = 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()) { - if (updateEventType != SWT.None) { - text.removeListener(updateEventType, updateListener); - } - text.removeVerifyListener(verifyListener); - } - super.dispose(); - } -} 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 bdd0af31..00000000 --- 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/SelectionProviderMultipleSelectionObservableList.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/SelectionProviderMultipleSelectionObservableList.java deleted file mode 100644 index 90bfd7f5..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/SelectionProviderMultipleSelectionObservableList.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Peter Centgraf 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: - * Peter Centgraf - initial API and implementation, bug 124683 - * Boris Bokowski, 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.List; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.list.ListDiff; -import org.eclipse.core.databinding.observable.list.WritableList; -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 multiple-selection of an {@link ISelectionProvider}. - * - * @since 1.2 - */ -public class SelectionProviderMultipleSelectionObservableList extends - WritableList { - - protected ISelectionProvider selectionProvider; - protected boolean handlingSelection; - protected boolean updating; - protected SelectionListener selectionListener = new SelectionListener(); - - class SelectionListener implements ISelectionChangedListener { - public void selectionChanged(SelectionChangedEvent event) { - if (updating) { - return; - } - handlingSelection = true; - try { - updateWrappedList(new ArrayList(getSelectionList(event.getSelection()))); - } finally { - handlingSelection = false; - } - } - } - - /** - * Create a new observable list based on the current selection of the given - * selection provider. Assumes that the selection provider provides - * structured selections. - * - * @param realm - * @param selectionProvider - * @param elementType - */ - public SelectionProviderMultipleSelectionObservableList(Realm realm, - ISelectionProvider selectionProvider, Object elementType) { - super(realm, new ArrayList(getSelectionList(selectionProvider)), elementType); - this.selectionProvider = selectionProvider; - selectionProvider.addSelectionChangedListener(selectionListener); - } - - protected void fireListChange(ListDiff diff) { - if (handlingSelection) { - super.fireListChange(diff); - } else { - // this is a bit of a hack - we are changing the diff to match the order - // of elements returned by the selection provider after we've set the - // selection. - updating = true; - try { - List oldList = getSelectionList(selectionProvider); - selectionProvider - .setSelection(new StructuredSelection(wrappedList)); - wrappedList = new ArrayList(getSelectionList(selectionProvider)); - super.fireListChange(Diffs.computeListDiff(oldList, wrappedList)); - } finally { - updating = false; - } - } - } - - protected static List getSelectionList(ISelectionProvider selectionProvider) { - if (selectionProvider == null) { - throw new IllegalArgumentException(); - } - return getSelectionList(selectionProvider.getSelection()); - } - - protected static List getSelectionList(ISelection sel) { - if (sel instanceof IStructuredSelection) { - return ((IStructuredSelection) sel).toList(); - } - return Collections.EMPTY_LIST; - } - - public synchronized void dispose() { - selectionProvider.removeSelectionChangedListener(selectionListener); - selectionProvider = null; - super.dispose(); - } -} 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 a025c17b..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValue.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 137877 - * Brad Reynolds - bug 164653 - * Brad Reynolds - bug 147515 - * Ashley Cambrell - bug 198906 - *******************************************************************************/ - -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; - - private ISelectionChangedListener selectionChangedListener; - - /** - * 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(); - - selectionChangedListener = new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - if (!updating) { - Object oldSelection = currentSelection; - currentSelection = doGetValue(); - fireValueChange(Diffs.createValueDiff(oldSelection, - currentSelection)); - } - } - }; - selectionProvider.addSelectionChangedListener(selectionChangedListener); - } - - /** - * 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; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose() - */ - public synchronized void dispose() { - selectionProvider - .removeSelectionChangedListener(selectionChangedListener); - super.dispose(); - } -} 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 d2b3598b..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTObservableValue.java +++ /dev/null @@ -1,68 +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.Realm; -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; - -/** - * NON-API - 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 1.1 - */ -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) { - this(SWTObservables.getRealm(widget.getDisplay()), widget); - } - - /** - * Constructor that allows for the setting of the realm. Makes sure that the - * observable gets disposed when the SWT widget is disposed. - * - * @param realm - * @param widget - */ - protected AbstractSWTObservableValue(Realm realm, Widget widget) { - super(realm); - 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 efe91701..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/AbstractSWTVetoableValue.java +++ /dev/null @@ -1,70 +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.Realm; -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; - -/** - * NON-API - 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 1.1 - */ -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) { - this(SWTObservables.getRealm(widget.getDisplay()), widget); - } - - /** - * Constructs a new instance for the provided <code>realm</code> and <code>widget</code>. - * - * @param realm - * @param widget - */ - protected AbstractSWTVetoableValue(Realm realm, Widget widget) { - super(realm); - 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 4a639ea5..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/CompositeUpdater.java +++ /dev/null @@ -1,241 +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 java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -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.Control; -import org.eclipse.swt.widgets.Widget; - -/** - * NON-API - This class can be used to update a composite with automatic dependency tracking. - * @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 LayoutRunnable implements Runnable { - private boolean posted = false; - private Set controlsToLayout = new HashSet(); - void add(Control toLayout) { - controlsToLayout.add(toLayout); - if (!posted) { - posted = true; - theComposite.getDisplay().asyncExec(this); - } - } - public void run() { - posted = false; - theComposite.getShell().layout((Control[])controlsToLayout.toArray(new Control[controlsToLayout.size()])); - controlsToLayout.clear(); - } - } - - private LayoutRunnable layoutRunnable = new LayoutRunnable(); - - /** - * To be called from {@link #updateWidget(Widget, Object)} or {@link #createWidget(int)} - * if this updater's composite's layout may need to be updated. - * @param control - */ - protected void requestLayout(Control control) { - layoutRunnable.add(control); - } - - 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()) { - createChild(listDiffEntry.getElement(), listDiffEntry.getPosition()); - } else { - disposeWidget(listDiffEntry.getPosition()); - } - } - 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); - ObservableTracker.runAndIgnore(new Runnable(){ - public void run() { - int index = 0; - for (Iterator it = CompositeUpdater.this.model.iterator(); it.hasNext();) { - Object element = it.next(); - createChild(element, index++); - } - } - }); - } - - /** - * @param position - */ - protected void disposeWidget(int position) { - theComposite.getChildren()[position].dispose(); - } - - /** - * 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); - - void createChild(Object element, int index) { - Widget newChild = createWidget(index); - final UpdateRunnable updateRunnable = new UpdateRunnable(newChild, element); - newChild.setData(updateRunnable); - updateRunnable.updateIfNecessary(); - } - -} 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 ca819b74..00000000 --- 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; - -/** - * NON-API - 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.1 - */ -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 updater 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 fc2fca7e..00000000 --- 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; - -/** - * NON-API - 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 d1499f86..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/SWTUtil.java +++ /dev/null @@ -1,179 +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; - -/** - * NON-API - Utility methods, mainly having to do with posting runnables to the UI thread - * in a particular way. - * @since 1.1 - */ -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 51b46a88..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/TableUpdater.java +++ /dev/null @@ -1,173 +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; - -/** - * NON-API - This class can be used to update a table with automatic dependency tracking. - * @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 dfb3db5a..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/swt/WorkQueue.java +++ /dev/null @@ -1,149 +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; - -/** - * NON-API - Helper class to manage a queue of runnables to be posted to the UI thread in a way - * that they are only run once. - * @since 1.1 - * - */ -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/IParentProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/IParentProvider.java deleted file mode 100644 index 5c55e68f..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/IParentProvider.java +++ /dev/null @@ -1,28 +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 - * Stefan Xenos, IBM - initial API and implementation - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.provisional.viewers; - -/** - * NON-API - Returns the parent of elements in a tree. - * - * @since 1.1 - */ -public interface IParentProvider { - - /** - * TODO: comment me - * - * @param child - * @return TODO: comment - */ - public Object getParent(Object child); -} diff --git a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/TreeNode.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/TreeNode.java deleted file mode 100644 index 9748ff8f..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/TreeNode.java +++ /dev/null @@ -1,333 +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 - * Stefan Xenos, IBM - initial API and implementation - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.provisional.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.core.databinding.observable.set.SetDiff; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.widgets.Control; - -/* package */ class TreeNode implements ISetChangeListener, IStaleListener { - private UnorderedTreeContentProvider contentProvider; - private Object 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; - - /** - * 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 TreeNode(Object element, UnorderedTreeContentProvider cp) { - this.element = element; - this.contentProvider = cp; - children = contentProvider.createChildSet(element); - if (children == null) { - children = Observables.emptyObservableSet(); - 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 TODO - */ - 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 TODO - */ - public IObservableSet getChildrenSet() { - return children; - } - - private void updateStale() { - boolean willBeStale = children.isStale(); - if (willBeStale != isStale) { - isStale = willBeStale; - - contentProvider.changeStale(isStale? 1 : -1); - } - } - - /** - * @return TODO - */ - public boolean isStale() { - return isStale; - } - - /** - * Returns true if the viewer should show a plus sign for expanding this - * node. - * - * @return TODO - */ - 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.removeSetChangeListener(this); - children.removeStaleListener(this); - } - children.dispose(); - children = null; - - if (listeningToChildren && isStale) { - contentProvider.changeStale(-1); - } - } - } - - /** - * @return TODO - */ - 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 TODO - */ - public Object getParent() { - return parent; - } - - /** - * - * @return the set of all known parents for this node - */ - public Set getParents() { - if (parents == null) { - if (parent == null) { - return Collections.EMPTY_SET; - } else { - return Collections.singleton(parent); - } - } else { - return parents; - } - } - - /** - * Called when the child set changes. Should not be called directly by the viewer. - */ - public void handleSetChange(SetChangeEvent event) { - SetDiff diff = event.diff; - TreeViewer viewer = this.contentProvider.getViewer(); - if (viewer != null) { - Control control = viewer.getControl(); - if (control != null) { - if (control.isDisposed()) { - // If the widgetry was disposed without notifying the content provider, then - // dispose the content provider now and stop processing events. - contentProvider.dispose(); - return; - } - } - } - - boolean shouldHavePendingNode = children.isEmpty() && children.isStale(); - - Set additions = 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 = 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(element, additions); - } - if (!removals.isEmpty()) { - contentProvider.remove(element, removals, children.isEmpty() && !hasPendingNode); - } - - updateStale(); - } - - public void handleStale(StaleEvent staleEvent) { - TreeViewer viewer = this.contentProvider.getViewer(); - if (viewer != null) { - Control control = viewer.getControl(); - if (control != null) { - if (control.isDisposed()) { - // If the widgetry was disposed without notifying the content provider, then - // dispose the content provider now and stop processing events. - contentProvider.dispose(); - return; - } - } - } - - boolean shouldHavePendingNode = children.isEmpty() && children.isStale(); - - // Check if we should add the pending node - if (shouldHavePendingNode && !hasPendingNode) { - hasPendingNode = shouldHavePendingNode; - contentProvider.add(element, Collections.singleton(contentProvider.getPendingNode())); - } - - // Check if we should remove the pending node - if (!shouldHavePendingNode && hasPendingNode) { - hasPendingNode = shouldHavePendingNode; - contentProvider.remove(element, Collections.singleton(contentProvider.getPendingNode()), true); - } - - updateStale(); - } - - /** - * @return TODO - */ - public Object getElement() { - return element; - } - - /** - * - */ - public void prefetch() { - TreeViewer viewer = this.contentProvider.getViewer(); - if (viewer != null) { - Control control = viewer.getControl(); - if (control != null) { - if (control.isDisposed()) { - // If the widgetry has been disposed, then avoid sending anything - // to the viewer. - return; - } - } - } - - Set 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/provisional/viewers/UnorderedTreeContentProvider.java b/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/UnorderedTreeContentProvider.java deleted file mode 100644 index 5de23fb4..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/UnorderedTreeContentProvider.java +++ /dev/null @@ -1,528 +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 - * Stefan Xenos, IBM - initial API and implementation - *******************************************************************************/ -package org.eclipse.jface.internal.databinding.provisional.viewers; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -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.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.ITreeContentProvider; -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; - -/** - * NON-API - Generic tree content provider to be used with an AbstractTreeViewer based on a IUnorderedTreeProvider. - * @since 1.1 - * - */ -public class UnorderedTreeContentProvider implements ITreeContentProvider, ITreePathContentProvider { - - private HashMap mapElementToTreeNode = new HashMap(); - private LinkedList enqueuedPrefetches = new LinkedList(); - private IParentProvider rootParentProvider = null; - private boolean useTreePaths = false; - - class KnownElementsSet extends AbstractObservableSet { - - protected KnownElementsSet() { - super(); - } - - /* (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)); - } - - public void fireSetChange(SetDiff diff) { - super.fireSetChange(diff); - } - - void doFireStale(boolean isStale) { - if (isStale) { - fireStale(); - } else { - fireSetChange(Diffs.createSetDiff(Collections.EMPTY_SET, Collections.EMPTY_SET)); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.internal.databinding.provisional.observable.set.IObservableSet#getElementType() - */ - public Object getElementType() { - return new Object(); - } - } - - KnownElementsSet elements = new KnownElementsSet(); - - private ITreeViewerListener expandListener = new ITreeViewerListener() { - public void treeCollapsed(TreeExpansionEvent event) { - } - - public void treeExpanded(TreeExpansionEvent event) { - } - }; - - private IUnorderedTreeProvider provider; - private Object pendingNode; - - private int avoidViewerUpdates; - - private TreeViewer treeViewer; - - private int staleCount = 0; - private boolean useRefresh; - private int maxPrefetches = 0; - - /** - * 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.pendingNode = pendingNode; - this.useRefresh = useRefresh; - } - - /** - * Sets whether this content provider should add/remove elements using - * TreePaths (true) or elements (false). - * - * <p></p> - * <p>When using elements:</p> - * - * <ul> - * <li>Cycles are permitted (elements can be their own ancestor)</li> - * <li>Addition, removal, and refresh are slightly faster</li> - * <li>It is not possible to have more than one content provider per tree</li> - * <li>The setRootPath(...) method is ignored</li> - * </ul> - * - * <p></p> - * <p>When using TreePaths:</p> - * - * <ul> - * <li>Cycles are not permitted (elements cannot be their own parent)</li> - * <li>Addition, removal, and refresh are slightly slower</li> - * <li>It is possible to use more than one content provider in the same tree</li> - * <li>The setRootPath(...) method can be used to direct the output to a particular - * subtree</li> - * </ul> - * - * @param usePaths - */ - public void useTreePaths(boolean usePaths) { - this.useTreePaths = usePaths; - } - - /** - * @param rootParentProvider - */ - public void setRootPath(IParentProvider rootParentProvider) { - this.rootParentProvider = rootParentProvider; - } - - /** - * @param maxPrefetches - */ - public void setMaxPrefetches(int maxPrefetches) { - this.maxPrefetches = maxPrefetches; - } - - /* package */ IObservableSet createChildSet(Object element) { - return provider.createChildSet(element); - } - - /* package */ void remove(Object element, Set removals, boolean lastElement) { - if (removals.isEmpty()) { - return; - } - if (avoidViewerUpdates == 0) { - if (lastElement || useRefresh) { - doRefresh(element); - } else { - if (useTreePaths) { - List toRemove = new ArrayList(); - TreePath[] parents = getParents(element); - for (int i = 0; i < parents.length; i++) { - TreePath parent = parents[i]; - - for (Iterator iter = removals.iterator(); iter.hasNext();) { - Object elementToRemove = (Object) iter.next(); - - toRemove.add(parent.createChildPath(element).createChildPath(elementToRemove)); - } - } - - treeViewer.remove((TreePath[]) toRemove.toArray(new TreePath[toRemove.size()])); - } else { - treeViewer.remove(element, removals.toArray()); - } - } - for (Iterator iter = removals.iterator(); iter.hasNext();) { - Object next = (Object) iter.next(); - - TreeNode nextNode = (TreeNode)mapElementToTreeNode.get(next); - if (nextNode != null) { - nextNode.removeParent(element); - removeIfUnused(nextNode); - } - } - } - } - - /* package */ void add(Object element, Set additions) { - if (additions.isEmpty()) { - return; - } - if (avoidViewerUpdates == 0) { - // Handle new parents - addParent(element, additions); - if (useRefresh) { - doRefresh(element); - } else { - if (useTreePaths) { - TreePath[] parents = getParents(element); - for (int i = 0; i < parents.length; i++) { - TreePath parent = parents[i]; - - treeViewer.add(parent.createChildPath(element), additions.toArray()); - } - } else { - treeViewer.add(element, additions.toArray()); - } - } - } - } - - private void doRefresh(Object element) { - treeViewer.refresh(element); - } - - /** - * Ensures that the given set of children have the given parent as - * one of their parents. - * - * @param parent - * @param children - */ - private void addParent(Object parent, Set children) { - for (Iterator iter = children.iterator(); iter.hasNext();) { - Object next = (Object) iter.next(); - - TreeNode nextNode = getNode(next); - nextNode.addParent(parent); - } - } - - /** - * @return saouesnth - */ - public final Object getPendingNode() { - return pendingNode; - } - - /** - * @param parent - * @return aueosnht - */ - public IObservableSet getChildrenSet(Object 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]; - - TreeNode result = (TreeNode)mapElementToTreeNode.get(key); - if (result != null) { - result.dispose(); - } - } - setViewer(null); - } 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++; - TreeNode oldNode = (TreeNode)mapElementToTreeNode.get(oldInput); - if (oldNode != null) { - removeIfUnused(oldNode); - } - } finally { - avoidViewerUpdates--; - } - } - - private void removeIfUnused(TreeNode toRemove) { - //TreeNode result = (TreeNode)mapElementToTreeNode.get(element); - Object element = toRemove.getElement(); - if (toRemove.getParent() == null) { - mapElementToTreeNode.remove(element); - elements.doFireDiff(Collections.EMPTY_SET, Collections.singleton(element)); - toRemove.dispose(); - } - } - - private void setViewer(Viewer viewer) { - if (viewer != null && !(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(Object parentElement) { - Set result = getNode(parentElement).getChildren(); - - addParent(parentElement, result); - - return result.toArray(); - } - - private TreeNode getNode(Object parentElement) { - TreeNode result = (TreeNode)mapElementToTreeNode.get(parentElement); - if (result == null) { - result = new TreeNode(parentElement, this); - mapElementToTreeNode.put(parentElement, result); - elements.fireSetChange(Diffs.createSetDiff(Collections.singleton(parentElement), - Collections.EMPTY_SET)); - } - return result; - } - - public Object getParent(Object element) { - Object result = getNode(element).getParent(); - if (result == null && rootParentProvider != null) { - result = rootParentProvider.getParent(element); - } - return result; - } - - public boolean hasChildren(Object element) { - return getNode(element).shouldShowPlus(); - } - - public Object[] getElements(Object inputElement) { - return getChildren(inputElement); - } - - /** - * @return aouesnth - */ - public IObservableSet getKnownElements() { - return elements; - } - - /* package */ void changeStale(int staleDelta) { - staleCount += staleDelta; - processPrefetches(); - elements.setStale(staleCount != 0); - } - - /** - * @return aoueesnth - */ - public TreeViewer getViewer() { - return treeViewer; - } - - /** - * @param element - * @return aoeusnth - */ - public boolean isDirty(Object element) { - return false; - } - - /* package */ void enqueuePrefetch(TreeNode node) { - if (maxPrefetches > 0 || maxPrefetches == -1) { - 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()) { - TreeNode next = (TreeNode)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 Object[] getChildren(TreePath parentPath) { - return getChildren(parentPath.getLastSegment()); - } - - public TreePath[] getParents(Object element) { - // Compute all paths that do not contain cycles - /** - * List of Lists - */ - List parentPaths = computeParents(element, new HashSet()); - - /** - * List of TreePath - */ - List result = new ArrayList(); - - for (Iterator iterator = parentPaths.iterator(); iterator.hasNext();) { - List nextPath = (List) iterator.next(); - - LinkedList resultPath = new LinkedList(); - resultPath.addAll(nextPath); - Object nextParent = resultPath.isEmpty() ? element : resultPath.getFirst(); - for(;nextParent != null;) { - if (rootParentProvider != null) { - nextParent = rootParentProvider.getParent(nextParent); - if (nextParent != null) { - resultPath.addFirst(nextParent); - } - } else { - nextParent = null; - } - } - - result.add(new TreePath(resultPath.toArray())); - } - - if (result.isEmpty() && rootParentProvider != null) { - Object nextParent = rootParentProvider.getParent(element); - if (nextParent != null) { - LinkedList resultPath = new LinkedList(); - while (nextParent != null) { - resultPath.addFirst(nextParent); - nextParent = rootParentProvider.getParent(nextParent); - } - - result.add(new TreePath(resultPath.toArray())); - } - - } - - return (TreePath[]) result.toArray(new TreePath[result.size()]); - } - - /** - * - * @param node - * @param toIgnore - * @return a list of Lists, indicating all known paths to the given node - */ - private List computeParents(Object node, HashSet toIgnore) { - List result = new ArrayList(); - boolean containedNode = toIgnore.add(node); - - TreeNode tn = getNode(node); - - HashSet parents = new HashSet(); - parents.addAll(tn.getParents()); - parents.removeAll(toIgnore); - if (parents.isEmpty()) { - ArrayList newPath = new ArrayList(); - result.add(newPath); - } else { - for (Iterator iterator = parents.iterator(); iterator.hasNext();) { - Object parent = iterator.next(); - - List parentPaths = computeParents(parent, toIgnore); - - for (Iterator iterator2 = parentPaths.iterator(); iterator2 - .hasNext();) { - List parentPath = (List) iterator2.next(); - - parentPath.add(parent); - result.add(parentPath); - } - } - } - - if (containedNode) { - toIgnore.remove(node); - } - return result; - } - - public boolean hasChildren(TreePath path) { - return hasChildren(path.getLastSegment()); - } -} 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 5137a987..00000000 --- a/bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/ViewerLabelProvider.java +++ /dev/null @@ -1,86 +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; - -/** - * NON-API - Generic viewer label provider. - * @since 1.1 - * - */ -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 d512f63a..00000000 --- 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 ba077a40..00000000 --- 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 0ccc2284..00000000 --- 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 2b83041f..00000000 --- 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 846d8bfc..00000000 --- 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 9ad123fb..00000000 --- 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 842cd388..00000000 --- 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 46023304..00000000 --- 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 72c23de9..00000000 --- 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 759e715f..00000000 --- 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 3e2acf33..00000000 --- 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 96691159..00000000 --- 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 736f7b55..00000000 --- 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 3089982d..00000000 --- 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 970b061e..00000000 --- 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 7d34d94b..00000000 --- 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 88ec4540..00000000 --- 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 20efc8eb..00000000 --- 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 80193573..00000000 --- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/contentprovider/test/TreeContentProviderTest.java +++ /dev/null @@ -1,217 +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.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.provisional.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(Object element) { - // If the parent is the root node, return the union of some - // randomly-generated - // nodes and some hardcoded nodes - if (element == 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 - 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...", false); - - 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) { - final Display display = Display.getDefault(); - Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() { - public void run() { - 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 031ac208..00000000 --- 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 c3b78ea7..00000000 --- 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 3ec9a58c..00000000 --- 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 fa433973..00000000 --- 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 484922e9..00000000 --- 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 f2b6aece..00000000 --- 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 49c9c1c3..00000000 --- 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 d9c61b49..00000000 --- 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 fc87f9e3..00000000 --- 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 333449cb..00000000 --- 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 e5eeaea2..00000000 --- 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 7509d647..00000000 --- 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 d78eed03..00000000 --- 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 2b95e139..00000000 --- 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 0606d436..00000000 --- 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 b82f45eb..00000000 --- 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 edbae49e..00000000 --- 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 778a31c1..00000000 --- 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 0b9d081c..00000000 --- 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 35e3f5e8..00000000 --- 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 f30a1592..00000000 --- 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 f6fae9f3..00000000 --- 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 cec1927d..00000000 --- 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 99a68fc9..00000000 --- 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 63ba02e4..00000000 --- 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 39fbc084..00000000 --- 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 980c75a5..00000000 --- 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 02e8f5db..00000000 --- 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 86f5d7b4..00000000 --- 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 492dcdc0..00000000 --- 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 c701255f..00000000 --- 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 09882e74..00000000 --- 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("text", 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 dd616344..00000000 --- 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("text", 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 ac674aa5..00000000 --- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet004DataBindingContextErrorLabel.java +++ /dev/null @@ -1,96 +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. http://www.eclipse.org - * - * @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.setText("Data Binding Snippet 004"); - 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 f84b40c9..00000000 --- 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 918715be..00000000 --- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet006Spreadsheet.java +++ /dev/null @@ -1,314 +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 = 6; - - private static final int NUM_ROWS = 16; - - /** - * 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 = false; - - /** - * // * 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); - shell.setText("Data Binding Snippet 006"); - - 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(60); - } - 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 aac19d25..00000000 --- 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 38433d91..00000000 --- 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 a96d5ec5..00000000 --- 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 b4cb4261..00000000 --- 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 59ae4c20..00000000 --- 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 af9fee0c..00000000 --- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet012CompositeUpdater.java +++ /dev/null @@ -1,112 +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.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(0, new Counter()); - } - }); - - final Composite composite = new Composite(shell, SWT.None); - - new CompositeUpdater(composite, list) { - protected Widget createWidget(int index) { - Label label = new Label(composite, SWT.BORDER); - //requestLayout(label); - return label; - } - - protected void updateWidget(Widget widget, Object element) { - ((Label) widget).setText(((Counter) element).getValue() - + ""); - requestLayout((Label)widget); - } - }; - GridLayoutFactory.fillDefaults().numColumns(10).generateLayout(composite); - - 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/Snippet013TableViewerEditing.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet013TableViewerEditing.java deleted file mode 100644 index 65dda9b3..00000000 --- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet013TableViewerEditing.java +++ /dev/null @@ -1,310 +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 - * Tom Schindl - cell editing - ******************************************************************************/ - -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.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.observable.Realm; -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.viewers.CellEditor; -import org.eclipse.jface.viewers.ColumnViewer; -import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; -import org.eclipse.jface.viewers.ColumnViewerEditorActivationListener; -import org.eclipse.jface.viewers.ColumnViewerEditorDeactivationEvent; -import org.eclipse.jface.viewers.EditingSupport; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TableViewerColumn; -import org.eclipse.jface.viewers.TextCellEditor; -import org.eclipse.jface.viewers.ViewerCell; -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.Table; - -/** - * Demonstrates binding a TableViewer to a collection using the 3.3 Viewer APIs. - */ -public class Snippet013TableViewerEditing { - 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(); - } - } - } - }); - } - - // 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; - } - } - - /** - * Editing support that uses JFace Data Binding to control the editing - * lifecycle. The standard EditingSupport get/setValue(...) lifecycle is not - * used. - * - * @since 3.3 - */ - static class InlineEditingSupport extends EditingSupport { - private TextCellEditor editor; - - private DataBindingContext bindingContext; - /** - * The current binding. - */ - private Binding binding; - - private final ColumnViewerEditorActivationListenerHelper activationListener = new ColumnViewerEditorActivationListenerHelper(); - - /** - * @param viewer - */ - public InlineEditingSupport(ColumnViewer viewer, - DataBindingContext bindingContext) { - super(viewer); - this.editor = new TextCellEditor((Composite) viewer.getControl()); - this.bindingContext = bindingContext; - } - - protected boolean canEdit(Object element) { - return true; - } - - protected CellEditor getCellEditor(Object element) { - return editor; - } - - protected Object getValue(Object element) { - // Not needed - return null; - } - - protected void setValue(Object element, Object value) { - // Not Needed - } - - protected void initializeCellEditorValue(CellEditor cellEditor, - ViewerCell cell) { - Object modelElement = cell.getElement(); - IObservableValue observableValue = BeansObservables.observeValue( - modelElement, "name"); - - /* - * Creates a binding between the cell editor and the model that only - * updates the model when the current edit is saved. - */ - binding = bindingContext - .bindValue(SWTObservables.observeText(cellEditor - .getControl(), SWT.Modify), observableValue, - new UpdateValueStrategy( - UpdateValueStrategy.POLICY_CONVERT), null); - - getViewer().getColumnViewerEditor().addEditorActivationListener( - activationListener); - } - - protected void saveCellEditorValue(CellEditor cellEditor, - ViewerCell cell) { - binding.updateTargetToModel(); - } - - private class ColumnViewerEditorActivationListenerHelper extends - ColumnViewerEditorActivationListener { - - public void afterEditorActivated( - ColumnViewerEditorActivationEvent event) { - // do nothing - } - - public void afterEditorDeactivated( - ColumnViewerEditorDeactivationEvent event) { - binding.dispose(); - binding = null; - } - - public void beforeEditorActivated( - ColumnViewerEditorActivationEvent event) { - // do nothing - } - - public void beforeEditorDeactivated( - ColumnViewerEditorDeactivationEvent event) { - // do nothing - } - } - } - - // The GUI view - static class View { - private ViewModel viewModel; - private Table committers; - private Label selectedCommitter; - - 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(SWT.VERTICAL)); - committers = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION); - committers.setLinesVisible(true); - - selectedCommitter = new Label(shell, SWT.NONE); - // 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. - 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); - TableViewerColumn column = new TableViewerColumn(peopleViewer, - SWT.NONE); - column.setEditingSupport(new InlineEditingSupport(peopleViewer, - bindingContext)); - column.getColumn().setWidth(100); - - // 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)); - - // bind selectedCommitter label to the name of the current selection - IObservableValue selection = ViewersObservables - .observeSingleSelection(peopleViewer); - bindingContext.bindValue(SWTObservables - .observeText(selectedCommitter), BeansObservables - .observeDetailValue(Realm.getDefault(), selection, "name", - String.class), null, null); - } - } - -} diff --git a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet014WizardDialog.java b/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet014WizardDialog.java deleted file mode 100644 index 788a51d0..00000000 --- a/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet014WizardDialog.java +++ /dev/null @@ -1,162 +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.examples.databinding.snippets; - -import java.util.Date; - -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.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.jface.databinding.wizard.WizardPageSupport; -import org.eclipse.jface.layout.GridLayoutFactory; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.wizard.IWizard; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * Creates and opens a wizard dialog with two simple wizard pages. - */ -public class Snippet014WizardDialog { - - static class FirstWizardPage extends WizardPage { - private final class SingleDigitValidator implements IValidator { - public IStatus validate(Object value) { - Integer i = (Integer) value; - if (i == null) { - return ValidationStatus - .info("Please enter a value."); - } - if (i.intValue() < 0 || i.intValue() > 9) { - return ValidationStatus - .error("Value must be between 0 and 9."); - } - return ValidationStatus.ok(); - } - } - - protected FirstWizardPage() { - super("First", "First Page", ImageDescriptor - .createFromImage(new Image(Display.getDefault(), 16, 16))); - } - - public void createControl(Composite parent) { - DataBindingContext dbc = new DataBindingContext(); - WizardPageSupport.create(this, dbc); - Composite composite = new Composite(parent, SWT.NONE); - Label label = new Label(composite, SWT.NONE); - label.setText("Enter a number between 0 and 9:"); - Text text = new Text(composite, SWT.BORDER); - - dbc.bindValue( - SWTObservables.observeText(text, SWT.Modify), - ((SampleWizard) getWizard()).getModel().intValue, - new UpdateValueStrategy().setAfterConvertValidator(new SingleDigitValidator()), - null); - - GridLayoutFactory.swtDefaults().numColumns(2).generateLayout( - composite); - setControl(composite); - } - } - - static class SecondWizardPage extends WizardPage { - protected SecondWizardPage() { - super("Second", "Second Page", ImageDescriptor - .createFromImage(new Image(Display.getDefault(), 16, 16))); - } - - public void createControl(Composite parent) { - DataBindingContext dbc = new DataBindingContext(); - WizardPageSupport.create(this, dbc); - Composite composite = new Composite(parent, SWT.NONE); - Label label = new Label(composite, SWT.NONE); - label.setText("Enter a date:"); - Text text = new Text(composite, SWT.BORDER); - - dbc.bindValue( - SWTObservables.observeText(text, SWT.Modify), - ((SampleWizard) getWizard()).getModel().dateValue, - null, - null); - - GridLayoutFactory.swtDefaults().numColumns(2).generateLayout( - composite); - setControl(composite); - } - } - - static class SampleWizardModel { - IObservableValue intValue = new WritableValue(null, Integer.class); - IObservableValue dateValue = new WritableValue(null, Date.class); - } - - static class SampleWizard extends Wizard { - - private SampleWizardModel model = new SampleWizardModel(); - - public void addPages() { - addPage(new FirstWizardPage()); - addPage(new SecondWizardPage()); - } - - public SampleWizardModel getModel() { - return model; - } - - public String getWindowTitle() { - return "Data Binding Snippet014"; - } - - public boolean performFinish() { - return true; - } - - } - - public static void main(String[] args) { - Display display = new Display(); - - // note that the "runWithDefault" will be done for you if you are using - // the - // Workbench as opposed to just JFace/SWT. - Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() { - public void run() { - IWizard wizard = new SampleWizard(); - WizardDialog dialog = new WizardDialog(null, wizard); - dialog.open(); - // The SWT event loop - Display display = Display.getCurrent(); - while (dialog.getShell() != null - && !dialog.getShell().isDisposed()) { - if (!display.readAndDispatch()) { - display.sleep(); - } - } - } - }); - } - -} 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 8b441634..00000000 --- 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.conformance/.classpath b/tests/org.eclipse.jface.tests.databinding.conformance/.classpath deleted file mode 100644 index ce739334..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/.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/tests/org.eclipse.jface.tests.databinding.conformance/.project b/tests/org.eclipse.jface.tests.databinding.conformance/.project deleted file mode 100644 index 3094c2c0..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.jface.tests.databinding.conformance</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.conformance/META-INF/MANIFEST.MF b/tests/org.eclipse.jface.tests.databinding.conformance/META-INF/MANIFEST.MF deleted file mode 100644 index f3c76406..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.jface.tests.databinding.conformance -Bundle-Version: 1.0.0 -Require-Bundle: org.junit, - org.eclipse.core.databinding, - org.eclipse.jface.databinding, - org.eclipse.swt, - org.eclipse.core.runtime -Bundle-Vendor: %providerName -Bundle-RequiredExecutionEnvironment: J2SE-1.4 -Export-Package: org.eclipse.jface.databinding.conformance;uses:="org.eclipse.core.databinding.observable,org.eclipse.jface.databinding.conformance.delegate,junit.framework", - org.eclipse.jface.databinding.conformance.delegate, - org.eclipse.jface.databinding.conformance.swt, - org.eclipse.jface.databinding.conformance.util; - uses:="org.eclipse.core.databinding.observable.map, - org.eclipse.jface.databinding.conformance.delegate, - org.eclipse.core.databinding.observable, - org.eclipse.core.databinding.observable.list, - org.eclipse.core.databinding.observable.value, - junit.framework, - org.eclipse.core.databinding.observable.set" diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/about.html b/tests/org.eclipse.jface.tests.databinding.conformance/about.html deleted file mode 100644 index d42b3ced..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/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> diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/build.properties b/tests/org.eclipse.jface.tests.databinding.conformance/build.properties deleted file mode 100644 index cc155527..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/build.properties +++ /dev/null @@ -1,17 +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 -############################################################################### -bin.includes = .,\ - META-INF/,\ - plugin.properties,\ - about.html -output.databinding.jar = bin/ -src.includes = about.html -source.. = src/ diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/plugin.properties b/tests/org.eclipse.jface.tests.databinding.conformance/plugin.properties deleted file mode 100644 index 4e17d68d..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/plugin.properties +++ /dev/null @@ -1,12 +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 -############################################################################### -pluginName = JFace Data Binding Conformance Tests -providerName = Eclipse.org diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableCollectionContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableCollectionContractTest.java deleted file mode 100644 index d14428e5..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableCollectionContractTest.java +++ /dev/null @@ -1,360 +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.conformance; - -import java.util.Arrays; -import java.util.Collections; - -import org.eclipse.core.databinding.observable.ChangeEvent; -import org.eclipse.core.databinding.observable.IChangeListener; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.jface.databinding.conformance.delegate.IObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * Mutability tests for IObservableCollection. - * <p> - * This class is experimental and can change at any time. It is recommended to - * not subclass or assume the test names will not change. The only API that is - * guaranteed to not change are the constructors. The tests will remain public - * and not final in order to allow for consumers to turn off a test if needed by - * subclassing. - * </p> - * - * @since 3.2 - */ -public class MutableObservableCollectionContractTest extends ObservableDelegateTest { - private IObservableCollectionContractDelegate delegate; - - private IObservableCollection collection; - - public MutableObservableCollectionContractTest( - IObservableCollectionContractDelegate delegate) { - super(delegate); - this.delegate = delegate; - } - - public MutableObservableCollectionContractTest(String name, - IObservableCollectionContractDelegate delegate) { - super(name, delegate); - this.delegate = delegate; - } - - protected void setUp() throws Exception { - super.setUp(); - - collection = (IObservableCollection) super.getObservable(); - } - - public void testAdd_ChangeEvent() throws Exception { - assertChangeEventFired(new Runnable() { - public void run() { - collection.add(delegate.createElement(collection)); - } - }, "Collection.add(Object)", collection); - } - - public void testAdd_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.add(delegate.createElement(collection)); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testAdd_ChangeEventFiredAfterElementIsAdded() throws Exception { - final Object element = delegate.createElement(collection); - - assertContainsDuringChangeEvent(new Runnable() { - public void run() { - collection.add(element); - } - }, "Collection.add(Object)", collection, element); - } - - public void testAddAll_ChangeEvent() throws Exception { - assertChangeEventFired(new Runnable() { - public void run() { - collection.addAll(Arrays.asList(new Object[] { delegate - .createElement(collection) })); - } - }, "Collection.addAll(Collection)", collection); - } - - public void testAddAll_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.addAll(Arrays.asList(new Object[] { delegate - .createElement(collection) })); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testAddAll_ChangeEventFiredAfterElementsAreAdded() - throws Exception { - final Object element = delegate.createElement(collection); - - assertContainsDuringChangeEvent(new Runnable() { - public void run() { - collection.addAll(Arrays.asList(new Object[] { element })); - } - }, "Collection.addAll(Collection)", collection, element); - } - - public void testRemove_ChangeEvent() throws Exception { - final Object element = delegate.createElement(collection); - collection.add(element); - - assertChangeEventFired(new Runnable() { - public void run() { - collection.remove(element); - } - }, "Collection.remove(Object)", collection); - } - - public void testRemove_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.remove(delegate.createElement(collection)); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testRemove_ChangeEventFiredAfterElementIsRemoved() - throws Exception { - final Object element = delegate.createElement(collection); - collection.add(element); - - assertDoesNotContainDuringChangeEvent(new Runnable() { - public void run() { - collection.remove(element); - } - }, "Collection.remove(Object)", collection, element); - } - - public void testRemoveAll_ChangeEvent() throws Exception { - final Object element = delegate.createElement(collection); - collection.add(element); - - assertChangeEventFired(new Runnable() { - public void run() { - collection.removeAll(Arrays.asList(new Object[] { element })); - } - }, "Collection.removeAll(Collection)", collection); - } - - public void testRemoveAll_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.removeAll(Arrays.asList(new Object[] { delegate.createElement(collection) })); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testRemoveAll_ChangeEventFiredAfterElementsAreRemoved() - throws Exception { - final Object element = delegate.createElement(collection); - collection.add(element); - - assertDoesNotContainDuringChangeEvent(new Runnable() { - public void run() { - collection.removeAll(Arrays.asList(new Object[] { element })); - } - }, "Collection.removeAll(Collection)", collection, element); - } - - public void testRetainAll_ChangeEvent() throws Exception { - final Object element1 = delegate.createElement(collection); - collection.add(element1); - Object element2 = delegate.createElement(collection); - collection.add(element2); - - assertChangeEventFired(new Runnable() { - public void run() { - collection.retainAll(Arrays.asList(new Object[] { element1 })); - } - - }, "Collection.retainAll(Collection)", collection); - } - - public void testRetainAll_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.retainAll(Collections.EMPTY_LIST); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testRetainAll_ChangeEventFiredAfterElementsAreRetained() - throws Exception { - Object element1 = delegate.createElement(collection); - collection.add(element1); - Object element2 = delegate.createElement(collection); - collection.add(element2); - - // precondition - assertTrue(collection.contains(element1)); - assertTrue(collection.contains(element2)); - - ContainsListener listener1 = new ContainsListener(collection, element1) - .init(); - ContainsListener listener2 = new ContainsListener(collection, element2) - .init(); - - // set contains the the opposite of the expected outcome to ensure they - // get set - listener1.contains = false; - listener2.contains = true; - - collection.retainAll(Arrays.asList(new Object[] { element1 })); - assertTrue( - formatFail("When Collection.retainAll(...) fires the change event the element should have been retained in the Collection."), - listener1.contains); - assertFalse( - formatFail("When Collection.retainAll(...) fires the change event the element should have been removed from the Collection."), - listener2.contains); - } - - public void testClear_ChangeEvent() throws Exception { - collection.add(delegate.createElement(collection)); - - assertChangeEventFired(new Runnable() { - public void run() { - collection.clear(); - } - }, "List.clear()", collection); - } - - public void testClear_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.clear(); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testClear_ChangeEventFiredAfterElementIsRemoved() - throws Exception { - Object element = delegate.createElement(collection); - collection.add(element); - - assertDoesNotContainDuringChangeEvent(new Runnable() { - public void run() { - collection.clear(); - } - }, "List.clear()", collection, element); - } - - /** - * Asserts that a ChangeEvent is fired once when the provided - * <code>runnable</code> is invoked and the source is the provided - * <code>collection</code>. - * - * @param runnable - * @param methodName - * @param collection - */ - /* package */void assertChangeEventFired(Runnable runnable, - String methodName, IObservableCollection collection) { - - ChangeEventTracker listener = ChangeEventTracker.observe(collection); - runnable.run(); - - assertEquals(formatFail(methodName + " should fire one ChangeEvent."), 1, - listener.count); - assertEquals( - formatFail(methodName - + "'s change event observable should be the created Collection."), - collection, listener.event.getObservable()); - } - - /** - * Asserts that when the change event is fired for the action contained in - * the <code>runnable</code> the change will have been applied to the - * <code>collection</code>. - * - * @param runnable - * @param methodName - * @param collection - * @param elementNotContained - */ - /* package */void assertDoesNotContainDuringChangeEvent(Runnable runnable, - String methodName, IObservableCollection collection, - Object elementNotContained) { - - // precondition - assertTrue(collection.contains(elementNotContained)); - - ContainsListener listener = new ContainsListener(collection, - elementNotContained).init(); - listener.contains = true; - collection.remove(elementNotContained); - assertFalse( - formatFail(new StringBuffer("When ") - .append(methodName) - .append( - " fires a change event the element should have been removed from the Collection.") - .toString()), listener.contains); - } - - /** - * Asserts that when the change event is fired for the action contained in - * the <code>runnable</code> the change will have been applied to the - * <code>collection</code>. - * - * @param runnable - * @param methodName - * @param collection - * @param elementContained - */ - /* package */void assertContainsDuringChangeEvent(Runnable runnable, - String methodName, IObservableCollection collection, - Object elementContained) { - ContainsListener listener = new ContainsListener(collection, - elementContained).init(); - - // precondition - assertFalse(collection.contains(elementContained)); - runnable.run(); - - assertTrue( - formatFail(new StringBuffer("When ") - .append(methodName) - .append( - " fires a change event the element should have been added to the Collection.") - .toString()), listener.contains); - } - - /* package */static class ContainsListener implements IChangeListener { - boolean contains; - - final private Object element; - - final private IObservableCollection collection; - - ContainsListener(IObservableCollection collection, Object element) { - this.element = element; - this.collection = collection; - } - - ContainsListener init() { - collection.addChangeListener(this); - return this; - } - - public void handleChange(ChangeEvent event) { - contains = collection.contains(element); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableListContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableListContractTest.java deleted file mode 100644 index 5524316c..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableListContractTest.java +++ /dev/null @@ -1,493 +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.conformance; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.list.ListDiffEntry; -import org.eclipse.jface.databinding.conformance.delegate.IObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.ListChangeEventTracker; - - -/** - * Mutability tests for IObservableList. - * - * <p> - * This class is experimental and can change at any time. It is recommended to - * not subclass or assume the test names will not change. The only API that is - * guaranteed to not change are the constructors. The tests will remain public - * and not final in order to allow for consumers to turn off a test if needed by - * subclassing. - * </p> - * - * @since 3.2 - */ -public class MutableObservableListContractTest extends - MutableObservableCollectionContractTest { - private IObservableCollectionContractDelegate delegate; - - private IObservableList list; - - /** - * @param delegate - */ - public MutableObservableListContractTest( - IObservableCollectionContractDelegate delegate) { - super(delegate); - this.delegate = delegate; - } - - public MutableObservableListContractTest(String testName, - IObservableCollectionContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - protected void setUp() throws Exception { - super.setUp(); - list = (IObservableList) getObservable(); - } - - public void testAdd_ListChangeEvent() throws Exception { - assertListChangeEventFired(new Runnable() { - public void run() { - list.add(delegate.createElement(list)); - } - }, "List.add(Object)", list); - } - - public void testAdd_ListDiffEntry() throws Exception { - list.add(delegate.createElement(list)); - final Object element = delegate.createElement(list); - - assertAddDiffEntry(new Runnable() { - public void run() { - list.add(element); - } - }, "List.add(Object)", list, element, 1); - } - - public void testAddAtIndex_ChangeEvent() throws Exception { - assertChangeEventFired(new Runnable() { - public void run() { - list.add(0, delegate.createElement(list)); - } - }, "List.add(int, Object)", list); - } - - public void testAddAtIndex_ListChangeEvent() throws Exception { - assertListChangeEventFired(new Runnable() { - public void run() { - list.add(0, delegate.createElement(list)); - } - }, "List.add(int, Object)", list); - } - - public void testAddAtIndex_ChangeEventFiredAfterElementIsAdded() - throws Exception { - final Object element = delegate.createElement(list); - - assertContainsDuringChangeEvent(new Runnable() { - public void run() { - list.add(0, element); - } - }, "List.add(int, Collection)", list, element); - } - - public void testAddAtIndex_ListDiffEntry() throws Exception { - list.add(delegate.createElement(list)); - final Object element = delegate.createElement(list); - - assertAddDiffEntry(new Runnable() { - public void run() { - list.add(1, element); - } - }, "List.add(int, Object)", list, element, 1); - } - - public void testAddAll_ListChangeEvent() throws Exception { - assertListChangeEventFired(new Runnable() { - public void run() { - list.addAll(Arrays.asList(new Object[] { delegate - .createElement(list) })); - } - }, "List.addAll(Collection", list); - } - - public void testAddAll_ListDiffEntry() throws Exception { - final Object element = delegate.createElement(list); - - assertAddDiffEntry(new Runnable() { - public void run() { - list.addAll(Arrays.asList(new Object[] { element })); - } - }, "List.addAll(Collection)", list, element, 0); - } - - public void testAddAllAtIndex_ChangeEvent() throws Exception { - assertChangeEventFired(new Runnable() { - public void run() { - list.addAll(0, Arrays.asList(new Object[] { delegate - .createElement(list) })); - } - }, "List.addAll(int, Collection)", list); - } - - public void testAddAllAtIndex_ListChangeEvent() throws Exception { - assertListChangeEventFired(new Runnable() { - public void run() { - list.addAll(0, Arrays.asList(new Object[] { delegate - .createElement(list) })); - } - }, "List.addAll(int, Collection)", list); - } - - public void testAddAllAtIndex_ChangeEventFiredAfterElementIsAdded() - throws Exception { - final Object element = delegate.createElement(list); - - assertContainsDuringChangeEvent(new Runnable() { - public void run() { - list.addAll(0, Arrays.asList(new Object[] { element })); - } - }, "List.addAll(int, Collection)", list, element); - } - - public void testAddAllAtIndex_ListDiffEntry() throws Exception { - list.add(delegate.createElement(list)); - final Object element = delegate.createElement(list); - - assertAddDiffEntry(new Runnable() { - public void run() { - list.addAll(1, Arrays.asList(new Object[] { element })); - } - }, "List.addAll(int, Collection)", list, element, 1); - } - - public void testSet_ChangeEvent() throws Exception { - list.add(delegate.createElement(list)); - - assertChangeEventFired(new Runnable() { - public void run() { - list.set(0, delegate.createElement(list)); - } - }, "List.set(int, Object)", list); - } - - public void testSet_ListChangeEvent() throws Exception { - list.add(delegate.createElement(list)); - - assertListChangeEventFired(new Runnable() { - public void run() { - list.set(0, delegate.createElement(list)); - } - }, "List.set(int, Object)", list); - } - - public void testSet_ChangeEventFiredAfterElementIsSet() throws Exception { - Object element1 = delegate.createElement(list); - list.add(element1); - final Object element2 = delegate.createElement(list); - - assertContainsDuringChangeEvent(new Runnable() { - public void run() { - list.set(0, element2); - } - }, "List.set(int, Object)", list, element2); - } - - public void testSet_ListDiffEntry() throws Exception { - list.add(delegate.createElement(list)); - Object oldElement = delegate.createElement(list); - list.add(oldElement); - - ListChangeEventTracker listener = ListChangeEventTracker.observe(list); - - Object newElement = delegate.createElement(list); - list.set(1, newElement); - - ListDiffEntry[] entries = listener.event.diff.getDifferences(); - assertEquals( - "List.set(int, Object) should result in 2 list diff entries.", - 2, entries.length); - - ListDiffEntry add = null; - ListDiffEntry remove = null; - - if (entries[0].isAddition() && !entries[1].isAddition()) { - add = entries[0]; - remove = entries[1]; - } else if (!entries[0].isAddition() && entries[1].isAddition()) { - add = entries[1]; - remove = entries[0]; - } else { - fail("List.set(int, Object) should result in an add and a remove entry."); - } - - assertEquals( - "List.set(int, Object) removed element should be the old element.", - oldElement, remove.getElement()); - assertEquals( - "List.set(int, Object) removed index should be the index the new element was set at.", - 1, remove.getPosition()); - - assertEquals( - "List.set(int, Object) added element should be the set element.", - newElement, add.getElement()); - assertEquals( - "List.set(int, Object) add index should be the index the new element was set at.", - 1, add.getPosition()); - } - - public void testRemove_ListChangeEvent() throws Exception { - final Object element = delegate.createElement(list); - list.add(element); - - assertListChangeEventFired(new Runnable() { - public void run() { - list.remove(element); - } - }, "List.remove(Object)", list); - } - - public void testRemove_ListDiffEntry() throws Exception { - list.add(delegate.createElement(list)); - final Object element = delegate.createElement(list); - list.add(element); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - list.remove(element); - } - }, "List.remove(Object)", list, element, 1); - } - - public void testRemoveAtIndex_ChangeEvent() throws Exception { - list.add(delegate.createElement(list)); - - assertChangeEventFired(new Runnable() { - public void run() { - list.remove(0); - } - }, "List.remove(int)", list); - } - - public void testRemoveAtIndex_ListChangeEvent() throws Exception { - list.add(delegate.createElement(list)); - - assertListChangeEventFired(new Runnable() { - public void run() { - list.remove(0); - } - }, "List.remove(int)", list); - } - - public void testRemoveAtIndex_ChangeEventFiredAfterElementIsRemoved() - throws Exception { - final Object element = delegate.createElement(list); - list.add(element); - - assertDoesNotContainDuringChangeEvent(new Runnable() { - public void run() { - list.remove(0); - } - }, "List.remove(int)", list, element); - } - - public void testRemoveAtIndex_ListDiffEntry() throws Exception { - list.add(delegate.createElement(list)); - Object element = delegate.createElement(list); - list.add(element); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - list.remove(1); - } - }, "List.remove(int)", list, element, 1); - } - - public void testRemoveAll_ListChangeEvent() throws Exception { - final Object element = delegate.createElement(list); - - assertListChangeEventFired(new Runnable() { - public void run() { - list.removeAll(Arrays.asList(new Object[] { element })); - } - }, "List.removeAll(Collection)", list); - } - - public void testRemoveAll_ListDiffEntry() throws Exception { - final Object element = delegate.createElement(list); - list.add(element); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - list.removeAll(Arrays.asList(new Object[] { element })); - } - }, "List.removeAll(Collection)", list, element, 0); - } - - public void testRetainAll_ListChangeEvent() throws Exception { - final Object element1 = delegate.createElement(list); - list.add(element1); - list.add(delegate.createElement(list)); - - assertListChangeEventFired(new Runnable() { - public void run() { - list.retainAll(Arrays.asList(new Object[] { element1 })); - } - }, "List.retainAll(Collection", list); - } - - public void testRetainAll_ListDiffEntry() throws Exception { - final Object element1 = delegate.createElement(list); - list.add(element1); - Object element2 = delegate.createElement(list); - list.add(delegate.createElement(list)); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - list.retainAll(Arrays.asList(new Object[] { element1 })); - } - }, "List.retainAll(Collection)", list, element2, 1); - } - - public void testClear_ListChangeEvent() throws Exception { - list.add(delegate.createElement(list)); - - assertListChangeEventFired(new Runnable() { - public void run() { - list.clear(); - } - }, "List.clear()", list); - } - - public void testClear_ListDiffEntry() throws Exception { - Object element = delegate.createElement(list); - list.add(element); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - list.clear(); - } - }, "List.clear()", list, element, 0); - } - - /** - * Asserts standard behaviors of firing list change events. - * <ul> - * <li>Event fires once.</li> - * <li>Source of the event is the provided <code>list</code>. - * <li>The list change event is fired after the change event.</li> - * </ul> - * - * @param runnable - * @param methodName - * @param list - */ - private void assertListChangeEventFired(Runnable runnable, - String methodName, IObservableList list) { - List queue = new ArrayList(); - ListChangeEventTracker listListener = new ListChangeEventTracker(queue); - ChangeEventTracker changeListener = new ChangeEventTracker(queue); - - list.addListChangeListener(listListener); - list.addChangeListener(changeListener); - - runnable.run(); - - assertEquals(formatFail(methodName + " should fire one ListChangeEvent."), 1, - listListener.count); - assertEquals(formatFail(methodName - + "'s change event observable should be the created List."), - list, listListener.event.getObservable()); - - assertEquals(formatFail("Two notifications should have been received."), 2, queue - .size()); - assertEquals("ChangeEvent of " + methodName - + " should have fired before the ListChangeEvent.", - changeListener, queue.get(0)); - assertEquals("ListChangeEvent of " + methodName - + " should have fired after the ChangeEvent.", listListener, - queue.get(1)); - } - - /** - * Asserts the list diff entry for a remove operation. - * - * @param runnable - * @param methodName - * @param list - * @param element - * @param index - */ - private void assertRemoveDiffEntry(Runnable runnable, String methodName, - IObservableList list, Object element, int index) { - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - runnable.run(); - - ListDiffEntry[] entries = listener.event.diff.getDifferences(); - assertEquals(methodName + " should result in one diff entry.", 1, - entries.length); - - ListDiffEntry entry = entries[0]; - assertFalse(methodName - + " should result in a diff entry that is an removal.", entry - .isAddition()); - assertEquals(methodName - + " remove diff entry should have removed the element.", - element, entry.getElement()); - assertEquals( - methodName - + " remove diff entry should have removed the element from the provided index.", - index, entry.getPosition()); - } - - /** - * Asserts the list diff entry for an add operation. - * - * @param runnable - * @param methodName - * @param list - * @param element - * @param index - */ - private void assertAddDiffEntry(Runnable runnable, String methodName, - IObservableList list, Object element, int index) { - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - runnable.run(); - - ListDiffEntry[] entries = listener.event.diff.getDifferences(); - assertEquals(methodName + " should result in one diff entry.", 1, - entries.length); - - ListDiffEntry entry = entries[0]; - assertTrue(methodName - + " should result in a diff entry that is an addition.", entry - .isAddition()); - assertEquals(methodName - + " add diff entry should have added the element.", element, - entry.getElement()); - assertEquals( - methodName - + "add diff entry should have added the element at the provided index.", - index, entry.getPosition()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableSetContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableSetContractTest.java deleted file mode 100644 index 0705a755..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableSetContractTest.java +++ /dev/null @@ -1,266 +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.databinding.conformance; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.jface.databinding.conformance.delegate.IObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.SetChangeEventTracker; - -/** - */ -public class MutableObservableSetContractTest extends - MutableObservableCollectionContractTest { - private IObservableCollectionContractDelegate delegate; - - private IObservableSet set; - - public MutableObservableSetContractTest(String testName, - IObservableCollectionContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - /** - * @param delegate - */ - public MutableObservableSetContractTest( - IObservableCollectionContractDelegate delegate) { - super(delegate); - } - - protected void setUp() throws Exception { - super.setUp(); - set = (IObservableSet) getObservable(); - } - - public void testAdd_SetChangeEvent() throws Exception { - assertSetChangeEventFired(new Runnable() { - public void run() { - set.add(delegate.createElement(set)); - } - }, "Set.add(Object)", set); - } - - public void testAdd_SetDiffEntry() throws Exception { - set.add(delegate.createElement(set)); - final Object element = delegate.createElement(set); - - assertAddDiffEntry(new Runnable() { - public void run() { - set.add(element); - } - }, "Set.add(Object)", set, element); - } - - public void testAddAll_SetChangeEvent() throws Exception { - assertSetChangeEventFired(new Runnable() { - public void run() { - set.addAll(Arrays.asList(new Object[] { delegate - .createElement(set) })); - } - }, "Set.addAll(Collection", set); - } - - public void testAddAll_SetDiffEntry() throws Exception { - final Object element = delegate.createElement(set); - - assertAddDiffEntry(new Runnable() { - public void run() { - set.addAll(Arrays.asList(new Object[] { element })); - } - }, "Set.addAll(Collection)", set, element); - } - - public void testRemove_SetChangeEvent() throws Exception { - final Object element = delegate.createElement(set); - set.add(element); - - assertSetChangeEventFired(new Runnable() { - public void run() { - set.remove(element); - } - }, "Set.remove(Object)", set); - } - - public void testRemove_SetDiffEntry() throws Exception { - set.add(delegate.createElement(set)); - final Object element = delegate.createElement(set); - set.add(element); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - set.remove(element); - } - }, "Set.remove(Object)", set, element); - } - - public void testRemoveAll_SetChangeEvent() throws Exception { - final Object element = delegate.createElement(set); - set.add(element); - - assertSetChangeEventFired(new Runnable() { - public void run() { - set.removeAll(Arrays.asList(new Object[] { element })); - } - }, "Set.removeAll(Collection)", set); - } - - public void testRemoveAll_SetDiffEntry() throws Exception { - final Object element = delegate.createElement(set); - set.add(element); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - set.removeAll(Arrays.asList(new Object[] { element })); - } - }, "Set.removeAll(Collection)", set, element); - } - - public void testRetainAll_SetChangeEvent() throws Exception { - final Object element1 = delegate.createElement(set); - set.add(element1); - set.add(delegate.createElement(set)); - - assertSetChangeEventFired(new Runnable() { - public void run() { - set.retainAll(Arrays.asList(new Object[] { element1 })); - } - }, "Set.retainAll(Collection", set); - } - - public void testRetainAll_SetDiffEntry() throws Exception { - final Object element1 = delegate.createElement(set); - set.add(element1); - Object element2 = delegate.createElement(set); - set.add(delegate.createElement(set)); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - set.retainAll(Arrays.asList(new Object[] { element1 })); - } - }, "Set.retainAll(Collection)", set, element2); - } - - public void testClear_SetChangeEvent() throws Exception { - set.add(delegate.createElement(set)); - - assertSetChangeEventFired(new Runnable() { - public void run() { - set.clear(); - } - }, "Set.clear()", set); - } - - public void testClear_SetDiffEntry() throws Exception { - Object element = delegate.createElement(set); - set.add(element); - - assertRemoveDiffEntry(new Runnable() { - public void run() { - set.clear(); - } - }, "Set.clear()", set, element); - } - - /** - * Asserts standard behaviors of firing set change events. - * <ul> - * <li>Event fires once.</li> - * <li>Source of the event is the provided <code>set</code>. - * <li>The set change event is fired after the change event.</li> - * </ul> - * - * @param runnable - * @param methodName - * @param set - */ - private void assertSetChangeEventFired(Runnable runnable, - String methodName, IObservableSet set) { - List queue = new ArrayList(); - SetChangeEventTracker setListener = new SetChangeEventTracker(queue); - ChangeEventTracker changeListener = new ChangeEventTracker(queue); - - set.addSetChangeListener(setListener); - set.addChangeListener(changeListener); - - runnable.run(); - - assertEquals(formatFail(methodName + " should fire one SetChangeEvent."), 1, - setListener.count); - assertEquals(formatFail(methodName - + "'s change event observable should be the created Set."), set, - setListener.event.getObservable()); - - assertEquals(formatFail("Two notifications should have been received."), 2, queue - .size()); - assertEquals(formatFail("ChangeEvent of " + methodName - + " should have fired before the SetChangeEvent."), - changeListener, queue.get(0)); - assertEquals(formatFail("SetChangeEvent of " + methodName - + " should have fired after the ChangeEvent."), setListener, - queue.get(1)); - } - - /** - * Asserts the set diff entry for an add operation. - * - * @param runnable - * @param methodName - * @param set - * @param element - */ - private void assertAddDiffEntry(Runnable runnable, String methodName, - IObservableSet set, Object element) { - SetChangeEventTracker listener = new SetChangeEventTracker(); - set.addSetChangeListener(listener); - - runnable.run(); - - Set entries = listener.event.diff.getAdditions(); - assertEquals(formatFail(methodName + " should result in one diff entry."), 1, - entries.size()); - - assertTrue(formatFail(methodName - + " should result in a diff entry that is an addition."), - entries.contains(element)); - } - - /** - * Asserts the set diff entry for a remove operation. - * - * @param runnable - * @param methodName - * @param set - * @param element - */ - private void assertRemoveDiffEntry(Runnable runnable, String methodName, - IObservableSet set, Object element) { - SetChangeEventTracker listener = new SetChangeEventTracker(); - set.addSetChangeListener(listener); - - runnable.run(); - - Set entries = listener.event.diff.getRemovals(); - assertEquals(formatFail(methodName + " should result in one diff entry."), 1, - entries.size()); - - assertTrue(formatFail(methodName - + " should result in a diff entry that is an addition."), - entries.contains(element)); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableValueContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableValueContractTest.java deleted file mode 100644 index cca61fed..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/MutableObservableValueContractTest.java +++ /dev/null @@ -1,104 +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.conformance; - -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.IObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; - -/** - * Mutability tests for IObservableValue. - * - * <p> - * This class is experimental and can change at any time. It is recommended to - * not subclass or assume the test names will not change. The only API that is - * guaranteed to not change are the constructors. The tests will remain public - * and not final in order to allow for consumers to turn off a test if needed by - * subclassing. - * </p> - * - * @since 3.2 - */ -public class MutableObservableValueContractTest extends - ObservableDelegateTest { - private IObservableValueContractDelegate delegate; - - private IObservableValue observable; - - /** - * @param delegate - */ - public MutableObservableValueContractTest( - IObservableValueContractDelegate delegate) { - this(null, delegate); - } - - public MutableObservableValueContractTest(String testName, - IObservableValueContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - protected void setUp() throws Exception { - super.setUp(); - - this.observable = (IObservableValue) getObservable(); - } - - public void testSetValue_SetsValue() throws Exception { - Object value = delegate.createValue(observable); - - observable.setValue(value); - assertEquals(formatFail("IObservableValue.setValue(Object) should set the value of the observable."), value, observable.getValue()); - } - - public void testSetValue_ChangeEvent() throws Exception { - ChangeEventTracker listener = ChangeEventTracker.observe(observable); - - observable.setValue(delegate.createValue(observable)); - - assertEquals(formatFail("Change event listeners were not notified"), 1, listener.count); - assertEquals(formatFail("IObservableValue.setValue(Object) should fire one ChangeEvent."), 1, - listener.count); - assertEquals( - formatFail("IObservableValue.setValue(Object)'s change event observable should be the created observable."), - observable, listener.event.getObservable()); - } - - public void testSetValue_SameValue() throws Exception { - // invoke change to ensure observable has a value - delegate.change(observable); - - ValueChangeEventTracker valueChangeListener = ValueChangeEventTracker.observe(observable); - ChangeEventTracker changeListener = ChangeEventTracker.observe(observable); - Object value = observable.getValue(); - observable.setValue(value); - - assertEquals( - formatFail("IObservableValue.setValue() should not fire a value change event when the value has not change."), - 0, valueChangeListener.count); - assertEquals( - formatFail("IObservableValue.setValue() should not fire a change event when the value has not change."), - 0, changeListener.count); - } - - public void testSetValue_RealmChecks() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - observable.setValue(delegate.createValue(observable)); - } - }, (CurrentRealm) observable.getRealm()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableCollectionContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableCollectionContractTest.java deleted file mode 100644 index 1d3391af..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableCollectionContractTest.java +++ /dev/null @@ -1,208 +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.conformance; - -import java.util.Arrays; - -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.jface.databinding.conformance.delegate.IObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * Tests for IObservableCollection that don't mutate the collection. - * <p> - * This class is experimental and can change at any time. It is recommended to - * not subclass or assume the test names will not change. The only API that is - * guaranteed to not change are the constructors. The tests will remain public - * and not final in order to allow for consumers to turn off a test if needed by - * subclassing. - * </p> - * - * @since 3.2 - */ -public class ObservableCollectionContractTest extends ObservableContractTest { - private IObservableCollectionContractDelegate delegate; - - private IObservableCollection collection; - - public ObservableCollectionContractTest( - IObservableCollectionContractDelegate delegate) { - super(delegate); - this.delegate = delegate; - } - - public ObservableCollectionContractTest(String testName, - IObservableCollectionContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - protected void setUp() throws Exception { - super.setUp(); - - collection = (IObservableCollection) getObservable(); - } - - public void testIterator_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.iterator(); - } - }, "Collection.iterator()", collection); - } - - public void testIterator_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.iterator(); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testSize_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.size(); - } - }, "Collection.size()", collection); - } - - public void testSize_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.size(); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testIsEmpty_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.isEmpty(); - } - }, "Collection.isEmpty()", collection); - } - - public void testIsEmpty_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.isEmpty(); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testContains_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.contains(delegate.createElement(collection)); - } - }, "Collection.contains(...)", collection); - } - - public void testContains_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.contains(delegate.createElement(collection)); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testContainsAll_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.containsAll(Arrays.asList(new Object[] { delegate - .createElement(collection) })); - } - }, "Collection.containsAll(Collection)", collection); - } - - public void testContainsAll_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.containsAll(Arrays.asList(new Object[] { delegate - .createElement(collection) })); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testToArray_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.toArray(); - } - }, "Collection.toArray()", collection); - } - - public void testToArray_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.toArray(); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testToArrayWithObjectArray_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.toArray(new Object[collection.size()]); - } - }, "Collection.toArray(Object[])", collection); - } - - public void testToArrayWithObjectArray_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.toArray(new Object[collection.size()]); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testEquals_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.equals(collection); - } - }, "Collection.equals(Object)", collection); - } - - public void testEquals_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.equals(collection); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testHashCode_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - collection.hashCode(); - } - }, "Collection.hashCode()", collection); - } - - public void testHashCode_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - collection.hashCode(); - } - }, (CurrentRealm) collection.getRealm()); - } - - public void testGetElementType_ReturnsType() throws Exception { - assertEquals( - "Element type of the collection should be returned from IObservableCollection.getElementType()", - delegate.getElementType(collection), collection - .getElementType()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableContractTest.java deleted file mode 100644 index e847b2aa..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableContractTest.java +++ /dev/null @@ -1,192 +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.databinding.conformance; - -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.Realm; -import org.eclipse.jface.databinding.conformance.delegate.IObservableContractDelegate; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * Tests for IObservable that don't require mutating the observable. - * <p> - * This class is experimental and can change at any time. It is recommended to - * not subclass or assume the test names will not change. The only API that is - * guaranteed to not change are the constructors. The tests will remain public - * and not final in order to allow for consumers to turn off a test if needed by - * subclassing. - * </p> - * - * @since 3.2 - */ -public class ObservableContractTest extends ObservableDelegateTest { - private IObservable observable; - - private IObservableContractDelegate delegate; - - public ObservableContractTest(IObservableContractDelegate delegate) { - this(null, delegate); - } - - public ObservableContractTest(String testName, - IObservableContractDelegate delegate) { - super(testName, delegate); - - this.delegate = delegate; - } - - protected void setUp() throws Exception { - super.setUp(); - observable = getObservable(); - } - - public void testGetRealm_NotNull() throws Exception { - assertNotNull(formatFail("The observable's realm should not be null."), observable - .getRealm()); - } - - public void testChange_ChangeEvent() throws Exception { - ChangeListener listener = new ChangeListener(); - - observable.addChangeListener(listener); - delegate.change(observable); - - assertEquals( - formatFail("A change in the observable should notify change listeners."), - listener.count, 1); - } - - public void testChange_EventObservable() throws Exception { - ChangeListener listener = new ChangeListener(); - - observable.addChangeListener(listener); - delegate.change(observable); - - ChangeEvent event = listener.event; - assertNotNull(formatFail("change event was null"), event); - - assertSame( - formatFail("In the change event the source of the change should be the observable."), - observable, event.getObservable()); - } - - public void testChange_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - delegate.change(observable); - } - }, (CurrentRealm) observable.getRealm()); - } - - public void testChange_ObservableRealmIsTheCurrentRealm() throws Exception { - ChangeListener listener = new ChangeListener(); - observable.addChangeListener(listener); - - delegate.change(observable); - assertTrue( - formatFail("On change the current realm should be the realm of the observable."), - listener.isCurrentRealm); - } - - public void testRemoveChangeListener_RemovesListener() throws Exception { - ChangeListener listener = new ChangeListener(); - - observable.addChangeListener(listener); - delegate.change(observable); - - // precondition check - assertEquals(formatFail("change did not notify listeners"), 1, listener.count); - - observable.removeChangeListener(listener); - delegate.change(observable); - - assertEquals( - formatFail("When a change listener is removed it should not still receive change events."), - 1, listener.count); - } - - public void testIsStale_NotStale() throws Exception { - delegate.setStale(observable, false); - assertFalse( - formatFail("When an observable is not stale isStale() should return false."), - observable.isStale()); - } - - public void testIsStale_RealmChecks() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - delegate.change(observable); - } - }, (CurrentRealm) observable.getRealm()); - } - - public void testDispose_RemovesListeners() throws Exception { - ChangeListener disposedObservableListener = new ChangeListener(); - Realm realm = observable.getRealm(); - - observable.addChangeListener(disposedObservableListener); - observable.dispose(); - - //create a new observable to fire a change from - observable = delegate.createObservable(realm); - delegate.change(observable); - - assertEquals( - formatFail("After being disposed listeners should not receive change events."), - 0, disposedObservableListener.count); - } - - /** - * Asserts that ObservableTracker.getterCalled(...) is invoked when the - * provided <code>runnable</code> is invoked. - * - * @param runnable - * @param methodName - * method name to display when displaying a message - * @param observable - * observable that should be collected by ObservableTracker - */ - protected void assertGetterCalled(Runnable runnable, - String methodName, IObservable observable) { - IObservable[] observables = ObservableTracker.runAndMonitor(runnable, - null, null); - - int count = 0; - for (int i = 0; i < observables.length; i++) { - if (observables[i] == observable) { - count++; - } - } - - assertEquals(formatFail(methodName - + " should invoke ObservableTracker.getterCalled() once."), 1, - count); - } - - /* package */static class ChangeListener implements IChangeListener { - int count; - - ChangeEvent event; - - boolean isCurrentRealm; - - public void handleChange(ChangeEvent event) { - count++; - this.event = event; - this.isCurrentRealm = event.getObservable().getRealm().isCurrent(); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableDelegateTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableDelegateTest.java deleted file mode 100644 index 37b6cfe6..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableDelegateTest.java +++ /dev/null @@ -1,107 +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.conformance; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.jface.databinding.conformance.delegate.IObservableContractDelegate; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * TestCase that provides the standard behavior expected for delegating test cases. - * - * @since 3.2 - */ -public class ObservableDelegateTest extends TestCase { - private IObservableContractDelegate delegate; - - private Realm previousRealm; - - private IObservable observable; - private String debugInfo; - - public ObservableDelegateTest(IObservableContractDelegate delegate) { - this(null, delegate); - } - - public ObservableDelegateTest(String testName, IObservableContractDelegate delegate) { - super(testName); - this.delegate = delegate; - } - - protected void setUp() throws Exception { - super.setUp(); - previousRealm = Realm.getDefault(); - - delegate.setUp(); - observable = doCreateObservable(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - - delegate.tearDown(); - observable.dispose(); - observable = null; - - RealmTester.setDefault(previousRealm); - - observable = null; - previousRealm = null; - } - - /** - * Creates a new observable with a default realm. Invoked from - * {@link #setUp()}. Override to customize the creation of observables - * (e.g. specifying a different Realm). - * - * @return observable - */ - protected IObservable doCreateObservable() { - return delegate.createObservable(new CurrentRealm(true)); - } - - /** - * Returns the created observable. The observable is created in - * {@link #setUp()}. If invoked before {@link #setUp()} will be - * <code>null</code>. - * - * @return observable - */ - protected IObservable getObservable() { - return observable; - } - - /** - * Returns the delegate in use. - * - * @return delegate - */ - protected IObservableContractDelegate getObservableContractDelegate() { - return delegate; - } - - protected String formatFail(String message) { - return message + getDebugString(); - } - - private String getDebugString() { - if (debugInfo == null) { - debugInfo = "(Test: " + this.getClass().getName() + ", Delegate: " + delegate.getClass().getName() + ")"; - } - - return debugInfo; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableListContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableListContractTest.java deleted file mode 100644 index 6bbe40d5..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableListContractTest.java +++ /dev/null @@ -1,109 +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.conformance; - -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.jface.databinding.conformance.delegate.IObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; - -/** - * Tests for IObservableList that don't require mutating the collection. - * <p> - * This class is experimental and can change at any time. It is recommended to - * not subclass or assume the test names will not change. The only API that is - * guaranteed to not change are the constructors. The tests will remain public - * and not final in order to allow for consumers to turn off a test if needed by - * subclassing. - * </p> - * - * @since 3.2 - */ -public class ObservableListContractTest extends - ObservableCollectionContractTest { - private IObservableList list; - - private IObservableCollectionContractDelegate delegate; - - /** - * @param delegate - */ - public ObservableListContractTest( - IObservableCollectionContractDelegate delegate) { - super(delegate); - this.delegate = delegate; - } - - public ObservableListContractTest(String testName, - IObservableCollectionContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - protected void setUp() throws Exception { - super.setUp(); - - list = (IObservableList) getObservable(); - } - - public void testListIterator_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - list.listIterator(); - } - }, "List.listIterator()", list); - } - - public void testGet_GetterCalled() throws Exception { - list = (IObservableList) delegate.createObservableCollection(new CurrentRealm(true), 1); - assertGetterCalled(new Runnable() { - public void run() { - list.get(0); - } - }, "List.get(int)", list); - } - - public void testIndexOf_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - list.indexOf(delegate.createElement(list)); - } - }, "List.indexOf(int)", list); - } - - public void testLastIndexOf_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - list.lastIndexOf(delegate.createElement(list)); - } - }, "List.lastIndexOf(Object)", list); - } - - public void testListIteratorAtIndex_GetterCalled() throws Exception { - // Create a new list instead of adding an item because the list might - // not be mutable - list = (IObservableList) delegate.createObservableCollection(new CurrentRealm(true), 1); - assertGetterCalled(new Runnable() { - public void run() { - list.listIterator(0); - } - }, "List.listIterator(int)", list); - } - - public void testSubList_GetterCalled() throws Exception { - list = (IObservableList) delegate.createObservableCollection(new CurrentRealm(true), 1); - assertGetterCalled(new Runnable() { - public void run() { - list.subList(0, 1); - } - }, "List.subList(int, int)", list); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableStaleContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableStaleContractTest.java deleted file mode 100644 index dd109ed2..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableStaleContractTest.java +++ /dev/null @@ -1,149 +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.databinding.conformance; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IStaleListener; -import org.eclipse.core.databinding.observable.StaleEvent; -import org.eclipse.jface.databinding.conformance.delegate.IObservableContractDelegate; - -/** - * @since 3.3 - */ -public class ObservableStaleContractTest extends ObservableDelegateTest { - private IObservableContractDelegate delegate; - private IObservable observable; - - public ObservableStaleContractTest(IObservableContractDelegate delegate) { - this(null, delegate); - } - - public ObservableStaleContractTest(String testName, IObservableContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - protected void setUp() throws Exception { - super.setUp(); - - observable = getObservable(); - } - - public void testIsStale_TrueWhenStale() throws Exception { - delegate.setStale(observable, true); - assertTrue(formatFail("When stale isStale() should return true."), observable.isStale()); - } - - public void testIsStale_FalseWhenNotStale() throws Exception { - delegate.setStale(observable, false); - assertFalse(formatFail("When not stale isStale() should return false."), observable.isStale()); - } - - public void testBecomingStaleFiresStaleEvent() throws Exception { - StaleListener listener = new StaleListener(); - - // precondition - ensureStale(observable, false); - - observable.addStaleListener(listener); - delegate.setStale(observable, true); - - assertEquals(formatFail("When becoming stale listeners should be notified."), 1, listener.count); - } - - public void testStaleEventObservable() throws Exception { - StaleListener listener = new StaleListener(); - - // precondition - ensureStale(observable, false); - - observable.addStaleListener(listener); - delegate.setStale(observable, true); - - StaleEvent event = listener.event; - assertNotNull(formatFail("stale event was null"), event); - assertEquals(formatFail("When notifying listeners of becoming stale the observable should be the source of the event."), observable, - event.getObservable()); - } - - public void testRemoveStaleListener_RemovesListener() throws Exception { - StaleListener listener = new StaleListener(); - - observable.addStaleListener(listener); - ensureStale(observable, false); - delegate.setStale(observable, true); - - // precondition check - assertEquals(formatFail("set stale did not notify listeners"), 1, listener.count); - - observable.removeStaleListener(listener); - ensureStale(observable, false); - delegate.setStale(observable, true); - - assertEquals(formatFail("Once removed stale listeners should not be notified of becoming stale."), 1, - listener.count); - } - - public void testStaleListenersAreNotNotifiedWhenObservableIsNoLongerStale() - throws Exception { - ensureStale(observable, true); - - StaleListener listener = new StaleListener(); - observable.addStaleListener(listener); - delegate.setStale(observable, false); - - assertEquals(formatFail("Stale listeners should not be notified when the stale state changes from true to false."), 0, - listener.count); - } - - public void testObservableRealmIsCurrentOnStale() throws Exception { - ensureStale(observable, false); - - StaleListener listener = new StaleListener(); - observable.addStaleListener(listener); - delegate.setStale(observable, true); - - assertTrue(formatFail("When notifying listeners of becoming stale the observable's realm should be the current realm."), - listener.isCurrentRealm); - } - - /** - * Ensures that stale is set to the provided state. Will throw an - * AssertionFailedError if setting of the state is unsuccessful. - * - * @param observable - * @param stale - */ - private void ensureStale(IObservable observable, boolean stale) { - if (observable.isStale() != stale) { - delegate.setStale(observable, stale); - } - - assertEquals(stale, observable.isStale()); - } - - /* package */static class StaleListener implements IStaleListener { - int count; - - StaleEvent event; - - boolean isCurrentRealm; - - public void handleStale(StaleEvent staleEvent) { - count++; - this.event = staleEvent; - this.isCurrentRealm = staleEvent.getObservable().getRealm() - .isCurrent(); - } - } - -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableValueContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableValueContractTest.java deleted file mode 100644 index 3ce93148..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/ObservableValueContractTest.java +++ /dev/null @@ -1,170 +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.databinding.conformance; - -import java.util.ArrayList; -import java.util.List; - -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.observable.value.IValueChangeListener; -import org.eclipse.core.databinding.observable.value.ValueChangeEvent; -import org.eclipse.jface.databinding.conformance.delegate.IObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; - -/** - * @since 3.2 - */ -public class ObservableValueContractTest extends ObservableContractTest { - private IObservableValueContractDelegate delegate; - private IObservableValue observable; - - public ObservableValueContractTest(IObservableValueContractDelegate delegate) { - super(delegate); - this.delegate = delegate; - } - - /** - * @param testName - * @param delegate - */ - public ObservableValueContractTest(String testName, - IObservableValueContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.databinding.conformance.ObservableContractTest#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - observable = (IObservableValue) getObservable(); - } - - public void testChange_ValueChangeEvent() throws Exception { - ValueChangeEventTracker listener = ValueChangeEventTracker.observe(observable); - - delegate.change(observable); - assertEquals(formatFail("On change value change listeners should be notified."), 1, - listener.count); - } - - public void testGetValueType_ExpectedType() throws Exception { - assertEquals(formatFail("Type of the value should be returned from getType()."), - delegate.getValueType(observable), observable.getValueType()); - } - - public void testChange_OrderOfNotifications() throws Exception { - final List listeners = new ArrayList(); - IChangeListener changeListener = new IChangeListener() { - public void handleChange(ChangeEvent event) { - listeners.add(this); - } - }; - - IValueChangeListener valueChangeListener = new IValueChangeListener() { - public void handleValueChange(ValueChangeEvent event) { - listeners.add(this); - } - }; - - observable.addChangeListener(changeListener); - observable.addValueChangeListener(valueChangeListener); - - delegate.change(observable); - - assertTrue(formatFail("Change Listeners were not notified on change."), listeners.size() > 0); - - // not asserting the fact that both are notified as this is asserted in - // other tests - assertEquals( - formatFail("Change listeners should be notified before value change listeners."), - changeListener, listeners.get(0)); - assertEquals( - formatFail("Value change listeners should be notified after change listeners."), - valueChangeListener, listeners.get(1)); - } - - public void testChange_ValueChangeEventDiff() throws Exception { - ValueChangeEventTracker listener = ValueChangeEventTracker.observe(observable); - Object oldValue = observable.getValue(); - - delegate.change(observable); - - ValueChangeEvent event = listener.event; - - assertTrue(formatFail("Change Listeners were not notified on change."), listener.count > 0); - - assertEquals( - formatFail("When a value change event is fired the old value should be the previous value of the observable value."), - oldValue, event.diff.getOldValue()); - assertEquals( - formatFail("When a value change event is fired the new value should be the same as the current value of the observable value."), - observable.getValue(), event.diff.getNewValue()); - } - - public void testChange_ValueChangeEventFiredAfterValueIsSet() - throws Exception { - class ValueChangeListener implements IValueChangeListener { - Object value; - - public void handleValueChange(ValueChangeEvent event) { - this.value = event.getObservableValue().getValue(); - } - } - - ValueChangeListener listener = new ValueChangeListener(); - observable.addValueChangeListener(listener); - delegate.change(observable); - assertEquals( - formatFail("When a value change event is fired the new value should be applied before firing the change event."), - listener.value, observable.getValue()); - } - - public void testRemoveValueChangeListener_RemovesListener() throws Exception { - ValueChangeEventTracker listener = ValueChangeEventTracker.observe(observable); - delegate.change(observable); - - // precondition - assertEquals(formatFail("Value change listeners should be notified on change."), 1, - listener.count); - - observable.removeValueChangeListener(listener); - delegate.change(observable); - - assertEquals( - formatFail("Value change listeners should not be notified after they've been removed from the observable."), - 1, listener.count); - } - - public void testGetValue_GetterCalled() throws Exception { - assertGetterCalled(new Runnable() { - public void run() { - observable.getValue(); - } - }, formatFail("IObservableValue.getValue()"), observable); - } - - public void testGetValue_RealmCheck() throws Exception { - RealmTester.exerciseCurrent(new Runnable() { - public void run() { - observable.getValue(); - } - }, (CurrentRealm) observable.getRealm()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableCollectionContractDelegate.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableCollectionContractDelegate.java deleted file mode 100644 index 5455d7f8..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableCollectionContractDelegate.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.databinding.conformance.delegate; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.Realm; - -/** - * Abstract implementation of {@link IObservableCollectionContractDelegate}. - * - * @since 3.2 - */ -public abstract class AbstractObservableCollectionContractDelegate extends - AbstractObservableContractDelegate implements - IObservableCollectionContractDelegate { - - /** - * Invokes {@link IObservableCollectionContractDelegate#createObservableCollection(Realm, int)}. - * @param realm - * @return observable - */ - public final IObservable createObservable(Realm realm) { - return createObservableCollection(realm, 0); - } - - public Object createElement(IObservableCollection collection) { - //no op - return null; - } - - public Object getElementType(IObservableCollection collection) { - //no op - return null; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableContractDelegate.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableContractDelegate.java deleted file mode 100644 index 81467602..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableContractDelegate.java +++ /dev/null @@ -1,39 +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.databinding.conformance.delegate; - -import org.eclipse.core.databinding.observable.IObservable; - -/** - * Abstract implementation of {@link IObservableContractDelegate}. - * - * @since 1.1 - */ -public abstract class AbstractObservableContractDelegate implements - IObservableContractDelegate { - - public void setUp() { - // no op - } - - public void tearDown() { - // no op - } - - public void change(IObservable observable) { - // no op - } - - public void setStale(IObservable observable, boolean stale) { - // no op - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableValueContractDelegate.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableValueContractDelegate.java deleted file mode 100644 index 6de2c2cd..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/AbstractObservableValueContractDelegate.java +++ /dev/null @@ -1,55 +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.databinding.conformance.delegate; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; - -/** - * Abstract implementation of {@link IObservableValueContractDelegate}. - * - * @since 1.1 - */ -public abstract class AbstractObservableValueContractDelegate extends - AbstractObservableContractDelegate implements - IObservableValueContractDelegate { - - /** - * Invokes {@link #createObservableValue(Realm)}. - * @param realm - * @return observable - */ - public final IObservable createObservable(Realm realm) { - return createObservableValue(realm); - } - - /** - * Default implementation returns <code>null</code>. - * @param observable - * @return value type - */ - public Object getValueType(IObservableValue observable) { - // no op - return null; - } - - /** - * Default implementation returns <code>null</code>. - * @param observable - * @return value - */ - public Object createValue(IObservableValue observable) { - //no op - return null; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableCollectionContractDelegate.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableCollectionContractDelegate.java deleted file mode 100644 index 5fb412c2..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableCollectionContractDelegate.java +++ /dev/null @@ -1,60 +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.conformance.delegate; - -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.Realm; - -/** - * Delegate interface for an IObservableCollection. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.1 - */ -public interface IObservableCollectionContractDelegate extends - IObservableContractDelegate { - /** - * Creates a new observable collection with the provided - * <code>elementCount</code>. - * - * @param realm realm of the collection - * @param elementCount - * number of elements to initialize the collection with - * - * @return new observable collection - */ - public IObservableCollection createObservableCollection(Realm realm, int elementCount); - - /** - * Creates a new element of the appropriate type for the provided - * <code>collection</code>. This element will be employed to assert the - * addition and removal of elements in the collection. - * - * @param collection - * @return valid element for the collection - */ - public Object createElement(IObservableCollection collection); - - /** - * Returns the expected type of the elements in the collection. - * - * @param collection - * @return element type - */ - public Object getElementType(IObservableCollection collection); -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableContractDelegate.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableContractDelegate.java deleted file mode 100644 index bcd59bbf..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableContractDelegate.java +++ /dev/null @@ -1,67 +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.databinding.conformance.delegate; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; - -/** - * Delegate interface for observables. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.1 - */ -public interface IObservableContractDelegate { - /** - * Notifies the delegate of the start of a test. - */ - public void setUp(); - - /** - * Notifies the delegate of the end of a test. - */ - public void tearDown(); - - /** - * Invokes an operation to set the stale state of the provided - * <code>observable</code>. - * - * @param observable - * @param stale - */ - public void setStale(IObservable observable, boolean stale); - - /** - * Creates a new observable. - * - * @param realm realm of the observable - * @return observable - */ - public IObservable createObservable(Realm realm); - - /** - * Invokes a change operation resulting in a change event being fired from - * the observable. The preferred approach is to change the observed object - * resulting in an observable event. There is no guaranteed as to the state - * of the observable when invoked. The observable could be disposed to - * assert the proper behavior of dispose. - * - * @param observable - */ - public void change(IObservable observable); -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableValueContractDelegate.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableValueContractDelegate.java deleted file mode 100644 index 873b0050..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/delegate/IObservableValueContractDelegate.java +++ /dev/null @@ -1,56 +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.databinding.conformance.delegate; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; - -/** - * Delegate interface for an observable value. - * - * <p> - * This interface is not intended to be implemented by clients. Clients should - * instead subclass one of the classes that implement this interface. Note that - * direct implementers of this interface outside of the framework will be broken - * in future releases when methods are added to this interface. - * </p> - * - * @since 1.1 - */ -public interface IObservableValueContractDelegate extends - IObservableContractDelegate { - - /** - * Creates a new observable value. - * - * @param realm - * realm of the observable - * @return observable value - */ - public IObservableValue createObservableValue(Realm realm); - - /** - * Returns the expected type of the observable. - * - * @param observable - * @return type - */ - public Object getValueType(IObservableValue observable); - - /** - * Returns a valid value that is not the current value of the observable. - * - * @param observable - * @return value - */ - public Object createValue(IObservableValue observable); -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/swt/SWTMutableObservableValueContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/swt/SWTMutableObservableValueContractTest.java deleted file mode 100644 index 9c92d99e..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/swt/SWTMutableObservableValueContractTest.java +++ /dev/null @@ -1,68 +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.conformance.swt; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.jface.databinding.conformance.MutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.delegate.IObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.util.DelegatingRealm; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.swt.widgets.Display; - -/** - * Mutability tests for IObservableValue for a SWT widget. - * - * <p> - * This class is experimental and can change at any time. It is recommended to - * not subclass or assume the test names will not change. The only API that is - * guaranteed to not change are the constructors. The tests will remain public - * and not final in order to allow for consumers to turn off a test if needed by - * subclassing. - * </p> - * - * @since 3.2 - */ -public class SWTMutableObservableValueContractTest extends - MutableObservableValueContractTest { - private IObservableValueContractDelegate delegate; - - public SWTMutableObservableValueContractTest( - IObservableValueContractDelegate delegate) { - this(null, delegate); - } - - /** - * @param testName - * @param delegate - */ - public SWTMutableObservableValueContractTest(String testName, - IObservableValueContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - /** - * Creates a new observable passing the realm for the current display. - * @return observable - */ - protected IObservable doCreateObservable() { - Display display = Display.getCurrent(); - if (display == null) { - display = new Display(); - } - DelegatingRealm delegateRealm = new DelegatingRealm(SWTObservables - .getRealm(display)); - delegateRealm.setCurrent(true); - - return delegate.createObservable(delegateRealm); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/swt/SWTObservableValueContractTest.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/swt/SWTObservableValueContractTest.java deleted file mode 100644 index 3fbb93cf..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/swt/SWTObservableValueContractTest.java +++ /dev/null @@ -1,65 +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.conformance.swt; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.jface.databinding.conformance.ObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.delegate.IObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.util.DelegatingRealm; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.swt.widgets.Display; - -/** - * Tests for IObservableValue that don't mutate the value. - * <p> - * This class is experimental and can change at any time. It is recommended to - * not subclass or assume the test names will not change. The only API that is - * guaranteed to not change are the constructors. The tests will remain public - * and not final in order to allow for consumers to turn off a test if needed by - * subclassing. - * </p> - * - * @since 3.2 - */ -public class SWTObservableValueContractTest extends ObservableValueContractTest { - private IObservableValueContractDelegate delegate; - - /** - * @param delegate - */ - public SWTObservableValueContractTest( - IObservableValueContractDelegate delegate) { - this(null, delegate); - } - - public SWTObservableValueContractTest(String testName, - IObservableValueContractDelegate delegate) { - super(testName, delegate); - this.delegate = delegate; - } - - /** - * Creates a new observable passing the realm for the current display. - * @return observable - */ - protected IObservable doCreateObservable() { - Display display = Display.getCurrent(); - if (display == null) { - display = new Display(); - } - DelegatingRealm delegateRealm = new DelegatingRealm(SWTObservables - .getRealm(display)); - delegateRealm.setCurrent(true); - - return delegate.createObservable(delegateRealm); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ChangeEventTracker.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ChangeEventTracker.java deleted file mode 100644 index 7b440acf..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ChangeEventTracker.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.jface.databinding.conformance.util; - -import java.util.List; - -import org.eclipse.core.databinding.observable.ChangeEvent; -import org.eclipse.core.databinding.observable.IChangeListener; -import org.eclipse.core.databinding.observable.IObservable; - -/** - * Listener for tracking the firing of ChangeEvents. - */ -public class ChangeEventTracker implements IChangeListener { - public int count; - public ChangeEvent event; - - /** - * Queue that the listener will add itself too when it is notified of an - * event. Used to determine order of notifications of listeners. Can be null. - */ - public final List queue; - - public ChangeEventTracker() { - queue = null; - } - - public ChangeEventTracker(List notificationQueue) { - this.queue = notificationQueue; - } - - public void handleChange(ChangeEvent event) { - count++; - this.event = event; - if (queue != null) { - queue.add(this); - } - } - - /** - * Convenience method to register a new listener. - * - * @param observable - * @return tracker - */ - public static ChangeEventTracker observe(IObservable observable) { - ChangeEventTracker tracker = new ChangeEventTracker(); - observable.addChangeListener(tracker); - return tracker; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/CurrentRealm.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/CurrentRealm.java deleted file mode 100644 index 0e0e264c..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/CurrentRealm.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.jface.databinding.conformance.util; - -import org.eclipse.core.databinding.observable.Realm; - -/** - * Allows for the toggling of the current status of the realm. The - * asyncExec(...) implementations do nothing. - * - * @since 3.2 - */ -public 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) { - super.syncExec(runnable); - } - - public void asyncExec(Runnable runnable) { - throw new UnsupportedOperationException( - "CurrentRealm does not support asyncExec(Runnable)."); //$NON-NLS-1$ - } - - protected static Realm setDefault(Realm realm) { - return Realm.setDefault(realm); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/DelegatingRealm.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/DelegatingRealm.java deleted file mode 100644 index 49552f73..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/DelegatingRealm.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.jface.databinding.conformance.util; - -import org.eclipse.core.databinding.observable.Realm; - -/** - * Realm that will delegate to another for all operations except calls to - * {@link #isCurrent()}. The current status can be set by the consumer to - * enable testing of realm checks. - * - * @since 3.2 - */ -public class DelegatingRealm extends CurrentRealm { - private Realm realm; - - public DelegatingRealm(Realm realm) { - this.realm = realm; - } - - protected void syncExec(Runnable runnable) { - realm.exec(runnable); - } - - public void asyncExec(Runnable runnable) { - realm.asyncExec(runnable); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ListChangeEventTracker.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ListChangeEventTracker.java deleted file mode 100644 index 9396d8b4..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ListChangeEventTracker.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.jface.databinding.conformance.util; - -import java.util.List; - -import org.eclipse.core.databinding.observable.list.IListChangeListener; -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.list.ListChangeEvent; - -/** - * Listener for tracking the firing of ListChangeEvents. - */ -public class ListChangeEventTracker implements IListChangeListener { - public int count; - - public ListChangeEvent event; - - /** - * Queue that the listener will add itself too when it is notified of an - * event. Used to determine order of notifications of listeners. - */ - public final List listenerQueue; - - public ListChangeEventTracker() { - this(null); - } - - public ListChangeEventTracker(List listenerQueue) { - this.listenerQueue = listenerQueue; - } - - public void handleListChange(ListChangeEvent event) { - count++; - this.event = event; - if (listenerQueue != null) { - listenerQueue.add(this); - } - } - - /** - * Convenience method to register a new listener. - * - * @param observable - * @return tracker - */ - public static ListChangeEventTracker observe(IObservableList observable) { - ListChangeEventTracker tracker = new ListChangeEventTracker(); - observable.addListChangeListener(tracker); - return tracker; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/MapChangeEventTracker.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/MapChangeEventTracker.java deleted file mode 100644 index 86c15251..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/MapChangeEventTracker.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.jface.databinding.conformance.util; - -import java.util.List; - -import org.eclipse.core.databinding.observable.map.IMapChangeListener; -import org.eclipse.core.databinding.observable.map.IObservableMap; -import org.eclipse.core.databinding.observable.map.MapChangeEvent; - -/** - * Listener for tracking the firing of ChangeEvents. - */ -public class MapChangeEventTracker implements IMapChangeListener { - public int count; - - public MapChangeEvent event; - - public List queue; - - public MapChangeEventTracker() { - this(null); - } - - public MapChangeEventTracker(List queue) { - this.queue = queue; - } - - public void handleMapChange(MapChangeEvent event) { - count++; - this.event = event; - - if (queue != null) { - queue.add(this); - } - } - - /** - * Convenience method to register a new listener. - * - * @param observable - * @return tracker - */ - public static MapChangeEventTracker observe(IObservableMap observable) { - MapChangeEventTracker tracker = new MapChangeEventTracker(); - observable.addMapChangeListener(tracker); - return tracker; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/RealmTester.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/RealmTester.java deleted file mode 100644 index bae6b173..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/RealmTester.java +++ /dev/null @@ -1,106 +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.databinding.conformance.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); - } - } - - /** - * 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. - * - * @param runnable - * @param realm - */ - public static void exerciseCurrent(Runnable runnable, CurrentRealm realm) { - realm.setCurrent(true); - - try { - runnable.run(); - } catch (AssertionFailedException e) { - Assert.fail("Correct realm, exception should not have been thrown"); - } - - realm.setCurrent(false); - - try { - runnable.run(); - Assert.fail("Incorrect realm, exception should have been thrown"); - } catch (AssertionFailedException e) { - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/SetChangeEventTracker.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/SetChangeEventTracker.java deleted file mode 100644 index f18ab44b..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/SetChangeEventTracker.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.jface.databinding.conformance.util; - -import java.util.List; - -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.observable.set.ISetChangeListener; -import org.eclipse.core.databinding.observable.set.SetChangeEvent; - -public class SetChangeEventTracker implements ISetChangeListener { - public int count; - - public SetChangeEvent event; - - /** - * Queue that the listener will add itself too when it is notified of an - * event. Used to determine order of notifications of listeners. - */ - public final List listenerQueue; - - public SetChangeEventTracker() { - this(null); - } - - public SetChangeEventTracker(List notificationQueue) { - this.listenerQueue = notificationQueue; - } - - public void handleSetChange(SetChangeEvent event) { - count++; - this.event = event; - if (listenerQueue != null) { - listenerQueue.add(this); - } - } - - /** - * Convenience method to register a new listener. - * - * @param observable - * @return tracker - */ - public static SetChangeEventTracker observe(IObservableSet observable) { - SetChangeEventTracker tracker = new SetChangeEventTracker(); - observable.addSetChangeListener(tracker); - return tracker; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/SuiteBuilder.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/SuiteBuilder.java deleted file mode 100644 index cf9b02be..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/SuiteBuilder.java +++ /dev/null @@ -1,181 +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.databinding.conformance.util; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.util.Iterator; -import java.util.LinkedHashSet; - -import org.eclipse.jface.databinding.conformance.delegate.IObservableContractDelegate; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * Builds a test suite. - * - * @since 1.1 - */ -public class SuiteBuilder { - private LinkedHashSet content; - - public SuiteBuilder() { - content = new LinkedHashSet(); - } - - /** - * Adds all test methods from the provided <code>testCase</code> to the - * suite. - * - * @param testCase - * @return builder - */ - public SuiteBuilder addTests(Class testCase) { - content.add(testCase); - return this; - } - - /** - * Adds all test methods from the provided <code>testCase</code> with the - * provided <code>parameters</code>. A constructor must exist in the - * testCase that accepts a String as the first parameter followed by - * parameters matching the provided parameters. If an appropriate - * constructor is not found an exception will be thrown. - * - * @param testCase - * @param parameters - * @return builder - */ - public SuiteBuilder addParameterizedTests(Class testCase, - Object[] parameters) { - - Constructor constructor = findConstructor(testCase, parameters); - if (constructor == null) { - throw new IllegalArgumentException( - "The parameters provided don't match a constructor found in [" - + testCase.getName() + "]"); - } - - content.add(new ParameterizedTest(testCase, constructor, parameters)); - - return this; - } - - /** - * Convenience method for invoking - * {@link #addParameterizedTests(Class, Object[])} with a delegate. - * - * @param testCase - * @param delegate - * @return builder - */ - public SuiteBuilder addObservableContractTest(Class testCase, - IObservableContractDelegate delegate) { - - addParameterizedTests(testCase, new Object[] {delegate}); - return this; - } - - /** - * Builds a new TestSuite out of the tests. - * - * @return suite - */ - public TestSuite build() { - TestSuite suite = new TestSuite(); - - for (Iterator it = content.iterator(); it.hasNext();) { - Object o = it.next(); - if (o instanceof Class) { - suite.addTestSuite((Class) o); - } else if (o instanceof ParameterizedTest) { - ParameterizedTest test = (ParameterizedTest) o; - - Method[] methods = test.testClass.getMethods(); - for (int i = 0; i < methods.length; i++) { - String name = methods[i].getName(); - if (name.startsWith("test")) { - try { - suite.addTest((Test) test.constructor - .newInstance(toParamArray(name, - test.parameters))); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - } - } - - return suite; - } - - private Object[] toParamArray(String testName, Object[] parameters) { - Object[] result = new Object[parameters.length + 1]; - result[0] = testName; - System.arraycopy(parameters, 0, result, 1, parameters.length); - return result; - } - - /** - * Returns the constructor that has a String as the first parameters and - * then matches the type of the parameters. - * @param clazz - * @param parameters - * @return constructor - */ - private static Constructor findConstructor(Class clazz, Object[] parameters) { - Constructor[] constructors = clazz.getConstructors(); - int expectedParametersLength = parameters.length + 1; - - for (int i = 0; i < constructors.length; i++) { - Constructor constructor = constructors[i]; - Class[] types = constructor.getParameterTypes(); - - if (types.length != expectedParametersLength - || !String.class.equals(types[0])) { - continue; - } - - boolean skip = false; - for (int j = 1; j < types.length; j++) { - Class type = types[j]; - if (!type.isInstance(parameters[j - 1])) { - skip = true; - break; - } - } - - if (!skip) { - return constructor; - } - } - - return null; - } - - /* package */static class ParameterizedTest { - final Constructor constructor; - - final Object[] parameters; - - private Class testClass; - - ParameterizedTest(Class testClass, Constructor constructor, - Object[] parameterss) { - this.testClass = testClass; - this.constructor = constructor; - this.parameters = parameterss; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ValueChangeEventTracker.java b/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ValueChangeEventTracker.java deleted file mode 100644 index 36e34dad..00000000 --- a/tests/org.eclipse.jface.tests.databinding.conformance/src/org/eclipse/jface/databinding/conformance/util/ValueChangeEventTracker.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.jface.databinding.conformance.util; - -import java.util.List; - -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.core.databinding.observable.value.IValueChangeListener; -import org.eclipse.core.databinding.observable.value.ValueChangeEvent; - -/** - * Listener for tracking the firing of ValueChangeEvents. - */ -public class ValueChangeEventTracker implements IValueChangeListener { - public int count; - - public ValueChangeEvent event; - - public final List queue; - - public ValueChangeEventTracker() { - this(null); - } - - public ValueChangeEventTracker(List queue) { - this.queue = queue; - } - - public void handleValueChange(ValueChangeEvent event) { - count++; - this.event = event; - - if (queue != null) { - queue.add(this); - } - } - - /** - * Convenience method to register a new listener. - * - * @param observable - * @return tracker - */ - public static ValueChangeEventTracker observe(IObservableValue observable) { - ValueChangeEventTracker tracker = new ValueChangeEventTracker(); - observable.addValueChangeListener(tracker); - return tracker; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/.classpath b/tests/org.eclipse.jface.tests.databinding/.classpath deleted file mode 100644 index d512f63a..00000000 --- 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 ba077a40..00000000 --- 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 815de410..00000000 --- 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 3268699f..00000000 --- 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 846d8bfc..00000000 --- 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 630927bb..00000000 --- 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 1e0c63ed..00000000 --- a/tests/org.eclipse.jface.tests.databinding/JFace-Data Binding Test Suite.launch +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig"> -<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/> -<booleanAttribute key="askclear" value="false"/> -<booleanAttribute key="automaticAdd" value="true"/> -<booleanAttribute key="automaticValidate" value="false"/> -<stringAttribute key="bootstrap" value=""/> -<stringAttribute key="checked" value="[NONE]"/> -<booleanAttribute key="clearConfig" value="true"/> -<booleanAttribute key="clearws" value="true"/> -<booleanAttribute key="clearwslog" value="false"/> -<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> -<booleanAttribute key="default" value="true"/> -<booleanAttribute key="includeOptional" value="true"/> -<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="1"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> -<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> -<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jface.tests.databinding.BindingTestSuite"/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jface.tests.databinding"/> -<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> -<stringAttribute key="pde.version" value="3.3"/> -<stringAttribute key="product" value="org.eclipse.sdk.ide"/> -<stringAttribute key="templateConfig" value=""/> -<booleanAttribute key="tracing" value="false"/> -<booleanAttribute key="useDefaultConfig" value="true"/> -<booleanAttribute key="useDefaultConfigArea" value="false"/> -<booleanAttribute key="useProduct" value="false"/> -</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 28b2697f..00000000 --- a/tests/org.eclipse.jface.tests.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.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, - org.eclipse.jface.tests.databinding.conformance -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 46023304..00000000 --- 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 e671f5a5..00000000 --- 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 6f8acfcf..00000000 --- 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/AggregateValidationStatusTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/AggregateValidationStatusTest.java deleted file mode 100644 index 28d5b068..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/AggregateValidationStatusTest.java +++ /dev/null @@ -1,37 +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 org.eclipse.core.databinding.AggregateValidationStatus; -import org.eclipse.core.databinding.DataBindingContext; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; - -/** - * @since 1.1 - */ -public class AggregateValidationStatusTest extends AbstractSWTTestCase { - public void testAggregateValidationStatusValueType() throws Exception { - DataBindingContext dbc = new DataBindingContext(); - AggregateValidationStatus status = new AggregateValidationStatus(dbc - .getBindings(), AggregateValidationStatus.MAX_SEVERITY); - assertEquals(IStatus.class, status.getValueType()); - } - - public void testConstructor_DefaultRealm() throws Exception { - DataBindingContext dbc = new DataBindingContext(); - AggregateValidationStatus status = new AggregateValidationStatus(dbc - .getBindings(), AggregateValidationStatus.MAX_SEVERITY); - assertEquals(Realm.getDefault(), status.getRealm()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/DatabindingContextTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/DatabindingContextTest.java deleted file mode 100755 index 78f47c6f..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/DatabindingContextTest.java +++ /dev/null @@ -1,269 +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.core.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.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -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()); - } - - protected void assertNoErrorsFound() { - IStatus status = AggregateValidationStatus.getStatusMaxSeverity(dbc.getBindings()); - assertTrue("No errors should be found, but found " + status , status.isOK()); - } - - protected void assertErrorsFound() { - IStatus status = AggregateValidationStatus.getStatusMaxSeverity(dbc.getBindings()); - assertFalse("Errors should be found, but found none.", status.isOK()); - } - - 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/core/tests/databinding/ListBindingTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ListBindingTest.java deleted file mode 100755 index cf97ec1d..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ListBindingTest.java +++ /dev/null @@ -1,188 +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.core.tests.databinding; - -import java.util.ArrayList; -import java.util.Arrays; -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.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.BindingStatus; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - * @since 1.1 - */ -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()); - } - - public void testStatusIsInstanceOfBindingStatus() throws Exception { - Binding binding = dbc.bindList(target, model, null, null); - assertTrue(binding.getValidationStatus().getValue() instanceof BindingStatus); - } - - public void testAddValidationStatusContainsMultipleStatuses() throws Exception { - UpdateListStrategy strategy = new UpdateListStrategy() { - protected IStatus doAdd(IObservableList observableList, - Object element, int index) { - super.doAdd(observableList, element, index); - - switch (index) { - case 0: - return ValidationStatus.error(""); - case 1: - return ValidationStatus.info(""); - } - - return null; - } - }; - - Binding binding = dbc.bindList(target, model, strategy, null); - target.addAll(Arrays.asList(new String[] {"1", "2"})); - - IStatus status = (IStatus) binding.getValidationStatus().getValue(); - assertEquals("maximum status", IStatus.ERROR, status.getSeverity()); - assertTrue("multi status", status.isMultiStatus()); - - IStatus[] children = status.getChildren(); - assertEquals("multi status children", 2, children.length); - assertEquals("first status severity", IStatus.ERROR, children[0].getSeverity()); - assertEquals("second status severity", IStatus.INFO, children[1].getSeverity()); - } - - public void testRemoveValidationStatusContainsMultipleStatuses() throws Exception { - List items = Arrays.asList(new String[] {"1", "2"}); - model.addAll(items); - - UpdateListStrategy strategy = new UpdateListStrategy() { - int count; - /* (non-Javadoc) - * @see org.eclipse.core.databinding.UpdateListStrategy#doRemove(org.eclipse.core.databinding.observable.list.IObservableList, int) - */ - protected IStatus doRemove(IObservableList observableList, int index) { - super.doRemove(observableList, index); - - switch (count++) { - case 0: - return ValidationStatus.error(""); - case 1: - return ValidationStatus.info(""); - } - - return null; - } - }; - - Binding binding = dbc.bindList(target, model, strategy, null); - target.removeAll(items); - - IStatus status = (IStatus) binding.getValidationStatus().getValue(); - assertEquals("maximum status", IStatus.ERROR, status.getSeverity()); - assertTrue("multi status", status.isMultiStatus()); - - IStatus[] children = status.getChildren(); - assertEquals("multi status children", 2, children.length); - assertEquals("first status severity", IStatus.ERROR, children[0].getSeverity()); - assertEquals("second status severity", IStatus.INFO, children[1].getSeverity()); - } - - public void testAddOKValidationStatus() throws Exception { - Binding binding = dbc.bindList(target, model, null, null); - target.add("1"); - - IStatus status = (IStatus) binding.getValidationStatus().getValue(); - assertTrue(status.isOK()); - assertEquals(0, status.getChildren().length); - } - - public void testRemoveOKValidationStatus() throws Exception { - model.add("1"); - Binding binding = dbc.bindList(target, model, null, null); - - target.remove("1"); - IStatus status = (IStatus) binding.getValidationStatus().getValue(); - assertTrue(status.isOK()); - assertEquals(0, status.getChildren().length); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ObservablesManagerTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ObservablesManagerTest.java deleted file mode 100644 index a89461bd..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ObservablesManagerTest.java +++ /dev/null @@ -1,222 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Bob Smith 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: - * Bob Smith - initial API and implementation (bug 198880) - ******************************************************************************/ - -package org.eclipse.core.tests.databinding; - -import org.eclipse.core.databinding.DataBindingContext; -import org.eclipse.core.databinding.ObservablesManager; -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; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - * @since 3.2 - * - */ -public class ObservablesManagerTest 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 testOnlyModelIsDisposed() throws Exception { - - FlagOnDisposeObservableValue targetOv = new FlagOnDisposeObservableValue(); - FlagOnDisposeObservableValue modelOv = new FlagOnDisposeObservableValue(); - dbc.bindValue(targetOv, modelOv, null, null); - - ObservablesManager observablesManager = new ObservablesManager(); - - observablesManager.addObservablesFromContext(dbc, false, true); - observablesManager.dispose(); - - assertFalse(targetOv.disposeCalled); - assertTrue(modelOv.disposeCalled); - } - - public void testOnlyTargetIsDisposed() throws Exception { - - FlagOnDisposeObservableValue targetOv = new FlagOnDisposeObservableValue(); - FlagOnDisposeObservableValue modelOv = new FlagOnDisposeObservableValue(); - dbc.bindValue(targetOv, modelOv, null, null); - - ObservablesManager observablesManager = new ObservablesManager(); - - observablesManager.addObservablesFromContext(dbc, true, false); - observablesManager.dispose(); - - assertTrue(targetOv.disposeCalled); - assertFalse(modelOv.disposeCalled); - } - - public void testTargetAndModelIsDisposed() throws Exception { - - FlagOnDisposeObservableValue targetOv = new FlagOnDisposeObservableValue(); - FlagOnDisposeObservableValue modelOv = new FlagOnDisposeObservableValue(); - dbc.bindValue(targetOv, modelOv, null, null); - - ObservablesManager observablesManager = new ObservablesManager(); - - observablesManager.addObservablesFromContext(dbc, true, true); - observablesManager.dispose(); - - assertTrue(targetOv.disposeCalled); - assertTrue(modelOv.disposeCalled); - } - - private static class FlagOnDisposeObservableValue implements - IObservableValue { - - private boolean disposeCalled = false; - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.IObservableValue#addValueChangeListener(org.eclipse.core.databinding.observable.value.IValueChangeListener) - */ - public void addValueChangeListener(IValueChangeListener listener) { - // dummy - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.IObservableValue#getValue() - */ - public Object getValue() { - // dummy - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType() - */ - public Object getValueType() { - // dummy - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.IObservableValue#removeValueChangeListener(org.eclipse.core.databinding.observable.value.IValueChangeListener) - */ - public void removeValueChangeListener(IValueChangeListener listener) { - // dummy - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.value.IObservableValue#setValue(java.lang.Object) - */ - public void setValue(Object value) { - // dummy - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.IObservable#addChangeListener(org.eclipse.core.databinding.observable.IChangeListener) - */ - public void addChangeListener(IChangeListener listener) { - // dummy - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.IObservable#addStaleListener(org.eclipse.core.databinding.observable.IStaleListener) - */ - public void addStaleListener(IStaleListener listener) { - // dummy - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.IObservable#dispose() - */ - public void dispose() { - disposeCalled = true; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.IObservable#getRealm() - */ - public Realm getRealm() { - return Realm.getDefault(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.IObservable#isStale() - */ - public boolean isStale() { - // dummy - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.IObservable#removeChangeListener(org.eclipse.core.databinding.observable.IChangeListener) - */ - public void removeChangeListener(IChangeListener listener) { - // dummy - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.databinding.observable.IObservable#removeStaleListener(org.eclipse.core.databinding.observable.IStaleListener) - */ - public void removeStaleListener(IStaleListener listener) { - // dummy - - } - - } -} 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 351f668d..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateStrategyTest.java +++ /dev/null @@ -1,315 +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.BigDecimal; -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.IdentityConverter; -import org.eclipse.core.internal.databinding.conversion.IntegerToStringConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToBigDecimalConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToBigIntegerConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToByteConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToDoubleConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToFloatConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToIntegerConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToLongConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToShortConverter; -import org.eclipse.core.internal.databinding.conversion.StatusToStringConverter; -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.StringToCharacterConverter; -import org.eclipse.core.internal.databinding.conversion.StringToDateConverter; -import org.eclipse.core.internal.databinding.conversion.StringToShortConverter; -import org.eclipse.core.runtime.IStatus; -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, StringToByteConverter.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, StringToShortConverter.class); - } - - public void testDefaultConverterForByteToString() throws Exception { - assertDefaultConverter(Byte.class, String.class, IntegerToStringConverter.class); - } - - public void testDefaultConverterForBytePrimitiveToString() throws Exception { - assertDefaultConverter(Byte.TYPE, String.class, IntegerToStringConverter.class); - } - - public void testDefaultConverterForShortToString() throws Exception { - assertDefaultConverter(Short.class, String.class, IntegerToStringConverter.class); - } - - public void testDefaultConverterForShortPrimitiveToString() throws Exception { - assertDefaultConverter(Short.TYPE, String.class, IntegerToStringConverter.class); - } - - public void testDefaultConverterForStatusToString() throws Exception { - assertDefaultConverter(IStatus.class, String.class, StatusToStringConverter.class); - } - - - public void testDefaultConverterForNumberToByte() throws Exception { - assertFromNumberToNumberConverter(Byte.class, Byte.TYPE, - NumberToByteConverter.class); - } - - public void testDefaultConverterForNumberToShort() throws Exception { - assertFromNumberToNumberConverter(Short.class, Short.TYPE, - NumberToShortConverter.class); - } - - public void testDefaultConverterForNumberToShortPrimitive() - throws Exception { - assertFromNumberToNumberConverter(Short.TYPE, Short.class, - NumberToShortConverter.class); - } - - public void testDefaultConverterForNumberToInteger() throws Exception { - assertFromNumberToNumberConverter(Integer.class, Integer.TYPE, - NumberToIntegerConverter.class); - } - - public void testDefaultConverterForNumberToIntegerPrimitive() - throws Exception { - assertFromNumberToNumberConverter(Integer.TYPE, Integer.class, - NumberToIntegerConverter.class); - } - - public void testDefaultConverterForNumberToLong() throws Exception { - assertFromNumberToNumberConverter(Long.class, Long.TYPE, - NumberToLongConverter.class); - } - - public void testDefaultConverterForNumberToLongPrimitive() throws Exception { - assertFromNumberToNumberConverter(Long.TYPE, Long.class, - NumberToLongConverter.class); - } - - public void testDefaultConverterForNumberToFloat() throws Exception { - assertFromNumberToNumberConverter(Float.class, Float.TYPE, - NumberToFloatConverter.class); - } - - public void testDefaultConverterForNumberToFloatPrimitive() - throws Exception { - assertFromNumberToNumberConverter(Float.TYPE, Float.class, - NumberToFloatConverter.class); - } - - public void testDefaultConverterForNumberToDouble() throws Exception { - assertFromNumberToNumberConverter(Double.class, Double.TYPE, - NumberToDoubleConverter.class); - } - - public void testDefaultConverterForNumberToDoublePrimitive() - throws Exception { - assertFromNumberToNumberConverter(Double.TYPE, Double.class, - NumberToDoubleConverter.class); - } - - public void testDefaultConverterForNumberToBigInteger() throws Exception { - assertFromNumberToNumberConverter(BigInteger.class, null, - NumberToBigIntegerConverter.class); - } - - public void testDefaultConverterForNumberToBigDecimal() throws Exception { - assertFromNumberToNumberConverter(BigDecimal.class, null, - NumberToBigDecimalConverter.class); - } - - - private static Class[] primitiveNumberTypes = new Class[] { Byte.TYPE, - Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE }; - - private static Class[] boxedNumberTypes = new Class[] { Byte.class, - Short.class, Integer.class, Long.class, Float.class, Double.class, - BigInteger.class, BigDecimal.class }; - - private void assertFromNumberToNumberConverter(Class toType, - Class toCounterPrimitiveType, Class converterType) { - - for (int i = 0; i < primitiveNumberTypes.length; i++) { - Class primitiveType = primitiveNumberTypes[i]; - - if (!primitiveType.equals(toType) - && !primitiveType.equals(toCounterPrimitiveType)) { - assertDefaultConverter(primitiveType, toType, converterType); - } else if (!primitiveType.equals(toType)) { - assertDefaultConverter(primitiveType, toType, - IdentityConverter.class); - } - } - - for (int i = 0; i < boxedNumberTypes.length; i++) { - Class boxedType = boxedNumberTypes[i]; - - if (!boxedType.equals(toType) - && !boxedType.equals(toCounterPrimitiveType)) { - assertDefaultConverter(boxedType, toType, converterType); - } else if (!boxedType.equals(toType)) { - assertDefaultConverter(boxedType, toType, - IdentityConverter.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 should be instanceof " + converterType - + " but was instanceof " + converter.getClass(), 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 881b562f..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/UpdateValueStrategyTest.java +++ /dev/null @@ -1,170 +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.BigDecimal; -import java.math.BigInteger; -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.NumberToByteValidator; -import org.eclipse.core.internal.databinding.validation.NumberToDoubleValidator; -import org.eclipse.core.internal.databinding.validation.NumberToFloatValidator; -import org.eclipse.core.internal.databinding.validation.NumberToIntegerValidator; -import org.eclipse.core.internal.databinding.validation.NumberToLongValidator; -import org.eclipse.core.internal.databinding.validation.NumberToShortValidator; -import org.eclipse.core.internal.databinding.validation.NumberToUnboundedNumberValidator; -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 testDefaultValidatorForNumberToByte() throws Exception { - assertDefaultValidator(Integer.class, Byte.class, NumberToByteValidator.class); - } - - public void testDefaultValidatorForNumberToShort() throws Exception { - assertDefaultValidator(Integer.class, Short.class, NumberToShortValidator.class); - } - - public void testDefaultValidatorForNumberToInteger() throws Exception { - assertDefaultValidator(Short.class, Integer.class, NumberToIntegerValidator.class); - } - - public void testDefaultValidatorForNumberToLong() throws Exception { - assertDefaultValidator(Short.class, Long.class, NumberToLongValidator.class); - } - - public void testDefaultValidatorForNumberToFloat() throws Exception { - assertDefaultValidator(Short.class, Float.class, NumberToFloatValidator.class); - } - - public void testDefaultValidatorForNumberToDouble() throws Exception { - assertDefaultValidator(Short.class, Double.class, NumberToDoubleValidator.class); - } - - public void testDefaultValidatorForNumberToBigInteger() throws Exception { - assertDefaultValidator(Short.class, BigInteger.class, NumberToUnboundedNumberValidator.class); - } - - public void testDefaultValidatorForNumberToBigDecimal() throws Exception { - assertDefaultValidator(Short.class, BigDecimal.class, NumberToUnboundedNumberValidator.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/ValueBindingTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ValueBindingTest.java deleted file mode 100755 index 12d32cd8..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/ValueBindingTest.java +++ /dev/null @@ -1,279 +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.core.tests.databinding; - -import org.eclipse.core.databinding.Binding; -import org.eclipse.core.databinding.DataBindingContext; -import org.eclipse.core.databinding.UpdateValueStrategy; -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.ValueDiff; -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.internal.databinding.BindingStatus; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - * @since 1.1 - */ -public class ValueBindingTest extends AbstractDefaultRealmTestCase { - private WritableValue target; - - private WritableValue model; - - private DataBindingContext dbc; - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - target = WritableValue.withValueType(String.class); - model = WritableValue.withValueType(String.class); - dbc = new DataBindingContext(); - } - - /** - * 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"; - model.setValue(initialValue); - - assertFalse(model.getValue().equals(target.getValue())); - dbc.bindValue(target, model, null, null); - - assertEquals(target.getValue(), model.getValue()); - } - - public void testGetTarget() throws Exception { - Binding binding = dbc.bindValue(target, model, null, null); - - assertEquals(target, binding.getTarget()); - } - - public void testGetModel() throws Exception { - Binding binding = dbc.bindValue(target, model, null, null); - - assertEquals(model, binding.getModel()); - } - - public void testOKStatusInValidationUpdatesModel() throws Exception { - Binding binding = dbc.bindValue(target, model, null, null); - - String value = "value"; - assertFalse(value.equals(model.getValue())); - target.setValue(value); - - assertEquals("value copied to model", value, model.getValue()); - assertTrue(((IStatus) binding.getValidationStatus().getValue()).isOK()); - } - - public void testWarningStatusInValidationUpdatesModel() throws Exception { - Binding binding = dbc.bindValue(target, model, - new UpdateValueStrategy() - .setAfterGetValidator(warningValidator()), null); - - String value = "value"; - assertFalse(value.equals(model.getValue())); - target.setValue(value); - - assertEquals("value copied to model", value, model.getValue()); - assertEquals("warning status", IStatus.WARNING, ((IStatus) binding - .getValidationStatus().getValue()).getSeverity()); - } - - public void testInfoStatusInValidationUpdatesModel() throws Exception { - Binding binding = dbc - .bindValue(target, model, new UpdateValueStrategy() - .setAfterGetValidator(infoValidator()), null); - - String value = "value"; - assertFalse(value.equals(model.getValue())); - target.setValue(value); - - assertEquals("value copied to model", value, model.getValue()); - assertEquals("info status", IStatus.INFO, ((IStatus) binding - .getValidationStatus().getValue()).getSeverity()); - } - - public void testErrorStatusInValidationDoesNotUpdateModel() - throws Exception { - Binding binding = dbc.bindValue(target, model, - new UpdateValueStrategy() - .setAfterGetValidator(errorValidator()), null); - - String value = "value"; - assertFalse(value.equals(model.getValue())); - target.setValue(value); - - assertFalse("value not copied to model", value.equals(model.getValue())); - assertEquals("error status", IStatus.ERROR, ((IStatus) binding - .getValidationStatus().getValue()).getSeverity()); - } - - public void testCancelStatusInValidationDoesNotUpdateModel() - throws Exception { - Binding binding = dbc.bindValue(target, model, - new UpdateValueStrategy() - .setAfterGetValidator(cancelValidator()), null); - - String value = "value"; - assertFalse(value.equals(model.getValue())); - target.setValue(value); - - assertFalse("value not copied to model", value.equals(model.getValue())); - assertEquals("cancel status", IStatus.CANCEL, ((IStatus) binding - .getValidationStatus().getValue()).getSeverity()); - } - - public void testStatusesFromEveryPhaseAreReturned() throws Exception { - UpdateValueStrategy strategy = new UpdateValueStrategy() { - protected IStatus doSet(IObservableValue observableValue, - Object value) { - super.doSet(observableValue, value); - return ValidationStatus.info(""); - } - }; - - strategy.setAfterGetValidator(warningValidator()); - strategy.setAfterConvertValidator(infoValidator()); - strategy.setBeforeSetValidator(warningValidator()); - - Binding binding = dbc.bindValue(target, model, strategy, null); - String value = "value"; - assertFalse(value.equals(model.getValue())); - - target.setValue(value); - assertEquals(value, model.getValue()); - IStatus status = (IStatus) binding.getValidationStatus().getValue(); - assertTrue(status.isMultiStatus()); - assertEquals("max status", IStatus.WARNING, status.getSeverity()); - - MultiStatus multiStatus = (MultiStatus) status; - assertEquals(4, multiStatus.getChildren().length); - IStatus[] children = multiStatus.getChildren(); - - assertEquals("after get severity", IStatus.WARNING, children[0] - .getSeverity()); - assertEquals("after convert severity", IStatus.INFO, children[1] - .getSeverity()); - assertEquals("before set severity", IStatus.WARNING, children[2] - .getSeverity()); - assertEquals("doSet severity", IStatus.INFO, children[3].getSeverity()); - } - - public void testStatusIsInstanceOfBindingStatus() throws Exception { - Binding binding = dbc.bindValue(target, model, null, null); - assertTrue(binding.getValidationStatus().getValue() instanceof BindingStatus); - } - - public void testDiffsAreCheckedForEqualityBeforeUpdate() throws Exception { - class WritableValueStub extends WritableValue { - public WritableValueStub() { - super("", String.class); - } - - protected void fireValueChange(ValueDiff diff) { - super.fireValueChange(diff); - } - } - - WritableValueStub target = new WritableValueStub(); - WritableValue model = WritableValue.withValueType(String.class); - - class Strategy extends UpdateValueStrategy { - int afterGetCount; - public IStatus validateAfterGet(Object value) { - afterGetCount++; - return super.validateAfterGet(value); - } - } - - Strategy strategy = new Strategy(); - dbc.bindValue(target, model, strategy, null); - int count = strategy.afterGetCount; - - target.fireValueChange(Diffs.createValueDiff("", "")); - assertEquals("update does not occur", count, strategy.afterGetCount); - } - - private IValidator warningValidator() { - return new IValidator() { - public IStatus validate(Object value) { - return ValidationStatus.warning(""); - } - }; - } - - private IValidator infoValidator() { - return new IValidator() { - public IStatus validate(Object value) { - return ValidationStatus.info(""); - } - }; - } - - private IValidator errorValidator() { - return new IValidator() { - public IStatus validate(Object value) { - return ValidationStatus.error(""); - } - }; - } - - private IValidator cancelValidator() { - return new IValidator() { - public IStatus validate(Object value) { - return ValidationStatus.cancel(""); - } - }; - } - - 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/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 5a2ed8cb..00000000 --- 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.core.tests.internal.databinding.internal.beans.Bean; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - * @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, "list", null); - assertEquals("element type", Object.class, 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/beans/PojoObservablesTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/beans/PojoObservablesTest.java deleted file mode 100644 index f0f3f081..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/beans/PojoObservablesTest.java +++ /dev/null @@ -1,187 +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.beans; - -import org.eclipse.core.databinding.beans.PojoObservables; -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.set.IObservableSet; -import org.eclipse.core.databinding.observable.set.WritableSet; -import org.eclipse.core.databinding.observable.value.IObservableValue; -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; -import org.eclipse.core.tests.internal.databinding.internal.beans.Bean; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - * @since 3.2 - */ -public class PojoObservablesTest extends AbstractDefaultRealmTestCase { - private Bean pojo; - private String propertyName; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - pojo = new Bean(); - propertyName = "value"; - } - - public void testObserveValue_ReturnsJavaBeanObservableValue() - throws Exception { - IObservableValue value = PojoObservables.observeValue(pojo, propertyName); - - assertNotNull(value); - assertTrue(value instanceof JavaBeanObservableValue); - } - - public void testObserveValue_DoesNotAttachListeners() throws Exception { - IObservableValue value = PojoObservables.observeValue(pojo, propertyName); - - ChangeEventTracker.observe(value); - assertFalse(pojo.hasListeners(propertyName)); - } - - public void testObservableValueWithRealm_ReturnsJavaBeanObservable() - throws Exception { - CurrentRealm realm = new CurrentRealm(true); - IObservableValue value = PojoObservables.observeValue(realm, pojo, - propertyName); - - assertNotNull(value); - assertTrue(value instanceof JavaBeanObservableValue); - } - - public void testObservableMap_ReturnsJavaBeanObservableMap() - throws Exception { - IObservableSet set = new WritableSet(); - set.add(new Bean()); - - IObservableMap map = PojoObservables.observeMap(set, Bean.class, - propertyName); - assertNotNull(map); - assertTrue(map instanceof JavaBeanObservableMap); - } - - public void testObservableMap_DoesNotAttachListeners() throws Exception { - IObservableSet set = new WritableSet(); - set.add(pojo); - - IObservableMap map = PojoObservables.observeMap(set, Bean.class, propertyName); - assertFalse(pojo.hasListeners(propertyName)); - ChangeEventTracker.observe(map); - assertFalse(pojo.hasListeners(propertyName)); - } - - public void testObserveMaps_ReturnsMaps() throws Exception { - IObservableSet set = new WritableSet(); - set.add(pojo); - - IObservableMap[] maps = PojoObservables.observeMaps(set, Bean.class, new String[] {"value", "class"}); - assertEquals(2, maps.length); - } - - public void testObserveListWithElementType_ReturnsJavaBeanObservableList() throws Exception { - IObservableList list = PojoObservables.observeList(Realm.getDefault(), pojo, "list", String.class); - assertTrue(list instanceof JavaBeanObservableList); - } - - public void testObserveListWithElementType_DoesNotAttachListeners() throws Exception { - IObservableList observable = PojoObservables.observeList(Realm.getDefault(), pojo, "list", String.class); - assertFalse(pojo.hasListeners("list")); - ChangeEventTracker.observe(observable); - assertFalse(pojo.hasListeners("list")); - } - - public void testObserveList_ReturnsJavaBeanObservableList() throws Exception { - IObservableList observable = PojoObservables.observeList(Realm.getDefault(), pojo, "list"); - assertTrue(observable instanceof JavaBeanObservableList); - } - - public void testObserveList_DoesNotAttachListeners() throws Exception { - IObservableList observable = PojoObservables.observeList(Realm.getDefault(), pojo, "list"); - assertFalse(pojo.hasListeners("list")); - ChangeEventTracker.observe(observable); - assertFalse(pojo.hasListeners("list")); - } - - public void testObserveSetWithElementType_ReturnsJavaBeanObservableList() throws Exception { - IObservableSet list = PojoObservables.observeSet(Realm.getDefault(), pojo, "set", String.class); - assertTrue(list instanceof JavaBeanObservableSet); - } - - public void testObserveSetWithElementType_DoesNotAttachListeners() throws Exception { - IObservableSet observable = PojoObservables.observeSet(Realm.getDefault(), pojo, "set", String.class); - assertFalse(pojo.hasListeners("set")); - ChangeEventTracker.observe(observable); - assertFalse(pojo.hasListeners("set")); - } - - public void testObserveSet_ReturnsJavaBeanObservableList() throws Exception { - IObservableSet list = PojoObservables.observeSet(Realm.getDefault(), pojo, "set"); - assertTrue(list instanceof JavaBeanObservableSet); - } - - public void testObserveSet_DoesNotAttachListeners() throws Exception { - IObservableSet observable = PojoObservables.observeSet(Realm.getDefault(), pojo, "set"); - assertFalse(pojo.hasListeners("set")); - ChangeEventTracker.observe(observable); - assertFalse(pojo.hasListeners("set")); - } - - public void testValueFactory_DoesNotAttachListeners() throws Exception { - IObservableFactory factory = PojoObservables.valueFactory(Realm.getDefault(), "value"); - IObservableValue observable = (IObservableValue) factory.createObservable(pojo); - - assertFalse(pojo.hasListeners("value")); - ChangeEventTracker.observe(observable); - assertFalse(pojo.hasListeners("value")); - } - - public void testListFactory_DoesNotAttachListeners() throws Exception { - IObservableFactory factory = PojoObservables.listFactory(Realm.getDefault(), "list", String.class); - IObservableList observable = (IObservableList) factory.createObservable(pojo); - - assertFalse(pojo.hasListeners("value")); - ChangeEventTracker.observe(observable); - assertFalse(pojo.hasListeners("value")); - } - - public void testSetFactory_DoesNotAttachListeners() throws Exception { - IObservableFactory factory = PojoObservables.setFactory(Realm.getDefault(), propertyName); - IObservableSet observable = (IObservableSet) factory.createObservable(pojo); - - assertFalse(pojo.hasListeners("set")); - ChangeEventTracker.observe(observable); - assertFalse(pojo.hasListeners("set")); - } - - public void testSetFactoryWithElementType_DoesNotAttachListeners() throws Exception { - IObservableFactory factory = PojoObservables.setFactory(Realm.getDefault(), propertyName, String.class); - IObservableSet observable = (IObservableSet) factory.createObservable(pojo); - - assertFalse(pojo.hasListeners("set")); - ChangeEventTracker.observe(observable); - assertFalse(pojo.hasListeners("set")); - } -} 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 4b2f4c3c..00000000 --- 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 d171fa38..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.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: - * 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 - */ -//TODO test for ICU4Js BigDecimal -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) { - } - } - - public void testThrowsIllegalArgumentExceptionIfNumberIsOutOfRange() throws Exception { - StringToNumberConverter converter = StringToNumberConverter.toInteger(false); - try { - converter.convert(numberFormat.format(Long.MAX_VALUE)); - 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/AbstractObservableTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/AbstractObservableTest.java deleted file mode 100755 index 0ba2b8be..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/AbstractObservableTest.java +++ /dev/null @@ -1,288 +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.core.tests.databinding.observable; - -import junit.framework.Test; - -import org.eclipse.core.databinding.observable.AbstractObservable; -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.databinding.conformance.ObservableContractTest; -import org.eclipse.jface.databinding.conformance.ObservableStaleContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableContractDelegate; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - * 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()); - - ChangeEventTracker listener1 = new ChangeEventTracker(); - - 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.event.getSource()); - - // Add a second listener as the 1 vs. 2 listener code is different. - ChangeEventTracker listener2 = new ChangeEventTracker(); - 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. - ChangeEventTracker listener3 = new ChangeEventTracker(); - 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 { - ChangeEventTracker changeListener = new ChangeEventTracker(); - 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 StaleListener implements IStaleListener { - int count; - IObservable source; - - public void handleStale(StaleEvent event) { - count++; - this.source = event.getObservable(); - } - } - - public static Test suite() { - Delegate delegate = new Delegate(); - - return new SuiteBuilder() - .addTests(AbstractObservableTest.class) - .addObservableContractTest(ObservableContractTest.class, delegate) - .addObservableContractTest(ObservableStaleContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableContractDelegate { - - public void change(IObservable observable) { - ((ObservableStub) observable).fireChange(); - } - - public void setStale(IObservable observable, boolean stale) { - ((ObservableStub) observable).setStale(stale); - } - - public IObservable createObservable(Realm realm) { - return new ObservableStub(realm); - } - } - - private static class ObservableStub extends AbstractObservable { - private boolean stale; - - 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 stale; - } - - public void setStale(boolean stale) { - boolean old = this.stale; - this.stale = stale; - - if (stale && !old) { - fireStale(); - } - } - - 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/core/tests/databinding/observable/DiffsTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/DiffsTest.java deleted file mode 100755 index 551acdd2..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/DiffsTest.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 - *******************************************************************************/ - -package org.eclipse.core.tests.databinding.observable; - -import java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.set.SetDiff; -import org.eclipse.core.databinding.observable.value.ValueDiff; - -/** - * @since 3.2 - * - */ -public class DiffsTest 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 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/core/tests/databinding/observable/Diffs_ListDiffTests.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/Diffs_ListDiffTests.java deleted file mode 100644 index cc0d9a05..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/Diffs_ListDiffTests.java +++ /dev/null @@ -1,216 +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.observable; - -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.list.ListDiff; -import org.eclipse.core.databinding.observable.list.ListDiffEntry; - -/** - * @since 1.1 - */ -public class Diffs_ListDiffTests extends TestCase { - public void testListDiffEntryToStringDoesNotThrowNPEForNullListDiffEntry() { - 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."); - } - } - - public void testListDiffToStringDoesNotThrowNPEForNullListDiff() { - ListDiff diff = new ListDiff() { - public ListDiffEntry[] getDifferences() { - return null; - } - }; - - try { - diff.toString(); - assertTrue(true); - } catch (NullPointerException e) { - fail("NPE was thrown."); - } - } - - public void testListDiffToStringDoesNotThrowNPEForNullListDiffEntry() { - ListDiff diff = new ListDiff() { - public ListDiffEntry[] getDifferences() { - return new ListDiffEntry[1]; - } - }; - - try { - diff.toString(); - assertTrue(true); - } catch (NullPointerException e) { - fail("NPE was thrown."); - } - } - - public void testDiffScenario1() throws Exception { - ListDiff diff = diff(null, null); - assertEquals(0, diff.getDifferences().length); - } - - private ListDiff diff(String[] oldArray, String[] newArray) { - List a = Arrays.asList((oldArray != null) ? oldArray : new String[] {}); - List b = Arrays.asList((newArray != null) ? newArray : new String[] {}); - - return Diffs.computeListDiff(a, b); - } - - public void testDiffScenario2() throws Exception { - ListDiff diff = diff(new String[] {"a"}, null); - assertEquals(1, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], false, 0, "a"); - } - - public void testDiffScenario3() throws Exception { - ListDiff diff = diff(null, new String[] {"a"}); - assertEquals(1, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], true, 0, "a"); - } - - public void testDiffScenario4() throws Exception { - ListDiff diff = diff(new String[] {"a"}, new String[] {"a"}); - - assertEquals(0, diff.getDifferences().length); - } - - public void testDiffScenario5() throws Exception { - ListDiff diff = diff(new String[] {"a"}, new String[] {"b"}); - assertEquals(2, diff.getDifferences().length); - - assertEntry(diff.getDifferences()[0], true, 0, "b"); - assertEntry(diff.getDifferences()[1], false, 1, "a"); - } - - public void testDiffScenario6() throws Exception { - ListDiff diff = diff(new String[] { "a" }, new String[] { "a", "b" }); - - assertEquals(1, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], true, 1, "b"); - } - - public void testDiffScenario7() throws Exception { - ListDiff diff = diff(new String[] { "a" }, new String[] { "b", "a" }); - - assertEquals(1, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], true, 0, "b"); - } - - public void testDiffScenario8() throws Exception { - ListDiff diff = diff(new String[] { "a" }, new String[] { "b", "b" }); - - assertEquals(3, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], true, 0, "b"); - assertEntry(diff.getDifferences()[1], true, 1, "b"); - assertEntry(diff.getDifferences()[2], false, 2, "a"); - } - - public void testDiffScenario9() throws Exception { - ListDiff diff = diff(new String[] { "a" }, new String[] { "a", "b", "c" }); - - assertEquals(2, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], true, 1, "b"); - assertEntry(diff.getDifferences()[1], true, 2, "c"); - } - - public void testDiffScenario10() throws Exception { - ListDiff diff = diff(new String[] { "b" }, new String[] { "a", "b", "c" }); - - assertEquals(2, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], true, 0, "a"); - assertEntry(diff.getDifferences()[1], true, 2, "c"); - } - - public void testDiffScenario11() throws Exception { - ListDiff diff = diff(new String[] { "c" }, new String[] { "a", "b", "c" }); - - assertEquals(2, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], true, 0, "a"); - assertEntry(diff.getDifferences()[1], true, 1, "b"); - } - - public void testDiffScenario12() throws Exception { - ListDiff diff = diff(new String[] { "a", "b", "c" }, new String[] { "a", "b", "c" }); - - assertEquals(0, diff.getDifferences().length); - } - - public void testDiffScenario13() throws Exception { - ListDiff diff = diff(new String[] { "a", "b", "c" }, new String[] { "b", "c" }); - - assertEquals(1, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], false, 0, "a"); - } - - public void testDiffScenarios14() throws Exception { - ListDiff diff = diff(new String[] { "a", "b", "c" }, new String[] { "a", "c" }); - - assertEquals(1, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], false, 1, "b"); - } - - public void testDiffScenarios15() throws Exception { - ListDiff diff = diff(new String[] { "a", "b", "c" }, new String[] { "a", "b" }); - - assertEquals(1, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], false, 2, "c"); - } - - public void testDiffScenarios16() throws Exception { - ListDiff diff = diff(new String[] { "a", "b", "c" }, new String[] { "c", "b", "a" }); - - assertEquals(4, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], false, 2, "c"); - assertEntry(diff.getDifferences()[1], true, 0, "c"); - assertEntry(diff.getDifferences()[2], false, 2, "b"); - assertEntry(diff.getDifferences()[3], true, 1, "b"); - } - - public void testDiffScenarios17() throws Exception { - ListDiff diff = diff(new String[] { "a", "b", "c" }, new String[] { "c", "b" }); - - assertEquals(3, diff.getDifferences().length); - assertEntry(diff.getDifferences()[0], false, 0, "a"); - assertEntry(diff.getDifferences()[1], false, 1, "c"); - assertEntry(diff.getDifferences()[2], true, 0, "c"); - } - - private static void assertEntry(ListDiffEntry entry, boolean addition, int position, String element) { - assertEquals("addition", addition, entry.isAddition()); - assertEquals("position", position, entry.getPosition()); - assertEquals("element", element, entry.getElement()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/LockRealm.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/LockRealm.java deleted file mode 100755 index 768fb335..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/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.core.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/core/tests/databinding/observable/ObservablesTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/ObservablesTest.java deleted file mode 100755 index 6c896db2..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/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.core.tests.databinding.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/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 ad8caf00..00000000 --- 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.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * @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/ThreadRealm.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/ThreadRealm.java deleted file mode 100755 index d325fb0d..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/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.core.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/core/tests/databinding/observable/list/AbstractObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/AbstractObservableListTest.java deleted file mode 100755 index 68387992..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/AbstractObservableListTest.java +++ /dev/null @@ -1,144 +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.core.tests.databinding.observable.list; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.ObservableTracker; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.list.AbstractObservableList; -import org.eclipse.core.databinding.observable.list.ListDiff; -import org.eclipse.jface.databinding.conformance.ObservableListContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; - -/** - * @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 static Test suite() { - return new SuiteBuilder().addTests(AbstractObservableListTest.class) - .addObservableContractTest(ObservableListContractTest.class, - new Delegate()).build(); - } - - /* package */static class Delegate extends - AbstractObservableCollectionContractDelegate { - - public IObservableCollection createObservableCollection(Realm realm, - final int itemCount) { - - String[] items = new String[itemCount]; - for (int i = 0; i < itemCount; i++) { - items[i] = String.valueOf(i); - } - - AbstractObservableListStub observable = new AbstractObservableListStub(realm, Arrays.asList(items)); - observable.elementType = String.class; - return observable; - } - - public Object getElementType(IObservableCollection collection) { - return String.class; - } - - public void change(IObservable observable) { - ((AbstractObservableListStub) observable).fireChange(); - } - } - - static class AbstractObservableListStub extends AbstractObservableList { - Object elementType; - - List wrappedList; - - public AbstractObservableListStub() { - super(); - wrappedList = new ArrayList(); - } - - public AbstractObservableListStub(Realm realm, List list) { - super(realm); - this.wrappedList = list; - } - - protected int doGetSize() { - return wrappedList.size(); - } - - public Object get(int index) { - ObservableTracker.getterCalled(this); - return wrappedList.get(index); - } - - public Object getElementType() { - return elementType; - } - - 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/core/tests/databinding/observable/list/ObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/ObservableListTest.java deleted file mode 100755 index b0a4de3e..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/ObservableListTest.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 167204 - *******************************************************************************/ - -package org.eclipse.core.tests.databinding.observable.list; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.list.ListDiff; -import org.eclipse.core.databinding.observable.list.ObservableList; -import org.eclipse.jface.databinding.conformance.ObservableListContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; - -/** - * @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 static Test suite() { - return new SuiteBuilder().addTests(ObservableListTest.class) - .addObservableContractTest(ObservableListContractTest.class, - new Delegate()).build(); - } - - /* package */ static class Delegate extends AbstractObservableCollectionContractDelegate { - public IObservableCollection createObservableCollection(Realm realm, final int elementCount) { - List wrappedList = new ArrayList(); - for (int i = 0; i < elementCount; i++) { - wrappedList.add(String.valueOf(i)); - } - - return new ObservableListStub(realm, wrappedList, String.class); - } - - public void change(IObservable observable) { - ObservableListStub list = (ObservableListStub) observable; - Object element = "element"; - list.wrappedList.add(element); - list.fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(list.size(), true, element))); - } - - public Object getElementType(IObservableCollection collection) { - return String.class; - } - } - - /* package */static class ObservableListStub extends ObservableList { - List wrappedList; - ObservableListStub(Realm realm, List wrappedList, Object elementType) { - super(realm, wrappedList, elementType); - this.wrappedList = wrappedList; - } - - ObservableListStub(List wrappedList, Object elementType) { - super(wrappedList, elementType); - this.wrappedList = wrappedList; - } - - protected void fireListChange(ListDiff diff) { - super.fireListChange(diff); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/WritableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/WritableListTest.java deleted file mode 100755 index 7ecc00f4..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/WritableListTest.java +++ /dev/null @@ -1,197 +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.core.tests.databinding.observable.list; - -import java.util.ArrayList; -import java.util.Collections; - -import junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.list.WritableList; -import org.eclipse.jface.databinding.conformance.MutableObservableListContractTest; -import org.eclipse.jface.databinding.conformance.ObservableListContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.swt.widgets.Display; - -/** - * @since 3.2 - */ -public class WritableListTest extends TestCase { - protected void tearDown() throws Exception { - RealmTester.setDefault(null); - } - - 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()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests(WritableListTest.class) - .addObservableContractTest(ObservableListContractTest.class, - delegate).addObservableContractTest( - MutableObservableListContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableCollectionContractDelegate { - public Object createElement(IObservableCollection collection) { - return String.valueOf(collection.size() + 1); - } - - public Object getElementType(IObservableCollection collection) { - return String.class; - } - - public IObservableCollection createObservableCollection(Realm realm, - final int itemCount) { - WritableList observable = new WritableList(realm, new ArrayList(), String.class); - - for (int i = 0; i < itemCount; i++) { - observable.add(String.valueOf(i)); - } - - return observable; - } - - public void change(IObservable observable) { - ((WritableList) observable).add(""); - } - } -} 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 a1839528..00000000 --- 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.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * @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 d69e786b..00000000 --- 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.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * @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 04341031..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/WritableMapTest.java +++ /dev/null @@ -1,105 +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 java.util.Set; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.map.MapChangeEvent; -import org.eclipse.core.databinding.observable.map.WritableMap; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.MapChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * @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); - } - }); - } - - public void testPutWithExistingKeyMapChangeEvent() throws Exception { - WritableMap map = new WritableMap(); - String key = "key"; - String value = "value"; - map.put(key, value); - - MapChangeEventTracker listener = new MapChangeEventTracker(); - map.addMapChangeListener(listener); - - assertEquals(0, listener.count); - - String newValue = "new value"; - map.put(key, newValue); - - assertEquals(1, listener.count); - MapChangeEvent event = listener.event; - - - Set changedKeys = event.diff.getChangedKeys(); - assertEquals(1, changedKeys.size()); - assertTrue(changedKeys.contains(key)); - assertEquals(value, event.diff.getOldValue(key)); - assertEquals(newValue, event.diff.getNewValue(key)); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/AbstractObservableSetTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/AbstractObservableSetTest.java deleted file mode 100644 index af2f1df8..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/AbstractObservableSetTest.java +++ /dev/null @@ -1,90 +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.databinding.observable.set; - -import java.util.HashSet; -import java.util.Set; - -import junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.set.AbstractObservableSet; -import org.eclipse.core.databinding.observable.set.SetDiff; -import org.eclipse.jface.databinding.conformance.ObservableCollectionContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; - -/** - */ -public class AbstractObservableSetTest extends TestCase { - public static Test suite() { - Delegate delegate = new Delegate(); - - return new SuiteBuilder() - .addObservableContractTest( - ObservableCollectionContractTest.class, delegate) - .build(); - } - - private static class Delegate extends - AbstractObservableCollectionContractDelegate { - public void change(IObservable observable) { - ((AbstractObservableSetStub) observable).fireSetChange(Diffs.createSetDiff(new HashSet(), new HashSet())); - } - - public Object createElement(IObservableCollection collection) { - return Integer.toString(collection.size()); - } - - public Object getElementType(IObservableCollection collection) { - return String.class; - } - - public IObservableCollection createObservableCollection(Realm realm, - int elementCount) { - AbstractObservableSetStub set = new AbstractObservableSetStub(realm, String.class); - - for (int i = 0; i < elementCount; i++) { - set.getWrappedSet().add(Integer.toString(i)); - } - - return set; - } - } - - private static class AbstractObservableSetStub extends AbstractObservableSet { - private Object type; - private HashSet set; - - private AbstractObservableSetStub(Realm realm, Object type) { - super (realm); - set = new HashSet(); - this.type = type; - } - - protected Set getWrappedSet() { - return set; - } - - public Object getElementType() { - return type; - } - - protected void fireSetChange(SetDiff diff) { - super.fireSetChange(diff); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/ObservableSetTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/ObservableSetTest.java deleted file mode 100755 index 85875cdd..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/ObservableSetTest.java +++ /dev/null @@ -1,85 +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.databinding.observable.set; - -import java.util.HashSet; -import java.util.Set; - -import junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.Diffs; -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.observable.set.ObservableSet; -import org.eclipse.core.databinding.observable.set.SetDiff; -import org.eclipse.jface.databinding.conformance.ObservableCollectionContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; - -/** - * @since 1.1 - */ -public class ObservableSetTest extends TestCase { - public static Test suite() { - Delegate delegate = new Delegate(); - - return new SuiteBuilder() - .addObservableContractTest( - ObservableCollectionContractTest.class, delegate) - .build(); - } - - private static class Delegate extends AbstractObservableCollectionContractDelegate { - private Delegate() { - } - - public void change(IObservable observable) { - ((ObservableSetStub) observable).fireSetChange(Diffs.createSetDiff(new HashSet(), new HashSet())); - } - - public Object createElement(IObservableCollection collection) { - return Integer.toString(collection.size()); - } - - public Object getElementType(IObservableCollection collection) { - return String.class; - } - - public IObservableCollection createObservableCollection(Realm realm, - int elementCount) { - IObservableSet set = new ObservableSetStub(realm, new HashSet(), String.class); - - for (int i = 0; i < elementCount; i++) { - set.add(Integer.toString(i)); - } - - return set; - } - } - - private static class ObservableSetStub extends ObservableSet { - /** - * @param wrappedSet - * @param elementType - */ - protected ObservableSetStub(Realm realm, Set wrappedSet, Object elementType) { - super(realm, wrappedSet, elementType); - } - - public void fireSetChange(SetDiff diff) { - super.fireSetChange(diff); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/UnionSetTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/UnionSetTest.java deleted file mode 100755 index 22d5f763..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/UnionSetTest.java +++ /dev/null @@ -1,78 +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.databinding.observable.set; - -import junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IObservableCollection; -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.jface.databinding.conformance.ObservableCollectionContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; - -/** - */ -public class UnionSetTest extends TestCase { - public static Test suite() { - Delegate delegate = new Delegate(); - - return new SuiteBuilder() - .addObservableContractTest( - ObservableCollectionContractTest.class, delegate) - .build(); - } - - private static class Delegate extends - AbstractObservableCollectionContractDelegate { - private IObservableSet[] sets; - - private Delegate() { - } - - public void setUp() { - - super.setUp(); - } - - public void tearDown() { - sets = null; - - super.tearDown(); - } - - public void change(IObservable observable) { - sets[0].add(Integer.toString(sets[0].size())); - } - - public Object createElement(IObservableCollection collection) { - return Integer.toString(collection.size()); - } - - public IObservableCollection createObservableCollection(Realm realm, - int elementCount) { - sets = new IObservableSet[]{new WritableSet(realm), new WritableSet(realm)}; - - IObservableSet set = new UnionSet(sets); - - for (int i = 0; i < elementCount; i++) { - sets[0].add(Integer.toString(i)); - } - - return set; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/WritableSetTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/WritableSetTest.java deleted file mode 100644 index 59e17713..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/set/WritableSetTest.java +++ /dev/null @@ -1,81 +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.databinding.observable.set; - -import java.util.Collections; - -import junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.IObservableCollection; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.observable.set.WritableSet; -import org.eclipse.jface.databinding.conformance.MutableObservableSetContractTest; -import org.eclipse.jface.databinding.conformance.ObservableCollectionContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableCollectionContractDelegate; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - */ -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()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - - return new SuiteBuilder() - .addTests(WritableSetTest.class) - .addObservableContractTest( - ObservableCollectionContractTest.class, delegate) - .addObservableContractTest( - MutableObservableSetContractTest.class, delegate) - .build(); - } - - private static class Delegate extends - AbstractObservableCollectionContractDelegate { - private Delegate() { - super(); - } - - public void change(IObservable observable) { - IObservableSet set = (IObservableSet) observable; - set.add(createElement((IObservableCollection) observable)); - } - - public Object createElement(IObservableCollection collection) { - return Integer.toString(collection.size()); - } - - public Object getElementType(IObservableCollection collection) { - return String.class; - } - - public IObservableCollection createObservableCollection(Realm realm, - int elementCount) { - IObservableSet set = new WritableSet(realm, Collections.EMPTY_SET, - String.class); - for (int i = 0; i < elementCount; i++) { - set.add(Integer.toString(i)); - } - - return set; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/AbstractObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/AbstractObservableValueTest.java deleted file mode 100755 index 66fb3591..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/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.core.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.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * @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/core/tests/databinding/observable/value/AbstractVetoableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/AbstractVetoableValueTest.java deleted file mode 100755 index 2507db4f..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/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.core.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.databinding.conformance.util.CurrentRealm; -import org.eclipse.jface.databinding.conformance.util.RealmTester; - -/** - * @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/core/tests/databinding/observable/value/ComputedValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/ComputedValueTest.java deleted file mode 100755 index 8d900117..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/ComputedValueTest.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 116920 - * Brad Reynolds - bug 164653 - *******************************************************************************/ - -package org.eclipse.core.tests.databinding.observable.value; - -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; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - * @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/core/tests/databinding/observable/value/WritableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/WritableValueTest.java deleted file mode 100755 index a96e6140..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/value/WritableValueTest.java +++ /dev/null @@ -1,82 +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.core.tests.databinding.observable.value; - -import junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.core.databinding.observable.value.WritableValue; -import org.eclipse.jface.databinding.conformance.MutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.ObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; -import org.eclipse.swt.widgets.Display; - -/** - * @since 3.2 - */ -public class WritableValueTest extends AbstractDefaultRealmTestCase { - /** - * 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()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - - return new SuiteBuilder().addTests(WritableValueTest.class) - .addObservableContractTest(ObservableValueContractTest.class, - delegate).addObservableContractTest( - MutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - public IObservableValue createObservableValue(Realm realm) { - return new WritableValue(realm, "", String.class); - } - - public void change(IObservable observable) { - IObservableValue observableValue = (IObservableValue) observable; - observableValue.setValue(createValue(observableValue)); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public Object createValue(IObservableValue observable) { - return observable.getValue() + "a"; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/validation/ValidationStatusTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/validation/ValidationStatusTest.java deleted file mode 100644 index b6f831e4..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/validation/ValidationStatusTest.java +++ /dev/null @@ -1,32 +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.validation; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.runtime.IStatus; - -/** - * @since 1.1 - */ -public class ValidationStatusTest extends TestCase { - public void testEqualsAndHashCode() throws Exception { - String message = "error"; - Exception e = new IllegalArgumentException(); - IStatus status1 = ValidationStatus.error(message, e); - IStatus status2 = ValidationStatus.error(message, e); - - assertEquals(status1, status2); - assertEquals(status1.hashCode(), status2.hashCode()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/BindingMessagesTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/BindingMessagesTest.java deleted file mode 100644 index 5e6b5162..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/BindingMessagesTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.core.tests.internal.databinding; -import junit.framework.TestCase; - -import org.eclipse.core.internal.databinding.BindingMessages; - -/******************************************************************************* - * 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 - ******************************************************************************/ - -/** - * @since 3.2 - * - */ -public class BindingMessagesTest extends TestCase { - public void testFormatString() throws Exception { - String key = "Validate_NumberOutOfRangeError"; - String result = BindingMessages.formatString(key, new Object[] {"1", "2"}); - assertFalse("key should not be returned", key.equals(result)); - } - - public void testFormatStringForKeyNotFound() throws Exception { - String key = "key_that_does_not_exist"; - String result = BindingMessages.formatString(key, null); - assertTrue(key.equals(result)); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/BindingStatusTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/BindingStatusTest.java deleted file mode 100644 index 4e732048..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/BindingStatusTest.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.eclipse.core.tests.internal.databinding; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.BindingStatus; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/******************************************************************************* - * 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 - ******************************************************************************/ - -/** - * @since 1.1 - */ -public class BindingStatusTest extends TestCase { - private BindingStatus bindingStatus; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - bindingStatus = BindingStatus.ok(); - } - - public void testMessageIsFromStatus() throws Exception { - String message = "error message"; - IStatus status = ValidationStatus.error(message); - - bindingStatus.add(status); - assertEquals(message, bindingStatus.getMessage()); - } - - public void testExceptionIsFromStatus() throws Exception { - IllegalArgumentException e = new IllegalArgumentException(); - Status status = new Status(0, Policy.JFACE_DATABINDING, 0, "", e); - - bindingStatus.add(status); - assertEquals(e, bindingStatus.getException()); - } - - public void testPluginIsFromStatus() throws Exception { - String plugin = "test"; - Status status = new Status(0, plugin, 0, "", null); - - bindingStatus.add(status); - assertEquals(plugin, bindingStatus.getPlugin()); - } - - public void testCodeIsFromStatus() throws Exception { - int code = 1; - Status status = new Status(0, Policy.JFACE_DATABINDING, code, "", null); - - bindingStatus.add(status); - assertEquals(code, status.getCode()); - } - - public void testSeverityIsFromStatus() throws Exception { - IStatus status = ValidationStatus.error(""); - - bindingStatus.add(status); - assertEquals(IStatus.ERROR, status.getSeverity()); - } - - public void testLowerSeverityDoesNotOverwriteGreaterSeverity() throws Exception { - String info = "info"; - String error = "error"; - - bindingStatus.add(ValidationStatus.error(error)); - assertEquals(IStatus.ERROR, bindingStatus.getSeverity()); - assertEquals(error, bindingStatus.getMessage()); - - bindingStatus.add(ValidationStatus.info(info)); - assertEquals(IStatus.ERROR, bindingStatus.getSeverity()); - assertEquals(error, bindingStatus.getMessage()); - - IStatus[] children = bindingStatus.getChildren(); - assertEquals(2, children.length); - assertEquals(IStatus.ERROR, children[0].getSeverity()); - assertEquals(IStatus.INFO, children[1].getSeverity()); - } - - public void testEqual() throws Exception { - BindingStatus status1 = BindingStatus.ok(); - BindingStatus status2 = BindingStatus.ok(); - - assertEquals(status1, status2); - } - - public void testNotEqual() throws Exception { - BindingStatus status1 = BindingStatus.ok(); - BindingStatus status2 = BindingStatus.ok(); - - status2.add(ValidationStatus.error("")); - assertFalse(status1.equals(status2)); - } - - public void testHashCode() throws Exception { - BindingStatus status1 = BindingStatus.ok(); - BindingStatus status2 = BindingStatus.ok(); - - assertEquals(status1.hashCode(), status2.hashCode()); - } - - public void testOkInitializesStatus() throws Exception { - BindingStatus status = BindingStatus.ok(); - assertEquals(Policy.JFACE_DATABINDING, status.getPlugin()); - assertEquals("", status.getMessage()); - assertEquals(0, status.getCode()); - assertEquals(0, status.getChildren().length); - assertNull(status.getException()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/QueueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/QueueTest.java deleted file mode 100644 index 0541847b..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/QueueTest.java +++ /dev/null @@ -1,68 +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; - -import org.eclipse.core.internal.databinding.Queue; - -import junit.framework.TestCase; - -/** - * @since 3.2 - * - */ -public class QueueTest extends TestCase { - - private Queue queue; - - protected void setUp() throws Exception { - this.queue = new Queue(); - } - - public void testIsEmpty() { - assertTrue(queue.isEmpty()); - queue.enqueue("foo"); - assertFalse(queue.isEmpty()); - queue.enqueue("bar"); - assertFalse(queue.isEmpty()); - queue.dequeue(); - assertFalse(queue.isEmpty()); - queue.dequeue(); - assertTrue(queue.isEmpty()); - } - - public void testEnqueueAndDequeue() { - try { - queue.dequeue(); - fail("expected IllegalStateException"); - } catch(IllegalStateException ex) { - // expected - } - queue.enqueue("foo"); - assertEquals("foo", queue.dequeue()); - try { - queue.dequeue(); - fail("expected IllegalStateException"); - } catch(IllegalStateException ex) { - // expected - } - queue.enqueue("foo"); - queue.enqueue("bar"); - queue.dequeue(); - queue.enqueue("bas"); - queue.enqueue("moo"); - assertEquals("bar", queue.dequeue()); - assertEquals("bas", queue.dequeue()); - assertEquals("moo", queue.dequeue()); - assertTrue(queue.isEmpty()); - } - -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/RandomAccessListIteratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/RandomAccessListIteratorTest.java deleted file mode 100755 index 20bcbdc3..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/RandomAccessListIteratorTest.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 - *******************************************************************************/ -package org.eclipse.core.tests.internal.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/core/tests/internal/databinding/conversion/DateConversionSupportTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/DateConversionSupportTest.java deleted file mode 100644 index 5e66de40..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/DateConversionSupportTest.java +++ /dev/null @@ -1,51 +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.conversion; - -import junit.framework.TestCase; - -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.internal.databinding.conversion.DateConversionSupport; - -import com.ibm.icu.text.DateFormat; -import com.ibm.icu.text.SimpleDateFormat; - -/** - * @since 1.1 - */ -public class DateConversionSupportTest extends TestCase { - public void testDatePatternIsExternalized() throws Exception { - StubConverter stub = new StubConverter(); - String key = "DateFormat_DateTime"; - String format = BindingMessages.getString(key); - - assertFalse("format is defined", key.equals(format)); - SimpleDateFormat dateFormat = (SimpleDateFormat) stub.getDateFormat(0); - assertEquals(format, dateFormat.toPattern()); - } - - public void testTimePatternIsExternalized() throws Exception { - StubConverter stub = new StubConverter(); - String key = "DateFormat_Time"; - String format = BindingMessages.getString(key); - - assertFalse("format is defined", key.equals(format)); - SimpleDateFormat dateFormat = (SimpleDateFormat) stub.getDateFormat(1); - assertEquals(format, dateFormat.toPattern()); - } - - static class StubConverter extends DateConversionSupport { - protected DateFormat getDateFormat(int index) { - return super.getDateFormat(index); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/IdentityConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/IdentityConverterTest.java deleted file mode 100755 index 149c08c1..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/IdentityConverterTest.java +++ /dev/null @@ -1,123 +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.core.tests.internal.databinding.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.TYPE, Float.class); - assertEquals("4.2", new Float(4.2), p2b.convert(new Float(4.2))); - } - - public void testConvert_BoxedToPrimitive() 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_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/core/tests/internal/databinding/conversion/IntegerToStringConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/IntegerToStringConverterTest.java deleted file mode 100644 index a86de2da..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/IntegerToStringConverterTest.java +++ /dev/null @@ -1,87 +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.conversion; - -import junit.framework.TestCase; - -import org.eclipse.core.internal.databinding.conversion.IntegerToStringConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class IntegerToStringConverterTest extends TestCase { - private NumberFormat integerFormat; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - integerFormat = NumberFormat.getIntegerInstance(); - } - - public void testFromTypeShort() throws Exception { - assertEquals(Short.class, IntegerToStringConverter.fromShort(false) - .getFromType()); - assertEquals(Short.TYPE, IntegerToStringConverter.fromShort(true) - .getFromType()); - assertEquals(Byte.class, IntegerToStringConverter.fromByte(false) - .getFromType()); - assertEquals(Byte.TYPE, IntegerToStringConverter.fromByte(true) - .getFromType()); - } - - public void testToTypeIsStringClass() throws Exception { - assertEquals(String.class, IntegerToStringConverter.fromShort(false) - .getToType()); - } - - public void testConvertShortToString() throws Exception { - Short value = new Short((short) 1); - String expected = integerFormat.format(value); - - IntegerToStringConverter converter = IntegerToStringConverter - .fromShort(integerFormat, false); - String result = (String) converter.convert(value); - assertEquals(expected, result); - } - - public void testConvertByteToString() throws Exception { - Byte value = new Byte((byte) 1); - String expected = integerFormat.format(value); - - IntegerToStringConverter converter = IntegerToStringConverter.fromByte( - integerFormat, false); - String result = (String) converter.convert(value); - assertEquals(expected, result); - } - - public void testNullSourceConvertsToEmptyString() throws Exception { - IntegerToStringConverter converter = IntegerToStringConverter - .fromByte(false); - assertEquals("", converter.convert(null)); - } - - public void testIllegalArgumentExceptionIfSourceIsNotExpectedType() throws Exception { - IntegerToStringConverter converter = IntegerToStringConverter.fromByte(false); - try { - converter.convert(new Integer(1)); - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToBigDecimalTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToBigDecimalTest.java deleted file mode 100644 index 9cdabd91..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToBigDecimalTest.java +++ /dev/null @@ -1,53 +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.conversion; - -import java.math.BigDecimal; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToBigDecimalConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToBigDecimalTest extends NumberToNumberTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return null; //does not exist - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected IConverter doGetToBoxedTypeValidator(Class fromType) { - return new NumberToBigDecimalConverter(NumberFormat.getInstance(), fromType); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected IConverter doGetToPrimitiveValidator(Class fromType) { - return null; // does not exist - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToType(boolean) - */ - protected Class doGetToType(boolean primitive) { - return (primitive) ? null : BigDecimal.class; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToBigIntegerConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToBigIntegerConverterTest.java deleted file mode 100644 index 2d41a6a8..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToBigIntegerConverterTest.java +++ /dev/null @@ -1,61 +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.conversion; - -import java.math.BigInteger; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToBigIntegerConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToBigIntegerConverterTest extends NumberToNumberTestHarness { - private NumberFormat numberFormat; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected IConverter doGetToBoxedTypeValidator(Class fromType) { - return new NumberToBigIntegerConverter(numberFormat, fromType); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected IConverter doGetToPrimitiveValidator(Class fromType) { - return null; //no such thing - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToType(boolean) - */ - protected Class doGetToType(boolean primitive) { - return (primitive) ? null : BigInteger.class; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToByteConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToByteConverterTest.java deleted file mode 100644 index 551b6844..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToByteConverterTest.java +++ /dev/null @@ -1,63 +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.conversion; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToByteConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToByteConverterTest extends NumberToNumberTestHarness { - private NumberFormat numberFormat; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - numberFormat = NumberFormat.getInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Integer(Byte.MAX_VALUE + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected IConverter doGetToBoxedTypeValidator(Class fromType) { - return new NumberToByteConverter(numberFormat, fromType, false); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected IConverter doGetToPrimitiveValidator(Class fromType) { - return new NumberToByteConverter(numberFormat, fromType, true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToType() - */ - protected Class doGetToType(boolean primitive) { - return (primitive) ? Byte.TYPE : Byte.class; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java deleted file mode 100644 index 2a5a4806..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java +++ /dev/null @@ -1,52 +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.conversion; - -import java.math.BigDecimal; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToDoubleConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToDoubleConverterTest extends NumberToNumberTestHarness { - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new BigDecimal(Double.MAX_VALUE).add(new BigDecimal(Double.MAX_VALUE)); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected IConverter doGetToBoxedTypeValidator(Class fromType) { - return new NumberToDoubleConverter(NumberFormat.getInstance(), fromType, false); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected IConverter doGetToPrimitiveValidator(Class fromType) { - return new NumberToDoubleConverter(NumberFormat.getInstance(), fromType, true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToType(boolean) - */ - protected Class doGetToType(boolean primitive) { - return (primitive) ? Double.TYPE : Double.class; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToFloatConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToFloatConverterTest.java deleted file mode 100644 index 17752f6e..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToFloatConverterTest.java +++ /dev/null @@ -1,61 +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.conversion; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToFloatConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToFloatConverterTest extends NumberToNumberTestHarness { - private NumberFormat numberFormat; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - numberFormat = NumberFormat.getInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Double(Double.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected IConverter doGetToBoxedTypeValidator(Class fromType) { - return new NumberToFloatConverter(numberFormat, fromType, false); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected IConverter doGetToPrimitiveValidator(Class fromType) { - return new NumberToFloatConverter(numberFormat, fromType, true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToType(boolean) - */ - protected Class doGetToType(boolean primitive) { - return (primitive) ? Float.TYPE : Float.class; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToIntegerConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToIntegerConverterTest.java deleted file mode 100644 index 07346772..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToIntegerConverterTest.java +++ /dev/null @@ -1,61 +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.conversion; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToIntegerConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToIntegerConverterTest extends NumberToNumberTestHarness { - private NumberFormat numberFormat; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - numberFormat = NumberFormat.getInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Long((long) Integer.MAX_VALUE + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected IConverter doGetToBoxedTypeValidator(Class fromType) { - return new NumberToIntegerConverter(numberFormat, fromType, false); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected IConverter doGetToPrimitiveValidator(Class fromType) { - return new NumberToIntegerConverter(numberFormat, fromType, true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToType(boolean) - */ - protected Class doGetToType(boolean primitive) { - return (primitive) ? Integer.TYPE : Integer.class; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToLongConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToLongConverterTest.java deleted file mode 100644 index aff8120b..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToLongConverterTest.java +++ /dev/null @@ -1,61 +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.conversion; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToLongConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToLongConverterTest extends NumberToNumberTestHarness { - private NumberFormat numberFormat; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - numberFormat = NumberFormat.getInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Double(Double.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected IConverter doGetToBoxedTypeValidator(Class fromType) { - return new NumberToLongConverter(numberFormat, fromType, false); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected IConverter doGetToPrimitiveValidator(Class fromType) { - return new NumberToLongConverter(numberFormat, fromType, true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToType(boolean) - */ - protected Class doGetToType(boolean primitive) { - return (primitive) ? Long.TYPE : Long.class; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToNumberTestHarness.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToNumberTestHarness.java deleted file mode 100644 index d6373b35..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToNumberTestHarness.java +++ /dev/null @@ -1,131 +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.conversion; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.conversion.IConverter; - -/** - * @since 1.1 - */ -public abstract class NumberToNumberTestHarness extends TestCase { - - /** - * Invoked when a to primitive validator is needed. - * - * @param fromType - * @return validator, <code>null</code> if the type does not have a primitive form - */ - protected abstract IConverter doGetToPrimitiveValidator(Class fromType); - - /** - * Invoked when a to boxed validator is needed. - * - * @param fromType - * @return - */ - protected abstract IConverter doGetToBoxedTypeValidator(Class fromType); - - /** - * Invoked when the type is needed. - * - * @param primitive - * @return type, <code>null</code> if the type does not have a primitive form - */ - protected abstract Class doGetToType(boolean primitive); - - /** - * Invoked when an out of range number is needed to use for conversion. - * - * @return out of range number of <code>null</code> if the type has no bounds - */ - protected abstract Number doGetOutOfRangeNumber(); - - public void testFromType() throws Exception { - Class from = Integer.class; - assertEquals(from, doGetToBoxedTypeValidator(from).getFromType()); - } - - public void testToTypeIsPrimitive() throws Exception { - Class toType = doGetToType(true); - - if (toType == null) { - //return if there is no primitive type - return; - } - assertEquals("to type was not of the correct type", toType, doGetToPrimitiveValidator(Integer.class) - .getToType()); - assertTrue("to type was not primitive", toType.isPrimitive()); - } - - public void testToTypeIsBoxedType() throws Exception { - Class toType = doGetToType(false); - assertEquals(toType, doGetToBoxedTypeValidator(Integer.class) - .getToType()); - assertFalse(toType.isPrimitive()); - } - - public void testValidConversion() throws Exception { - Integer value = new Integer(1); - Number result = (Number) doGetToBoxedTypeValidator(Integer.class) - .convert(value); - - assertNotNull("result was null", result); - - // regardless if the converter is for the primitive value the returned - // value will be the boxed type - assertEquals(doGetToType(false), result.getClass()); - assertEquals(value, new Integer(result.intValue())); - } - - public void testOutOfRangeConversion() throws Exception { - Number outOfRange = doGetOutOfRangeNumber(); - - if (outOfRange == null) { - //the number does not have bounds (e.g. BigInteger or BigDecimal) - return; - } - try { - doGetToBoxedTypeValidator(Integer.class).convert(outOfRange); - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } - - public void testConvertNullValueForPrimitiveThrowsIllegalArgumentException() - throws Exception { - if (doGetToType(true) == null) { - //return if primitive is not supported - - return; - } - - try { - doGetToPrimitiveValidator(Integer.class).convert(null); - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } - - public void testConvertNullValueForBoxedTypeReturnsNull() throws Exception { - assertNull(doGetToBoxedTypeValidator(Integer.class).convert(null)); - } - - public void testNonNumberThrowsIllegalArgumentException() throws Exception { - try { - doGetToBoxedTypeValidator(Integer.class).convert(""); - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToShortConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToShortConverterTest.java deleted file mode 100644 index 4c00cfc9..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToShortConverterTest.java +++ /dev/null @@ -1,61 +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.conversion; - -import org.eclipse.core.databinding.conversion.IConverter; -import org.eclipse.core.internal.databinding.conversion.NumberToShortConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToShortConverterTest extends NumberToNumberTestHarness { - private NumberFormat numberFormat; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - numberFormat = NumberFormat.getInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Integer(Short.MAX_VALUE + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected IConverter doGetToBoxedTypeValidator(Class fromType) { - return new NumberToShortConverter(numberFormat, fromType, false); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected IConverter doGetToPrimitiveValidator(Class fromType) { - return new NumberToShortConverter(numberFormat, fromType, true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.NumberToNumberTestHarness#doGetToType(boolean) - */ - protected Class doGetToType(boolean primitive) { - return (primitive) ? Short.TYPE : Short.class; - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/ObjectToPrimitiveValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/ObjectToPrimitiveValidatorTest.java deleted file mode 100755 index 9fbfb831..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/ObjectToPrimitiveValidatorTest.java +++ /dev/null @@ -1,49 +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.internal.databinding.conversion; - -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/core/tests/internal/databinding/conversion/StatusToStringConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StatusToStringConverterTest.java deleted file mode 100644 index 51bb8729..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StatusToStringConverterTest.java +++ /dev/null @@ -1,56 +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.conversion; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.validation.ValidationStatus; -import org.eclipse.core.internal.databinding.conversion.StatusToStringConverter; -import org.eclipse.core.runtime.IStatus; - -/** - * @since 1.1 - */ -public class StatusToStringConverterTest extends TestCase { - private StatusToStringConverter converter; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - converter = new StatusToStringConverter(); - } - - public void testConvertedValueIsMessageOfStatus() throws Exception { - String message = "this is my message"; - IStatus status = ValidationStatus.error(message); - assertEquals(message, converter.convert(status)); - } - - public void testFromTypeIsIStatus() throws Exception { - assertEquals(IStatus.class, converter.getFromType()); - } - - public void testToTypeIsString() throws Exception { - assertEquals(String.class, converter.getToType()); - } - - public void testIllegalArgumentExceptionIsThrownWithNullInput() throws Exception { - try { - converter.convert(null); - fail(); - } catch (IllegalArgumentException e) { - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToBooleanConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToBooleanConverterTest.java deleted file mode 100644 index b1534ec6..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToBooleanConverterTest.java +++ /dev/null @@ -1,96 +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.conversion; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.StringTokenizer; - -import junit.framework.TestCase; -import junit.framework.TestResult; - -import org.eclipse.core.internal.databinding.BindingMessages; -import org.eclipse.core.internal.databinding.conversion.StringToBooleanConverter; - -/** - * @since 1.1 - */ -public class StringToBooleanConverterTest extends TestCase { - private StringToBooleanConverter converter; - - private List trueValues; - - private List falseValues; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#run(junit.framework.TestResult) - */ - public void run(TestResult result) { - trueValues = Collections.unmodifiableList(toValues(BindingMessages - .getString("ValueDelimiter"), BindingMessages - .getString("TrueStringValues"))); - falseValues = Collections.unmodifiableList(toValues(BindingMessages - .getString("ValueDelimiter"), BindingMessages - .getString("FalseStringValues"))); - - super.run(result); - } - - private List toValues(String delimiter, String values) { - StringTokenizer tokenizer = new StringTokenizer(values, delimiter); - List result = new LinkedList(); - - while (tokenizer.hasMoreTokens()) { - result.add(tokenizer.nextToken()); - } - - return result; - } - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - converter = new StringToBooleanConverter(); - assertTrue(trueValues.size() > 0); - assertTrue(falseValues.size() > 0); - } - - public void testConvertsToTrue() throws Exception { - Boolean result = (Boolean) converter.convert(trueValues.get(0)); - assertTrue(result.booleanValue()); - } - - public void testConvertsToFalse() throws Exception { - Boolean result = (Boolean) converter.convert(falseValues.get(0)); - assertFalse(result.booleanValue()); - } - - public void testUpperCaseStringConvertsToTrue() throws Exception { - Boolean result = (Boolean) converter.convert(((String) trueValues.get(0)) - .toUpperCase()); - assertTrue(result.booleanValue()); - } - - public void testUpperCaseStringConvertsToFalse() throws Exception { - Boolean result = (Boolean) converter.convert(((String) falseValues.get(0)) - .toUpperCase()); - assertFalse(result.booleanValue()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToByteConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToByteConverterTest.java deleted file mode 100644 index 1c614680..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToByteConverterTest.java +++ /dev/null @@ -1,77 +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.conversion; - -import junit.framework.TestCase; - -import org.eclipse.core.internal.databinding.conversion.StringToByteConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToByteConverterTest extends TestCase { - private NumberFormat numberFormat; - private StringToByteConverter converter; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - numberFormat = NumberFormat.getIntegerInstance(); - converter = StringToByteConverter.toByte(numberFormat, false); - } - - public void testConvertsToByte() throws Exception { - Byte value = new Byte((byte) 1); - Byte result = (Byte) converter.convert(numberFormat.format(value)); - - assertEquals(value, result); - } - - public void testConvertsToBytePrimitive() throws Exception { - converter = StringToByteConverter.toByte(numberFormat, true); - Byte value = new Byte((byte) 1); - Byte result = (Byte) converter.convert(numberFormat.format(value)); - assertEquals(value, result); - } - - public void testFromTypeIsString() throws Exception { - assertEquals(String.class, converter.getFromType()); - } - - public void testToTypeIsShort() throws Exception { - assertEquals(Byte.class, converter.getToType()); - } - - public void testToTypeIsBytePrimitive() throws Exception { - converter = StringToByteConverter.toByte(true); - assertEquals(Byte.TYPE, converter.getToType()); - } - - public void testReturnsNullBoxedTypeForEmptyString() throws Exception { - assertNull(converter.convert("")); - } - - public void testThrowsIllegalArgumentExceptionIfAskedToConvertNonString() - throws Exception { - try { - converter.convert(new Integer(1)); - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserByteTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserByteTest.java deleted file mode 100644 index dd8b65bb..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserByteTest.java +++ /dev/null @@ -1,43 +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.conversion; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * @since 3.2 - * - */ -public class StringToNumberParserByteTest extends - StringToNumberParserTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#assertValid(java.lang.Number) - */ - protected boolean assertValid(Number number) { - return StringToNumberParser.inByteRange(number); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMax() - */ - protected Number getValidMax() { - return new Byte(Byte.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMin() - */ - protected Number getValidMin() { - return new Byte(Byte.MIN_VALUE); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserDoubleTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserDoubleTest.java deleted file mode 100644 index 485d0592..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserDoubleTest.java +++ /dev/null @@ -1,43 +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.conversion; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * @since 3.2 - * - */ -public class StringToNumberParserDoubleTest extends - StringToNumberParserTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#assertValid(java.lang.Number) - */ - protected boolean assertValid(Number number) { - return StringToNumberParser.inDoubleRange(number); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMax() - */ - protected Number getValidMax() { - return new Double(Double.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMin() - */ - protected Number getValidMin() { - return new Double(-Double.MAX_VALUE); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserFloatTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserFloatTest.java deleted file mode 100644 index 8a286eb4..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserFloatTest.java +++ /dev/null @@ -1,44 +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.conversion; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * @since 1.1 - * - */ -public class StringToNumberParserFloatTest extends - StringToNumberParserTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#assertValid(java.lang.Number) - */ - protected boolean assertValid(Number number) { - return StringToNumberParser.inFloatRange(number); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMax() - */ - protected Number getValidMax() { - return new Float(Float.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMin() - */ - protected Number getValidMin() { - return new Float(-Float.MAX_VALUE); - } - -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserIntegerTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserIntegerTest.java deleted file mode 100644 index cd37511a..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserIntegerTest.java +++ /dev/null @@ -1,42 +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.conversion; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * @since 1.1 - */ -public class StringToNumberParserIntegerTest extends - StringToNumberParserTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#assertValid(java.lang.Number) - */ - protected boolean assertValid(Number number) { - return StringToNumberParser.inIntegerRange(number); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMax() - */ - protected Number getValidMax() { - return new Integer(Integer.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMin() - */ - protected Number getValidMin() { - return new Integer(Integer.MIN_VALUE); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserLongTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserLongTest.java deleted file mode 100644 index 3ecef0d6..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserLongTest.java +++ /dev/null @@ -1,40 +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.conversion; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -/** - * @since 1.1 - * - */ -public class StringToNumberParserLongTest extends - StringToNumberParserTestHarness { - - protected boolean assertValid(Number number) { - return StringToNumberParser.inLongRange(number); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMax() - */ - protected Number getValidMax() { - return new Long(Long.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMin() - */ - protected Number getValidMin() { - return new Long(Long.MIN_VALUE); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserShortTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserShortTest.java deleted file mode 100644 index cf0c0fa1..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserShortTest.java +++ /dev/null @@ -1,42 +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.conversion; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - - -/** - * @since 1.1 - */ -public class StringToNumberParserShortTest extends StringToNumberParserTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#assertValid(java.lang.Number) - */ - protected boolean assertValid(Number number) { - return StringToNumberParser.inShortRange(number); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMax() - */ - protected Number getValidMax() { - return new Short(Short.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTestHarness#getValidMin() - */ - protected Number getValidMin() { - return new Short(Short.MIN_VALUE); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTest.java deleted file mode 100644 index a1329a0d..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTest.java +++ /dev/null @@ -1,68 +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.conversion; - -import junit.framework.TestCase; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser.ParseResult; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToNumberParserTest extends TestCase { - private NumberFormat integerFormat; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - integerFormat = NumberFormat.getIntegerInstance(); - } - - public void testParseNonStringThrowsIllegalArgumentException() - throws Exception { - try { - StringToNumberParser.parse(new Integer(0), integerFormat, false); - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } - - public void testEmptyStringReturnsNullIfNotPrimitive() throws Exception { - ParseResult result = StringToNumberParser.parse("", - integerFormat, false); - assertNull(result.getNumber()); - } - - public void testReturnsParsePositionWhenValueCannotBeParsed() - throws Exception { - ParseResult result = StringToNumberParser.parse("adsf", - integerFormat, false); - assertNotNull(result.getPosition()); - assertNull(result.getNumber()); - } - - public void testReturnsNumberWhenSuccessfullyParsed() throws Exception { - Integer number = new Integer(5); - ParseResult result = StringToNumberParser.parse(integerFormat - .format(number.longValue()), integerFormat, false); - assertNull(result.getPosition()); - assertEquals(number.intValue(), result.getNumber().intValue()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java deleted file mode 100644 index 476ba39c..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java +++ /dev/null @@ -1,215 +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.conversion; - -import java.math.BigDecimal; -import java.math.BigInteger; - -import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; - -import junit.framework.TestCase; - -/** - * @since 1.1 - */ -public abstract class StringToNumberParserTestHarness extends TestCase { - - protected abstract Number getValidMax(); - - protected abstract Number getValidMin(); - - protected abstract boolean assertValid(Number number); - - public void testRanges() throws Exception { - Number min = getValidMin(); - Number max = getValidMax(); - - double minDouble = min.doubleValue(); - double maxDouble = max.doubleValue(); - - //test bytes - assertTrue("valid byte", assertValid(new Byte((byte) 1))); - assertTrue("valid byte min", assertValid(new Byte(Byte.MIN_VALUE))); - assertTrue("valid byte max", assertValid(new Byte(Byte.MAX_VALUE))); - - // test shorts - assertTrue("valid short", assertValid(new Short((short) 1))); - boolean result = assertValid(new Short(Short.MIN_VALUE)); - if (minDouble > Short.MIN_VALUE) { - assertFalse("invalid short min", result); - } else { - assertTrue("valid short min", result); - } - - result = assertValid(new Short(Short.MAX_VALUE)); - if (maxDouble < Short.MAX_VALUE) { - assertFalse("invalid short max", result); - } else { - assertTrue("valid short max", result); - } - - // test integers - assertTrue("valid Integer", assertValid(new Integer(1))); - - result = assertValid(new Integer(Integer.MIN_VALUE)); - if (minDouble > Integer.MIN_VALUE) { - assertFalse("invalid Integer min", result); - } else { - assertTrue("valid integer min", result); - } - - result = assertValid(new Integer(Integer.MAX_VALUE)); - if (maxDouble < Integer.MAX_VALUE) { - assertFalse("valid Integer max", result); - } else { - assertTrue("valid integer max", result); - } - - // test longs - assertTrue("valid long", assertValid(new Long(1))); - result = assertValid(new Long(Long.MIN_VALUE)); - if (minDouble > Long.MIN_VALUE) { - assertFalse("invalid long min", result); - } else { - assertTrue("valid long min", result); - } - - result = assertValid(new Long(Long.MAX_VALUE)); - if (maxDouble < Long.MAX_VALUE) { - assertFalse("invalid long max", result); - } else { - assertTrue("valid long max", result); - } - - // test floats - assertTrue("valid float", assertValid(new Float(1))); - result = assertValid(new Float(-Float.MAX_VALUE)); - if (minDouble > -Float.MAX_VALUE) { - assertFalse("invalid float min", result); - } else { - assertTrue("valid float min", result); - } - - result = assertValid(new Float(Float.MAX_VALUE)); - if (maxDouble < Float.MAX_VALUE) { - assertFalse("invalid float max", result); - } else { - assertTrue("valid float max", result); - } - - assertFalse("invalid negative float infinity", assertValid(new Float( - Float.NEGATIVE_INFINITY))); - assertFalse("invalid positive float infinity", assertValid(new Float( - Float.POSITIVE_INFINITY))); - assertFalse("invalid float NaN", assertValid(new Float(Float.NaN))); - - // test doubles - assertTrue("valid double", assertValid(new Double(1))); - result = assertValid(new Double(-Double.MAX_VALUE)); - if (minDouble > -Double.MAX_VALUE) { - assertFalse("invalid double min", result); - } else { - assertTrue("valid double min", result); - } - - result = assertValid(new Double(Double.MAX_VALUE)); - if (maxDouble < Double.MAX_VALUE) { - assertFalse("invalid float max", result); - } else { - assertTrue("valid float max", result); - } - - assertFalse("invalid negative double infinity", assertValid(new Double( - Double.NEGATIVE_INFINITY))); - assertFalse("invalid positive double infinity", assertValid(new Double( - Double.POSITIVE_INFINITY))); - assertFalse("invalid double NaN", assertValid(new Double(Double.NaN))); - - // test BigIntegers - assertTrue("valid BigInteger", assertValid(BigInteger.valueOf(1))); - BigDecimal bigDecimalMin = new BigDecimal(min.doubleValue()); - bigDecimalMin = bigDecimalMin.subtract(new BigDecimal(1)); - assertFalse("invalid BigInteger min", assertValid(bigDecimalMin.toBigInteger())); - - BigDecimal bigDecimalMax = new BigDecimal(max.doubleValue()); - bigDecimalMax = bigDecimalMax.add(new BigDecimal(1)); - assertFalse("invalid BigInteger max", assertValid(bigDecimalMax.toBigInteger())); - - // test BigDecimals - assertTrue("valid BigDecimal", assertValid(new BigDecimal(1))); - assertFalse("invalid BigDecimal min", assertValid(bigDecimalMin)); - assertFalse("invalid BigDecimal max", assertValid(bigDecimalMax)); - - /** - * The ICU4J plugin's NumberFormat will return it's own BigDecimal - * implementation, com.ibm.icu.math.BigDecimal. The issue this causes is - * that we can't reference this class as it's not part of the - * replacement plugin. So in order to ensure that we handle Number's - * that are not part of the JDK stub a number implemenation and ensure - * that the double representation of this number is used. - * - * @throws Exception - */ - class MyNumber extends Number { - double value; - int count; - - MyNumber(double value) { - this.value = value; - } - - private static final long serialVersionUID = 1L; - - /* - * (non-Javadoc) - * - * @see java.lang.Number#doubleValue() - */ - public double doubleValue() { - count++; - return value; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Number#floatValue() - */ - public float floatValue() { - return 0; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Number#intValue() - */ - public int intValue() { - return 0; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Number#longValue() - */ - public long longValue() { - return 0; - } - } - - MyNumber number = new MyNumber(1); - assertEquals(0, number.count); - assertTrue(StringToNumberParser.inIntegerRange(number)); - assertTrue("double value retrieved", number.count > 0); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToShortConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToShortConverterTest.java deleted file mode 100644 index b37fba1c..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToShortConverterTest.java +++ /dev/null @@ -1,77 +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.conversion; - -import junit.framework.TestCase; - -import org.eclipse.core.internal.databinding.conversion.StringToShortConverter; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToShortConverterTest extends TestCase { - private NumberFormat numberFormat; - private StringToShortConverter converter; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - numberFormat = NumberFormat.getIntegerInstance(); - converter = StringToShortConverter.toShort(numberFormat, false); - } - - public void testConvertsToShort() throws Exception { - Short value = new Short((short) 1); - Short result = (Short) converter.convert(numberFormat.format(value)); - - assertEquals(value, result); - } - - public void testConvertsToShortPrimitive() throws Exception { - converter = StringToShortConverter.toShort(numberFormat, true); - Short value = new Short((short) 1); - Short result = (Short) converter.convert(numberFormat.format(value)); - assertEquals(value, result); - } - - public void testFromTypeIsString() throws Exception { - assertEquals(String.class, converter.getFromType()); - } - - public void testToTypeIsShort() throws Exception { - assertEquals(Short.class, converter.getToType()); - } - - public void testToTypeIsShortPrimitive() throws Exception { - converter = StringToShortConverter.toShort(true); - assertEquals(Short.TYPE, converter.getToType()); - } - - public void testReturnsNullBoxedTypeForEmptyString() throws Exception { - assertNull(converter.convert("")); - } - - public void testThrowsIllegalArgumentExceptionIfAskedToConvertNonString() - throws Exception { - try { - converter.convert(new Integer(1)); - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/Bean.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/Bean.java deleted file mode 100644 index 505db63d..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/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.core.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 Object[] list = new Object[0]; - private Set set; - - public Bean() { - } - - public Bean(String value) { - this.value = value; - } - - public Bean(List list) { - this.list = (Bean[]) list.toArray(new Bean[list.size()]); - } - - 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 Object[] getList() { - return list; - } - - public void setList(Object[] elements) { - changeSupport.firePropertyChange("list", this.list, this.list = elements); - } - - public Set getSet() { - return set; - } - - public void setSet(Set set) { - changeSupport.firePropertyChange("set", this.set, this.set = set); - } - - public boolean hasListeners(String propertyName) { - return changeSupport.hasListeners(propertyName); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/BeanObservableListDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/BeanObservableListDecoratorTest.java deleted file mode 100644 index 6b86e0fe..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/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.core.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,"getList","setList"); - 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/core/tests/internal/databinding/internal/beans/BeanObservableSetDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/BeanObservableSetDecoratorTest.java deleted file mode 100644 index 0a0fa9fe..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/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.core.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/core/tests/internal/databinding/internal/beans/BeanObservableValueDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/BeanObservableValueDecoratorTest.java deleted file mode 100644 index 63b84e7e..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/BeanObservableValueDecoratorTest.java +++ /dev/null @@ -1,62 +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.internal.beans; - -import java.beans.PropertyDescriptor; - -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.jface.tests.databinding.AbstractDefaultRealmTestCase; -import org.eclipse.swt.widgets.Display; - -/** - * @since 3.3 - */ -public class BeanObservableValueDecoratorTest extends AbstractDefaultRealmTestCase { - private Bean bean; - private JavaBeanObservableValue observableValue; - private BeanObservableValueDecorator decorator; - private PropertyDescriptor propertyDescriptor; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - bean = new Bean(); - propertyDescriptor = new PropertyDescriptor("value", - Bean.class); - observableValue = new JavaBeanObservableValue( - SWTObservables.getRealm(Display.getDefault()), bean, - propertyDescriptor); - 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/core/tests/internal/databinding/internal/beans/JavaBeanObservableArrayBasedListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableArrayBasedListTest.java deleted file mode 100644 index 411c4d50..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableArrayBasedListTest.java +++ /dev/null @@ -1,467 +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.internal.beans; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.beans.PropertyDescriptor; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -import org.eclipse.core.databinding.observable.list.ListChangeEvent; -import org.eclipse.core.databinding.observable.list.ListDiffEntry; -import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableList; -import org.eclipse.jface.databinding.conformance.util.ListChangeEventTracker; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; -import org.eclipse.swt.widgets.Display; - -/** - * @since 1.1 - */ -public class JavaBeanObservableArrayBasedListTest extends AbstractDefaultRealmTestCase { - private JavaBeanObservableList list; - - 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(new ArrayList()); - - list = new JavaBeanObservableList(SWTObservables.getRealm(Display - .getDefault()), bean, propertyDescriptor, Bean.class); - } - - public void testGetObserved() throws Exception { - assertEquals(bean, list.getObserved()); - } - - public void testGetPropertyDescriptor() throws Exception { - assertEquals(propertyDescriptor, list.getPropertyDescriptor()); - } - - public void testRegistersListenerAfterFirstListenerIsAdded() - throws Exception { - assertFalse(bean.changeSupport.hasListeners(propertyName)); - list.addListChangeListener(new ListChangeEventTracker()); - assertTrue(bean.changeSupport.hasListeners(propertyName)); - } - - public void testRemovesListenerAfterLastListenerIsRemoved() - throws Exception { - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertTrue(bean.changeSupport.hasListeners(propertyName)); - list.removeListChangeListener(listener); - assertFalse(bean.changeSupport.hasListeners(propertyName)); - } - - public void testFiresListChangeEvents() throws Exception { - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - bean.setList(new Bean[] { new Bean() }); - assertEquals(1, listener.count); - } - - public void testAddAddsElement() throws Exception { - int count = list.size(); - String element = "1"; - - assertEquals(0, count); - list.add(element); - assertEquals(count + 1, list.size()); - assertEquals(element, bean.getList()[count]); - } - - public void testAddListChangeEvent() throws Exception { - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - String element = "1"; - - list.add(element); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], true, 0, element); - } - - public void testAddFiresPropertyChangeEvent() throws Exception { - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.add("0"); - } - }); - } - - public void testAddAtIndex() throws Exception { - String element = "1"; - assertEquals(0, list.size()); - - list.add(0, element); - assertEquals(element, bean.getList()[0]); - } - - public void testAddAtIndexListChangeEvent() throws Exception { - String element = "1"; - assertEquals(0, list.size()); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - list.add(0, element); - - ListChangeEvent event = listener.event; - assertEntry(event.diff.getDifferences()[0], true, 0, element); - } - - public void testAddAtIndexPropertyChangeEvent() throws Exception { - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.add(0, "0"); - } - }); - } - - public void testRemove() throws Exception { - String element = "1"; - list.add(element); - - assertEquals(1, bean.getList().length); - list.remove(element); - assertEquals(0, bean.getList().length); - } - - public void testRemoveListChangeEvent() throws Exception { - String element = "1"; - list.add(element); - - assertEquals(1, list.size()); - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - list.remove(element); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], false, 0, element); - } - - public void testRemovePropertyChangeEvent() throws Exception { - list.add("0"); - - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.remove("0"); - } - }); - } - - public void testRemoveAtIndex() throws Exception { - String element = "1"; - list.add(element); - - assertEquals(element, bean.getList()[0]); - - list.remove(0); - assertEquals(0, bean.getList().length); - } - - public void testRemoveAtIndexListChangeEvent() throws Exception { - String element = "1"; - list.add(element); - - assertEquals(1, list.size()); - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - list.remove(0); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], false, 0, element); - } - - public void testRemoveAtIndexPropertyChangeEvent() throws Exception { - list.add("0"); - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.remove(0); - } - }); - } - - public void testAddAll() throws Exception { - Collection elements = Arrays.asList(new String[] { "1", "2" }); - assertEquals(0, list.size()); - - list.addAll(elements); - - assertEquals(2, bean.getList().length); - } - - public void testAddAllListChangEvent() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - assertEquals(0, list.size()); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - assertEquals(0, listener.count); - - list.addAll(elements); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - - assertEntry(event.diff.getDifferences()[0], true, 0, elements.get(0)); - assertEntry(event.diff.getDifferences()[1], true, 1, elements.get(1)); - } - - public void testAddAllPropertyChangeEvent() throws Exception { - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.addAll(Arrays.asList(new String[] {"0", "1"})); - } - }); - } - - public void testAddAllAtIndex() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - list.addAll(elements); - - assertEquals(2, list.size()); - - list.addAll(2, elements); - - assertEquals(4, bean.getList().length); - assertEquals(elements.get(0), bean.getList()[0]); - assertEquals(elements.get(1), bean.getList()[1]); - } - - public void testAddAllAtIndexListChangeEvent() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - list.addAll(elements); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - - list.addAll(2, elements); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], true, 2, elements.get(0)); - assertEntry(event.diff.getDifferences()[1], true, 3, elements.get(1)); - } - - public void testAddAllAtIndexPropertyChangeEvent() throws Exception { - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.addAll(0, Arrays.asList(new String[] {"1", "2"})); - } - }); - } - - public void testRemoveAll() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - list.addAll(elements); - list.addAll(elements); - - assertEquals(4, bean.getList().length); - list.removeAll(elements); - - assertEquals(2, bean.getList().length); - assertEquals(elements.get(0), bean.getList()[0]); - assertEquals(elements.get(1), bean.getList()[1]); - } - - public void testRemoveAllListChangeEvent() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - list.addAll(elements); - list.addAll(elements); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - list.removeAll(elements); - - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], false, 0, elements.get(0)); - assertEntry(event.diff.getDifferences()[1], false, 0, elements.get(1)); - } - - public void testRemoveAllPropertyChangeEvent() throws Exception { - list.add("0"); - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.removeAll(Arrays.asList(new String[] {"0"})); - } - }); - } - - public void testRetailAll() throws Exception { - List elements = Arrays.asList(new String[] { "0", "1", "2", "3" }); - list.addAll(elements); - - assertEquals(4, bean.getList().length); - - list.retainAll(elements.subList(0, 2)); - assertEquals(2, bean.getList().length); - - assertEquals(elements.get(0), bean.getList()[0]); - assertEquals(elements.get(1), bean.getList()[1]); - } - - public void testRetainAllListChangeEvent() throws Exception { - List elements = Arrays.asList(new String[] { "0", "1", "2", "3" }); - list.addAll(elements); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - list.retainAll(elements.subList(0, 2)); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], false, 2, elements.get(2)); - assertEntry(event.diff.getDifferences()[1], false, 2, elements.get(3)); - } - - public void testRetainAllPropertyChangeEvent() throws Exception { - list.addAll(Arrays.asList(new String[] {"0", "1"})); - - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.retainAll(Arrays.asList(new String[] {"0"})); - } - }); - } - - public void testSet() throws Exception { - String oldElement = "old"; - String newElement = "new"; - list.add(oldElement); - - assertEquals(oldElement, bean.getList()[0]); - - list.set(0, newElement); - assertEquals(newElement, bean.getList()[0]); - } - - public void testSetListChangeEvent() throws Exception { - String oldElement = "old"; - String newElement = "new"; - list.add(oldElement); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - assertEquals(0, listener.count); - - list.set(0, newElement); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], true, 0, newElement); - assertEntry(event.diff.getDifferences()[1], false, 1, oldElement); - } - - public void testSetPropertyChangeEvent() throws Exception { - list.add("0"); - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.set(0, "1"); - } - }); - } - - public void testListChangeEventFiresWhenNewListIsSet() throws Exception { - Bean[] elements = new Bean[] { new Bean(), new Bean() }; - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - bean.setList(elements); - assertEquals(1, listener.count); - } - - private static void assertEntry(ListDiffEntry entry, boolean addition, - int position, Object element) { - assertEquals("addition", addition, entry.isAddition()); - assertEquals("position", position, entry.getPosition()); - assertEquals("element", element, entry.getElement()); - } - - private static void assertPropertyChangeEvent(Bean bean, Runnable runnable) { - PropertyChangeTracker listener = new PropertyChangeTracker(); - bean.addPropertyChangeListener(listener); - - Object[] old = bean.getList(); - assertEquals(0, listener.count); - - runnable.run(); - - PropertyChangeEvent event = listener.evt; - assertEquals("event did not fire", 1, listener.count); - assertEquals("list", event.getPropertyName()); - assertEquals("old value", old, event.getOldValue()); - assertEquals("new value", bean.getList(), event.getNewValue()); - assertFalse("lists are equal", bean.getList().equals(old)); - } - - private static class PropertyChangeTracker implements - PropertyChangeListener { - int count; - - PropertyChangeEvent evt; - - /* - * (non-Javadoc) - * - * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent) - */ - public void propertyChange(PropertyChangeEvent evt) { - count++; - this.evt = evt; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java deleted file mode 100644 index f2615dc1..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java +++ /dev/null @@ -1,491 +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.internal.beans; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.beans.PropertyDescriptor; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.list.ListChangeEvent; -import org.eclipse.core.databinding.observable.list.ListDiffEntry; -import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableList; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.ListChangeEventTracker; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; -import org.eclipse.swt.widgets.Display; - -/** - * @since 1.1 - */ -public class JavaBeanObservableListTest extends AbstractDefaultRealmTestCase { - private JavaBeanObservableList list; - - private PropertyDescriptor propertyDescriptor; - - private NonStandardBean bean; - - private String propertyName; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - propertyName = "list"; - propertyDescriptor = new PropertyDescriptor(propertyName, NonStandardBean.class); - bean = new NonStandardBean(new ArrayList()); - - list = new JavaBeanObservableList(SWTObservables.getRealm(Display - .getDefault()), bean, propertyDescriptor, NonStandardBean.class); - } - - public void testGetObserved() throws Exception { - assertEquals(bean, list.getObserved()); - } - - public void testGetPropertyDescriptor() throws Exception { - assertEquals(propertyDescriptor, list.getPropertyDescriptor()); - } - - public void testRegistersListenerAfterFirstListenerIsAdded() - throws Exception { - assertFalse(bean.changeSupport.hasListeners(propertyName)); - list.addListChangeListener(new ListChangeEventTracker()); - assertTrue(bean.changeSupport.hasListeners(propertyName)); - } - - public void testRemovesListenerAfterLastListenerIsRemoved() - throws Exception { - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertTrue(bean.changeSupport.hasListeners(propertyName)); - list.removeListChangeListener(listener); - assertFalse(bean.changeSupport.hasListeners(propertyName)); - } - - public void testFiresListChangeEvents() throws Exception { - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - bean.setList(Arrays.asList(new String[] { "value" })); - assertEquals(1, listener.count); - } - - public void testAddAddsElement() throws Exception { - int count = list.size(); - String element = "1"; - - assertEquals(0, count); - list.add(element); - assertEquals(count + 1, list.size()); - assertEquals(element, bean.getList().get(count)); - } - - public void testAddListChangeEvent() throws Exception { - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - String element = "1"; - - list.add(element); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], true, 0, element); - } - - public void testAddFiresPropertyChangeEvent() throws Exception { - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.add("0"); - } - }); - } - - public void testAddAtIndex() throws Exception { - String element = "1"; - assertEquals(0, list.size()); - - list.add(0, element); - assertEquals(element, bean.getList().get(0)); - } - - public void testAddAtIndexListChangeEvent() throws Exception { - String element = "1"; - assertEquals(0, list.size()); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - list.add(0, element); - - ListChangeEvent event = listener.event; - assertEntry(event.diff.getDifferences()[0], true, 0, element); - } - - public void testAddAtIndexPropertyChangeEvent() throws Exception { - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.add(0, "0"); - } - }); - } - - public void testRemove() throws Exception { - String element = "1"; - list.add(element); - - assertEquals(1, bean.getList().size()); - list.remove(element); - assertEquals(0, bean.getList().size()); - } - - public void testRemoveListChangeEvent() throws Exception { - String element = "1"; - list.add(element); - - assertEquals(1, list.size()); - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - list.remove(element); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], false, 0, element); - } - - public void testRemovePropertyChangeEvent() throws Exception { - list.add("0"); - - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.remove("0"); - } - }); - } - - public void testRemoveAtIndex() throws Exception { - String element = "1"; - list.add(element); - - assertEquals(element, bean.getList().get(0)); - - list.remove(0); - assertEquals(0, bean.getList().size()); - } - - public void testRemoveAtIndexListChangeEvent() throws Exception { - String element = "1"; - list.add(element); - - assertEquals(1, list.size()); - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - list.remove(0); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], false, 0, element); - } - - public void testRemoveAtIndexPropertyChangeEvent() throws Exception { - list.add("0"); - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.remove(0); - } - }); - } - - public void testAddAll() throws Exception { - Collection elements = Arrays.asList(new String[] { "1", "2" }); - assertEquals(0, list.size()); - - list.addAll(elements); - - assertEquals(2, bean.getList().size()); - } - - public void testAddAllListChangEvent() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - assertEquals(0, list.size()); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - assertEquals(0, listener.count); - - list.addAll(elements); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - - assertEntry(event.diff.getDifferences()[0], true, 0, elements.get(0)); - assertEntry(event.diff.getDifferences()[1], true, 1, elements.get(1)); - } - - public void testAddAllPropertyChangeEvent() throws Exception { - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.addAll(Arrays.asList(new String[] {"0", "1"})); - } - }); - } - - public void testAddAllAtIndex() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - list.addAll(elements); - - assertEquals(2, list.size()); - - list.addAll(2, elements); - - assertEquals(4, bean.getList().size()); - assertEquals(elements.get(0), bean.getList().get(0)); - assertEquals(elements.get(1), bean.getList().get(1)); - } - - public void testAddAllAtIndexListChangeEvent() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - list.addAll(elements); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - - list.addAll(2, elements); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], true, 2, elements.get(0)); - assertEntry(event.diff.getDifferences()[1], true, 3, elements.get(1)); - } - - public void testAddAllAtIndexPropertyChangeEvent() throws Exception { - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.addAll(0, Arrays.asList(new String[] {"1", "2"})); - } - }); - } - - public void testRemoveAll() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - list.addAll(elements); - list.addAll(elements); - - assertEquals(4, bean.getList().size()); - list.removeAll(elements); - - assertEquals(2, bean.getList().size()); - assertEquals(elements.get(0), bean.getList().get(0)); - assertEquals(elements.get(1), bean.getList().get(1)); - } - - public void testRemoveAllListChangeEvent() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - list.addAll(elements); - list.addAll(elements); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - list.removeAll(elements); - - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], false, 0, elements.get(0)); - assertEntry(event.diff.getDifferences()[1], false, 0, elements.get(1)); - } - - public void testRemoveAllPropertyChangeEvent() throws Exception { - list.add("0"); - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.removeAll(Arrays.asList(new String[] {"0"})); - } - }); - } - - public void testRetailAll() throws Exception { - List elements = Arrays.asList(new String[] { "0", "1", "2", "3" }); - list.addAll(elements); - - assertEquals(4, bean.getList().size()); - - list.retainAll(elements.subList(0, 2)); - assertEquals(2, bean.getList().size()); - - assertEquals(elements.get(0), bean.getList().get(0)); - assertEquals(elements.get(1), bean.getList().get(1)); - } - - public void testRetainAllListChangeEvent() throws Exception { - List elements = Arrays.asList(new String[] { "0", "1", "2", "3" }); - list.addAll(elements); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - list.retainAll(elements.subList(0, 2)); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], false, 2, elements.get(2)); - assertEntry(event.diff.getDifferences()[1], false, 2, elements.get(3)); - } - - public void testRetainAllPropertyChangeEvent() throws Exception { - list.addAll(Arrays.asList(new String[] {"0", "1"})); - - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.retainAll(Arrays.asList(new String[] {"0"})); - } - }); - } - - public void testSet() throws Exception { - String oldElement = "old"; - String newElement = "new"; - list.add(oldElement); - - assertEquals(oldElement, bean.getList().get(0)); - - list.set(0, newElement); - assertEquals(newElement, bean.getList().get(0)); - } - - public void testSetListChangeEvent() throws Exception { - String oldElement = "old"; - String newElement = "new"; - list.add(oldElement); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - assertEquals(0, listener.count); - - list.set(0, newElement); - - assertEquals(1, listener.count); - ListChangeEvent event = listener.event; - assertEquals(list, event.getObservableList()); - assertEntry(event.diff.getDifferences()[0], true, 0, newElement); - assertEntry(event.diff.getDifferences()[1], false, 1, oldElement); - } - - public void testSetPropertyChangeEvent() throws Exception { - list.add("0"); - assertPropertyChangeEvent(bean, new Runnable() { - public void run() { - list.set(0, "1"); - } - }); - } - - public void testListChangeEventFiresWhenNewListIsSet() throws Exception { - List elements = Arrays.asList(new String[] { "1", "2" }); - - ListChangeEventTracker listener = new ListChangeEventTracker(); - list.addListChangeListener(listener); - - assertEquals(0, listener.count); - bean.setList(elements); - assertEquals(1, listener.count); - } - - public void testConstructor_RegistersListener() throws Exception { - Bean bean = new Bean(); - JavaBeanObservableList observable = new JavaBeanObservableList(Realm - .getDefault(), bean, - new PropertyDescriptor("list", Bean.class), Bean.class); - - assertFalse(bean.hasListeners("list")); - ChangeEventTracker.observe(observable); - assertTrue(bean.hasListeners("list")); - } - - public void testConstructor_SkipsRegisterListener() throws Exception { - Bean bean = new Bean(); - JavaBeanObservableList observable = new JavaBeanObservableList(Realm - .getDefault(), bean, - new PropertyDescriptor("list", Bean.class), Bean.class, false); - - assertFalse(bean.hasListeners("list")); - ChangeEventTracker.observe(observable); - assertFalse(bean.hasListeners("list")); - } - - private static void assertEntry(ListDiffEntry entry, boolean addition, - int position, Object element) { - assertEquals("addition", addition, entry.isAddition()); - assertEquals("position", position, entry.getPosition()); - assertEquals("element", element, entry.getElement()); - } - - private static void assertPropertyChangeEvent(NonStandardBean bean, Runnable runnable) { - PropertyChangeTracker listener = new PropertyChangeTracker(); - bean.addPropertyChangeListener(listener); - - List old = bean.getList(); - assertEquals(0, listener.count); - - runnable.run(); - - PropertyChangeEvent event = listener.evt; - assertEquals("event did not fire", 1, listener.count); - assertEquals("list", event.getPropertyName()); - assertEquals("old value", old, event.getOldValue()); - assertEquals("new value", bean.getList(), event.getNewValue()); - assertFalse("lists are equal", bean.getList().equals(old)); - } - - private static class PropertyChangeTracker implements - PropertyChangeListener { - int count; - - PropertyChangeEvent evt; - - /* - * (non-Javadoc) - * - * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent) - */ - public void propertyChange(PropertyChangeEvent evt) { - count++; - this.evt = evt; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableMapTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableMapTest.java deleted file mode 100755 index c0e0a7ab..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableMapTest.java +++ /dev/null @@ -1,170 +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.internal.databinding.internal.beans; - -import java.beans.PropertyDescriptor; -import java.util.HashSet; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.Realm; -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.core.tests.databinding.observable.ThreadRealm; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; - -/** - * @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()); - } - - public void testConstructor_SkipRegisterListeners() throws Exception { - Realm realm = new CurrentRealm(true); - WritableSet set = new WritableSet(realm); - Bean bean = new Bean(); - set.add(bean); - - JavaBeanObservableMap observable = new JavaBeanObservableMap(set, new PropertyDescriptor("value", Bean.class), false); - ChangeEventTracker.observe(observable); - - assertFalse(bean.hasListeners("value")); - } - - public void testConstructor_RegistersListeners() throws Exception { - Realm realm = new CurrentRealm(true); - WritableSet set = new WritableSet(realm); - Bean bean = new Bean(); - set.add(bean); - - JavaBeanObservableMap observable = new JavaBeanObservableMap(set, new PropertyDescriptor("value", Bean.class)); - ChangeEventTracker.observe(observable); - - assertTrue(bean.hasListeners("value")); - } - - 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/core/tests/internal/databinding/internal/beans/JavaBeanObservableSetTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableSetTest.java deleted file mode 100644 index c11c4055..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableSetTest.java +++ /dev/null @@ -1,113 +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.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.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.CurrentRealm; -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); - } - - public void testConstructor_RegisterListeners() throws Exception { - bean = new Bean(); - - observableSet = new JavaBeanObservableSet(new CurrentRealm(true), bean, - propertyDescriptor, Bean.class); - assertFalse(bean.hasListeners(propertyName)); - ChangeEventTracker.observe(observableSet); - assertTrue(bean.hasListeners(propertyName)); - } - - public void testConstructore_SkipsRegisterListeners() throws Exception { - bean = new Bean(); - - observableSet = new JavaBeanObservableSet(new CurrentRealm(true), bean, - propertyDescriptor, Bean.class, false); - assertFalse(bean.hasListeners(propertyName)); - ChangeEventTracker.observe(observableSet); - assertFalse(bean.hasListeners(propertyName)); - } - - 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/core/tests/internal/databinding/internal/beans/JavaBeanObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableValueTest.java deleted file mode 100755 index 07fce798..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableValueTest.java +++ /dev/null @@ -1,199 +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 - * Katarzyna Marszalek - test case for bug 198519 - ******************************************************************************/ - -package org.eclipse.core.tests.internal.databinding.internal.beans; - -import java.beans.IntrospectionException; -import java.beans.PropertyDescriptor; - -import junit.framework.Test; - -import org.eclipse.core.databinding.beans.BeansObservables; -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.Realm; -import org.eclipse.core.databinding.observable.value.ComputedValue; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.core.internal.databinding.internal.beans.JavaBeanObservableValue; -import org.eclipse.jface.databinding.conformance.MutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.ObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.util.ChangeEventTracker; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.examples.databinding.model.SimplePerson; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; - -/** - * @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); - } - - public void testGetObserved() throws Exception { - assertEquals(bean, observableValue.getObserved()); - } - - public void testGetPropertyDescriptor() throws Exception { - assertEquals(propertyDescriptor, observableValue.getPropertyDescriptor()); - } - - public void testSetValueThrowsExceptionThrownByBean() throws Exception { - ThrowsSetException temp = new ThrowsSetException(); - JavaBeanObservableValue observable = new JavaBeanObservableValue(Realm - .getDefault(), temp, - new PropertyDescriptor("value", ThrowsSetException.class)); - - try { - observable.setValue(""); - fail("exception should have been thrown"); - } catch (RuntimeException e) { - assertEquals(temp.thrownException, e.getCause()); - } - } - - public void testGetValueThrowsExceptionThrownByBean() throws Exception { - ThrowsGetException temp = new ThrowsGetException(); - JavaBeanObservableValue observable = new JavaBeanObservableValue(Realm - .getDefault(), temp, - new PropertyDescriptor("value", ThrowsGetException.class)); - - try { - observable.getValue(); - fail("exception should have been thrown"); - } catch (RuntimeException e) { - assertEquals(temp.thrownException, e.getCause()); - } - } - - public void testBug198519() { - final SimplePerson person = new SimplePerson(); - final ComputedValue cv = new ComputedValue() { - final IObservableValue name = BeansObservables.observeValue(person, "name"); //$NON-NLS-1$ - protected Object calculate() { - return Boolean.valueOf(name.getValue() != null); - } - }; - cv.addChangeListener(new IChangeListener() { - public void handleChange(ChangeEvent event) { - cv.getValue(); - } - }); - person.setName("foo"); - } - - public void testConstructor_RegistersListeners() throws Exception { - JavaBeanObservableValue observable = new JavaBeanObservableValue(Realm.getDefault(), bean, propertyDescriptor); - ChangeEventTracker.observe(observable); - - assertTrue(bean.hasListeners(propertyName)); - } - - public void testConstructor_SkipRegisterListeners() throws Exception { - JavaBeanObservableValue observable = new JavaBeanObservableValue(Realm.getDefault(), bean, propertyDescriptor, false); - ChangeEventTracker.observe(observable); - - assertFalse(bean.hasListeners(propertyName)); - } - - public static Test suite() { - Object[] params = new Object[] {new Delegate()}; - - return new SuiteBuilder().addTests(JavaBeanObservableValueTest.class) - .addParameterizedTests(ObservableValueContractTest.class, - params).addParameterizedTests( - MutableObservableValueContractTest.class, params) - .build(); - } - - /* package */ static class Delegate extends AbstractObservableValueContractDelegate { - private Bean bean; - - public void setUp() { - super.setUp(); - - bean = new Bean(""); - } - - public IObservableValue createObservableValue(Realm realm) { - try { - PropertyDescriptor propertyDescriptor = new PropertyDescriptor("value", Bean.class); - return new JavaBeanObservableValue(realm, bean, - propertyDescriptor); - } catch (IntrospectionException e) { - throw new RuntimeException(e); - } - } - - public void change(IObservable observable) { - IObservableValue observableValue = (IObservableValue) observable; - observableValue.setValue(createValue(observableValue)); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public Object createValue(IObservableValue observable) { - return observable.getValue() + "a"; - } - } - - /** - * Throws an exception when the value is set. - * - * @since 3.2 - */ - /* package */class ThrowsSetException { - private String value; - - /* package */NullPointerException thrownException; - - public void setValue(String value) { - throw thrownException = new NullPointerException(); - } - - public String getValue() { - return value; - } - } - - /* package */class ThrowsGetException { - public String value; - - /* package */NullPointerException thrownException; - - public String getValue() { - throw thrownException = new NullPointerException(); - } - - public void setValue(String value) { - this.value = value; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/ListenerSupportTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/ListenerSupportTest.java deleted file mode 100644 index 2a1b2693..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/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.core.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/core/tests/internal/databinding/internal/beans/NonStandardBean.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/NonStandardBean.java deleted file mode 100644 index 2ee5b1a1..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/NonStandardBean.java +++ /dev/null @@ -1,77 +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.internal.beans; - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -/** - * Simple non-standard (java.util.List-based property) Java Bean for testing. - * - * @since 3.3 - */ -public class NonStandardBean { - /* package */PropertyChangeSupport changeSupport = new PropertyChangeSupport(this); - private String value; - private List list = new ArrayList(); - private Set set; - - public NonStandardBean() { - } - - public NonStandardBean(String value) { - this.value = value; - } - - public NonStandardBean(List list) { - this.list = list; - } - - public NonStandardBean(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 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/core/tests/internal/databinding/observable/UnmodifiableObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/observable/UnmodifiableObservableListTest.java deleted file mode 100755 index 6fde8a89..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/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.core.tests.internal.databinding.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/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 20c41028..00000000 --- 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 0ed49887..00000000 --- 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 471666b4..00000000 --- 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/AbstractStringToNumberValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/AbstractStringToNumberValidatorTest.java deleted file mode 100644 index cf58d351..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/AbstractStringToNumberValidatorTest.java +++ /dev/null @@ -1,55 +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.validation; - -import junit.framework.TestCase; - -import org.eclipse.core.databinding.conversion.StringToNumberConverter; -import org.eclipse.core.internal.databinding.validation.AbstractStringToNumberValidator; -import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; -import org.eclipse.core.runtime.IStatus; - -/** - * Tests for AbstractStringToNumberValidator. Most tests should be included in - * StringToNumberValidatorTestHarness. This class is for the edge cases. - * - * @since 3.2 - */ -public class AbstractStringToNumberValidatorTest extends TestCase { - /** - * Test for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=194353. - * - * @throws Exception - */ - public void testErrorMessagesAreNotCached() throws Exception { - NumberFormatConverter c = StringToNumberConverter.toInteger(false); - ValidatorStub v = new ValidatorStub(c); - - IStatus status1 = v.validate("1a"); - assertEquals(IStatus.ERROR, status1.getSeverity()); - - IStatus status2 = v.validate("2b"); - assertEquals(IStatus.ERROR, status2.getSeverity()); - - assertFalse("messages should not be equal", status1.getMessage().equals(status2.getMessage())); - } - - static class ValidatorStub extends AbstractStringToNumberValidator { - ValidatorStub(NumberFormatConverter c) { - super(c, new Integer(Integer.MIN_VALUE), new Integer(Integer.MAX_VALUE)); - } - - protected boolean isInRange(Number number) { - return true; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToByteValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToByteValidatorTest.java deleted file mode 100644 index 88f27505..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToByteValidatorTest.java +++ /dev/null @@ -1,48 +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 org.eclipse.core.internal.databinding.conversion.NumberToByteConverter; -import org.eclipse.core.internal.databinding.validation.NumberToByteValidator; -import org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToByteValidatorTest extends NumberToNumberValidatorTestHarness { - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Integer(Byte.MAX_VALUE + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToBoxedTypeValidator() - */ - protected NumberToNumberValidator doGetToBoxedTypeValidator(Class fromType) { - NumberToByteConverter converter = new NumberToByteConverter(NumberFormat.getInstance(), - fromType, false); - return new NumberToByteValidator(converter); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToPrimitiveValidator() - */ - protected NumberToNumberValidator doGetToPrimitiveValidator(Class fromType) { - NumberToByteConverter converter = new NumberToByteConverter(NumberFormat.getInstance(), - fromType, true); - return new NumberToByteValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java deleted file mode 100644 index 38c7a291..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java +++ /dev/null @@ -1,50 +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 java.math.BigDecimal; - -import org.eclipse.core.internal.databinding.conversion.NumberToDoubleConverter; -import org.eclipse.core.internal.databinding.validation.NumberToDoubleValidator; -import org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToDoubleValidatorTest extends - NumberToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new BigDecimal(Double.MAX_VALUE).add(new BigDecimal(Double.MAX_VALUE)); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToBoxedTypeValidator(Class fromType) { - NumberToDoubleConverter converter = new NumberToDoubleConverter(NumberFormat.getInstance(), fromType, false); - return new NumberToDoubleValidator(converter); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToPrimitiveValidator(Class fromType) { - NumberToDoubleConverter converter = new NumberToDoubleConverter(NumberFormat.getInstance(), fromType, true); - return new NumberToDoubleValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToFloatValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToFloatValidatorTest.java deleted file mode 100644 index f2f8a588..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToFloatValidatorTest.java +++ /dev/null @@ -1,48 +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 org.eclipse.core.internal.databinding.conversion.NumberToFloatConverter; -import org.eclipse.core.internal.databinding.validation.NumberToFloatValidator; -import org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToFloatValidatorTest extends - NumberToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Double(Double.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToBoxedTypeValidator(Class fromType) { - NumberToFloatConverter converter = new NumberToFloatConverter(NumberFormat.getInstance(), fromType, false); - return new NumberToFloatValidator(converter); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToPrimitiveValidator(Class fromType) { - NumberToFloatConverter converter = new NumberToFloatConverter(NumberFormat.getInstance(), fromType, true); - return new NumberToFloatValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToIntegerValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToIntegerValidatorTest.java deleted file mode 100644 index 37015a26..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToIntegerValidatorTest.java +++ /dev/null @@ -1,48 +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 org.eclipse.core.internal.databinding.conversion.NumberToIntegerConverter; -import org.eclipse.core.internal.databinding.validation.NumberToIntegerValidator; -import org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToIntegerValidatorTest extends - NumberToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Long((long) Integer.MAX_VALUE + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToBoxedTypeValidator(Class fromType) { - NumberToIntegerConverter converter = new NumberToIntegerConverter(NumberFormat.getInstance(), fromType, false); - return new NumberToIntegerValidator(converter); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToPrimitiveValidator(Class fromType) { - NumberToIntegerConverter converter = new NumberToIntegerConverter(NumberFormat.getInstance(), fromType, true); - return new NumberToIntegerValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToLongValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToLongValidatorTest.java deleted file mode 100644 index 7821d758..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToLongValidatorTest.java +++ /dev/null @@ -1,48 +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 org.eclipse.core.internal.databinding.conversion.NumberToLongConverter; -import org.eclipse.core.internal.databinding.validation.NumberToLongValidator; -import org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToLongValidatorTest extends - NumberToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Double(Double.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToBoxedTypeValidator(Class fromType) { - NumberToLongConverter converter = new NumberToLongConverter(NumberFormat.getInstance(), fromType, false); - return new NumberToLongValidator(converter); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToPrimitiveValidator(Class fromType) { - NumberToLongConverter converter = new NumberToLongConverter(NumberFormat.getInstance(), fromType, true); - return new NumberToLongValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToNumberValidatorTestHarness.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToNumberValidatorTestHarness.java deleted file mode 100644 index 817241c5..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToNumberValidatorTestHarness.java +++ /dev/null @@ -1,75 +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.validation.IValidator; -import org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; -import org.eclipse.core.runtime.IStatus; - -/** - * @since 1.1 - */ -public abstract class NumberToNumberValidatorTestHarness extends TestCase { - protected abstract NumberToNumberValidator doGetToPrimitiveValidator(Class fromType); - protected abstract NumberToNumberValidator doGetToBoxedTypeValidator(Class fromType); - protected abstract Number doGetOutOfRangeNumber(); - - public void testValidateNullForBoxedTypeIsOK() throws Exception { - IStatus status = doGetToBoxedTypeValidator(Integer.class).validate(null); - assertTrue(status.isOK()); - } - - public void testValidateNullForPrimitiveThrowsIllegalArgumentException() - throws Exception { - IValidator validator = doGetToPrimitiveValidator(Integer.class); - - if (validator == null) { - //return if a primitive validator does not exist (e.g. BigInteger, BigDecimal, etc.) - return; - } - - try { - doGetToPrimitiveValidator(Integer.class).validate(null); - - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } - - public void testValidReturnsOK() throws Exception { - assertTrue(doGetToBoxedTypeValidator(Integer.class).validate(new Integer(1)).isOK()); - } - - public void testOutOfRangeReturnsError() throws Exception { - Number number = doGetOutOfRangeNumber(); - - if (number == null) { - //return if there is no value out of range (e.g. BigInteger, BigDecimal, etc.) - return; - } - - IStatus status = doGetToBoxedTypeValidator(Integer.class).validate(number); - - assertEquals(IStatus.ERROR, status.getSeverity()); - assertTrue(status.getMessage() != null); - } - - public void testValidateIncorrectTypeThrowsIllegalArgumentException() throws Exception { - try { - doGetToBoxedTypeValidator(Integer.class).validate(""); - fail("exception should have been thrown"); - } catch (IllegalArgumentException e) { - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToShortValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToShortValidatorTest.java deleted file mode 100644 index df915931..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToShortValidatorTest.java +++ /dev/null @@ -1,48 +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 org.eclipse.core.internal.databinding.conversion.NumberToShortConverter; -import org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; -import org.eclipse.core.internal.databinding.validation.NumberToShortValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToShortValidatorTest extends NumberToNumberValidatorTestHarness { - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return new Integer(Short.MAX_VALUE + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToBoxedTypeValidator(Class fromType) { - NumberToShortConverter converter = new NumberToShortConverter(NumberFormat.getInstance(), - Integer.class, false); - return new NumberToShortValidator(converter); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToPrimitiveValidator(Class fromType) { - NumberToShortConverter converter = new NumberToShortConverter(NumberFormat.getInstance(), - Integer.class, true); - return new NumberToShortValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToUnboundedNumberValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToUnboundedNumberValidatorTest.java deleted file mode 100644 index da5fa743..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToUnboundedNumberValidatorTest.java +++ /dev/null @@ -1,47 +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 org.eclipse.core.internal.databinding.conversion.NumberToBigIntegerConverter; -import org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; -import org.eclipse.core.internal.databinding.validation.NumberToUnboundedNumberValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class NumberToUnboundedNumberValidatorTest extends - NumberToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetOutOfRangeNumber() - */ - protected Number doGetOutOfRangeNumber() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToBoxedTypeValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToBoxedTypeValidator(Class fromType) { - NumberToBigIntegerConverter converter = new NumberToBigIntegerConverter(NumberFormat.getInstance(), fromType); - return new NumberToUnboundedNumberValidator(converter); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.NumberToNumberValidatorTestHarness#doGetToPrimitiveValidator(java.lang.Class) - */ - protected NumberToNumberValidator doGetToPrimitiveValidator(Class fromType) { - return null; // primitive BigInteger does not exist - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToByteValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToByteValidatorTest.java deleted file mode 100644 index 7e33bc2b..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToByteValidatorTest.java +++ /dev/null @@ -1,61 +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 org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.internal.databinding.conversion.StringToByteConverter; -import org.eclipse.core.internal.databinding.validation.StringToByteValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToByteValidatorTest extends - StringToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInRangeNumber() - */ - protected Number getInRangeNumber() { - return new Byte(Byte.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInvalidString() - */ - protected String getInvalidString() { - return "1.1"; - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getOutOfRangeNumber() - */ - protected Number getOutOfRangeNumber() { - return new Integer(Byte.MAX_VALUE + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupNumberFormat() - */ - protected NumberFormat setupNumberFormat() { - return NumberFormat.getIntegerInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupValidator(com.ibm.icu.text.NumberFormat) - */ - protected IValidator setupValidator(NumberFormat numberFormat) { - StringToByteConverter converter = StringToByteConverter.toByte(numberFormat, false); - return new StringToByteValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java deleted file mode 100644 index 71d6f3ff..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java +++ /dev/null @@ -1,64 +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 java.math.BigDecimal; - -import org.eclipse.core.databinding.conversion.StringToNumberConverter; -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.internal.databinding.validation.StringToDoubleValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToDoubleValidatorTest extends - StringToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInRangeNumber() - */ - protected Number getInRangeNumber() { - return new Double(1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInvalidString() - */ - protected String getInvalidString() { - return "1a"; - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getOutOfRangeNumber() - */ - protected Number getOutOfRangeNumber() { - BigDecimal decimal = new BigDecimal(Double.MAX_VALUE); - return decimal.add(new BigDecimal(Double.MAX_VALUE)); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupNumberFormat() - */ - protected NumberFormat setupNumberFormat() { - return NumberFormat.getInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupValidator(com.ibm.icu.text.NumberFormat) - */ - protected IValidator setupValidator(NumberFormat numberFormat) { - StringToNumberConverter converter = StringToNumberConverter.toDouble(numberFormat, false); - return new StringToDoubleValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToFloatValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToFloatValidatorTest.java deleted file mode 100644 index d7ec0329..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToFloatValidatorTest.java +++ /dev/null @@ -1,61 +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 org.eclipse.core.databinding.conversion.StringToNumberConverter; -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.internal.databinding.validation.StringToFloatValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToFloatValidatorTest extends - StringToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInRangeNumber() - */ - protected Number getInRangeNumber() { - return new Float(1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInvalidString() - */ - protected String getInvalidString() { - return "1a"; - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getOutOfRangeNumber() - */ - protected Number getOutOfRangeNumber() { - return new Double(Double.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupNumberFormat() - */ - protected NumberFormat setupNumberFormat() { - return NumberFormat.getInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupValidator(com.ibm.icu.text.NumberFormat) - */ - protected IValidator setupValidator(NumberFormat numberFormat) { - StringToNumberConverter converter = StringToNumberConverter.toFloat(numberFormat, false); - return new StringToFloatValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToIntegerValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToIntegerValidatorTest.java deleted file mode 100644 index d854d0b6..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToIntegerValidatorTest.java +++ /dev/null @@ -1,71 +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 org.eclipse.core.databinding.conversion.StringToNumberConverter; -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.internal.databinding.validation.StringToIntegerValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToIntegerValidatorTest extends - StringToNumberValidatorTestHarness { - /* - * (non-Javadoc) - * - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupNumberFormat() - */ - protected NumberFormat setupNumberFormat() { - return NumberFormat.getIntegerInstance(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupValidator(com.ibm.icu.text.NumberFormat) - */ - protected IValidator setupValidator(NumberFormat numberFormat) { - StringToNumberConverter converter = StringToNumberConverter.toInteger( - numberFormat, false); - return new StringToIntegerValidator(converter); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInRangeNumber() - */ - protected Number getInRangeNumber() { - return new Integer(1); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInvalidString() - */ - protected String getInvalidString() { - return "1.1"; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getOutOfRangeNumber() - */ - protected Number getOutOfRangeNumber() { - return new Double(Double.MAX_VALUE); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToLongValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToLongValidatorTest.java deleted file mode 100644 index 97f76474..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToLongValidatorTest.java +++ /dev/null @@ -1,60 +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 org.eclipse.core.databinding.conversion.StringToNumberConverter; -import org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; -import org.eclipse.core.internal.databinding.validation.StringToLongValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToLongValidatorTest extends StringToNumberValidatorTestHarness { - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInRangeNumber() - */ - protected Number getInRangeNumber() { - return new Long(1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInvalidString() - */ - protected String getInvalidString() { - return "1.1"; - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getOutOfRangeNumber() - */ - protected Number getOutOfRangeNumber() { - return new Double(Double.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupNumberFormat() - */ - protected NumberFormat setupNumberFormat() { - return NumberFormat.getIntegerInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupValidator() - */ - protected IValidator setupValidator(NumberFormat numberFormat) { - NumberFormatConverter converter = StringToNumberConverter.toInteger(numberFormat, false); - return new StringToLongValidator(converter); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToNumberValidatorTestHarness.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToNumberValidatorTestHarness.java deleted file mode 100644 index 9e62ec32..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToNumberValidatorTestHarness.java +++ /dev/null @@ -1,95 +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.validation.IValidator; -import org.eclipse.core.runtime.IStatus; - -import com.ibm.icu.text.NumberFormat; - -/** - * A test harness for testing string to number validators. - * - * @since 1.1 - */ -public abstract class StringToNumberValidatorTestHarness extends TestCase { - private NumberFormat numberFormat; - private IValidator validator; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - numberFormat = setupNumberFormat(); - validator = setupValidator(numberFormat); - } - - /** - * Invoked during setup to instantiate the number format. - * - * @return number format - */ - protected abstract NumberFormat setupNumberFormat(); - - /** - * Invoked during setup to instantiate the validator. - * - * @param numberFormat - * @return validator - */ - protected abstract IValidator setupValidator(NumberFormat numberFormat); - - /** - * Returns a string value that will not parse. - * - * @return string - */ - protected abstract String getInvalidString(); - - /** - * Returns a number value that is out of range for the validator. - * - * @return number - */ - protected abstract Number getOutOfRangeNumber(); - - /** - * Returns a number that is in range for the validator. - * - * @return number - */ - protected abstract Number getInRangeNumber(); - - public void testInvalidValueReturnsError() throws Exception { - IStatus status = validator.validate(getInvalidString()); - assertEquals("error severify", IStatus.ERROR, status.getSeverity()); - assertNotNull("message not null", status.getMessage()); - } - - public void testOutOfRangeValueReturnsError() throws Exception { - String string = numberFormat.format(getOutOfRangeNumber()); - IStatus status = validator.validate(string); - assertEquals(IStatus.ERROR, status.getSeverity()); - assertNotNull(status.getMessage()); - } - - public void testValidateValidValue() throws Exception { - String string = numberFormat.format(getInRangeNumber()); - assertTrue(validator.validate(string).isOK()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToShortValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToShortValidatorTest.java deleted file mode 100644 index 9de5b389..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToShortValidatorTest.java +++ /dev/null @@ -1,62 +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 org.eclipse.core.databinding.validation.IValidator; -import org.eclipse.core.internal.databinding.conversion.StringToShortConverter; -import org.eclipse.core.internal.databinding.validation.StringToShortValidator; - -import com.ibm.icu.text.NumberFormat; - -/** - * @since 1.1 - */ -public class StringToShortValidatorTest extends - StringToNumberValidatorTestHarness { - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInRangeNumber() - */ - protected Number getInRangeNumber() { - return new Short(Short.MAX_VALUE); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getInvalidString() - */ - protected String getInvalidString() { - return "1.1"; - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#getOutOfRangeNumber() - */ - protected Number getOutOfRangeNumber() { - return new Integer(Short.MAX_VALUE + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupNumberFormat() - */ - protected NumberFormat setupNumberFormat() { - return NumberFormat.getIntegerInstance(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.tests.internal.databinding.validation.StringToNumberValidatorTestHarness#setupValidator(com.ibm.icu.text.NumberFormat) - */ - protected IValidator setupValidator(NumberFormat numberFormat) { - StringToShortConverter converter = StringToShortConverter.toShort(numberFormat, false); - return new StringToShortValidator(converter); - } - -} 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 c6fd4a9a..00000000 --- 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.conformance.util.RealmTester; -import org.eclipse.jface.databinding.swt.SWTObservables; -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 32f0cdb5..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/AbstractSWTTestCase.java +++ /dev/null @@ -1,59 +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 - * Ashley Cambrell - bug 198904 - ******************************************************************************/ - -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/BindingTestSetup.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSetup.java deleted file mode 100644 index 7ef5f670..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSetup.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.jface.tests.databinding; - -import java.util.Locale; - -import org.eclipse.core.databinding.util.ILogger; -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.runtime.IStatus; - -import junit.extensions.TestSetup; -import junit.framework.Test; - -/** - * @since 3.2 - * - */ -public class BindingTestSetup extends TestSetup { - - private Locale oldLocale; - private ILogger oldLogger; - private org.eclipse.jface.util.ILogger oldJFaceLogger; - - public BindingTestSetup(Test test) { - super(test); - } - - protected void setUp() throws Exception { - super.setUp(); - oldLocale = Locale.getDefault(); - Locale.setDefault(Locale.US); - oldLogger = Policy.getLog(); - Policy.setLog(new ILogger() { - public void log(IStatus status) { - // we are not expecting anything in the log while we test. - if (status.getException() != null) { - throw new RuntimeException(status.getException()); - } - fail(); - } - }); - oldJFaceLogger = org.eclipse.jface.util.Policy.getLog(); - org.eclipse.jface.util.Policy.setLog(new org.eclipse.jface.util.ILogger(){ - public void log(IStatus status) { - // we are not expecting anything in the log while we test. - if (status.getException() != null) { - throw new RuntimeException(status.getException()); - } - fail(); - } - }); - } - - protected void tearDown() throws Exception { - Locale.setDefault(oldLocale); - Policy.setLog(oldLogger); - org.eclipse.jface.util.Policy.setLog(oldJFaceLogger); - super.tearDown(); - } -} 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 e9b1d206..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/BindingTestSuite.java +++ /dev/null @@ -1,343 +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 - * Bob Smith - bug 198880 - * Ashley Cambrell - bugs 198903, 198904 - *******************************************************************************/ -package org.eclipse.jface.tests.databinding; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.core.tests.databinding.AggregateValidationStatusTest; -import org.eclipse.core.tests.databinding.DatabindingContextTest; -import org.eclipse.core.tests.databinding.ListBindingTest; -import org.eclipse.core.tests.databinding.ObservablesManagerTest; -import org.eclipse.core.tests.databinding.UpdateStrategyTest; -import org.eclipse.core.tests.databinding.UpdateValueStrategyTest; -import org.eclipse.core.tests.databinding.ValueBindingTest; -import org.eclipse.core.tests.databinding.beans.BeansObservablesTest; -import org.eclipse.core.tests.databinding.beans.PojoObservablesTest; -import org.eclipse.core.tests.databinding.conversion.NumberToStringConverterTest; -import org.eclipse.core.tests.databinding.conversion.StringToNumberConverterTest; -import org.eclipse.core.tests.databinding.observable.AbstractObservableTest; -import org.eclipse.core.tests.databinding.observable.DiffsTest; -import org.eclipse.core.tests.databinding.observable.Diffs_ListDiffTests; -import org.eclipse.core.tests.databinding.observable.ObservablesTest; -import org.eclipse.core.tests.databinding.observable.RealmTest; -import org.eclipse.core.tests.databinding.observable.list.AbstractObservableListTest; -import org.eclipse.core.tests.databinding.observable.list.ObservableListTest; -import org.eclipse.core.tests.databinding.observable.list.WritableListTest; -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.databinding.observable.set.AbstractObservableSetTest; -import org.eclipse.core.tests.databinding.observable.set.ObservableSetTest; -import org.eclipse.core.tests.databinding.observable.set.UnionSetTest; -import org.eclipse.core.tests.databinding.observable.set.WritableSetTest; -import org.eclipse.core.tests.databinding.observable.value.AbstractObservableValueTest; -import org.eclipse.core.tests.databinding.observable.value.AbstractVetoableValueTest; -import org.eclipse.core.tests.databinding.observable.value.ComputedValueTest; -import org.eclipse.core.tests.databinding.observable.value.WritableValueTest; -import org.eclipse.core.tests.databinding.validation.ValidationStatusTest; -import org.eclipse.core.tests.internal.databinding.BindingMessagesTest; -import org.eclipse.core.tests.internal.databinding.BindingStatusTest; -import org.eclipse.core.tests.internal.databinding.QueueTest; -import org.eclipse.core.tests.internal.databinding.RandomAccessListIteratorTest; -import org.eclipse.core.tests.internal.databinding.conversion.DateConversionSupportTest; -import org.eclipse.core.tests.internal.databinding.conversion.IdentityConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.IntegerToStringConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.NumberToBigDecimalTest; -import org.eclipse.core.tests.internal.databinding.conversion.NumberToBigIntegerConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.NumberToByteConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.NumberToDoubleConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.NumberToFloatConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.NumberToIntegerConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.NumberToLongConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.NumberToShortConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.ObjectToPrimitiveValidatorTest; -import org.eclipse.core.tests.internal.databinding.conversion.StatusToStringConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToBooleanConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToByteConverterTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserByteTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserDoubleTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserFloatTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserIntegerTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserLongTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserShortTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToNumberParserTest; -import org.eclipse.core.tests.internal.databinding.conversion.StringToShortConverterTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.BeanObservableListDecoratorTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.BeanObservableSetDecoratorTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.BeanObservableValueDecoratorTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.JavaBeanObservableArrayBasedListTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.JavaBeanObservableListTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.JavaBeanObservableMapTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.JavaBeanObservableSetTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.JavaBeanObservableValueTest; -import org.eclipse.core.tests.internal.databinding.internal.beans.ListenerSupportTest; -import org.eclipse.core.tests.internal.databinding.observable.UnmodifiableObservableListTest; -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.AbstractStringToNumberValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.NumberToByteValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.NumberToDoubleValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.NumberToFloatValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.NumberToIntegerValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.NumberToLongValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.NumberToShortValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.NumberToUnboundedNumberValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.StringToByteValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.StringToDoubleValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.StringToFloatValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.StringToIntegerValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.StringToLongValidatorTest; -import org.eclipse.core.tests.internal.databinding.validation.StringToShortValidatorTest; -import org.eclipse.jface.tests.databinding.scenarios.BindingScenariosTestSuite; -import org.eclipse.jface.tests.databinding.swt.SWTObservablesTest; -import org.eclipse.jface.tests.databinding.viewers.ObservableMapLabelProviderTest; -import org.eclipse.jface.tests.databinding.viewers.ObservableSetContentProviderTest; -import org.eclipse.jface.tests.examples.databinding.mask.internal.EditMaskLexerAndTokenTest; -import org.eclipse.jface.tests.examples.databinding.mask.internal.EditMaskParserTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.ButtonObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.CComboObservableValueSelectionTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.CComboObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.CComboObservableValueTextTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.CComboSingleSelectionObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.CLabelObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.ComboObservableValueSelectionTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.ComboObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.ComboObservableValueTextTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.ComboSingleSelectionObservableValueTest; -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.ListSingleSelectionObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.ScaleObservableValueMaxTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.ScaleObservableValueMinTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.ScaleObservableValueSelectionTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.SpinnerObservableValueMaxTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.SpinnerObservableValueMinTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.SpinnerObservableValueSelectionTest; -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.TableSingleSelectionObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.TextEditableObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.TextObservableValueFocusOutTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.TextObservableValueModifyTest; -import org.eclipse.jface.tests.internal.databinding.internal.swt.TextObservableValueTest; -import org.eclipse.jface.tests.internal.databinding.internal.viewers.SelectionProviderMultiSelectionObservableListTest; -import org.eclipse.jface.tests.internal.databinding.internal.viewers.SelectionProviderSingleSelectionObservableValueTest; - -public class BindingTestSuite extends TestSuite { - - public static void main(String[] args) { - junit.textui.TestRunner.run(suite()); - } - - public static Test suite() { - return new BindingTestSetup(new BindingTestSuite()); - } - - public BindingTestSuite() { - // org.eclipse.core.tests.databinding - addTestSuite(AggregateValidationStatusTest.class); - addTestSuite(DatabindingContextTest.class); - addTestSuite(ListBindingTest.class); - addTestSuite(UpdateStrategyTest.class); - addTestSuite(UpdateValueStrategyTest.class); - addTestSuite(ValueBindingTest.class); - addTestSuite(ObservablesManagerTest.class); - - // org.eclipse.core.tests.databinding.beans - addTestSuite(BeansObservablesTest.class); - addTestSuite(PojoObservablesTest.class); - - // org.eclipse.core.tests.databinding.conversion - addTestSuite(NumberToStringConverterTest.class); - addTestSuite(StringToNumberConverterTest.class); - - // org.eclipse.core.tests.databinding.observable - addTest(AbstractObservableTest.suite()); - addTestSuite(Diffs_ListDiffTests.class); - addTestSuite(DiffsTest.class); - addTestSuite(ObservablesTest.class); - addTestSuite(RealmTest.class); - - // org.eclipse.core.tests.databinding.observable.list - addTest(AbstractObservableListTest.suite()); - addTest(ObservableListTest.suite()); - addTest(WritableListTest.suite()); - - // org.eclipse.core.tests.databinding.observable.map - addTestSuite(AbstractObservableMapTest.class); - addTestSuite(ObservableMapTest.class); - addTestSuite(WritableMapTest.class); - - // org.eclipse.core.tests.databinding.observable.set - addTest(AbstractObservableSetTest.suite()); - addTest(ObservableSetTest.suite()); - addTest(UnionSetTest.suite()); - addTest(WritableSetTest.suite()); - - //org.eclipse.core.tests.databinding.observable.value - addTestSuite(AbstractObservableValueTest.class); - addTestSuite(AbstractVetoableValueTest.class); - addTestSuite(ComputedValueTest.class); - addTest(WritableValueTest.suite()); - - //org.eclipse.core.tests.databinding.validation - addTestSuite(ValidationStatusTest.class); - - // org.eclipse.core.tests.internal.databinding - addTestSuite(BindingMessagesTest.class); - addTestSuite(BindingStatusTest.class); - addTestSuite(RandomAccessListIteratorTest.class); - addTestSuite(QueueTest.class); - - // org.eclipse.core.tests.internal.databinding.conversion - addTestSuite(DateConversionSupportTest.class); - addTestSuite(IdentityConverterTest.class); - addTestSuite(IntegerToStringConverterTest.class); - addTestSuite(NumberToBigDecimalTest.class); - addTestSuite(NumberToBigIntegerConverterTest.class); - addTestSuite(NumberToByteConverterTest.class); - addTestSuite(NumberToDoubleConverterTest.class); - addTestSuite(NumberToFloatConverterTest.class); - addTestSuite(NumberToIntegerConverterTest.class); - addTestSuite(NumberToLongConverterTest.class); - addTestSuite(NumberToShortConverterTest.class); - addTestSuite(ObjectToPrimitiveValidatorTest.class); - addTestSuite(StatusToStringConverterTest.class); - addTestSuite(StringToBooleanConverterTest.class); - addTestSuite(StringToByteConverterTest.class); - addTestSuite(StringToNumberParserByteTest.class); - addTestSuite(StringToNumberParserDoubleTest.class); - addTestSuite(StringToNumberParserFloatTest.class); - addTestSuite(StringToNumberParserIntegerTest.class); - addTestSuite(StringToNumberParserLongTest.class); - addTestSuite(StringToNumberParserShortTest.class); - addTestSuite(StringToNumberParserTest.class); - addTestSuite(StringToShortConverterTest.class); - - //org.eclipse.core.tests.internal.databinding.internal.beans - addTestSuite(BeanObservableListDecoratorTest.class); - addTestSuite(BeanObservableSetDecoratorTest.class); - addTestSuite(BeanObservableValueDecoratorTest.class); - addTestSuite(BeanObservableListDecoratorTest.class); - addTestSuite(JavaBeanObservableArrayBasedListTest.class); - addTestSuite(JavaBeanObservableListTest.class); - addTestSuite(JavaBeanObservableMapTest.class); - addTestSuite(JavaBeanObservableSetTest.class); - addTest(JavaBeanObservableValueTest.suite()); - addTestSuite(ListenerSupportTest.class); - - //org.eclipse.core.tests.internal.databinding.observable - addTestSuite(UnmodifiableObservableListTest.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(AbstractStringToNumberValidatorTest.class); - addTestSuite(NumberToByteValidatorTest.class); - addTestSuite(NumberToDoubleValidatorTest.class); - addTestSuite(NumberToFloatValidatorTest.class); - addTestSuite(NumberToIntegerValidatorTest.class); - addTestSuite(NumberToLongValidatorTest.class); - addTestSuite(NumberToShortValidatorTest.class); - addTestSuite(NumberToUnboundedNumberValidatorTest.class); - addTestSuite(StringToByteValidatorTest.class); - addTestSuite(StringToDoubleValidatorTest.class); - addTestSuite(StringToFloatValidatorTest.class); - addTestSuite(StringToIntegerValidatorTest.class); - addTestSuite(StringToLongValidatorTest.class); - addTestSuite(StringToShortValidatorTest.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 - addTestSuite(SWTObservablesTest.class); - - // org.eclipse.jface.tests.databinding.viewers - addTestSuite(ObservableMapLabelProviderTest.class); - addTestSuite(ObservableSetContentProviderTest.class); - - //org.eclipse.jface.tests.example.databinding.mask.internal - addTestSuite(EditMaskLexerAndTokenTest.class); - addTestSuite(EditMaskParserTest.class); - - //org.eclipse.jface.tests.internal.databinding.internal.swt - addTest(ButtonObservableValueTest.suite()); - addTestSuite(CComboObservableValueTest.class); - addTest(CComboObservableValueSelectionTest.suite()); - addTest(CComboObservableValueTextTest.suite()); - addTestSuite(CComboSingleSelectionObservableValueTest.class); - addTest(CComboSingleSelectionObservableValueTest.suite()); - addTest(CLabelObservableValueTest.suite()); - addTestSuite(ComboObservableValueTest.class); - addTest(ComboObservableValueSelectionTest.suite()); - addTest(ComboObservableValueTextTest.suite()); - addTestSuite(ComboSingleSelectionObservableValueTest.class); - - addTestSuite(ControlObservableValueTest.class); - addTest(LabelObservableValueTest.suite()); - addTestSuite(ListSingleSelectionObservableValueTest.class); - addTest(ScaleObservableValueMinTest.suite()); - addTest(ScaleObservableValueMaxTest.suite()); - addTest(ScaleObservableValueSelectionTest.suite()); - - addTestSuite(SpinnerObservableValueTest.class); - addTest(SpinnerObservableValueMinTest.suite()); - addTest(SpinnerObservableValueMaxTest.suite()); - addTest(SpinnerObservableValueSelectionTest.suite()); - - addTestSuite(TableObservableValueTest.class); - addTest(TableSingleSelectionObservableValueTest.suite()); - addTest(TextEditableObservableValueTest.suite()); - addTest(TextObservableValueFocusOutTest.suite()); - addTest(TextObservableValueModifyTest.suite()); - addTestSuite(TextObservableValueTest.class); - - //org.eclipse.jface.tests.internal.databinding.internal.viewers - addTestSuite(SelectionProviderMultiSelectionObservableListTest.class); - addTestSuite(SelectionProviderSingleSelectionObservableValueTest.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/scenarios/AutomationUtil.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/AutomationUtil.java deleted file mode 100644 index 9e881ae6..00000000 --- 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 93fb3cb7..00000000 --- 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 5f1ac5ab..00000000 --- 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 aefc9e25..00000000 --- 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 31c683b0..00000000 --- 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 4cf8176c..00000000 --- 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 f8af8534..00000000 --- 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 e2447101..00000000 --- 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 d3507787..00000000 --- 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 c6eb678c..00000000 --- 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 ad234a6e..00000000 --- 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 0fe7dda1..00000000 --- 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 d8b8b767..00000000 --- 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 b7e4aed3..00000000 --- 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 6a323258..00000000 --- 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 719ceed4..00000000 --- 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 b55c59bc..00000000 --- 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.conformance.util.RealmTester; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.examples.databinding.model.SampleData; -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 b1d2ad2f..00000000 --- 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 70c38acb..00000000 --- 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 500b09bf..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/TextControlScenario.java +++ /dev/null @@ -1,310 +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.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 0097d63e..00000000 --- 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/SWTObservablesTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/SWTObservablesTest.java deleted file mode 100644 index 9ea0aba0..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/swt/SWTObservablesTest.java +++ /dev/null @@ -1,335 +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.conformance.util.RealmTester; -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.TableSingleSelectionObservableValue; -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.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; -import org.eclipse.swt.widgets.Tree; - -/** - * @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 TableSingleSelectionObservableValue); - } - - public void testObserveSingleSelectionIndexOfUnsupportedControl() - throws Exception { - Tree tree = new Tree(shell, SWT.NONE); - try { - SWTObservables.observeSingleSelectionIndex(tree); - 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/viewers/ObservableMapLabelProviderTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/viewers/ObservableMapLabelProviderTest.java deleted file mode 100644 index cffed54f..00000000 --- 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 dbf95fbb..00000000 --- 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/databinding/mask/internal/EditMaskLexerAndTokenTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/databinding/mask/internal/EditMaskLexerAndTokenTest.java deleted file mode 100755 index 040ae6c8..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/databinding/mask/internal/EditMaskLexerAndTokenTest.java +++ /dev/null @@ -1,108 +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.examples.databinding.mask.internal; - -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/examples/databinding/mask/internal/EditMaskParserTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/databinding/mask/internal/EditMaskParserTest.java deleted file mode 100755 index 8a2ceb45..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/examples/databinding/mask/internal/EditMaskParserTest.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.jface.tests.examples.databinding.mask.internal; - -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/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 1c9b9c1a..00000000 --- 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/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 a4e8d53b..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ButtonObservableValueTest.java +++ /dev/null @@ -1,149 +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 - * Ashley Cambrell - bug 198904 - ******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.internal.databinding.internal.swt.ButtonObservableValue; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - */ -public class ButtonObservableValueTest extends AbstractSWTTestCase { - private Button button; - private ButtonObservableValue observableValue; - private ValueChangeEventTracker listener; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - Shell shell = getShell(); - button = new Button(shell, SWT.CHECK); - observableValue = new ButtonObservableValue( - button); - listener = new ValueChangeEventTracker(); - } - - public void testSelection_ChangeNotifiesObservable() throws Exception { - observableValue.addValueChangeListener(listener); - button.setSelection(true); - - // precondition - assertEquals(0, listener.count); - button.notifyListeners(SWT.Selection, null); - - assertEquals("Selection event should notify observable.", 1, - listener.count); - } - - public void testSelection_NoChange() throws Exception { - button.setSelection(true); - button.notifyListeners(SWT.Selection, null); - observableValue.addValueChangeListener(listener); - - //precondition - assertEquals(0, listener.count); - - button.notifyListeners(SWT.Selection, null); - assertEquals("Value did not change. Listeners should not have been notified.", 0, listener.count); - } - - public void testDispose() throws Exception { - ValueChangeEventTracker testCounterValueChangeListener = new ValueChangeEventTracker(); - observableValue.addValueChangeListener(testCounterValueChangeListener); - - assertEquals(Boolean.FALSE, observableValue.getValue()); - assertFalse(button.getSelection()); - - button.setSelection(true); - button.notifyListeners(SWT.Selection, null); - - assertEquals(1, testCounterValueChangeListener.count); - assertEquals(Boolean.TRUE, observableValue.getValue()); - assertTrue(button.getSelection()); - - observableValue.dispose(); - - button.setSelection(false); - button.notifyListeners(SWT.Selection, null); - - assertEquals(1, testCounterValueChangeListener.count); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - - return new SuiteBuilder().addTests(ButtonObservableValueTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - Shell shell; - - Button button; - - public void setUp() { - super.setUp(); - - shell = new Shell(); - button = new Button(shell, SWT.CHECK); - } - - public void tearDown() { - super.tearDown(); - - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new ButtonObservableValue(realm, button); - } - - public Object getValueType(IObservableValue observable) { - return Boolean.TYPE; - } - - public void change(IObservable observable) { - button.setSelection(changeValue(button)); - button.notifyListeners(SWT.Selection, null); - } - - public Object createValue(IObservableValue observable) { - return Boolean.valueOf(changeValue(button)); - } - - private boolean changeValue(Button button) { - return !button.getSelection(); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueSelectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueSelectionTest.java deleted file mode 100644 index 6e7a18da..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueSelectionTest.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 junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.databinding.swt.ISWTObservable; -import org.eclipse.jface.databinding.swt.SWTObservables; -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.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - */ -public class CComboObservableValueSelectionTest extends TestCase { - private Delegate delegate; - - private CCombo combo; - - protected void setUp() throws Exception { - super.setUp(); - - delegate = new Delegate(); - delegate.setUp(); - combo = delegate.combo; - } - - protected void tearDown() throws Exception { - super.tearDown(); - - delegate.tearDown(); - } - - public void testSelection_NotifiesObservable() throws Exception { - IObservableValue observable = (IObservableValue) delegate - .createObservable(SWTObservables.getRealm(Display.getDefault())); - - ValueChangeEventTracker listener = ValueChangeEventTracker.observe(observable); - combo.select(0); - - assertEquals("Observable was not notified.", 1, listener.count); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests( - CComboObservableValueSelectionTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - /* package */CCombo combo; - - public void setUp() { - shell = new Shell(); - combo = new CCombo(shell, SWT.NONE); - combo.add("a"); - combo.add("b"); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new CComboObservableValue(realm, combo, - SWTProperties.SELECTION); - } - - public void change(IObservable observable) { - int index = combo - .indexOf((String) createValue((IObservableValue) observable)); - - combo.select(index); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public Object createValue(IObservableValue observable) { - CCombo combo = ((CCombo) ((ISWTObservable) observable).getWidget()); - switch (combo.getSelectionIndex()) { - case -1: - // fall thru - case 1: - return combo.getItem(0); - case 0: - return combo.getItem(1); - default: - throw new RuntimeException("Unexpected selection."); - } - } - } -} 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 74a7941e..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueTest.java +++ /dev/null @@ -1,52 +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 - * Ashley Cambrell - bug 198904 - ******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.internal.databinding.internal.swt.CComboObservableValue; -import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; - -/** - * @since 3.2 - */ -public class CComboObservableValueTest extends AbstractSWTTestCase { - public void testDispose() throws Exception { - CCombo combo = new CCombo(getShell(), SWT.NONE); - CComboObservableValue observableValue = new CComboObservableValue( - combo, SWTProperties.TEXT); - - ValueChangeEventTracker testCounterValueChangeListener = new ValueChangeEventTracker(); - observableValue.addValueChangeListener(testCounterValueChangeListener); - - assertEquals("", combo.getText()); - assertEquals("", observableValue.getValue()); - - String expected1 = "Test123"; - combo.setText(expected1); - - assertEquals(1, testCounterValueChangeListener.count); - assertEquals(expected1, combo.getText()); - assertEquals(expected1, observableValue.getValue()); - - observableValue.dispose(); - - String expected2 = "NewValue123"; - combo.setText(expected2); - - assertEquals(1, testCounterValueChangeListener.count); - assertEquals(expected2, combo.getText()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueTextTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueTextTest.java deleted file mode 100755 index 7dfffe1d..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboObservableValueTextTest.java +++ /dev/null @@ -1,110 +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.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.databinding.swt.ISWTObservable; -import org.eclipse.jface.databinding.swt.SWTObservables; -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.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - */ -public class CComboObservableValueTextTest extends TestCase { - private Delegate delegate; - - private CCombo combo; - - protected void setUp() throws Exception { - super.setUp(); - - delegate = new Delegate(); - delegate.setUp(); - combo = delegate.combo; - } - - protected void tearDown() throws Exception { - super.tearDown(); - - delegate.tearDown(); - } - - public void testModify_NotifiesObservable() throws Exception { - IObservableValue observable = delegate - .createObservableValue(SWTObservables.getRealm(Display - .getDefault())); - ValueChangeEventTracker listener = ValueChangeEventTracker - .observe(observable); - - combo.setText((String) delegate.createValue(observable)); - - assertEquals("Observable was not notified.", 1, listener.count); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests(CComboObservableValueTextTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - /* package */CCombo combo; - - private Shell shell; - - public void setUp() { - shell = new Shell(); - combo = new CCombo(shell, SWT.NONE); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new CComboObservableValue(realm, combo, SWTProperties.TEXT); - } - - public void change(IObservable observable) { - CCombo combo = (CCombo) ((ISWTObservable) observable).getWidget(); - combo.setText(combo.getText() + "a"); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public Object createValue(IObservableValue observable) { - return observable.getValue() + "a"; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboSingleSelectionObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboSingleSelectionObservableValueTest.java deleted file mode 100644 index 52cb5bb6..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CComboSingleSelectionObservableValueTest.java +++ /dev/null @@ -1,108 +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 - * Ashley Cambrell - bug 198903 - ******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.ISWTObservable; -import org.eclipse.jface.internal.databinding.internal.swt.CComboSingleSelectionObservableValue; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - */ -public class CComboSingleSelectionObservableValueTest extends AbstractSWTTestCase { - public void testSetValue() throws Exception { - CCombo combo = new CCombo(getShell(), SWT.NONE); - CComboSingleSelectionObservableValue observableValue = new CComboSingleSelectionObservableValue( - combo); - combo.add("Item1"); - combo.add("Item2"); - - assertEquals(-1, combo.getSelectionIndex()); - assertEquals(-1, ((Integer) observableValue.getValue()).intValue()); - - Integer value = new Integer(1); - observableValue.setValue(value); - assertEquals("combo selection index", value.intValue(), combo - .getSelectionIndex()); - assertEquals("observable value", value, observableValue.getValue()); - - assertEquals("Item2", combo.getText()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - - return new SuiteBuilder().addTests( - CComboSingleSelectionObservableValueTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private CCombo combo; - private Shell shell; - - public void setUp() { - shell = new Shell(); - combo = new CCombo(shell, SWT.NONE); - combo.add("0"); - combo.add("1"); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new CComboSingleSelectionObservableValue(realm, combo); - } - - public void change(IObservable observable) { - int index = _createValue((IObservableValue) observable); - combo.select(index); - combo.notifyListeners(SWT.Selection, null); - } - - public Object getValueType(IObservableValue observable) { - return Integer.TYPE; - } - - public Object createValue(IObservableValue observable) { - return new Integer(_createValue(observable)); - } - - private int _createValue(IObservableValue observable) { - CCombo combo = ((CCombo) ((ISWTObservable) observable).getWidget()); - int value = Math.max(0, combo.getSelectionIndex()); - - //returns either 0 or 1 depending upon current value - return Math.abs(value - 1); - } - } -} 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 61a47868..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/CLabelObservableValueTest.java +++ /dev/null @@ -1,108 +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.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -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.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - * - */ -public class CLabelObservableValueTest extends TestCase { - private Delegate delegate; - private IObservableValue observable; - private CLabel label; - - protected void setUp() throws Exception { - super.setUp(); - - delegate = new Delegate(); - delegate.setUp(); - label = delegate.label; - observable = delegate.createObservableValue(SWTObservables.getRealm(Display.getDefault())); - } - - protected void tearDown() throws Exception { - super.tearDown(); - - delegate.tearDown(); - observable.dispose(); - } - - public void testSetValue() throws Exception { - //preconditions - assertEquals("", label.getText()); - assertEquals("", observable.getValue()); - - String value = "value"; - observable.setValue(value); - assertEquals("label text", value, label.getText()); - assertEquals("observable value", value, observable.getValue()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - CLabel label; - - public void setUp() { - shell = new Shell(); - label = new CLabel(shell, SWT.NONE); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new CLabelObservableValue(realm, label); - } - - public void change(IObservable observable) { - IObservableValue value = (IObservableValue) observable; - value.setValue(value.getValue() + "a"); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public Object createValue(IObservableValue observable) { - return observable.getValue() + "a"; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueSelectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueSelectionTest.java deleted file mode 100644 index 0274e648..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueSelectionTest.java +++ /dev/null @@ -1,128 +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 junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.databinding.swt.ISWTObservable; -import org.eclipse.jface.databinding.swt.SWTObservables; -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.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - * - */ -public class ComboObservableValueSelectionTest extends TestCase { - private Delegate delegate; - - private Combo combo; - - protected void setUp() throws Exception { - super.setUp(); - - delegate = new Delegate(); - delegate.setUp(); - combo = delegate.combo; - } - - protected void tearDown() throws Exception { - super.tearDown(); - - delegate.tearDown(); - } - - public void testSelection_NotifiesObservable() throws Exception { - IObservableValue observable = (IObservableValue) delegate - .createObservable(SWTObservables.getRealm(Display.getDefault())); - - ValueChangeEventTracker listener = ValueChangeEventTracker - .observe(observable); - combo.select(0); - combo.notifyListeners(SWT.Selection, null); - - assertEquals("Observable was not notified.", 1, listener.count); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests( - ComboObservableValueSelectionTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - /* package */Combo combo; - - public void setUp() { - shell = new Shell(); - combo = new Combo(shell, SWT.NONE); - combo.add("a"); - combo.add("b"); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new ComboObservableValue(realm, combo, - SWTProperties.SELECTION); - } - - public void change(IObservable observable) { - int index = combo - .indexOf((String) createValue((IObservableValue) observable)); - - combo.select(index); - combo.notifyListeners(SWT.Selection, null); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public Object createValue(IObservableValue observable) { - Combo combo = ((Combo) ((ISWTObservable) observable).getWidget()); - switch (combo.getSelectionIndex()) { - case -1: - // fall thru - case 1: - return combo.getItem(0); - case 0: - return combo.getItem(1); - default: - throw new RuntimeException("Unexpected selection."); - } - } - } -} 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 961a7da0..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueTest.java +++ /dev/null @@ -1,52 +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 - * Ashley Cambrell - bug 198904 - ******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.internal.databinding.internal.swt.ComboObservableValue; -import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Combo; - -/** - * @since 3.2 - * - */ -public class ComboObservableValueTest extends AbstractSWTTestCase { - public void testDispose() throws Exception { - Combo combo = new Combo(getShell(), SWT.NONE); - ComboObservableValue observableValue = new ComboObservableValue(combo, - SWTProperties.TEXT); - ValueChangeEventTracker testCounterValueChangeListener = new ValueChangeEventTracker(); - observableValue.addValueChangeListener(testCounterValueChangeListener); - - assertEquals("", combo.getText()); - assertEquals("", observableValue.getValue()); - - String expected1 = "Test123"; - combo.setText(expected1); - - assertEquals(1, testCounterValueChangeListener.count); - assertEquals(expected1, combo.getText()); - assertEquals(expected1, observableValue.getValue()); - - observableValue.dispose(); - - String expected2 = "NewValue123"; - combo.setText(expected2); - - assertEquals(1, testCounterValueChangeListener.count); - assertEquals(expected2, combo.getText()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueTextTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueTextTest.java deleted file mode 100755 index fdc64489..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboObservableValueTextTest.java +++ /dev/null @@ -1,111 +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.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.databinding.swt.ISWTObservable; -import org.eclipse.jface.databinding.swt.SWTObservables; -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.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - * - */ -public class ComboObservableValueTextTest extends TestCase { - private Delegate delegate; - - private Combo combo; - - protected void setUp() throws Exception { - super.setUp(); - - delegate = new Delegate(); - delegate.setUp(); - combo = delegate.combo; - } - - protected void tearDown() throws Exception { - super.tearDown(); - - delegate.tearDown(); - } - - public void testModify_NotifiesObservable() throws Exception { - IObservableValue observable = delegate - .createObservableValue(SWTObservables.getRealm(Display - .getDefault())); - ValueChangeEventTracker listener = ValueChangeEventTracker - .observe(observable); - - combo.setText((String) delegate.createValue(observable)); - - assertEquals("Observable was not notified.", 1, listener.count); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests(ComboObservableValueTextTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - /* package */Combo combo; - - private Shell shell; - - public void setUp() { - shell = new Shell(); - combo = new Combo(shell, SWT.NONE); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new ComboObservableValue(realm, combo, SWTProperties.TEXT); - } - - public void change(IObservable observable) { - Combo combo = (Combo) ((ISWTObservable) observable).getWidget(); - combo.setText(combo.getText() + "a"); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public Object createValue(IObservableValue observable) { - return observable.getValue() + "a"; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboSingleSelectionObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboSingleSelectionObservableValueTest.java deleted file mode 100644 index 9ba66a72..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ComboSingleSelectionObservableValueTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Ashley Cambrell 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: - * Ashley Cambrell - initial API and implementation (bug 198903) - ******************************************************************************/ -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import org.eclipse.jface.internal.databinding.internal.swt.ComboSingleSelectionObservableValue; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Combo; - -/** - * @since 3.2 - * - */ -public class ComboSingleSelectionObservableValueTest extends - AbstractSWTTestCase { - public void testSetValue() throws Exception { - Combo combo = new Combo(getShell(), SWT.NONE); - ComboSingleSelectionObservableValue observableValue = new ComboSingleSelectionObservableValue( - combo); - combo.add("Item1"); - combo.add("Item2"); - - assertEquals(-1, combo.getSelectionIndex()); - assertEquals(-1, ((Integer) observableValue.getValue()).intValue()); - - Integer value = new Integer(1); - observableValue.setValue(value); - assertEquals("combo selection index", value.intValue(), combo - .getSelectionIndex()); - assertEquals("observable value", value, observableValue.getValue()); - - assertEquals("Item2", combo.getText()); - } -} 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 031e8c0c..00000000 --- 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 5aad4767..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/LabelObservableValueTest.java +++ /dev/null @@ -1,111 +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.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.internal.swt.LabelObservableValue; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - */ -public class LabelObservableValueTest extends ObservableDelegateTest { - private Delegate delegate; - private IObservableValue observable; - private Label label; - - public LabelObservableValueTest() { - this(null); - } - - public LabelObservableValueTest(String testName) { - super(testName, new Delegate()); - } - - protected void setUp() throws Exception { - super.setUp(); - - delegate = (Delegate) getObservableContractDelegate(); - observable = (IObservableValue) getObservable(); - label = delegate.label; - } - - protected IObservable doCreateObservable() { - return getObservableContractDelegate().createObservable(SWTObservables.getRealm(Display.getDefault())); - } - - public void testSetValue() throws Exception { - //preconditions - assertEquals("", label.getText()); - assertEquals("", observable.getValue()); - - String value = "value"; - observable.setValue(value); - assertEquals("label text", value, label.getText()); - assertEquals("observable value", value, observable.getValue()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests(LabelObservableValueTest.class).addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - Label label; - - public void setUp() { - shell = new Shell(); - label = new Label(shell, SWT.NONE); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new LabelObservableValue(realm, label); - } - - public void change(IObservable observable) { - IObservableValue value = (IObservableValue) observable; - value.setValue(value.getValue() + "a"); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public Object createValue(IObservableValue observable) { - return observable.getValue() + "a"; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ListSingleSelectionObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ListSingleSelectionObservableValueTest.java deleted file mode 100644 index 5b474178..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ListSingleSelectionObservableValueTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Ashley Cambrell 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: - * Ashley Cambrell - initial API and implementation - ******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import org.eclipse.jface.internal.databinding.internal.swt.ListSingleSelectionObservableValue; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.List; - -/** - * @since 3.2 - * - */ -public class ListSingleSelectionObservableValueTest extends AbstractSWTTestCase { - public void testSetValue() throws Exception { - List list = new List(getShell(), SWT.NONE); - ListSingleSelectionObservableValue observableValue = new ListSingleSelectionObservableValue( - list); - list.add("Item1"); - - assertEquals(-1, list.getSelectionIndex()); - assertEquals(-1, ((Integer) observableValue.getValue()).intValue()); - - Integer value = new Integer(0); - observableValue.setValue(value); - assertEquals("list selection index", value.intValue(), list - .getSelectionIndex()); - assertEquals("observable value", value, observableValue.getValue()); - } - - public void testDispose() throws Exception { - List list = new List(getShell(), SWT.NONE); - ListSingleSelectionObservableValue observableValue = new ListSingleSelectionObservableValue( - list); - list.add("Item1"); - list.add("Item2"); - - assertEquals(-1, list.getSelectionIndex()); - assertEquals(-1, ((Integer) observableValue.getValue()).intValue()); - - list.select(0); - list.notifyListeners(SWT.Selection, null); - assertEquals(0, list.getSelectionIndex()); - assertEquals(new Integer(0), observableValue.getValue()); - - observableValue.dispose(); - - list.select(1); - list.notifyListeners(SWT.Selection, null); - assertEquals(1, list.getSelectionIndex()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueMaxTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueMaxTest.java deleted file mode 100644 index 2e703b8c..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueMaxTest.java +++ /dev/null @@ -1,122 +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 junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties; -import org.eclipse.jface.internal.databinding.internal.swt.ScaleObservableValue; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Scale; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - */ -public class ScaleObservableValueMaxTest extends ObservableDelegateTest { - private Delegate delegate; - - private Scale scale; - - private IObservableValue observable; - - public ScaleObservableValueMaxTest() { - this(null); - } - - public ScaleObservableValueMaxTest(String testName) { - super(testName, new Delegate()); - } - - protected void setUp() throws Exception { - super.setUp(); - - delegate = (Delegate) getObservableContractDelegate(); - observable = (IObservableValue) getObservable(); - scale = delegate.scale; - } - - protected IObservable doCreateObservable() { - return getObservableContractDelegate().createObservable( - SWTObservables.getRealm(Display.getDefault())); - } - - public void testGetValue() throws Exception { - int max = 100; - scale.setMaximum(max); - assertEquals(new Integer(max), observable.getValue()); - } - - public void testSetValue() throws Exception { - int max = 100; - observable.setValue(new Integer(max)); - assertEquals(max, scale.getMaximum()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests(ScaleObservableValueMaxTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - Scale scale; - - public void setUp() { - shell = new Shell(); - scale = new Scale(shell, SWT.NONE); - scale.setMaximum(1000); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new ScaleObservableValue(realm, scale, SWTProperties.MAX); - } - - public void change(IObservable observable) { - IObservableValue observableValue = (IObservableValue) observable; - observableValue.setValue(createValue(observableValue)); - } - - public Object getValueType(IObservableValue observable) { - return Integer.TYPE; - } - - public Object createValue(IObservableValue observable) { - return createIntegerValue(observable); - } - - private Integer createIntegerValue(IObservableValue observable) { - return new Integer(((Integer) observable.getValue()).intValue() + 1); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueMinTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueMinTest.java deleted file mode 100644 index 48f54e0b..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueMinTest.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.jface.tests.internal.databinding.internal.swt; - -import junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties; -import org.eclipse.jface.internal.databinding.internal.swt.ScaleObservableValue; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Scale; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - */ -public class ScaleObservableValueMinTest extends ObservableDelegateTest { - private Delegate delegate; - - private Scale scale; - - private IObservableValue observable; - - public ScaleObservableValueMinTest() { - this(null); - } - - public ScaleObservableValueMinTest(String testName) { - super(testName, new Delegate()); - } - - protected void setUp() throws Exception { - super.setUp(); - - delegate = (Delegate) getObservableContractDelegate(); - observable = (IObservableValue) getObservable(); - scale = delegate.scale; - } - - protected IObservable doCreateObservable() { - return getObservableContractDelegate().createObservable(SWTObservables.getRealm(Display.getDefault())); - } - - public void testGetValue() throws Exception { - int min = 100; - scale.setMinimum(min); - assertEquals(new Integer(min), observable.getValue()); - } - - public void testSetValue() throws Exception { - int min = 100; - observable.setValue(new Integer(min)); - assertEquals(min, scale.getMinimum()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests(ScaleObservableValueMinTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - Scale scale; - - public void setUp() { - shell = new Shell(); - scale = new Scale(shell, SWT.NONE); - scale.setMaximum(1000); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new ScaleObservableValue(realm, scale, SWTProperties.MIN); - } - - public void change(IObservable observable) { - IObservableValue observableValue = (IObservableValue) observable; - observableValue.setValue(createValue(observableValue)); - } - - public Object getValueType(IObservableValue observable) { - return Integer.TYPE; - } - - public Object createValue(IObservableValue observable) { - return createIntegerValue(observable); - } - - private Integer createIntegerValue(IObservableValue observable) { - return new Integer(((Integer) observable.getValue()).intValue() + 1); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueSelectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueSelectionTest.java deleted file mode 100644 index 3959195b..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/ScaleObservableValueSelectionTest.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 junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties; -import org.eclipse.jface.internal.databinding.internal.swt.ScaleObservableValue; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Scale; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.2 - */ -public class ScaleObservableValueSelectionTest extends ObservableDelegateTest { - private Delegate delegate; - - private Scale scale; - - private IObservableValue observable; - - public ScaleObservableValueSelectionTest() { - this(null); - } - - public ScaleObservableValueSelectionTest(String testName) { - super(testName, new Delegate()); - } - - protected void setUp() throws Exception { - super.setUp(); - - delegate = (Delegate) getObservableContractDelegate(); - observable = (IObservableValue) getObservable(); - scale = delegate.scale; - } - - protected IObservable doCreateObservable() { - return getObservableContractDelegate().createObservable(SWTObservables.getRealm(Display.getDefault())); - } - - public void testGetValue() throws Exception { - int value = 100; - scale.setSelection(value); - assertEquals(new Integer(value), observable.getValue()); - } - - public void testSetValue() throws Exception { - int value = 100; - observable.setValue(new Integer(value)); - assertEquals(value, scale.getSelection()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests( - ScaleObservableValueSelectionTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - Scale scale; - - public void setUp() { - shell = new Shell(); - scale = new Scale(shell, SWT.NONE); - scale.setMaximum(1000); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new ScaleObservableValue(realm, scale, SWTProperties.SELECTION); - } - - public void change(IObservable observable) { - scale - .setSelection(createIntegerValue( - (IObservableValue) observable).intValue()); - scale.notifyListeners(SWT.Selection, null); - } - - public Object getValueType(IObservableValue observable) { - return Integer.TYPE; - } - - public Object createValue(IObservableValue observable) { - return createIntegerValue(observable); - } - - private Integer createIntegerValue(IObservableValue observable) { - return new Integer(((Integer) observable.getValue()).intValue() + 1); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueMaxTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueMaxTest.java deleted file mode 100644 index 4ac36ecb..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueMaxTest.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.jface.tests.internal.databinding.internal.swt; - -import junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -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.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Spinner; - -/** - * @since 3.2 - */ -public class SpinnerObservableValueMaxTest extends ObservableDelegateTest { - private Delegate delegate; - - private Spinner spinner; - - private IObservableValue observable; - - public SpinnerObservableValueMaxTest() { - this(null); - } - - public SpinnerObservableValueMaxTest(String testName) { - super(testName, new Delegate()); - } - - protected void setUp() throws Exception { - super.setUp(); - - delegate = (Delegate) getObservableContractDelegate(); - observable = (IObservableValue) getObservable(); - spinner = delegate.spinner; - } - - protected IObservable doCreateObservable() { - return getObservableContractDelegate().createObservable(SWTObservables.getRealm(Display.getDefault())); - } - - public void testGetValue() throws Exception { - int max = 100; - spinner.setMaximum(max); - assertEquals(new Integer(max), observable.getValue()); - } - - public void testSetValue() throws Exception { - int max = 100; - observable.setValue(new Integer(max)); - assertEquals(max, spinner.getMaximum()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests(SpinnerObservableValueMaxTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - Spinner spinner; - - public void setUp() { - shell = new Shell(); - spinner = new Spinner(shell, SWT.NONE); - spinner.setMaximum(1000); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new SpinnerObservableValue(realm, spinner, SWTProperties.MAX); - } - - public void change(IObservable observable) { - IObservableValue observableValue = (IObservableValue) observable; - observableValue.setValue(createValue(observableValue)); - } - - public Object getValueType(IObservableValue observable) { - return Integer.TYPE; - } - - public Object createValue(IObservableValue observable) { - return createIntegerValue(observable); - } - - private Integer createIntegerValue(IObservableValue observable) { - return new Integer(((Integer) observable.getValue()).intValue() + 1); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueMinTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueMinTest.java deleted file mode 100644 index 4c0fe5b4..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueMinTest.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.jface.tests.internal.databinding.internal.swt; - -import junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -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.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Spinner; - -/** - * @since 3.2 - */ -public class SpinnerObservableValueMinTest extends ObservableDelegateTest { - private Delegate delegate; - - private Spinner spinner; - - private IObservableValue observable; - - public SpinnerObservableValueMinTest() { - this(null); - } - - public SpinnerObservableValueMinTest(String testName) { - super(testName, new Delegate()); - } - - protected void setUp() throws Exception { - super.setUp(); - - delegate = (Delegate) getObservableContractDelegate(); - observable = (IObservableValue) getObservable(); - spinner = delegate.spinner; - } - - protected IObservable doCreateObservable() { - return getObservableContractDelegate().createObservable(SWTObservables.getRealm(Display.getDefault())); - } - - public void testGetValue() throws Exception { - int min = 100; - spinner.setMinimum(min); - assertEquals(new Integer(min), observable.getValue()); - } - - public void testSetValue() throws Exception { - int min = 100; - observable.setValue(new Integer(min)); - assertEquals(min, spinner.getMinimum()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests(SpinnerObservableValueMinTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - Spinner spinner; - - public void setUp() { - shell = new Shell(); - spinner = new Spinner(shell, SWT.NONE); - spinner.setMaximum(1000); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new SpinnerObservableValue(realm, spinner, SWTProperties.MIN); - } - - public void change(IObservable observable) { - IObservableValue observableValue = (IObservableValue) observable; - observableValue.setValue(createValue(observableValue)); - } - - public Object getValueType(IObservableValue observable) { - return Integer.TYPE; - } - - public Object createValue(IObservableValue observable) { - return createIntegerValue(observable); - } - - private Integer createIntegerValue(IObservableValue observable) { - return new Integer(((Integer) observable.getValue()).intValue() + 1); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueSelectionTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueSelectionTest.java deleted file mode 100644 index 4b0ed716..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueSelectionTest.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 junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -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.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Spinner; - -/** - * @since 3.2 - */ -public class SpinnerObservableValueSelectionTest extends ObservableDelegateTest { - private Delegate delegate; - - private Spinner spinner; - - private IObservableValue observable; - - public SpinnerObservableValueSelectionTest() { - this(null); - } - - public SpinnerObservableValueSelectionTest(String testName) { - super(testName, new Delegate()); - } - - protected void setUp() throws Exception { - super.setUp(); - - delegate = (Delegate) getObservableContractDelegate(); - observable = (IObservableValue) getObservable(); - spinner = delegate.spinner; - } - - protected IObservable doCreateObservable() { - return getObservableContractDelegate().createObservable(SWTObservables.getRealm(Display.getDefault())); - } - - public void testGetValue() throws Exception { - int value = 100; - spinner.setSelection(value); - assertEquals(new Integer(value), observable.getValue()); - } - - public void testSetValue() throws Exception { - int value = 100; - observable.setValue(new Integer(value)); - assertEquals(value, spinner.getSelection()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests( - SpinnerObservableValueSelectionTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - Spinner spinner; - - public void setUp() { - shell = new Shell(); - spinner = new Spinner(shell, SWT.NONE); - spinner.setMaximum(1000); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new SpinnerObservableValue(realm, spinner, SWTProperties.SELECTION); - } - - public void change(IObservable observable) { - spinner - .setSelection(createIntegerValue( - (IObservableValue) observable).intValue()); - spinner.notifyListeners(SWT.Selection, null); - } - - public Object getValueType(IObservableValue observable) { - return Integer.TYPE; - } - - public Object createValue(IObservableValue observable) { - return createIntegerValue(observable); - } - - private Integer createIntegerValue(IObservableValue observable) { - return new Integer(((Integer) observable.getValue()).intValue() + 1); - } - } -} 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 1966663c..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/SpinnerObservableValueTest.java +++ /dev/null @@ -1,52 +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 - * Ashley Cambrell - bug 198904 - ******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.internal.databinding.internal.swt.SWTProperties; -import org.eclipse.jface.internal.databinding.internal.swt.SpinnerObservableValue; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Spinner; - -/** - * @since 3.2 - * - */ -public class SpinnerObservableValueTest extends AbstractSWTTestCase { - public void testDispose() throws Exception { - Spinner spinner = new Spinner(getShell(), SWT.NONE); - SpinnerObservableValue observableValue = new SpinnerObservableValue( - spinner, SWTProperties.SELECTION); - ValueChangeEventTracker testCounterValueChangeListener = new ValueChangeEventTracker(); - observableValue.addValueChangeListener(testCounterValueChangeListener); - - assertEquals(0, spinner.getSelection()); - assertEquals(0, ((Integer) observableValue.getValue()).intValue()); - - Integer expected1 = new Integer(1); - spinner.setSelection(expected1.intValue()); - -// assertEquals(1, testCounterValueChangeListener.counter); - assertEquals(expected1.intValue(), spinner.getSelection()); - assertEquals(expected1, observableValue.getValue()); - - observableValue.dispose(); - - Integer expected2 = new Integer(2); - spinner.setSelection(expected2.intValue()); - -// assertEquals(1, testCounterValueChangeListener.counter); - assertEquals(expected2.intValue(), spinner.getSelection()); - } -} 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 bbfbb273..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TableObservableValueTest.java +++ /dev/null @@ -1,50 +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 - * Ashley Cambrell - bug 198904 - ******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import org.eclipse.jface.internal.databinding.internal.swt.TableSingleSelectionObservableValue; -import org.eclipse.jface.tests.databinding.AbstractSWTTestCase; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; - -/** - * @since 3.2 - */ -public class TableObservableValueTest extends AbstractSWTTestCase { - public void testDispose() throws Exception { - Table table = new Table(getShell(), SWT.NONE); - TableSingleSelectionObservableValue observableValue = new TableSingleSelectionObservableValue( - table); - - TableItem item1 = new TableItem(table, SWT.NONE); - item1.setText("Item1"); - TableItem item2 = new TableItem(table, SWT.NONE); - item2.setText("Item2"); - - assertEquals(-1, table.getSelectionIndex()); - assertEquals(-1, ((Integer) observableValue.getValue()).intValue()); - - table.select(0); - table.notifyListeners(SWT.Selection, null); - - assertEquals(0, table.getSelectionIndex()); - assertEquals(new Integer(0), observableValue.getValue()); - - observableValue.dispose(); - - table.select(1); - table.notifyListeners(SWT.Selection, null); - assertEquals(1, table.getSelectionIndex()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TableSingleSelectionObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TableSingleSelectionObservableValueTest.java deleted file mode 100755 index 5d48e126..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TableSingleSelectionObservableValueTest.java +++ /dev/null @@ -1,144 +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.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.internal.swt.TableSingleSelectionObservableValue; -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; - -/** - * @since 3.2 - */ -public class TableSingleSelectionObservableValueTest extends ObservableDelegateTest { - private Delegate delegate; - private IObservableValue observable; - private Table table; - - public TableSingleSelectionObservableValueTest() { - this(null); - } - - public TableSingleSelectionObservableValueTest(String testName) { - super(testName, new Delegate()); - } - - protected void setUp() throws Exception { - super.setUp(); - - observable = (IObservableValue) getObservable(); - delegate = (Delegate) getObservableContractDelegate(); - table = delegate.table; - } - - protected IObservable doCreateObservable() { - Delegate delegate = (Delegate) getObservableContractDelegate(); - return delegate.createObservableValue(SWTObservables.getRealm(Display.getDefault())); - } - - public void testSetValue() throws Exception { - //preconditions - assertEquals(-1, table.getSelectionIndex()); - assertEquals(-1, ((Integer) observable.getValue()).intValue()); - - Integer value = new Integer(0); - observable.setValue(value); - assertEquals("table selection index", value.intValue(), table - .getSelectionIndex()); - assertEquals("observable value", value, observable.getValue()); - } - - public void testGetValue() throws Exception { - int value = 1; - table.setSelection(value); - - assertEquals("table selection index", value, table.getSelectionIndex()); - assertEquals("observable value", new Integer(value), observable.getValue()); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests( - TableSingleSelectionObservableValueTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - Table table; - - public void setUp() { - shell = new Shell(); - table = new Table(shell, SWT.NONE); - new TableItem(table, SWT.NONE).setText("0"); - new TableItem(table, SWT.NONE).setText("1"); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new TableSingleSelectionObservableValue(realm, table); - } - - public Object getValueType(IObservableValue observable) { - return Integer.TYPE; - } - - public void change(IObservable observable) { - int index = createIntegerValue((IObservableValue) observable) - .intValue(); - table.select(index); - - table.notifyListeners(SWT.Selection, null); - } - - public Object createValue(IObservableValue observable) { - return createIntegerValue(observable); - } - - private Integer createIntegerValue(IObservableValue observable) { - int value = ((Integer) observable.getValue()).intValue(); - switch (value) { - case -1: - case 1: - return new Integer(0); - case 0: - return new Integer(1); - } - - Assert.isTrue(false); - return null; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TestCounterValueChangeListener.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TestCounterValueChangeListener.java deleted file mode 100644 index de95c016..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TestCounterValueChangeListener.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Ashley Cambrell 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: - * Ashley Cambrell - initial API and implementation - ******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import org.eclipse.core.databinding.observable.value.IValueChangeListener; -import org.eclipse.core.databinding.observable.value.ValueChangeEvent; - -class TestCounterValueChangeListener implements - IValueChangeListener { - public int counter = 0; - - public void handleValueChange(ValueChangeEvent event) { - ++counter; - } -} 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 74c1cc9a..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextEditableObservableValueTest.java +++ /dev/null @@ -1,119 +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 junit.framework.Test; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.ObservableDelegateTest; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.internal.databinding.internal.swt.TextEditableObservableValue; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - * @since 1.1 - */ -public class TextEditableObservableValueTest extends - ObservableDelegateTest { - - private Delegate delegate; - private Text text; - private IObservableValue observable; - - public TextEditableObservableValueTest() { - this(null); - } - - public TextEditableObservableValueTest(String testName) { - super(testName, new Delegate()); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.conformance.databinding.ObservableDelegateTest#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - - delegate = (Delegate) getObservableContractDelegate(); - observable = (IObservableValue) getObservable(); - text = delegate.text; - } - - protected IObservable doCreateObservable() { - return super.doCreateObservable(); - } - - public void testGetValue() throws Exception { - text.setEditable(false); - assertEquals(Boolean.valueOf(text.getEditable()), observable.getValue()); - - text.setEditable(true); - assertEquals(Boolean.valueOf(text.getEditable()), observable.getValue()); - } - - public void testSetValue() throws Exception { - text.setEditable(false); - observable.setValue(Boolean.TRUE); - assertEquals(Boolean.TRUE, Boolean.valueOf(text.getEditable())); - - observable.setValue(Boolean.FALSE); - assertEquals(Boolean.FALSE, Boolean.valueOf(text.getEditable())); - } - - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addTests( - TextEditableObservableValueTest.class) - .addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate).build(); - } - - /*package*/ static class Delegate extends AbstractObservableValueContractDelegate { - private Shell shell; - Text text; - - public void setUp() { - shell = new Shell(); - text = new Text(shell, SWT.NONE); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new TextEditableObservableValue(realm, text); - } - - public Object getValueType(IObservableValue observable) { - return Boolean.TYPE; - } - - public void change(IObservable observable) { - IObservableValue observableValue = (IObservableValue) observable; - observableValue.setValue(createValue(observableValue)); - } - - public Object createValue(IObservableValue observable) { - return (Boolean.TRUE.equals(observable.getValue()) ? Boolean.FALSE: Boolean.TRUE); - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueFocusOutTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueFocusOutTest.java deleted file mode 100644 index cf73eb2b..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueFocusOutTest.java +++ /dev/null @@ -1,79 +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 junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.internal.databinding.internal.swt.TextObservableValue; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - * Tests for the FocusOut version of TextObservableValue. - */ -public class TextObservableValueFocusOutTest extends TestCase { - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - private Text text; - - public void setUp() { - shell = new Shell(); - text = new Text(shell, SWT.NONE); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new TextObservableValue(realm, text, SWT.FocusOut); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public void change(IObservable observable) { - text.setFocus(); - - IObservableValue observableValue = (IObservableValue) observable; - text.setText((String) createValue(observableValue)); - - text.notifyListeners(SWT.FocusOut, null); - } - - public Object createValue(IObservableValue observable) { - String value = (String) observable.getValue(); - return value + "a"; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueModifyTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueModifyTest.java deleted file mode 100644 index eee15a0a..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueModifyTest.java +++ /dev/null @@ -1,77 +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 junit.framework.Test; -import junit.framework.TestCase; - -import org.eclipse.core.databinding.observable.IObservable; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.value.IObservableValue; -import org.eclipse.jface.databinding.conformance.delegate.AbstractObservableValueContractDelegate; -import org.eclipse.jface.databinding.conformance.swt.SWTMutableObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.swt.SWTObservableValueContractTest; -import org.eclipse.jface.databinding.conformance.util.SuiteBuilder; -import org.eclipse.jface.internal.databinding.internal.swt.TextObservableValue; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - * @since 3.2 - */ -public class TextObservableValueModifyTest extends TestCase { - public static Test suite() { - Delegate delegate = new Delegate(); - return new SuiteBuilder().addObservableContractTest( - SWTObservableValueContractTest.class, delegate) - .addObservableContractTest( - SWTMutableObservableValueContractTest.class, delegate) - .build(); - } - - /* package */static class Delegate extends - AbstractObservableValueContractDelegate { - private Shell shell; - - private Text text; - - public void setUp() { - shell = new Shell(); - text = new Text(shell, SWT.NONE); - } - - public void tearDown() { - shell.dispose(); - } - - public IObservableValue createObservableValue(Realm realm) { - return new TextObservableValue(realm, text, SWT.Modify); - } - - public Object getValueType(IObservableValue observable) { - return String.class; - } - - public void change(IObservable observable) { - text.setFocus(); - - IObservableValue observableValue = (IObservableValue) observable; - text.setText((String) createValue(observableValue)); - } - - public Object createValue(IObservableValue observable) { - String value = (String) observable.getValue(); - return value + "a"; - } - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueTest.java deleted file mode 100755 index 55898e7e..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/swt/TextObservableValueTest.java +++ /dev/null @@ -1,108 +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 - * Ashley Cambrell - bug 198904 - *******************************************************************************/ - -package org.eclipse.jface.tests.internal.databinding.internal.swt; - -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -import org.eclipse.jface.internal.databinding.internal.swt.TextObservableValue; -import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase; -import org.eclipse.swt.SWT; -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 TextObservableValueTest extends AbstractDefaultRealmTestCase { - private Text text; - private ValueChangeEventTracker listener; - - protected void setUp() throws Exception { - super.setUp(); - - Shell shell = new Shell(); - text = new Text(shell, SWT.NONE); - - listener = new ValueChangeEventTracker(); - } - - /** - * 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); - } - } - - /** - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=171132 - * - * @throws Exception - */ - public void testGetValueBeforeFocusOutChangeEventsFire() throws Exception { - TextObservableValue observableValue = new TextObservableValue(text, SWT.FocusOut); - observableValue.addValueChangeListener(listener); - - String a = "a"; - String b = "b"; - - text.setText(a); - assertEquals(a, observableValue.getValue()); //fetch the value updating the buffered value - - text.setText(b); - text.notifyListeners(SWT.FocusOut, null); - - assertEquals(1, listener.count); - assertEquals(a, listener.event.diff.getOldValue()); - assertEquals(b, listener.event.diff.getNewValue()); - } - - public void testDispose() throws Exception { - TextObservableValue observableValue = new TextObservableValue(text, - SWT.Modify); - ValueChangeEventTracker testCounterValueChangeListener = new ValueChangeEventTracker(); - observableValue.addValueChangeListener(testCounterValueChangeListener); - - String expected1 = "Test123"; - text.setText(expected1); - - assertEquals(1, testCounterValueChangeListener.count); - assertEquals(expected1, text.getText()); - assertEquals(expected1, observableValue.getValue()); - - observableValue.dispose(); - - String expected2 = "NewValue123"; - text.setText(expected2); - - assertEquals(1, testCounterValueChangeListener.count); - assertEquals(expected2, text.getText()); - } -} diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderMultiSelectionObservableListTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderMultiSelectionObservableListTest.java deleted file mode 100644 index efb5dc25..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderMultiSelectionObservableListTest.java +++ /dev/null @@ -1,170 +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.core.databinding.observable.list.ListDiffEntry; -import org.eclipse.jface.databinding.conformance.util.ListChangeEventTracker; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.internal.databinding.internal.viewers.SelectionProviderMultipleSelectionObservableList; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -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 SelectionProviderMultiSelectionObservableList. - * - * @since 1.2 - */ -public class SelectionProviderMultiSelectionObservableListTest extends TestCase { - private ISelectionProvider selectionProvider; - - private TableViewer viewer; - - private static String[] model = new String[] { "0", "1", "2", "3" }; - - protected void setUp() throws Exception { - Shell shell = new Shell(); - viewer = new TableViewer(shell, SWT.MULTI); - viewer.setContentProvider(new ContentProvider()); - viewer.setInput(model); - selectionProvider = viewer; - } - - protected void tearDown() throws Exception { - Shell shell = viewer.getTable().getShell(); - if (!shell.isDisposed()) - shell.dispose(); - } - - public void testConstructorIllegalArgumentException() { - try { - new SelectionProviderMultipleSelectionObservableList(SWTObservables - .getRealm(Display.getDefault()), null, Object.class); - 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 testAddRemove() { - SelectionProviderMultipleSelectionObservableList observable = new SelectionProviderMultipleSelectionObservableList( - SWTObservables.getRealm(Display.getDefault()), - selectionProvider, Object.class); - ListChangeEventTracker listener = new ListChangeEventTracker(); - observable.addListChangeListener(listener); - assertEquals(0, observable.size()); - - selectionProvider.setSelection(new StructuredSelection(model[0])); - assertEquals(1, listener.count); - assertEquals(1, listener.event.diff.getDifferences().length); - assertDiffEntry(listener.event.diff.getDifferences()[0], 0, model[0], true); - assertEquals(observable, listener.event.getObservableList()); - assertEquals(1, observable.size()); - assertEquals(model[0], observable.get(0)); - - selectionProvider.setSelection(new StructuredSelection(model[1])); - assertEquals(2, listener.count); - assertEquals(2, listener.event.diff.getDifferences().length); - assertDiffEntry(listener.event.diff.getDifferences()[0], 0, model[1], true); - assertDiffEntry(listener.event.diff.getDifferences()[1], 1, model[0], false); - assertEquals(observable, listener.event.getObservableList()); - assertEquals(1, observable.size()); - assertEquals(model[1], observable.get(0)); - - selectionProvider.setSelection(new StructuredSelection(new Object[]{model[2],model[3]})); - assertEquals(3, listener.count); - assertEquals(3, listener.event.diff.getDifferences().length); - assertDiffEntry(listener.event.diff.getDifferences()[0], 0, model[2], true); - assertDiffEntry(listener.event.diff.getDifferences()[1], 1, model[3], true); - assertDiffEntry(listener.event.diff.getDifferences()[2], 2, model[1], false); - assertEquals(observable, listener.event.getObservableList()); - assertEquals(2, observable.size()); - assertEquals(model[2], observable.get(0)); - assertEquals(model[3], observable.get(1)); - - selectionProvider.setSelection(StructuredSelection.EMPTY); - assertEquals(4, listener.count); - assertEquals(2, listener.event.diff.getDifferences().length); - assertDiffEntry(listener.event.diff.getDifferences()[0], 1, model[3], false); - assertDiffEntry(listener.event.diff.getDifferences()[1], 0, model[2], false); - assertEquals(observable, listener.event.getObservableList()); - assertEquals(0, observable.size()); - - observable.add(model[1]); - assertEquals(5, listener.count); - assertEquals(1, listener.event.diff.getDifferences().length); - assertDiffEntry(listener.event.diff.getDifferences()[0], 0, model[1], true); - assertEquals(observable, listener.event.getObservableList()); - assertEquals(1, ((IStructuredSelection)viewer.getSelection()).size()); - - observable.add(0, model[2]); - assertEquals(6, listener.count); - assertEquals(1, listener.event.diff.getDifferences().length); - // This is a bit surprising (we added at index 0 but the event says index 1). - // It is to the fact that the observable list tracks the underlying selection - // provider's notion of which element is at which index. - assertDiffEntry(listener.event.diff.getDifferences()[0], 1, model[2], true); - assertEquals(observable, listener.event.getObservableList()); - assertEquals(2, ((IStructuredSelection)viewer.getSelection()).size()); - - observable.clear(); - assertEquals(7, listener.count); - assertEquals(2, listener.event.diff.getDifferences().length); - assertDiffEntry(listener.event.diff.getDifferences()[0], 1, model[2], false); - assertDiffEntry(listener.event.diff.getDifferences()[1], 0, model[1], false); - assertEquals(observable, listener.event.getObservableList()); - assertEquals(0, ((IStructuredSelection)viewer.getSelection()).size()); -} - - /** - * @param diffEntry - * @param position - * @param element - * @param isAddition - */ - private void assertDiffEntry(ListDiffEntry diffEntry, int position, - String element, boolean isAddition) { - assertEquals(isAddition, diffEntry.isAddition()); - assertEquals(position, diffEntry.getPosition()); - assertEquals(element, diffEntry.getElement()); - } - - 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/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 d02f8747..00000000 --- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/internal/viewers/SelectionProviderSingleSelectionObservableValueTest.java +++ /dev/null @@ -1,147 +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 - * Ashley Cambrell - bug 198906 - *******************************************************************************/ -package org.eclipse.jface.tests.internal.databinding.internal.viewers; - -import junit.framework.TestCase; - -import org.eclipse.jface.databinding.conformance.util.ValueChangeEventTracker; -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.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()); - } - - public void testDispose() throws Exception { - SelectionProviderSingleSelectionObservableValue observable = new SelectionProviderSingleSelectionObservableValue( - SWTObservables.getRealm(Display.getDefault()), - selectionProvider); - ValueChangeEventTracker listener = new ValueChangeEventTracker(); - observable.addValueChangeListener(listener); - - 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()); - - observable.dispose(); - selectionProvider.setSelection(new StructuredSelection(model[1])); - assertEquals(1, listener.count); - } - - 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/test.xml b/tests/org.eclipse.jface.tests.databinding/test.xml deleted file mode 100644 index 73284d59..00000000 --- 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> |