Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 07:43:07 -0400
committerCamille Letavernier2014-08-21 09:50:25 -0400
commitdbc038b44bcbb890ae256d15eb09eb285512f020 (patch)
tree757e736583eea3ae352ad9ac91a81df7e59b79ff /plugins/xwt/org.eclipse.papyrus.xwt
parentea48a20561464c3cbb7895d430583669a9f82fcc (diff)
downloadorg.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.gz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.xz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.zip
[Code style] Apply clean-up and formatter on Main plug-ins
Diffstat (limited to 'plugins/xwt/org.eclipse.papyrus.xwt')
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/DefaultLoadingContext.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ICLRFactory.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IConstants.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBinding.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBindingInfo.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProvider.java16
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProviderFactory.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventConstants.java20
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventGroup.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventHandler.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventInvoker.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IIndexedElement.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILoadingContext.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILogger.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMetaclassFactory.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMultiValueConverter.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/INamespaceHandler.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IObservableValueListener.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IStyle.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIExtensionProvider.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIResource.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValidationRule.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValueConverter.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IXWTLoader.java207
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/InverseValueConverter.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ResourceDictionary.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/Tracking.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWT.java221
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTException.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoader.java272
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoaderManager.java20
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTMaps.java334
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/animation/Drawing.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/Containment.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UI.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UIBounds.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/IBeforeParsingCallback.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ICreatedCallback.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ILoadedCallback.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionView.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionViewSource.java26
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/GroupDescription.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/ListSortDirection.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/SortDescription.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/AbstractMultiValueConverter.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/BindingToObject.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToBoolean.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToInteger.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/DateToString.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/EnumToString.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToBoolean.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToString.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToIObservableCollection.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToSet.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToBoolean.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToISelection.java14
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToObject.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToString.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SelectionToBoolean.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SetToIObservableCollection.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringMultiValueConerter.java18
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToBoolean.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToColor.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToDoubleArray.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToEnum.java14
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFont.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFormAttachment.java16
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValidationRule.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValueConverter.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToImage.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIntArray.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToInteger.java66
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToPoint.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToRectangle.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToType.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToURL.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ValueConverterAdapter.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/AbstractEventGroup.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Condition.java62
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/DataTrigger.java75
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/EventTrigger.java39
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IBinding.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/ICollectionView.java26
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IDynamicBinding.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IElementLoaderFactory.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IRenderingContext.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IVisualElementLoader.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiDataTrigger.java27
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiTrigger.java18
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Operator.java87
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/RadioEventGroup.java18
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Setter.java20
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/SetterBase.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Style.java14
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Trigger.java36
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerAction.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerBase.java16
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AbstractDataBinding.java14
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AggregateObservableValue.java19
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingContext.java19
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingMode.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ControlDataBinding.java32
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/DataBinding.java62
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/Event.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventListener.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventManager.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventPropertyObservableValue.java7
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/IBindingContext.java35
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/JFaceXWTDataBinding.java200
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ListToArrayObservableValue.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/TypedViewerObservableValueDecorator.java16
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/XWTObservableValue.java24
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/AbstractDataProvider.java48
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/IObjectDataProvider.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/ObjectDataProvider.java84
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Color.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Point.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Rect.java26
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CanExecuteChangedListener.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CommandBinding.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ICommand.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/InputBinding.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyBinding.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyGesture.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ModifierKeys.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/MouseAction.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/RoutedCommand.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Binding.java92
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingExpressionPath.java60
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingGate.java142
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Core.java220
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DataBindingTrack.java70
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicBinding.java58
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicValueBinding.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassManager.java44
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassService.java34
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MultiBinding.java68
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeKeeper.java74
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeManager.java154
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/UpdateSourceTrigger.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/AbstractMenuItemObservableValue.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemEnabledObservableValue.java9
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemSelectionObservableValue.java9
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ClassLoaderUtil.java48
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/DocumentObjectSorter.java22
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/LoggerManager.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/NamespaceHelper.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObjectUtil.java150
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObservableValueManager.java22
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/TableEditorHelper.java16
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/UserData.java324
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/Attribute.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DefaultElementCache.java15
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DocumentObject.java34
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DocumentRoot.java112
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/Element.java72
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/ElementHandler.java249
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/ElementManager.java40
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/IElementCache.java14
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/XDataHandler.java33
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/Controller.java130
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/ResourceLoader.java730
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/ResourceLoaderFactory.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/StaticResourceBinding.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/ValueConvertorRegister.java28
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/AbstractMetaclass.java209
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/BeanEvent.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/Behavior.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/BindingMetaclass.java24
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/ComboBoxCellEditorMetaclass.java25
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/ExpandItemHeightAction.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/LoadedEvent.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/Metaclass.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/TableEditorMetaclass.java14
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/TableViewerColumnMetaClass.java18
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/TypedEvent.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/AbstractProperty.java24
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/BeanProperty.java36
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/ColumnViewerColumnsProperty.java18
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/DataProperty.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/DynamicBeanProperty.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/DynamicProperty.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/EventProperty.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/FieldProperty.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/InputBeanProperty.java82
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/MultiSelectionBeanProperty.java30
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/PropertiesConstants.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/SingleSelectionBeanProperty.java16
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/StyleProperty.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TableColumnEditorProperty.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TableEditorDynamicProperty.java84
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TableItemEditorProperty.java20
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TableItemProperty.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TableViewerColumnDynamicProperty.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TableViewerColumnImageProperty.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TableViewerColumnTextProperty.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TableViewerColumnWidthProperty.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/javabean/metadata/properties/TriggersProperty.java12
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/AbstractDialog.java15
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/CellEditorHelper.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/ComboBoxCellEditor.java26
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/DefaultCellModifier.java18
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/DefaultListContentProvider.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/DefaultViewerLabelProvider.java24
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/JFaceInitializer.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/JFacesHelper.java101
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/ObservableMapLabelProvider.java15
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/ObservableTreeContentProvider.java26
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/TextCellEditor.java18
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/ViewerFilter.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/XWTDialog.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/XWTObservableWrapper.java16
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/jface/XWTTitleAreaDialog.java23
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/DefaultLoadingType.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/DelegateProperty.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/IBehavior.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/IEvent.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/ILoadingType.java8
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/IMetaclass.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/IObjectInitializer.java6
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/IProperty.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/ISetPostAction.java2
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/IValueLoading.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/metadata/ModelUtils.java10
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/utils/NamedColorsUtil.java24
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/utils/OperatorExceptionMessage.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/utils/PathHelper.java54
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/utils/ResourceManager.java54
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/validation/AbstractValidationRule.java4
-rw-r--r--plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/validation/InverseValidationRule.java4
230 files changed, 3611 insertions, 3560 deletions
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/DefaultLoadingContext.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/DefaultLoadingContext.java
index 8676be2e340..a53700e3363 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/DefaultLoadingContext.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/DefaultLoadingContext.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -26,7 +26,7 @@ public class DefaultLoadingContext implements ILoadingContext {
}
public ClassLoader getClassLoader() {
- if(classLoader == null) {
+ if (classLoader == null) {
return Thread.currentThread().getContextClassLoader();
}
return classLoader;
@@ -42,14 +42,14 @@ public class DefaultLoadingContext implements ILoadingContext {
public Class<?> loadClass(String name) {
Class<?> type = doLoadClass(name);
- if(type != null) {
+ if (type != null) {
return type;
}
int index = name.lastIndexOf('.');
- while(index != -1) {
+ while (index != -1) {
name = name.substring(0, index) + "$" + name.substring(index + 1);
type = doLoadClass(name);
- if(type != null) {
+ if (type != null) {
return type;
}
index = name.lastIndexOf('.');
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ICLRFactory.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ICLRFactory.java
index 1cbdac9c618..65cf3e9f4b0 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ICLRFactory.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ICLRFactory.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
@@ -17,10 +17,10 @@ public interface ICLRFactory {
/**
* This method is used to create a CLR instance to handle events.
- *
+ *
* @param args
- * null if the default CLRFactory comes from XWT.getCLRFactory()
- * or CLASS_FACTORY. Otherwise, it is the value x:ClassFactory
+ * null if the default CLRFactory comes from XWT.getCLRFactory()
+ * or CLASS_FACTORY. Otherwise, it is the value x:ClassFactory
* @options contains structures used by XWT (ex : URL, DataContext). Keys of
* this Map come from {@link IXWTLoader}.
* @return
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IConstants.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IConstants.java
index 85878984d63..0670125faa6 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IConstants.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IConstants.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.papyrus.xwt.internal.xml.DocumentObject;
/**
* Shared constants
- *
+ *
* @author yyang
*/
public interface IConstants {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBinding.java
index eff21832e8a..9afa7fe14c1 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBinding.java
@@ -4,21 +4,21 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface IDataBinding extends IDataBindingInfo {
/**
* The argument is used to determine the filtering. If type is null, no filtering
- *
+ *
* @return
*/
public Object getValue(Class<?> targetType);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBindingInfo.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBindingInfo.java
index 0464fab681c..a2235ca2936 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBindingInfo.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataBindingInfo.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProvider.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProvider.java
index 81b0dab980c..f8a266b1ea8 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProvider.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProvider.java
@@ -15,14 +15,14 @@ import org.eclipse.core.databinding.property.value.IValueProperty;
/**
* A Data Binding provider defines the nature of Data Binding such as Bean Object Binding, EMF Object Binding, XML data Binding or Data Base binding
- *
+ *
* @author yyang
*/
public interface IDataProvider {
/**
* Return the data of the provider, this value can be not used for databindings.
- *
+ *
* @param path
* @return
*/
@@ -30,7 +30,7 @@ public interface IDataProvider {
/**
* Return the data of the provider, this value can be not used for databindings.
- *
+ *
* @param path
* @return
*/
@@ -38,7 +38,7 @@ public interface IDataProvider {
/**
* Return the data of the provider, this value can be not used for databindings.
- *
+ *
* @param path
* @return
*/
@@ -46,7 +46,7 @@ public interface IDataProvider {
/**
* Return the data of the provider, this value can be not used for databindings.
- *
+ *
* @param path
* @return
*/
@@ -54,7 +54,7 @@ public interface IDataProvider {
/**
* Return the data type of the provider.lue
- *
+ *
* @param path
* @return
*/
@@ -62,7 +62,7 @@ public interface IDataProvider {
/**
* check if the property is read only.
- *
+ *
* @param path
* @return
*/
@@ -84,7 +84,7 @@ public interface IDataProvider {
/**
* get the type of this object
- *
+ *
* @param object
* @return
*/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProviderFactory.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProviderFactory.java
index b46e470ea83..d9d75e8489d 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProviderFactory.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IDataProviderFactory.java
@@ -4,27 +4,27 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface IDataProviderFactory {
/**
* The type of the Data provider
- *
+ *
* @return
*/
Class<?> getType();
/**
- *
+ *
* @param dataContext
* @return null if this factory doesn't match with the data context
*/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventConstants.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventConstants.java
index e1de975dd5c..6741514f66c 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventConstants.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventConstants.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt;
@@ -24,7 +24,7 @@ public final class IEventConstants {
public static final String KEY_UP = "KeyUp";
- public static final String[] KEY_GROUP = new String[]{ KEY_DOWN, KEY_UP };
+ public static final String[] KEY_GROUP = new String[] { KEY_DOWN, KEY_UP };
public static final String XWT_KEY_DOWN = "KeyDown" + SUFFIX;
@@ -34,7 +34,7 @@ public final class IEventConstants {
public static final String MOUSE_UP = "MouseUp";
- public static final String[] MOUSE_GROUP = new String[]{ MOUSE_DOWN, MOUSE_UP };
+ public static final String[] MOUSE_GROUP = new String[] { MOUSE_DOWN, MOUSE_UP };
public static final String XWT_MOUSE_DOWN = "MouseDown" + SUFFIX;
@@ -48,7 +48,7 @@ public final class IEventConstants {
public static final String MOUSE_HOVER = "MouseHover";
- public static final String[] MOUSE_MOVING_GROUP = new String[]{ MOUSE_ENTER, MOUSE_EXIT };
+ public static final String[] MOUSE_MOVING_GROUP = new String[] { MOUSE_ENTER, MOUSE_EXIT };
public static final String XWT_MOUSE_MOVE = "MouseMove" + SUFFIX;
@@ -90,7 +90,7 @@ public final class IEventConstants {
public static final String FOCUS_OUT = "FocusOut";
- public static final String[] FOCUS_GROUP = new String[]{ FOCUS_IN, FOCUS_OUT };
+ public static final String[] FOCUS_GROUP = new String[] { FOCUS_IN, FOCUS_OUT };
public static final String XWT_FOCUS_IN = "FocusIn" + SUFFIX;
@@ -100,7 +100,7 @@ public final class IEventConstants {
public static final String COLLAPSE = "Collapse";
- public static final String[] EXPAND_GROUP = new String[]{ EXPAND, COLLAPSE };
+ public static final String[] EXPAND_GROUP = new String[] { EXPAND, COLLAPSE };
public static final String XWT_EXPAND = "Expand" + SUFFIX;
@@ -116,7 +116,7 @@ public final class IEventConstants {
public static final String HIDE = "Hide";
- public static final String[] WINDOW_GROUP = new String[]{ ICONIFY, DEICONIFY, CLOSE, SHOW, HIDE };
+ public static final String[] WINDOW_GROUP = new String[] { ICONIFY, DEICONIFY, CLOSE, SHOW, HIDE };
public static final String XWT_ICONIFY = "Iconify" + SUFFIX;
@@ -140,7 +140,7 @@ public final class IEventConstants {
public static final String DEACTIVATE = "Deactivate";
- public static final String[] ACTIVATION_GROUP = new String[]{ ACTIVATE, DEACTIVATE };
+ public static final String[] ACTIVATION_GROUP = new String[] { ACTIVATE, DEACTIVATE };
public static final String XWT_ACTIVATE = "Activate" + SUFFIX;
@@ -166,7 +166,7 @@ public final class IEventConstants {
public static final String HARD_KEY_UP = "HardKeyUp";
- public static final String[] HARD_KEY = new String[]{ HARD_KEY_DOWN, HARD_KEY_UP };
+ public static final String[] HARD_KEY = new String[] { HARD_KEY_DOWN, HARD_KEY_UP };
public static final String XWT_HARD_KEY_DOWN = "HardKeyDown" + SUFFIX;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventGroup.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventGroup.java
index 3335d307f13..5c9d239dd20 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventGroup.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventGroup.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt;
@@ -14,7 +14,7 @@ import org.eclipse.papyrus.xwt.metadata.IProperty;
/**
* This class manages the coordination between events' state
- *
+ *
* @author yyang
*/
public interface IEventGroup {
@@ -23,7 +23,7 @@ public interface IEventGroup {
/**
* Fire the event to update other when an event occurs
- *
+ *
* @param object
* @param property
*/
@@ -31,7 +31,7 @@ public interface IEventGroup {
/**
* Register the event
- *
+ *
* @param manager
* @param property
*/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventHandler.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventHandler.java
index 8fe58150c82..d7ec3feacba 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventHandler.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventHandler.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt;
@@ -15,7 +15,7 @@ package org.eclipse.papyrus.xwt;
* XWT uses Java reflection to find the method to handle an event. If the class
* specified by <code>x:Class</code> implements this interface, this class can provide
* the IEventInvoker for each event.
- *
+ *
* @author yyang
*/
public interface IEventHandler {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventInvoker.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventInvoker.java
index 84191187fed..902771a2590 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventInvoker.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IEventInvoker.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IIndexedElement.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IIndexedElement.java
index c382da8c2ce..9eb6cec31fc 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IIndexedElement.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IIndexedElement.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILoadingContext.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILoadingContext.java
index 5544ad0aa06..c5aa3081c3f 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILoadingContext.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILoadingContext.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILogger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILogger.java
index 1110c2a0fe5..850cd1cc725 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILogger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ILogger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,7 +14,7 @@ import java.util.Set;
/**
* Looger interface
- *
+ *
* @author yyang
*/
public interface ILogger {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMetaclassFactory.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMetaclassFactory.java
index ed1dab8bbe8..9d1bed23751 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMetaclassFactory.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMetaclassFactory.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,9 +14,9 @@ import org.eclipse.papyrus.xwt.metadata.IMetaclass;
/**
* Metaclass factory provides a customizable Metaclass creation mechanism.
- *
+ *
* @author yyang
- *
+ *
*/
public interface IMetaclassFactory {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMultiValueConverter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMultiValueConverter.java
index 3f0457e4479..7e8a7a4be4c 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMultiValueConverter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IMultiValueConverter.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,9 +12,9 @@ package org.eclipse.papyrus.xwt;
/**
* Data converter used in MultiBinding
- *
+ *
* @author yyang
- *
+ *
*/
public interface IMultiValueConverter extends IValueConverter {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/INamespaceHandler.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/INamespaceHandler.java
index 564132c26bd..f0374c69b77 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/INamespaceHandler.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/INamespaceHandler.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,7 +14,7 @@ import org.eclipse.swt.widgets.Widget;
/**
* This class defines the public behavior to handle the foreigner namespace
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface INamespaceHandler {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IObservableValueListener.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IObservableValueListener.java
index bc9591928ee..ddd97c4c9f9 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IObservableValueListener.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IObservableValueListener.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IStyle.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IStyle.java
index 4cc6197feec..cca4aa3a6f4 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IStyle.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IStyle.java
@@ -4,21 +4,21 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface IStyle {
/**
* The element to apply the style. The argument is an instance created through XML. It can be a Widget, or others such as TableViewer.
- *
+ *
* @param target
*/
void applyStyle(Object target);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIExtensionProvider.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIExtensionProvider.java
index 7cd368fbdc2..98fde0e43d5 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIExtensionProvider.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIExtensionProvider.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,7 +12,7 @@ package org.eclipse.papyrus.xwt;
/**
* In some UI elements, property data may not be provided in the element it-self.
- *
+ *
* @author yyang
*/
public interface IUIExtensionProvider {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIResource.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIResource.java
index 10a5c2044b9..c227c2d83da 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIResource.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IUIResource.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValidationRule.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValidationRule.java
index d70cd207823..2f3c4695e36 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValidationRule.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValidationRule.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.core.runtime.IStatus;
/**
* @author hceylan
- *
+ *
*/
public interface IValidationRule extends IValidator {
@@ -35,7 +35,7 @@ public interface IValidationRule extends IValidator {
/**
* Returns the direction of the validation
- *
+ *
* @return {@link Direction} indicating the direction of the validation.
* Never null
*/
@@ -43,16 +43,16 @@ public interface IValidationRule extends IValidator {
/**
* Returns the phase this validator applies to
- *
+ *
* @return {@link Phase} to indicate the phase of the validation. Never null
*/
public Phase getPhase();
/**
* Determines if the given value is valid.
- *
+ *
* @param value
- * the value to validate
+ * the value to validate
* @return a status object indicating whether the validation succeeded {@link IStatus#isOK()} or not. Never null.
*/
public IStatus validateBack(Object value);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValueConverter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValueConverter.java
index 05ef460142b..da0dc962c0e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValueConverter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IValueConverter.java
@@ -14,9 +14,9 @@ import org.eclipse.core.databinding.conversion.IConverter;
/**
* For a data binding, the conversion could be bidirectional. The standard IConverter is not enough. This class is designed to meet this requirement.
- *
+ *
* @author yyang
- *
+ *
*/
public interface IValueConverter extends IConverter {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IXWTLoader.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IXWTLoader.java
index dd8713bf5be..026d04af5a9 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IXWTLoader.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/IXWTLoader.java
@@ -8,7 +8,7 @@
* Contributors:
* Soyatec - initial API and implementation
* Christian W. Damus (CEA) - bug 417409
- *
+ *
*******************************************************************************/
package org.eclipse.papyrus.xwt;
@@ -40,7 +40,7 @@ import org.eclipse.swt.widgets.Composite;
/**
* XWT loader interface
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface IXWTLoader {
@@ -49,7 +49,7 @@ public interface IXWTLoader {
/**
* The URL which open XWT file
- *
+ *
*/
String URL_PROPERTY = "XWT.URL";
@@ -68,100 +68,101 @@ public interface IXWTLoader {
/**
* Default styles to apply. The value should be a collection or Array of
* IStyle
- *
+ *
*/
String DEFAULT_STYLES_PROPERTY = "XWT.DefaultStyles";
/**
* Enabled or disabled the styles. By default, it is enabled
- *
+ *
*/
String DISABLE_STYLES_PROPERTY = "XWT.DisabledStyles";
/**
* The DataContext to setup in root element
- *
+ *
*/
String DATACONTEXT_PROPERTY = "XWT.DataContext";
/**
* The BindingContext to setup in root element
- *
+ *
*/
String BINDING_CONTEXT_PROPERTY = "XWT.BindingContext";
/**
* The CLR class
- *
+ *
*/
String CLASS_PROPERTY = "XWT.Class";
/**
* The CLR class factory
- *
+ *
*/
String CLASS_FACTORY_PROPERTY = "XWT.ClassFactory";
/**
* Resources to associate to root element
- *
+ *
*/
String RESOURCE_DICTIONARY_PROPERTY = "XWT.Resources";
/**
* Resources to associate to root element
- *
+ *
*/
String LOADED_CALLBACK = ILoadedCallback.class.getName();
/**
* Action to invoke after the creation of each UI element before the properties setting
- *
+ *
*/
String CREATED_CALLBACK = ICreatedCallback.class.getName();
/**
* Action to invoke before parsing the XML file
- *
+ *
*/
String BEFORE_PARSING_CALLBACK = IBeforeParsingCallback.class.getName();
-
+
/**
* Parsed XML element caching option. In the public API, this may be only either a {@link Boolean} indicating whether to cache the XML content
* parsed from XWT resources (the cache having some unspecified default size) or a positive {@link Integer} indicating the size of XML cache.
* This load option is a bit odd in that, if specified, it is replaced by the actual cache, which then should be supplied as the option value
* for subsequent calls. Thus, the following idiom is recommended:
- *
+ *
* <pre>
- * private Object xmlCache; // the XML cache
- *
- * // other fields ...
- *
- * void whatever() {
- * Map<String, Object> options = new HashMap&lt;String, Object&gt;();
- * options.put(IXWTLoader.XML_CACHE_PROPERTY, (xmlCache != null) ? xmlCache : Boolean.TRUE);
- * // ... set other options as needed ...
- *
- * URL url = getResourceURL(); // however this is obtained
- *
- * Object ui = XWT.loadWithOptions(url, options);
- *
- * // Get the cache to reuse next time
- * xmlCache = options.get(IXWTLoader.XML_CACHE_PROPERTY);
- *
- * doSomethingWithTheUI(ui);
- * }
+ * private Object xmlCache; // the XML cache
+ *
+ * // other fields ...
+ *
+ * void whatever() {
+ * Map&lt;String, Object&gt; options = new HashMap&lt;String, Object&gt;();
+ * options.put(IXWTLoader.XML_CACHE_PROPERTY, (xmlCache != null) ? xmlCache : Boolean.TRUE);
+ * // ... set other options as needed ...
+ *
+ * URL url = getResourceURL(); // however this is obtained
+ *
+ * Object ui = XWT.loadWithOptions(url, options);
+ *
+ * // Get the cache to reuse next time
+ * xmlCache = options.get(IXWTLoader.XML_CACHE_PROPERTY);
+ *
+ * doSomethingWithTheUI(ui);
+ * }
* </pre>
*/
String XML_CACHE_PROPERTY = IElementCache.class.getName();
- String[] ALL_PROPERTIES = { URL_PROPERTY, CONTAINER_PROPERTY, INIT_STYLE_PROPERTY, DATACONTEXT_PROPERTY, BINDING_CONTEXT_PROPERTY, RESOURCE_DICTIONARY_PROPERTY, CLASS_PROPERTY, CLASS_FACTORY_PROPERTY, LOADED_CALLBACK, CREATED_CALLBACK, BEFORE_PARSING_CALLBACK, DESIGN_MODE_PROPERTY, XML_CACHE_PROPERTY };
+ String[] ALL_PROPERTIES = { URL_PROPERTY, CONTAINER_PROPERTY, INIT_STYLE_PROPERTY, DATACONTEXT_PROPERTY, BINDING_CONTEXT_PROPERTY, RESOURCE_DICTIONARY_PROPERTY, CLASS_PROPERTY, CLASS_FACTORY_PROPERTY, LOADED_CALLBACK, CREATED_CALLBACK,
+ BEFORE_PARSING_CALLBACK, DESIGN_MODE_PROPERTY, XML_CACHE_PROPERTY };
/**
* Register an Observable IChangeListener for a given UI element. The second
* registration of the same listener on the same UI Element has no effect.
- *
+ *
* @param control
* @param listener
* @return
@@ -171,7 +172,7 @@ public interface IXWTLoader {
/**
* Undo the registration of the Observable IChangeListener for a given UI
* element.
- *
+ *
* @param context
* @param listener
*/
@@ -179,7 +180,7 @@ public interface IXWTLoader {
/**
* Find the used IObservable value for given data.
- *
+ *
* @param nsmapace
* @return
*/
@@ -187,7 +188,7 @@ public interface IXWTLoader {
/**
* Find the used IObservableFactory value for given data.
- *
+ *
* @param nsmapace
* @return
*/
@@ -195,7 +196,7 @@ public interface IXWTLoader {
/**
* Find the used IObservableValue value for given data.
- *
+ *
* @param nsmapace
* @return
*/
@@ -203,7 +204,7 @@ public interface IXWTLoader {
/**
* Find the used IObservableList value for given data.
- *
+ *
* @param nsmapace
* @return
*/
@@ -211,7 +212,7 @@ public interface IXWTLoader {
/**
* Find the used IObservableList value for given data.
- *
+ *
* @param nsmapace
* @return
*/
@@ -219,7 +220,7 @@ public interface IXWTLoader {
/**
* Find the used IObservableValue value for given data.
- *
+ *
* @param context
* @param data
* @param propertyName
@@ -230,7 +231,7 @@ public interface IXWTLoader {
/**
* Find the resource in Resources Dictionary attached in the UI Element.
* If the key isn't found, the research will be propagated in its parent.
- *
+ *
* @param object
* @param key
* @return
@@ -239,48 +240,48 @@ public interface IXWTLoader {
/**
* Get the Resources Dictionary attached in the UI Element.
- *
+ *
* @param object
* @return
*/
Map<String, Object> getResources(Object object);
/**
- *
+ *
* @param nsmapace
* @param handler
*/
void registerNamespaceHandler(String nsmapace, INamespaceHandler handler);
/**
- *
+ *
* @param nsmapace
*/
void unregisterNamespaceHandler(String nsmapace);
/**
- *
+ *
* @param nsmapace
* @return
*/
INamespaceHandler getNamespaceHandler(String nsmapace);
/**
- *
+ *
* @return
*/
Realm getRealm();
/**
* Get the system logger.
- *
+ *
* @return
*/
ILogger getLogger();
/**
* Change the system logger
- *
+ *
* @param logger
*/
void setLogger(ILogger log);
@@ -288,7 +289,7 @@ public interface IXWTLoader {
/**
* This namespace service returns the associated or declared namespace for a
* given class.
- *
+ *
* @param javaclass
* @return
*/
@@ -296,7 +297,7 @@ public interface IXWTLoader {
/**
* Get the name of the element, which is defined by <code>Name</code> or <code>x:Name</code>. Return <code>null</code>
- *
+ *
* @param object
* @return
*/
@@ -304,9 +305,9 @@ public interface IXWTLoader {
/**
* Find a named UI element.
- *
+ *
* @param context
- * the start point of research.
+ * the start point of research.
* @param name
* @return
*/
@@ -314,7 +315,7 @@ public interface IXWTLoader {
/**
* Get the DataContext of given element
- *
+ *
* @param context
* @return
*/
@@ -322,7 +323,7 @@ public interface IXWTLoader {
/**
* Get the Triggers of given element
- *
+ *
* @param context
* @return
*/
@@ -330,7 +331,7 @@ public interface IXWTLoader {
/**
* Change the DataContext of given element
- *
+ *
* @param context
* @return
*/
@@ -338,7 +339,7 @@ public interface IXWTLoader {
/**
* Changes the default data context of given element
- *
+ *
* @param widget
* @param dataBindingContext
*/
@@ -346,7 +347,7 @@ public interface IXWTLoader {
/**
* Change the Triggers of given element
- *
+ *
* @param context
* @return
*/
@@ -354,7 +355,7 @@ public interface IXWTLoader {
/**
* Find the closet parent of type Composite
- *
+ *
* @param context
* @return
*/
@@ -362,7 +363,7 @@ public interface IXWTLoader {
/**
* Get the Metaclass of the given object
- *
+ *
* @param context
* @return
*/
@@ -371,7 +372,7 @@ public interface IXWTLoader {
/**
* Load the file content. All widget will be created but they are showed.
* This method return the root element.
- *
+ *
*/
Object load(URL file) throws Exception;
@@ -472,7 +473,7 @@ public interface IXWTLoader {
/**
* Data conversion service from String to a given type
- *
+ *
* @param type
* @param string
* @return
@@ -481,7 +482,7 @@ public interface IXWTLoader {
/**
* Data conversion service from String to a given type
- *
+ *
* @param targetType
* @param string
* @return
@@ -491,7 +492,7 @@ public interface IXWTLoader {
Object loadWithOptions(URL url, Map<String, Object> options) throws Exception;
/**
- *
+ *
* @param stream
* @param url
* @param options
@@ -512,7 +513,7 @@ public interface IXWTLoader {
/**
* Generic load method
- *
+ *
* @param stream
* @param url
* @param loadData
@@ -525,7 +526,7 @@ public interface IXWTLoader {
/**
* Metaclass services to return all registered Metaclasses.
- *
+ *
* @param stream
* @param url
* @param loadData
@@ -536,66 +537,66 @@ public interface IXWTLoader {
/**
* Get the corresponding Metaclass
- *
+ *
* @param tagName
* @param ns
- * The namespace
+ * The namespace
* @return
*/
IMetaclass getMetaclass(String tagName, String ns);
/**
* Register UI type
- *
+ *
* @param javaclass
*/
IMetaclass registerMetaclass(Class<?> type);
/**
* Register UI type
- *
+ *
* @param javaclass
*/
void registerMetaclass(IMetaclass type);
/**
* Get the dynamic property value
- *
+ *
* @param javaclass
*/
Object getPropertyValue(Object uiElement, IProperty property);
/**
* Set the dynamic property value
- *
+ *
* @param javaclass
*/
void setPropertyValue(Object uiElement, IProperty property, Object value);
/**
* Remove the dynamic property value
- *
+ *
* @param javaclass
*/
void removePropertyValue(Object uiElement, IProperty property);
/**
* Remove the dynamic property value
- *
+ *
* @param javaclass
*/
boolean hasPropertyValue(Object uiElement, IProperty property);
/**
* Register Metaclass factory
- *
+ *
* @param javaclass
*/
void registerMetaclassFactory(IMetaclassFactory metaclassFactory);
/**
* Find a Data converter
- *
+ *
* @param converter
* @param type
*/
@@ -603,7 +604,7 @@ public interface IXWTLoader {
/**
* Register a Data converter
- *
+ *
* @param converter
* @param type
*/
@@ -611,14 +612,14 @@ public interface IXWTLoader {
/**
* Add a tracking option
- *
+ *
* @param tracking
*/
void addTracking(Tracking tracking);
/**
* Test if the tracking on argument is enabled.
- *
+ *
* @param tracking
* @return
*/
@@ -626,21 +627,21 @@ public interface IXWTLoader {
/**
* Get all tracking options
- *
+ *
* @return
*/
Set<Tracking> getTrackings();
/**
* Remove a tracking option.
- *
+ *
* @param tracking
*/
void removeTracking(Tracking tracking);
/**
* Register a command to a name
- *
+ *
* @param name
* @param command
*/
@@ -648,7 +649,7 @@ public interface IXWTLoader {
/**
* Register a command to a name
- *
+ *
* @param name
* @param command
*/
@@ -656,7 +657,7 @@ public interface IXWTLoader {
/**
* Find a command by name
- *
+ *
* @param name
* @return
*/
@@ -664,21 +665,21 @@ public interface IXWTLoader {
/**
* Return all registered commands
- *
+ *
* @return
*/
Map<String, ICommand> getCommands();
/**
* Unregister a command
- *
+ *
* @param name
*/
void unregisterCommand(String name);
/**
* Add a default style
- *
+ *
* @param style
* @return
*/
@@ -686,7 +687,7 @@ public interface IXWTLoader {
/**
* Remove a default style
- *
+ *
* @param style
* @return
*/
@@ -714,7 +715,7 @@ public interface IXWTLoader {
/**
* Create a UI Profile with the provide data and apply it immediately.
- *
+ *
* @param profileData
* @return
*/
@@ -722,7 +723,7 @@ public interface IXWTLoader {
/**
* Put the Profile in place
- *
+ *
* @param profile
* @return
*/
@@ -730,28 +731,28 @@ public interface IXWTLoader {
/**
* Restore the previous profile
- *
+ *
* @return
*/
public Object restoreProfile();
/**
* Set up the default ICLRFactory
- *
+ *
* @param factory
*/
public void setCLRFactory(ICLRFactory factory);
/**
* The default CLRFactory.
- *
+ *
* @return
*/
public ICLRFactory getCLRFactory();
/**
* Returns the {@link BindingContext} of the element
- *
+ *
* @param element
* @param contextName
* @return
@@ -760,27 +761,27 @@ public interface IXWTLoader {
/**
* Check if the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
boolean isFileResolveType(Class<?> type);
/**
* Register the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
void registerFileResolveType(Class<?> type);
/**
* Register the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
void unregisterFileResolveType(Class<?> type);
@@ -788,8 +789,8 @@ public interface IXWTLoader {
public class Utilities {
public static boolean isPropertyName(String name) {
- for(String propertyName : ALL_PROPERTIES) {
- if(propertyName.equalsIgnoreCase(name)) {
+ for (String propertyName : ALL_PROPERTIES) {
+ if (propertyName.equalsIgnoreCase(name)) {
return true;
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/InverseValueConverter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/InverseValueConverter.java
index 7270d39e7e2..84294990a53 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/InverseValueConverter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/InverseValueConverter.java
@@ -12,9 +12,9 @@ package org.eclipse.papyrus.xwt;
/**
* The operation to inverse the converter direction.
- *
+ *
* @author yyang
- *
+ *
*/
public class InverseValueConverter implements IValueConverter {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ResourceDictionary.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ResourceDictionary.java
index f0757517425..b82b138d024 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ResourceDictionary.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/ResourceDictionary.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/Tracking.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/Tracking.java
index a25a3ee9060..2847b125d7e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/Tracking.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/Tracking.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWT.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWT.java
index 07a50b90c6a..ef3a31942c6 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWT.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWT.java
@@ -49,7 +49,7 @@ import org.eclipse.swt.widgets.Widget;
/**
* XWT is the main class of the XWT framework. It provides most of the services
* in API.
- *
+ *
* @author yyang
*/
public class XWT {
@@ -62,7 +62,7 @@ public class XWT {
/**
* Get the system logger.
- *
+ *
* @returnF
*/
public static ILogger getLogger() {
@@ -71,7 +71,7 @@ public class XWT {
/**
* Create a UI Profile with the provide data and apply it immediately.
- *
+ *
* @param profileData
* @return
*/
@@ -81,7 +81,7 @@ public class XWT {
/**
* Put the Profile in place
- *
+ *
* @param profile
* @return
*/
@@ -91,7 +91,7 @@ public class XWT {
/**
* Restore the previous profile
- *
+ *
* @return
*/
public static Object restoreProfile() {
@@ -99,7 +99,7 @@ public class XWT {
}
/**
- *
+ *
* @param nsmapace
* @param handler
*/
@@ -108,7 +108,7 @@ public class XWT {
}
/**
- *
+ *
* @param nsmapace
*/
public static void unregisterNamespaceHandler(String nsmapace) {
@@ -116,7 +116,7 @@ public class XWT {
}
/**
- *
+ *
* @param nsmapace
* @return
*/
@@ -127,7 +127,7 @@ public class XWT {
/**
* Register an Observable IChangeListener for a given UI element. The second
* registration of the same listener on the same UI Element has no effect.
- *
+ *
* @param context
* @param listener
* @return
@@ -139,7 +139,7 @@ public class XWT {
/**
* Undo the registration of the Observable IChangeListener for a given UI
* element.
- *
+ *
* @param context
* @param listener
*/
@@ -149,7 +149,7 @@ public class XWT {
/**
* Find an existing IObservableValue
- *
+ *
* @param nsmapace
* @return null if it doesn't exist.
*/
@@ -159,7 +159,7 @@ public class XWT {
/**
* Find an existing IObservableValue
- *
+ *
* @param nsmapace
* @return null if it doesn't exist.
*/
@@ -169,7 +169,7 @@ public class XWT {
/**
* Find an existing IObservableValue
- *
+ *
* @param nsmapace
* @return null if it doesn't exist.
*/
@@ -179,7 +179,7 @@ public class XWT {
/**
* get or create a IObservableValue
- *
+ *
* @param nsmapace
* @return return null or raises an exception XWTException if fails
*/
@@ -189,7 +189,7 @@ public class XWT {
/**
* get or create a IObservable
- *
+ *
* @param nsmapace
* @return return null or raises an exception XWTException if fails
*/
@@ -199,7 +199,7 @@ public class XWT {
/**
* get or create a IObservable
- *
+ *
* @param nsmapace
* @return return null or raises an exception XWTException if fails
*/
@@ -209,7 +209,7 @@ public class XWT {
/**
* get or create a IObservableValue
- *
+ *
* @param nsmapace
* @return return null or raises an exception XWTException if fails
*/
@@ -219,7 +219,7 @@ public class XWT {
/**
* Change the system logger
- *
+ *
* @param logger
*/
public static void setLogger(ILogger log) {
@@ -228,7 +228,7 @@ public class XWT {
/**
* Get the name of the element, which is defined by <code>Name</code> or <code>x:Name</code>. Return <code>null</code>
- *
+ *
* @param object
* @return
*/
@@ -238,9 +238,9 @@ public class XWT {
/**
* Find a named UI element.
- *
+ *
* @param context
- * the start point of research.
+ * the start point of research.
* @param name
* @return
*/
@@ -250,18 +250,18 @@ public class XWT {
/**
* Get the DataContext of given element
- *
+ *
* @param context
* @return
*/
public static Object getDataContext(Object element, Class<?> targetType) {
Object value = XWTLoaderManager.getActive().getDataContext(element);
- if(targetType == null || !targetType.isInstance(value)) {
- if(value instanceof IBinding) {
- return ((IBinding)value).getValue(targetType);
+ if (targetType == null || !targetType.isInstance(value)) {
+ if (value instanceof IBinding) {
+ return ((IBinding) value).getValue(targetType);
}
- if(value instanceof IObservableValue) {
- return ((IObservableValue)value).getValue();
+ if (value instanceof IObservableValue) {
+ return ((IObservableValue) value).getValue();
}
}
return value;
@@ -270,13 +270,12 @@ public class XWT {
/**
* Returns the {@link BindingContext} within the upper scope of the control.
* <p>
- * Each UI Element may have a local DataBindingContext property. While locating DataBindingContext, if the current UI Element has not the
- * property, the parent's will be used.
+ * Each UI Element may have a local DataBindingContext property. While locating DataBindingContext, if the current UI Element has not the property, the parent's will be used.
* <p>
* If none is found, a default one will be created as default for the current scope
* <p>
* If still not found {@link XWTException} thrown...
- *
+ *
* @param element
* @return
*/
@@ -286,7 +285,7 @@ public class XWT {
/**
* Get the DataContext of given element
- *
+ *
* @param context
* @return
*/
@@ -296,7 +295,7 @@ public class XWT {
/**
* Set the DataContext of given element
- *
+ *
* @param context
* @return
*/
@@ -306,7 +305,7 @@ public class XWT {
/**
* Get the Triggers of given element
- *
+ *
* @param context
* @return
*/
@@ -316,7 +315,7 @@ public class XWT {
/**
* Get the Triggers of given element
- *
+ *
* @param context
* @return
*/
@@ -327,7 +326,7 @@ public class XWT {
/**
* Get the CLR (Common Language Runtime) object. If no CLR object is found
* in this element, the research will be propagated in it parent.
- *
+ *
* @param widget
* @return
*/
@@ -337,7 +336,7 @@ public class XWT {
/**
* Find the root shell
- *
+ *
* @param context
* @return
*/
@@ -370,7 +369,7 @@ public class XWT {
/**
* Load the file content. All widget will be created but they are showed.
* This method return the root element.
- *
+ *
*/
static public Object load(URL file) throws Exception {
XWT.checkInitialization();
@@ -380,7 +379,7 @@ public class XWT {
/**
* Load the content from IUIResource. All widget will be created but they
* are showed. This method return the root element.
- *
+ *
*/
static public Object load(IUIResource resource) throws Exception {
XWT.checkInitialization();
@@ -390,7 +389,7 @@ public class XWT {
/**
* Load the file content. All widget will be created but they are showed.
* This method return the root element.
- *
+ *
*/
static public Object load(URL file, Object dataContext) throws Exception {
XWT.checkInitialization();
@@ -400,7 +399,7 @@ public class XWT {
/**
* Load the content from IUIResource. All widget will be created but they
* are showed. This method return the root element.
- *
+ *
*/
static public Object load(IUIResource resource, Object dataContext) throws Exception {
XWT.checkInitialization();
@@ -420,7 +419,7 @@ public class XWT {
* Load the file content under a UI Object. All widget will be created. This
* method returns the root element. The DataContext will be associated to
* the root element.
- *
+ *
*/
static public Object load(Object parent, IUIResource resource) throws Exception {
return XWTLoaderManager.getActive().load(parent, resource);
@@ -437,11 +436,11 @@ public class XWT {
/**
* Load the content from IUIResource.
- *
+ *
* @param stream
* @param input
* @param parsingCallback
- * null if the callback is not necessary
+ * null if the callback is not necessary
* @return
* @throws Exception
*/
@@ -451,11 +450,11 @@ public class XWT {
/**
* Load the content from IUIResource.
- *
+ *
* @param stream
* @param input
* @param parsingCallback
- * null if the callback is not necessary
+ * null if the callback is not necessary
* @return
* @throws Exception
*/
@@ -465,10 +464,10 @@ public class XWT {
/**
* Load the content from IUIResource.
- *
+ *
* @param input
* @param parsingCallback
- * null if the callback is not necessary
+ * null if the callback is not necessary
* @return
* @throws Exception
*/
@@ -478,7 +477,7 @@ public class XWT {
/**
* Load the content from IUIResource.
- *
+ *
* @param input
* @return
* @throws Exception
@@ -586,7 +585,7 @@ public class XWT {
}
/**
- *
+ *
* @param stream
* @param url
* @param options
@@ -599,7 +598,7 @@ public class XWT {
}
/**
- *
+ *
* @param stream
* @param url
* @param options
@@ -613,7 +612,7 @@ public class XWT {
/**
* Metaclass services to return all registered Metaclasses.
- *
+ *
* @param stream
* @param url
* @param loadData
@@ -626,10 +625,10 @@ public class XWT {
/**
* Get the corresponding Metaclass
- *
+ *
* @param tagName
* @param ns
- * The namespace
+ * The namespace
* @return
*/
static public IMetaclass getMetaclass(String tagName, String ns) {
@@ -638,7 +637,7 @@ public class XWT {
/**
* Register a Data converter
- *
+ *
* @param converter
* @param type
*/
@@ -648,7 +647,7 @@ public class XWT {
/**
* Register a Data converter
- *
+ *
* @param converter
* @param type
*/
@@ -658,7 +657,7 @@ public class XWT {
/**
* Register a command to a name
- *
+ *
* @param name
* @param command
*/
@@ -668,7 +667,7 @@ public class XWT {
/**
* Add a default style
- *
+ *
* @param style
* @return
*/
@@ -694,7 +693,7 @@ public class XWT {
/**
* Register UI type
- *
+ *
* @param javaclass
*/
static public IMetaclass registerMetaclass(Class<?> type) {
@@ -703,7 +702,7 @@ public class XWT {
/**
* Register UI type
- *
+ *
* @param javaclass
*/
static public void registerMetaclass(IMetaclass type) {
@@ -712,7 +711,7 @@ public class XWT {
/**
* Get the dynamic property value
- *
+ *
* @param javaclass
*/
static public Object getPropertyValue(Object uiElement, IProperty property) {
@@ -721,13 +720,13 @@ public class XWT {
/**
* Get the dynamic property value
- *
+ *
* @param javaclass
*/
static public Object getPropertyValue(Object uiElement, String propertyName) {
IMetaclass metaclass = XWT.getMetaclass(uiElement);
IProperty property = metaclass.findProperty(propertyName);
- if(property == null) {
+ if (property == null) {
return null;
}
return XWTLoaderManager.getActive().getPropertyValue(uiElement, property);
@@ -735,7 +734,7 @@ public class XWT {
/**
* Set the dynamic property value
- *
+ *
* @param javaclass
*/
static public void setPropertyValue(Object uiElement, IProperty property, Object value) {
@@ -744,13 +743,13 @@ public class XWT {
/**
* Set the dynamic property value
- *
+ *
* @param javaclass
*/
static public void setPropertyValue(Object uiElement, String propertyName, Object value) {
IMetaclass metaclass = XWT.getMetaclass(uiElement);
IProperty property = metaclass.findProperty(propertyName);
- if(property == null) {
+ if (property == null) {
throw new XWTException("Property " + propertyName + " not found.");
}
XWTLoaderManager.getActive().setPropertyValue(uiElement, property, value);
@@ -758,7 +757,7 @@ public class XWT {
/**
* Remove the dynamic property value
- *
+ *
* @param javaclass
*/
static public void removePropertyValue(Object uiElement, IProperty property) {
@@ -767,7 +766,7 @@ public class XWT {
/**
* Remove the dynamic property value
- *
+ *
* @param javaclass
*/
static public boolean hasPropertyValue(Object uiElement, IProperty property) {
@@ -776,7 +775,7 @@ public class XWT {
/**
* Find a Data converter
- *
+ *
* @param converter
* @param type
*/
@@ -786,7 +785,7 @@ public class XWT {
/**
* Switch current loading context
- *
+ *
*/
public static void setLoadingContext(ILoadingContext loadingContext) {
XWTLoaderManager.getActive().setLoadingContext(loadingContext);
@@ -794,7 +793,7 @@ public class XWT {
/**
* Return current loading context
- *
+ *
* @return ILoadingContext
*/
public static ILoadingContext getLoadingContext() {
@@ -803,7 +802,7 @@ public class XWT {
/**
* Add a tracking option
- *
+ *
* @param tracking
*/
static public void addTracking(Tracking tracking) {
@@ -812,7 +811,7 @@ public class XWT {
/**
* Test if the tracking on argument is enabled.
- *
+ *
* @param tracking
* @return
*/
@@ -822,7 +821,7 @@ public class XWT {
/**
* Get all tracking options
- *
+ *
* @return
*/
static public Set<Tracking> getTrackings() {
@@ -831,7 +830,7 @@ public class XWT {
/**
* Set up the default ICLRFactory
- *
+ *
* @param factory
*/
static public void setCLRFactory(ICLRFactory factory) {
@@ -839,7 +838,7 @@ public class XWT {
}
static public boolean checkInitialization() {
- if(isAllInitializersInitialized()) {
+ if (isAllInitializersInitialized()) {
return false;
}
return checkInitialization(-1);
@@ -847,12 +846,12 @@ public class XWT {
static public boolean checkInitialization(long timeoutMillis) {
long started = System.currentTimeMillis();
- while(true) {
- if(timeoutMillis != -1 && System.currentTimeMillis() - started > timeoutMillis) {
+ while (true) {
+ if (timeoutMillis != -1 && System.currentTimeMillis() - started > timeoutMillis) {
return false;
}
- if(isAllInitializersInitialized()) {
+ if (isAllInitializersInitialized()) {
return false;
}
@@ -865,9 +864,9 @@ public class XWT {
}
private static boolean isAllInitializersInitialized() {
- synchronized(initializers) {
- for(IXWTInitializer initializer : initializers) {
- if(!initializer.isInitialized()) {
+ synchronized (initializers) {
+ for (IXWTInitializer initializer : initializers) {
+ if (!initializer.isInitialized()) {
return false;
}
}
@@ -877,7 +876,7 @@ public class XWT {
/**
* The default CLRFactory.
- *
+ *
* @return
*/
static public ICLRFactory getCLRFactory() {
@@ -886,7 +885,7 @@ public class XWT {
/**
* Find a command by name
- *
+ *
* @param name
* @return
*/
@@ -908,9 +907,9 @@ public class XWT {
/**
* Check if the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public static boolean isFileResolveType(Class<?> type) {
@@ -919,9 +918,9 @@ public class XWT {
/**
* Register the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public static void registerFileResolveType(Class<?> type) {
@@ -930,9 +929,9 @@ public class XWT {
/**
* Register the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public static void unregisterFileResolveType(Class<?> type) {
@@ -957,26 +956,26 @@ public class XWT {
/**
* Run in UI context.
- *
+ *
* @param runnable
*/
public static void runOnUIThread(final Runnable runnable) {
String platform = SWT.getPlatform();
- if(platform.startsWith("win")) {
+ if (platform.startsWith("win")) {
XWTLoaderManager.getDefault();
runnable.run();
- } else if(platform.startsWith("rap")) {
+ } else if (platform.startsWith("rap")) {
XWTLoaderManager.getDefault();
runnable.run();
- } else if(platform.endsWith("gtk") || platform.endsWith("cocoa")) {
- synchronized(displayLock) {
- if(displayThread == null || !displayThread.isAlive()) {
+ } else if (platform.endsWith("gtk") || platform.endsWith("cocoa")) {
+ synchronized (displayLock) {
+ if (displayThread == null || !displayThread.isAlive()) {
try {
Field field = Display.class.getDeclaredField("Default");
- if(field != null) {
+ if (field != null) {
field.setAccessible(true);
- Display defaultDisplay = (Display)field.get(null);
- if(defaultDisplay != null) {
+ Display defaultDisplay = (Display) field.get(null);
+ if (defaultDisplay != null) {
displayThread = defaultDisplay.getThread();
}
}
@@ -984,7 +983,7 @@ public class XWT {
}
}
- if(displayThread == null || !displayThread.isAlive()) {
+ if (displayThread == null || !displayThread.isAlive()) {
displayThread = new Thread() {
private long startTime = -1;
@@ -998,14 +997,14 @@ public class XWT {
protected Runnable runnable = new Runnable() {
public void run() {
- if(ignoreNotification) {
+ if (ignoreNotification) {
startTime = -1;
return;
}
- if(startTime == -1) {
+ if (startTime == -1) {
startTime = System.currentTimeMillis();
} else {
- if((System.currentTimeMillis() - startTime) > 10000 && display.getActiveShell() == null && display.getShells().length == 0) {
+ if ((System.currentTimeMillis() - startTime) > 10000 && display.getActiveShell() == null && display.getShells().length == 0) {
toStop = true;
display.wake();
} else {
@@ -1021,13 +1020,13 @@ public class XWT {
XWTLoaderManager.getDefault();
display = Display.getDefault();
runnable.run();
- while(true) {
- if(!display.readAndDispatch()) {
+ while (true) {
+ if (!display.readAndDispatch()) {
display.timerExec(10000, runnable);
display.sleep();
ignoreNotification = true;
}
- if(toStop) {
+ if (toStop) {
break;
}
startTime = -1;
@@ -1039,7 +1038,7 @@ public class XWT {
XWTLoaderManager.getDefault();
XWT.checkInitialization();
Display display = Display.findDisplay(displayThread);
- if(display != null) {
+ if (display != null) {
display.syncExec(runnable);
}
}
@@ -1050,8 +1049,8 @@ public class XWT {
}
public static void addInitializer(IXWTInitializer initializer) {
- synchronized(initializers) {
- if(!XWTLoaderManager.isStarted()) {
+ synchronized (initializers) {
+ if (!XWTLoaderManager.isStarted()) {
initializers.add(initializer);
}
}
@@ -1063,15 +1062,15 @@ public class XWT {
public static Object findParent(Object element, Class<?> type) {
Widget widget = UserData.getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return null;
}
return UserData.findParent(widget, type);
}
static void runInitializers(IXWTLoader loader) {
- synchronized(initializers) {
- for(IXWTInitializer initializer : XWT.getInitializers()) {
+ synchronized (initializers) {
+ for (IXWTInitializer initializer : XWT.getInitializers()) {
initializer.initialize(loader);
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTException.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTException.java
index e46b4532f13..dddf166eec9 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTException.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTException.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoader.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoader.java
index e354a8e49d5..b05a2bc15e7 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoader.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoader.java
@@ -156,7 +156,7 @@ import org.eclipse.swt.widgets.TreeItem;
/**
* Default XWT loader
- *
+ *
* @author yyang (yves.yang@soyatec.com) jliu (jin.liu@soyatec.com)
*/
public class XWTLoader implements IXWTLoader {
@@ -177,29 +177,29 @@ public class XWTLoader implements IXWTLoader {
}
public boolean applyProfile(Object profile) {
- if(profile instanceof Core) {
- if(cores.peek() == profile) {
+ if (profile instanceof Core) {
+ if (cores.peek() == profile) {
return false;
}
- cores.push((Core)profile);
+ cores.push((Core) profile);
return true;
}
throw new XWTException("Wrong UI Profile.");
}
public Object restoreProfile() {
- if(cores.size() > 1) {
+ if (cores.size() > 1) {
return cores.pop();
}
throw new XWTException("No user-defined UI Profile.");
}
public Realm getRealm() {
- if(realm != null) {
+ if (realm != null) {
return realm;
}
Display display = Display.getCurrent();
- if(display == null) {
+ if (display == null) {
display = Display.getDefault();
}
return SWTObservables.getRealm(display);
@@ -229,7 +229,7 @@ public class XWTLoader implements IXWTLoader {
/**
* Get the dynamic property value
- *
+ *
* @param javaclass
*/
public Object getPropertyValue(Object uiElement, IProperty property) {
@@ -238,7 +238,7 @@ public class XWTLoader implements IXWTLoader {
/**
* Set the dynamic property value
- *
+ *
* @param javaclass
*/
public void setPropertyValue(Object uiElement, IProperty property, Object value) {
@@ -247,7 +247,7 @@ public class XWTLoader implements IXWTLoader {
/**
* Remove the dynamic property value
- *
+ *
* @param javaclass
*/
public void removePropertyValue(Object uiElement, IProperty property) {
@@ -256,7 +256,7 @@ public class XWTLoader implements IXWTLoader {
/**
* Remove the dynamic property value
- *
+ *
* @param javaclass
*/
public boolean hasPropertyValue(Object uiElement, IProperty property) {
@@ -266,7 +266,7 @@ public class XWTLoader implements IXWTLoader {
/**
* Register an Observable IChangeListener for a given UI element. The second
* registration of the same listener on the same UI Element has no effect.
- *
+ *
* @param context
* @param listener
* @return <code>true</code> the listener is added, <code>false</code> if
@@ -274,7 +274,7 @@ public class XWTLoader implements IXWTLoader {
*/
public boolean addObservableChangeListener(Object control, IChangeListener listener) {
ScopeKeeper scope = UserData.findScopeKeeper(control);
- if(scope != null) {
+ if (scope != null) {
return scope.addChangeListener(listener);
}
return false;
@@ -283,19 +283,19 @@ public class XWTLoader implements IXWTLoader {
/**
* Undo the registration of the Observable IChangeListener for a given UI
* element.
- *
+ *
* @param context
* @param listener
*/
public void removeObservableChangeListener(Object control, IChangeListener listener) {
ScopeKeeper scope = UserData.findScopeKeeper(control);
- if(scope != null) {
+ if (scope != null) {
scope.removeChangeListener(listener);
}
}
/**
- *
+ *
* @param nsmapace
* @return
*/
@@ -304,7 +304,7 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
* @param nsmapace
* @return
*/
@@ -313,7 +313,7 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
* @param nsmapace
* @return
*/
@@ -322,7 +322,7 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
* @param nsmapace
* @return
*/
@@ -331,7 +331,7 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
* @param nsmapace
* @return
*/
@@ -340,7 +340,7 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
* @param nsmapace
* @return
*/
@@ -349,7 +349,7 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
*/
public Object findResource(Object object, String key) {
return UserData.findResource(object, key);
@@ -360,7 +360,7 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
* @param nsmapace
* @param handler
*/
@@ -369,7 +369,7 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
* @param nsmapace
*/
public void unregisterNamespaceHandler(String nsmapace) {
@@ -377,15 +377,15 @@ public class XWTLoader implements IXWTLoader {
}
/**
- *
+ *
* @param nsmapace
* @return
*/
public INamespaceHandler getNamespaceHandler(String nsmapace) {
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
INamespaceHandler handler = core.getNamespaceHandler(nsmapace);
- if(handler != null) {
+ if (handler != null) {
return handler;
}
}
@@ -398,11 +398,11 @@ public class XWTLoader implements IXWTLoader {
* @see org.eclipse.papyrus.xwt.IXWTLoader#getNamespace(java.lang.Class)
*/
public String getNamespace(Class<?> javaclass) {
- if(getMetaclass(javaclass) != null) {
+ if (getMetaclass(javaclass) != null) {
return IConstants.XWT_NAMESPACE;
}
Package javaPackage = javaclass.getPackage();
- if(javaPackage == null) {
+ if (javaPackage == null) {
return IConstants.XAML_CLR_NAMESPACE_PROTO;
}
return IConstants.XAML_CLR_NAMESPACE_PROTO + javaclass.getPackage().getName();
@@ -437,17 +437,17 @@ public class XWTLoader implements IXWTLoader {
*/
public IBindingContext getBindingContext(Object element) {
IBindingContext dataBindingContext = UserData.getBindingContext(element);
- if(dataBindingContext == null) {
+ if (dataBindingContext == null) {
dataBindingContext = UserData.createBindingContext(element);
}
return dataBindingContext;
}
public ICLRFactory getCLRFactory() {
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
ICLRFactory factory = core.getCLRFactory();
- if(factory != null) {
+ if (factory != null) {
return factory;
}
}
@@ -504,7 +504,7 @@ public class XWTLoader implements IXWTLoader {
/**
* Get the Triggers of given element
- *
+ *
* @param context
* @return
*/
@@ -529,22 +529,22 @@ public class XWTLoader implements IXWTLoader {
* @see org.eclipse.papyrus.xwt.IXWTLoader#getMetaclass(java.lang.Object)
*/
public IMetaclass getMetaclass(Object object) {
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
IMetaclass metaclass = core.findMetaclass(object);
- if(metaclass != null) {
+ if (metaclass != null) {
return metaclass;
}
}
Class<?> javaClass = null;
- if(object instanceof Class<?>) {
- javaClass = (Class<?>)object;
+ if (object instanceof Class<?>) {
+ javaClass = (Class<?>) object;
} else {
javaClass = object.getClass();
}
Class<?> superclass = javaClass.getSuperclass();
IMetaclass superMetaclass = null;
- if(superclass != null) {
+ if (superclass != null) {
superMetaclass = getMetaclass(superclass);
}
return getCurrentCore().registerMetaclass(javaClass, IConstants.XWT_NAMESPACE, superMetaclass);
@@ -613,7 +613,7 @@ public class XWTLoader implements IXWTLoader {
}
public Object load(Object parent, IUIResource resource, Map<String, Object> options) throws Exception {
- if(options.isEmpty()) {
+ if (options.isEmpty()) {
options = new HashMap<String, Object>();
}
options.put(CONTAINER_PROPERTY, parent);
@@ -635,25 +635,25 @@ public class XWTLoader implements IXWTLoader {
}
protected Map<String, Object> prepareOptions(Map<String, Object> options, URL url) {
- Boolean disabledStyle = (Boolean)options.get(DISABLE_STYLES_PROPERTY);
- if(!Boolean.TRUE.equals(disabledStyle)) {
+ Boolean disabledStyle = (Boolean) options.get(DISABLE_STYLES_PROPERTY);
+ if (!Boolean.TRUE.equals(disabledStyle)) {
Collection<IStyle> defaultStyles = getDefaultStyles();
Object styles = options.get(DEFAULT_STYLES_PROPERTY);
- if(styles != null) {
- if(styles instanceof IStyle) {
- defaultStyles.add((IStyle)styles);
- } else if(styles instanceof Collection) {
- for(Object element : (Collection<?>)styles) {
- if(element instanceof IStyle) {
- defaultStyles.add((IStyle)element);
+ if (styles != null) {
+ if (styles instanceof IStyle) {
+ defaultStyles.add((IStyle) styles);
+ } else if (styles instanceof Collection) {
+ for (Object element : (Collection<?>) styles) {
+ if (element instanceof IStyle) {
+ defaultStyles.add((IStyle) element);
} else {
throw new XWTException("IStyle is expected in [styles] parameters.");
}
}
- } else if(styles instanceof Object[]) {
- for(Object element : (Object[])styles) {
- if(element instanceof IStyle) {
- defaultStyles.add((IStyle)element);
+ } else if (styles instanceof Object[]) {
+ for (Object element : (Object[]) styles) {
+ if (element instanceof IStyle) {
+ defaultStyles.add((IStyle) element);
} else {
throw new XWTException("IStyle is expected in [styles] parameters.");
}
@@ -661,11 +661,11 @@ public class XWTLoader implements IXWTLoader {
}
options.remove(DEFAULT_STYLES_PROPERTY);
}
- if(!defaultStyles.isEmpty()) {
- ResourceDictionary dictionary = (ResourceDictionary)options.get(RESOURCE_DICTIONARY_PROPERTY);
- if(dictionary == null) {
+ if (!defaultStyles.isEmpty()) {
+ ResourceDictionary dictionary = (ResourceDictionary) options.get(RESOURCE_DICTIONARY_PROPERTY);
+ if (dictionary == null) {
dictionary = new ResourceDictionary();
- if(options == Collections.EMPTY_MAP) {
+ if (options == Collections.EMPTY_MAP) {
options = new HashMap<String, Object>();
}
options.put(RESOURCE_DICTIONARY_PROPERTY, dictionary);
@@ -674,7 +674,7 @@ public class XWTLoader implements IXWTLoader {
}
}
// Register URL property
- if(options == Collections.EMPTY_MAP) {
+ if (options == Collections.EMPTY_MAP) {
options = new HashMap<String, Object>();
}
options.put(URL_PROPERTY, url);
@@ -783,34 +783,34 @@ public class XWTLoader implements IXWTLoader {
* @see org.eclipse.papyrus.xwt.IXWTLoader#open(java.net.URL, java.util.Map)
*/
public void open(final URL url, final Map<String, Object> options) throws Exception {
- if(SWT.getPlatform().startsWith("win")) {
- if(Display.getCurrent() == null) {
+ if (SWT.getPlatform().startsWith("win")) {
+ if (Display.getCurrent() == null) {
new Display();
}
Realm.runWithDefault(getRealm(), new Runnable() {
public void run() {
try {
- if(url == null) {
+ if (url == null) {
throw new XWTException("UI Resource is not found.");
}
Object element = loadWithOptions(url, options);
Shell shell = XWT.findShell(element);
- if(shell == null) {
+ if (shell == null) {
throw new XWTException("Root element must be a control.");
}
shell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
Shell[] shells = Display.getCurrent().getShells();
- if(shells.length == 0) {
+ if (shells.length == 0) {
ResourceManager.resources.dispose();
}
}
});
shell.open();
- while(!shell.isDisposed()) {
- if(!shell.getDisplay().readAndDispatch()) {
+ while (!shell.isDisposed()) {
+ if (!shell.getDisplay().readAndDispatch()) {
shell.getDisplay().sleep();
}
}
@@ -822,27 +822,27 @@ public class XWTLoader implements IXWTLoader {
return;
}
Display defaultDisplay = Display.getDefault();
- if(Thread.currentThread() == defaultDisplay.getThread()) {
+ if (Thread.currentThread() == defaultDisplay.getThread()) {
Realm.runWithDefault(getRealm(), new Runnable() {
public void run() {
try {
- if(url == null) {
+ if (url == null) {
throw new XWTException("UI Resource is not found.");
}
Object element = loadWithOptions(url, options);
Shell shell = XWT.findShell(element);
shell.open();
long startTime = -1;
- while(true) {
- if(!Display.getDefault().readAndDispatch()) {
+ while (true) {
+ if (!Display.getDefault().readAndDispatch()) {
Display.getDefault().sleep();
}
Shell[] shells = Display.getDefault().getShells();
- if(shells.length == 0) {
- if(startTime == -1) {
+ if (shells.length == 0) {
+ if (startTime == -1) {
startTime = System.currentTimeMillis();
- } else if((System.currentTimeMillis() - startTime) > 1000) {
+ } else if ((System.currentTimeMillis() - startTime) > 1000) {
break;
}
} else {
@@ -862,12 +862,12 @@ public class XWTLoader implements IXWTLoader {
public void run() {
try {
- if(url == null) {
+ if (url == null) {
throw new XWTException("UI Resource is not found.");
}
Object element = loadWithOptions(url, options);
Shell shell = XWT.findShell(element);
- if(shell == null) {
+ if (shell == null) {
throw new XWTException("Root element must be a control.");
}
shell.open();
@@ -882,8 +882,8 @@ public class XWTLoader implements IXWTLoader {
}
public void open(final IUIResource resource, final Map<String, Object> options) throws Exception {
- if(SWT.getPlatform().startsWith("win")) {
- if(Display.getCurrent() == null) {
+ if (SWT.getPlatform().startsWith("win")) {
+ if (Display.getCurrent() == null) {
new Display();
}
Realm.runWithDefault(getRealm(), new Runnable() {
@@ -892,21 +892,21 @@ public class XWTLoader implements IXWTLoader {
try {
Object element = loadWithOptions(resource, options);
Shell shell = XWT.findShell(element);
- if(shell == null) {
+ if (shell == null) {
throw new XWTException("Root element must be a control.");
}
shell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
Shell[] shells = Display.getCurrent().getShells();
- if(shells.length == 0) {
+ if (shells.length == 0) {
ResourceManager.resources.dispose();
}
}
});
shell.open();
- while(!shell.isDisposed()) {
- if(!shell.getDisplay().readAndDispatch()) {
+ while (!shell.isDisposed()) {
+ if (!shell.getDisplay().readAndDispatch()) {
shell.getDisplay().sleep();
}
}
@@ -918,27 +918,27 @@ public class XWTLoader implements IXWTLoader {
return;
}
Display defaultDisplay = Display.getDefault();
- if(Thread.currentThread() == defaultDisplay.getThread()) {
+ if (Thread.currentThread() == defaultDisplay.getThread()) {
Realm.runWithDefault(getRealm(), new Runnable() {
public void run() {
try {
Object element = loadWithOptions(resource, options);
Shell shell = XWT.findShell(element);
- if(shell == null) {
+ if (shell == null) {
throw new XWTException("Root element must be a control.");
}
shell.open();
long startTime = -1;
- while(true) {
- if(!Display.getDefault().readAndDispatch()) {
+ while (true) {
+ if (!Display.getDefault().readAndDispatch()) {
Display.getDefault().sleep();
}
Shell[] shells = Display.getDefault().getShells();
- if(shells.length == 0) {
- if(startTime == -1) {
+ if (shells.length == 0) {
+ if (startTime == -1) {
startTime = System.currentTimeMillis();
- } else if((System.currentTimeMillis() - startTime) > 1000) {
+ } else if ((System.currentTimeMillis() - startTime) > 1000) {
break;
}
} else {
@@ -960,7 +960,7 @@ public class XWTLoader implements IXWTLoader {
try {
Object element = loadWithOptions(resource, options);
Shell shell = XWT.findShell(element);
- if(shell == null) {
+ if (shell == null) {
throw new XWTException("Root element must be a control.");
}
shell.open();
@@ -993,14 +993,14 @@ public class XWTLoader implements IXWTLoader {
* java.lang.String)
*/
public Object convertFrom(Class<?> targetType, String string) {
- if(targetType == String.class) {
+ if (targetType == String.class) {
return string;
}
IConverter converter = findConvertor(String.class, targetType);
- if(converter != null) {
+ if (converter != null) {
return converter.convert(string);
}
- if(targetType == Object.class) {
+ if (targetType == Object.class) {
return string;
}
throw new XWTException("Converter is missing of type: " + targetType.getName() + " from String");
@@ -1013,10 +1013,10 @@ public class XWTLoader implements IXWTLoader {
* java.util.Map)
*/
public Object loadWithOptions(URL url, Map<String, Object> options) throws Exception {
- if(url == null) {
+ if (url == null) {
throw new XWTException("UI Resource is not found.");
}
- Composite object = (Composite)options.get(CONTAINER_PROPERTY);
+ Composite object = (Composite) options.get(CONTAINER_PROPERTY);
ILoadingContext loadingContext = (object != null ? getLoadingContext(object) : getLoadingContext());
options = prepareOptions(options, url);
Object visualObject = getCurrentCore().load(loadingContext, url, options);
@@ -1024,7 +1024,7 @@ public class XWTLoader implements IXWTLoader {
}
public Object loadWithOptions(IUIResource resource, Map<String, Object> options) throws Exception {
- UIResource uiResource = (UIResource)resource;
+ UIResource uiResource = (UIResource) resource;
Object object = options.get(CONTAINER_PROPERTY);
ILoadingContext loadingContext = (object != null ? getLoadingContext(object) : getLoadingContext());
options = prepareOptions(options, uiResource.getURL());
@@ -1053,7 +1053,7 @@ public class XWTLoader implements IXWTLoader {
* java.net.URL, java.util.Map)
*/
public Object loadWithOptions(InputStream stream, URL base, Map<String, Object> options) throws Exception {
- Composite object = (Composite)options.get(CONTAINER_PROPERTY);
+ Composite object = (Composite) options.get(CONTAINER_PROPERTY);
ILoadingContext loadingContext = (object != null ? getLoadingContext(object) : getLoadingContext());
options = prepareOptions(options, base);
Control visualObject = getCurrentCore().load(loadingContext, stream, base, options);
@@ -1067,7 +1067,7 @@ public class XWTLoader implements IXWTLoader {
*/
public IMetaclass[] getAllMetaclasses() {
Collection<IMetaclass> collector = new ArrayList<IMetaclass>();
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
Collection<IMetaclass> metaclasses = core.getAllMetaclasses(IConstants.XWT_NAMESPACE);
collector.addAll(metaclasses);
@@ -1082,10 +1082,10 @@ public class XWTLoader implements IXWTLoader {
* java.lang.String)
*/
public IMetaclass getMetaclass(String tagName, String ns) {
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
IMetaclass metaclass = core.getMetaclass(getLoadingContext(), tagName, ns);
- if(metaclass != null) {
+ if (metaclass != null) {
return metaclass;
}
}
@@ -1130,10 +1130,10 @@ public class XWTLoader implements IXWTLoader {
public IConverter findConvertor(Class<?> source, Class<?> target) {
source = ObjectUtil.normalizedType(source);
target = ObjectUtil.normalizedType(target);
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
IConverter converter = core.findConvertor(source, target);
- if(converter != null) {
+ if (converter != null) {
return converter;
}
}
@@ -1222,10 +1222,10 @@ public class XWTLoader implements IXWTLoader {
* @see org.eclipse.papyrus.xwt.IXWTLoader#getCommand(java.lang.String)
*/
public ICommand getCommand(String name) {
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
ICommand command = core.getCommand(name);
- if(command != null) {
+ if (command != null) {
return command;
}
}
@@ -1239,10 +1239,10 @@ public class XWTLoader implements IXWTLoader {
*/
public Map<String, ICommand> getCommands() {
HashMap<String, ICommand> collector = new HashMap<String, ICommand>();
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
Map<String, ICommand> map = core.getCommands();
- if(map != null) {
+ if (map != null) {
collector.putAll(map);
}
}
@@ -1260,7 +1260,7 @@ public class XWTLoader implements IXWTLoader {
/**
* Register a command to a name
- *
+ *
* @param name
* @param command
*/
@@ -1340,10 +1340,10 @@ public class XWTLoader implements IXWTLoader {
*/
public Collection<IDataProviderFactory> getDataProviderFactories() {
ArrayList<IDataProviderFactory> collector = new ArrayList<IDataProviderFactory>();
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
Collection<IDataProviderFactory> factories = core.getDataProviderFactories();
- if(factories != null) {
+ if (factories != null) {
collector.addAll(factories);
}
}
@@ -1356,10 +1356,10 @@ public class XWTLoader implements IXWTLoader {
* @see org.eclipse.papyrus.xwt.IXWTLoader#findDataProvider(java.lang.Object)
*/
public IDataProvider findDataProvider(Object dataContext) {
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
IDataProvider provider = core.findDataProvider(dataContext);
- if(provider != null) {
+ if (provider != null) {
return provider;
}
}
@@ -1430,13 +1430,13 @@ public class XWTLoader implements IXWTLoader {
registerConvertor(SetToIObservableCollection.instance);
registerConvertor(ObjectToISelection.instance);
registerConvertor(ListToSet.instance);
- // registerConvertor(StringToKeyTime.instance);
- // registerConvertor(StringToKeySpline.instance);
+ // registerConvertor(StringToKeyTime.instance);
+ // registerConvertor(StringToKeySpline.instance);
registerConvertor(IStatusToString.instance);
registerConvertor(IStatusToBoolean.instance);
- ValueConvertorRegister convertorRegister = (ValueConvertorRegister)core.getService(ValueConvertorRegister.class);
+ ValueConvertorRegister convertorRegister = (ValueConvertorRegister) core.getService(ValueConvertorRegister.class);
convertorRegister.register(String.class, float.class, StringToNumberConverter.toFloat(true));
convertorRegister.register(String.class, int.class, StringToInteger.instance);
@@ -1477,8 +1477,8 @@ public class XWTLoader implements IXWTLoader {
IProperty drawingProperty = new AbstractProperty(IUserDataConstants.XWT_DRAWING_KEY, Drawing.class) {
public void setValue(Object target, Object value) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchFieldException {
- if(!ObjectUtil.isAssignableFrom(IBinding.class, getType())) {
- if(value != null) {
+ if (!ObjectUtil.isAssignableFrom(IBinding.class, getType())) {
+ if (value != null) {
value = ObjectUtil.resolveValue(value, getType(), value);
}
}
@@ -1491,7 +1491,7 @@ public class XWTLoader implements IXWTLoader {
metaclass.addProperty(drawingProperty);
IProperty dataContextProperty = new DataProperty(IConstants.XAML_DATA_CONTEXT, IUserDataConstants.XWT_DATACONTEXT_KEY);
metaclass.addProperty(dataContextProperty);
- ILoadingType loadingType = new DefaultLoadingType(IValueLoading.PostChildren, new IProperty[]{ dataContextProperty });
+ ILoadingType loadingType = new DefaultLoadingType(IValueLoading.PostChildren, new IProperty[] { dataContextProperty });
metaclass.addProperty(new DataProperty(IConstants.XAML_BINDING_CONTEXT, IUserDataConstants.XWT_BINDING_CONTEXT_KEY));
metaclass.addProperty(new TriggersProperty(loadingType));
@@ -1516,7 +1516,7 @@ public class XWTLoader implements IXWTLoader {
registerMetaclass(org.eclipse.swt.widgets.Canvas.class);
registerMetaclass(org.eclipse.swt.widgets.Caret.class);
metaclass = registerMetaclass(org.eclipse.swt.widgets.Combo.class);
- if(metaclass != null) {
+ if (metaclass != null) {
IProperty property = metaclass.findProperty("text");
IProperty inputProperty = new DelegateProperty(property, loadingType);
metaclass.addProperty(inputProperty);
@@ -1583,7 +1583,7 @@ public class XWTLoader implements IXWTLoader {
registerMetaclass(type);
metaclass = registerMetaclass(type);
metaclass.addProperty(new DynamicBeanProperty(TreeItem.class, String[].class, PropertiesConstants.PROPERTY_TEXTS, PropertiesConstants.PROPERTY_TEXT));
- if(metaclass != null) {
+ if (metaclass != null) {
IProperty property = metaclass.findProperty("expanded");
IProperty expandedProperty = new DelegateProperty(property, loadingType);
metaclass.addProperty(expandedProperty);
@@ -1602,7 +1602,7 @@ public class XWTLoader implements IXWTLoader {
registerMetaclass(org.eclipse.swt.custom.CLabel.class);
metaclass = registerMetaclass(org.eclipse.swt.custom.CCombo.class);
- if(metaclass != null) {
+ if (metaclass != null) {
IProperty property = metaclass.findProperty("text");
IProperty inputProperty = new DelegateProperty(property, loadingType);
metaclass.addProperty(inputProperty);
@@ -1610,7 +1610,7 @@ public class XWTLoader implements IXWTLoader {
registerMetaclass(org.eclipse.swt.custom.CTabFolder.class);
registerMetaclass(org.eclipse.swt.custom.CTabItem.class);
metaclass = registerMetaclass(org.eclipse.swt.custom.SashForm.class);
- if(metaclass != null) {
+ if (metaclass != null) {
IProperty property = metaclass.findProperty("weights");
IProperty inputProperty = new DelegateProperty(property, loadingType);
metaclass.addProperty(inputProperty);
@@ -1625,7 +1625,7 @@ public class XWTLoader implements IXWTLoader {
type = org.eclipse.jface.viewers.Viewer.class;
metaclass = core.getMetaclass(type, IConstants.XWT_NAMESPACE);
- if(metaclass != null) {
+ if (metaclass != null) {
IProperty property = metaclass.findProperty("Input");
IProperty inputProperty = new InputBeanProperty(property, loadingType);
metaclass.addProperty(inputProperty);
@@ -1636,34 +1636,34 @@ public class XWTLoader implements IXWTLoader {
metaclass.addProperty(new DataProperty(PropertiesConstants.PROPERTY_BINDING_PATH, IUserDataConstants.XWT_PROPERTY_DATA_KEY, String.class));
metaclass.addProperty(new DataProperty(PropertiesConstants.PROPERTY_ITEM_TEXT, IUserDataConstants.XWT_PROPERTY_ITEM_TEXT_KEY, IBinding.class));
metaclass.addProperty(new DataProperty(PropertiesConstants.PROPERTY_ITEM_IMAGE, IUserDataConstants.XWT_PROPERTY_ITEM_IMAGE_KEY, IBinding.class));
- ILoadingType inputLoadingType = new DefaultLoadingType(IValueLoading.PostChildren, new IProperty[]{ inputProperty });
+ ILoadingType inputLoadingType = new DefaultLoadingType(IValueLoading.PostChildren, new IProperty[] { inputProperty });
metaclass.addProperty(new SingleSelectionBeanProperty(PropertiesConstants.PROPERTY_SINGLE_SELECTION, inputLoadingType));
metaclass.addProperty(new MultiSelectionBeanProperty(PropertiesConstants.PROPERTY_MULTI_SELECTION, inputLoadingType));
}
type = org.eclipse.jface.viewers.AbstractListViewer.class;
metaclass = core.getMetaclass(type, IConstants.XWT_NAMESPACE);
- if(metaclass != null) {
+ if (metaclass != null) {
metaclass.addInitializer(new JFaceInitializer());
}
type = org.eclipse.jface.viewers.ColumnViewer.class;
metaclass = core.getMetaclass(type, IConstants.XWT_NAMESPACE);
- if(metaclass != null) {
+ if (metaclass != null) {
metaclass.addProperty(new DynamicBeanProperty(type, String[].class, PropertiesConstants.PROPERTY_COLUMN_PROPERTIES));
metaclass.addProperty(new ColumnViewerColumnsProperty());
metaclass.addInitializer(new JFaceInitializer());
}
- for(Class<?> cls : JFacesHelper.getSupportedElements()) {
+ for (Class<?> cls : JFacesHelper.getSupportedElements()) {
registerMetaclass(cls);
}
type = org.eclipse.jface.viewers.TableViewer.class;
metaclass = core.getMetaclass(type, IConstants.XWT_NAMESPACE);
IProperty property = metaclass.findProperty("table");
- if(property instanceof AbstractProperty) {
- AbstractProperty abstractProperty = (AbstractProperty)property;
+ if (property instanceof AbstractProperty) {
+ AbstractProperty abstractProperty = (AbstractProperty) property;
abstractProperty.setValueAsParent(true);
}
@@ -1701,9 +1701,9 @@ public class XWTLoader implements IXWTLoader {
registerMetaclass(MultiDataTrigger.class);
registerMetaclass(Condition.class);
- // registerConvertor(StringToDuration.instance);
- // registerConvertor(StringToTimeSpan.instance);
- // registerConvertor(StringToRepeatBehavior.instance);
+ // registerConvertor(StringToDuration.instance);
+ // registerConvertor(StringToTimeSpan.instance);
+ // registerConvertor(StringToRepeatBehavior.instance);
registerMetaclass(CollectionViewSource.class);
@@ -1721,10 +1721,10 @@ public class XWTLoader implements IXWTLoader {
* @see org.eclipse.papyrus.xwt.IXWTLoader#findLoadingContext(java.lang.Object)
*/
public ILoadingContext findLoadingContext(Object container) {
- for(int i = cores.size() - 1; i >= 0; i--) {
+ for (int i = cores.size() - 1; i >= 0; i--) {
Core core = cores.get(i);
ILoadingContext context = core.findLoadingContext(container);
- if(context != null) {
+ if (context != null) {
return context;
}
}
@@ -1763,9 +1763,9 @@ public class XWTLoader implements IXWTLoader {
/**
* Check if the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public boolean isFileResolveType(Class<?> type) {
@@ -1774,9 +1774,9 @@ public class XWTLoader implements IXWTLoader {
/**
* Register the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public void registerFileResolveType(Class<?> type) {
@@ -1785,9 +1785,9 @@ public class XWTLoader implements IXWTLoader {
/**
* Register the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public void unregisterFileResolveType(Class<?> type) {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoaderManager.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoaderManager.java
index 365a24b99bc..16b21696713 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoaderManager.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTLoaderManager.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
* Anyware-tech - add multiple loaders
@@ -24,11 +24,11 @@ public class XWTLoaderManager {
/**
* Returns the default instance of the XWT loader
- *
+ *
* @return the default instance of the XWT loader
*/
public static IXWTLoader getDefault() {
- if(defaultXWTLoader == null) {
+ if (defaultXWTLoader == null) {
defaultXWTLoader = new XWTLoader();
XWT.runInitializers(defaultXWTLoader);
}
@@ -41,12 +41,12 @@ public class XWTLoaderManager {
/**
* Returns the instance of the XWT loader active. If no XWT loader are active, returns the default XWT loader
- *
+ *
* @return the instance of the XWT loader active
*/
public static IXWTLoader getActive() {
IXWTLoader xwtLoader = activeXWTLoader;
- if(xwtLoader == null) {
+ if (xwtLoader == null) {
xwtLoader = getDefault();
}
return xwtLoader;
@@ -54,16 +54,16 @@ public class XWTLoaderManager {
/**
* Sets the active XWT loader
- *
+ *
* @param xwtLoader
- * the XWT loader
+ * the XWT loader
* @param active
- * true if the XWT loader is active, otherwise false
+ * true if the XWT loader is active, otherwise false
*/
public static void setActive(IXWTLoader xwtLoader, boolean active) {
- if(active) {
+ if (active) {
activeXWTLoader = xwtLoader;
- } else if(xwtLoader != null && xwtLoader.equals(activeXWTLoader)) {
+ } else if (xwtLoader != null && xwtLoader.equals(activeXWTLoader)) {
activeXWTLoader = null;
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTMaps.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTMaps.java
index 7a7d870fba6..2c6e34b79e1 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTMaps.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/XWTMaps.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -34,7 +34,7 @@ public class XWTMaps {
}
private static void checkAndInit() {
- if(styles.isEmpty() || colors.isEmpty() || events.isEmpty() || accelerators.isEmpty()) {
+ if (styles.isEmpty() || colors.isEmpty() || events.isEmpty() || accelerators.isEmpty()) {
init();
}
}
@@ -272,12 +272,12 @@ public class XWTMaps {
}
public static int getStyle(String key) {
- if(key == null) {
+ if (key == null) {
return SWT.NONE;
}
checkAndInit();
String mapKey = key.toUpperCase();
- if(!mapKey.startsWith("SWT.")) {
+ if (!mapKey.startsWith("SWT.")) {
mapKey = "SWT." + mapKey;
}
Integer style = styles.get(mapKey);
@@ -290,12 +290,12 @@ public class XWTMaps {
}
public static int getColor(String key) {
- if(key == null || key.equals("")) {
+ if (key == null || key.equals("")) {
return SWT.NONE;
}
checkAndInit();
String mapKey = key.toUpperCase();
- if(!mapKey.startsWith("SWT.")) {
+ if (!mapKey.startsWith("SWT.")) {
mapKey = "SWT." + mapKey;
}
Integer color = colors.get(mapKey);
@@ -308,12 +308,12 @@ public class XWTMaps {
}
public static int getEvent(String key) {
- if(key == null || key.equals("")) {
+ if (key == null || key.equals("")) {
return SWT.None;
}
checkAndInit();
String mapKey = key.toLowerCase();
- if(!mapKey.startsWith("swt.")) {
+ if (!mapKey.startsWith("swt.")) {
mapKey = "swt." + mapKey;
}
Integer event = events.get(mapKey);
@@ -327,32 +327,32 @@ public class XWTMaps {
public static int getAccelerator(String key) {
char letter;
- if(key == null || key.equals("")) {
+ if (key == null || key.equals("")) {
return SWT.NONE;
}
checkAndInit();
- if(key.equals("BS")) {
+ if (key.equals("BS")) {
Integer accelerator = Integer.valueOf(SWT.BS);
return accelerator == null ? SWT.NONE : accelerator;
- } else if(key.equals("ENTER")) {
+ } else if (key.equals("ENTER")) {
Integer accelerator = Integer.valueOf(SWT.CR);
return accelerator == null ? SWT.NONE : accelerator;
- } else if(key.equals("DEL")) {
+ } else if (key.equals("DEL")) {
Integer accelerator = Integer.valueOf(SWT.DEL);
return accelerator == null ? SWT.NONE : accelerator;
- } else if(key.equals("SPACE")) {
+ } else if (key.equals("SPACE")) {
Integer accelerator = Integer.valueOf(' ');
return accelerator == null ? SWT.NONE : accelerator;
- } else if(key.length() == 1) {
+ } else if (key.length() == 1) {
letter = key.charAt(0);
- if(letter >= 'A' && letter <= 'Z' || letter >= 'a' && letter <= 'z') {
+ if (letter >= 'A' && letter <= 'Z' || letter >= 'a' && letter <= 'z') {
Integer accelerator = Integer.valueOf(letter);
return accelerator == null ? SWT.NONE : accelerator;
}
}
String mapKey = key.toUpperCase();
- if(!mapKey.startsWith("SWT.")) {
+ if (!mapKey.startsWith("SWT.")) {
mapKey = "SWT." + mapKey;
}
@@ -362,314 +362,314 @@ public class XWTMaps {
public static int getValue(String key) {
int value = getStyle(key);
- if(value == SWT.NONE) {
+ if (value == SWT.NONE) {
value = getColor(key);
}
- if(value == SWT.NONE) {
+ if (value == SWT.NONE) {
value = getEvent(key);
}
- if(value == SWT.NONE) {
+ if (value == SWT.NONE) {
value = getAccelerator(key);
}
return value;
}
public static String getCombAccelerator(String content) {
- if(content.equals("Alt0")) {
+ if (content.equals("Alt0")) {
return "SWT.ALT | SWT.KEYPAD_0";
- } else if(content.equals("Alt1")) {
+ } else if (content.equals("Alt1")) {
return "SWT.ALT | SWT.KEYPAD_1";
- } else if(content.equals("Alt2")) {
+ } else if (content.equals("Alt2")) {
return "SWT.ALT | SWT.KEYPAD_2";
- } else if(content.equals("Alt3")) {
+ } else if (content.equals("Alt3")) {
return "SWT.ALT | SWT.KEYPAD_3";
- } else if(content.equals("Alt4")) {
+ } else if (content.equals("Alt4")) {
return "SWT.ALT | SWT.KEYPAD_4";
- } else if(content.equals("Alt5")) {
+ } else if (content.equals("Alt5")) {
return "SWT.ALT | SWT.KEYPAD_5";
- } else if(content.equals("Alt6")) {
+ } else if (content.equals("Alt6")) {
return "SWT.ALT | SWT.KEYPAD_6";
- } else if(content.equals("Alt7")) {
+ } else if (content.equals("Alt7")) {
return "SWT.ALT | SWT.KEYPAD_7";
- } else if(content.equals("Alt8")) {
+ } else if (content.equals("Alt8")) {
return "SWT.ALT | SWT.KEYPAD_8";
- } else if(content.equals("Alt9")) {
+ } else if (content.equals("Alt9")) {
return "SWT.ALT | SWT.KEYPAD_9";
- } else if(content.equals("AltBksp")) {
+ } else if (content.equals("AltBksp")) {
return "SWT.ALT | BS";
- } else if(content.equals("AltDownArrow")) {
+ } else if (content.equals("AltDownArrow")) {
return "SWT.ALT | SWT.ARROW_DOWN";
- } else if(content.equals("AltF1")) {
+ } else if (content.equals("AltF1")) {
return "SWT.ALT | SWT.F1";
- } else if(content.equals("AltF10")) {
+ } else if (content.equals("AltF10")) {
return "SWT.ALT | SWT.F10";
- } else if(content.equals("AltF11")) {
+ } else if (content.equals("AltF11")) {
return "SWT.ALT | SWT.F11";
- } else if(content.equals("AltF12")) {
+ } else if (content.equals("AltF12")) {
return "SWT.ALT | SWT.F12";
- } else if(content.equals("AltF2")) {
+ } else if (content.equals("AltF2")) {
return "SWT.ALT | SWT.F2";
- } else if(content.equals("AltF3")) {
+ } else if (content.equals("AltF3")) {
return "SWT.ALT | SWT.F3";
- } else if(content.equals("AltF4")) {
+ } else if (content.equals("AltF4")) {
return "SWT.ALT | SWT.F4";
- } else if(content.equals("AltF5")) {
+ } else if (content.equals("AltF5")) {
return "SWT.ALT | SWT.F5";
- } else if(content.equals("AltF6")) {
+ } else if (content.equals("AltF6")) {
return "SWT.ALT | SWT.F6";
- } else if(content.equals("AltF7")) {
+ } else if (content.equals("AltF7")) {
return "SWT.ALT | SWT.F7";
- } else if(content.equals("AltF8")) {
+ } else if (content.equals("AltF8")) {
return "SWT.ALT | SWT.F8";
- } else if(content.equals("AltF9")) {
+ } else if (content.equals("AltF9")) {
return "SWT.ALT | SWT.F9";
- } else if(content.equals("AltLeftArrow")) {
+ } else if (content.equals("AltLeftArrow")) {
return "SWT.ALT | SWT.ARROW_LEFT";
- } else if(content.equals("AltRightArrow")) {
+ } else if (content.equals("AltRightArrow")) {
return "SWT.ALT | SWT.ARROW_RIGHT";
- } else if(content.equals("AltUpArrow")) {
+ } else if (content.equals("AltUpArrow")) {
return "SWT.ALT | SWT.ARROW_UP";
- } else if(content.equals("AltEnter")) {
+ } else if (content.equals("AltEnter")) {
return "SWT.ALT | Enter";
- } else if(content.equals("AltSpace")) {
+ } else if (content.equals("AltSpace")) {
return "SWT.ALT | Space";
- } else if(content.equals("Ctrl0")) {
+ } else if (content.equals("Ctrl0")) {
return "SWT.CTRL | SWT.KEYPAD_0";
- } else if(content.equals("Ctrl1")) {
+ } else if (content.equals("Ctrl1")) {
return "SWT.CTRL | SWT.KEYPAD_1";
- } else if(content.equals("Ctrl2")) {
+ } else if (content.equals("Ctrl2")) {
return "SWT.CTRL | SWT.KEYPAD_2";
- } else if(content.equals("Ctrl3")) {
+ } else if (content.equals("Ctrl3")) {
return "SWT.CTRL | SWT.KEYPAD_3";
- } else if(content.equals("Ctrl4")) {
+ } else if (content.equals("Ctrl4")) {
return "SWT.CTRL | SWT.KEYPAD_4";
- } else if(content.equals("Ctrl5")) {
+ } else if (content.equals("Ctrl5")) {
return "SWT.CTRL | SWT.KEYPAD_5";
- } else if(content.equals("Ctrl6")) {
+ } else if (content.equals("Ctrl6")) {
return "SWT.CTRL | SWT.KEYPAD_6";
- } else if(content.equals("Ctrl7")) {
+ } else if (content.equals("Ctrl7")) {
return "SWT.CTRL | SWT.KEYPAD_7";
- } else if(content.equals("Ctrl8")) {
+ } else if (content.equals("Ctrl8")) {
return "SWT.CTRL | SWT.KEYPAD_8";
- } else if(content.equals("Ctrl9")) {
+ } else if (content.equals("Ctrl9")) {
return "SWT.CTRL | SWT.KEYPAD_9";
- } else if(content.equals("CtrlA")) {
+ } else if (content.equals("CtrlA")) {
return "SWT.CTRL | A";
- } else if(content.equals("CtrlB")) {
+ } else if (content.equals("CtrlB")) {
return "SWT.CTRL | B";
- } else if(content.equals("CtrlC")) {
+ } else if (content.equals("CtrlC")) {
return "SWT.CTRL | C";
- } else if(content.equals("CtrlD")) {
+ } else if (content.equals("CtrlD")) {
return "SWT.CTRL | D";
- } else if(content.equals("CtrlDel")) {
+ } else if (content.equals("CtrlDel")) {
return "SWT.CTRL | DEL";
- } else if(content.equals("CtrlEnter")) {
+ } else if (content.equals("CtrlEnter")) {
return "SWT.CTRL | Enter";
- } else if(content.equals("CtrlSpace")) {
+ } else if (content.equals("CtrlSpace")) {
return "SWT.CTRL | Space";
- } else if(content.equals("CtrlE")) {
+ } else if (content.equals("CtrlE")) {
return "SWT.CTRL | E";
- } else if(content.equals("CtrlF")) {
+ } else if (content.equals("CtrlF")) {
return "SWT.CTRL | F";
- } else if(content.equals("CtrlF1")) {
+ } else if (content.equals("CtrlF1")) {
return "SWT.CTRL | SWT.F1";
- } else if(content.equals("CtrlF10")) {
+ } else if (content.equals("CtrlF10")) {
return "SWT.CTRL | SWT.F10";
- } else if(content.equals("CtrlF11")) {
+ } else if (content.equals("CtrlF11")) {
return "SWT.CTRL | SWT.F11";
- } else if(content.equals("CtrlF12")) {
+ } else if (content.equals("CtrlF12")) {
return "SWT.CTRL | SWT.F12";
- } else if(content.equals("CtrlF2")) {
+ } else if (content.equals("CtrlF2")) {
return "SWT.CTRL | SWT.F2";
- } else if(content.equals("CtrlF3")) {
+ } else if (content.equals("CtrlF3")) {
return "SWT.CTRL | SWT.F3";
- } else if(content.equals("CtrlF4")) {
+ } else if (content.equals("CtrlF4")) {
return "SWT.CTRL | SWT.F4";
- } else if(content.equals("CtrlF5")) {
+ } else if (content.equals("CtrlF5")) {
return "SWT.CTRL | SWT.F5";
- } else if(content.equals("CtrlF6")) {
+ } else if (content.equals("CtrlF6")) {
return "SWT.CTRL | SWT.F6";
- } else if(content.equals("CtrlF7")) {
+ } else if (content.equals("CtrlF7")) {
return "SWT.CTRL | SWT.F7";
- } else if(content.equals("CtrlF8")) {
+ } else if (content.equals("CtrlF8")) {
return "SWT.CTRL | SWT.F8";
- } else if(content.equals("CtrlF9")) {
+ } else if (content.equals("CtrlF9")) {
return "SWT.CTRL | SWT.F9";
- } else if(content.equals("CtrlG")) {
+ } else if (content.equals("CtrlG")) {
return "SWT.CTRL | G";
- } else if(content.equals("CtrlH")) {
+ } else if (content.equals("CtrlH")) {
return "SWT.CTRL | H";
- } else if(content.equals("CtrlI")) {
+ } else if (content.equals("CtrlI")) {
return "SWT.CTRL | I";
- } else if(content.equals("CtrlIns")) {
+ } else if (content.equals("CtrlIns")) {
return "SWT.CTRL | SWT.INSERT";
- } else if(content.equals("CtrlJ")) {
+ } else if (content.equals("CtrlJ")) {
return "SWT.CTRL | J";
- } else if(content.equals("CtrlK")) {
+ } else if (content.equals("CtrlK")) {
return "SWT.CTRL | K";
- } else if(content.equals("CtrlL")) {
+ } else if (content.equals("CtrlL")) {
return "SWT.CTRL | L";
- } else if(content.equals("CtrlM")) {
+ } else if (content.equals("CtrlM")) {
return "SWT.CTRL | M";
- } else if(content.equals("CtrlN")) {
+ } else if (content.equals("CtrlN")) {
return "SWT.CTRL | N";
- } else if(content.equals("CtrlO")) {
+ } else if (content.equals("CtrlO")) {
return "SWT.CTRL | O";
- } else if(content.equals("CtrlP")) {
+ } else if (content.equals("CtrlP")) {
return "SWT.CTRL | P";
- } else if(content.equals("CtrlQ")) {
+ } else if (content.equals("CtrlQ")) {
return "SWT.CTRL | Q";
- } else if(content.equals("CtrlR")) {
+ } else if (content.equals("CtrlR")) {
return "SWT.CTRL | R";
- } else if(content.equals("CtrlS")) {
+ } else if (content.equals("CtrlS")) {
return "SWT.CTRL | S";
- } else if(content.equals("CtrlShift0")) {
+ } else if (content.equals("CtrlShift0")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_0";
- } else if(content.equals("CtrlShift1")) {
+ } else if (content.equals("CtrlShift1")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_1";
- } else if(content.equals("CtrlShift2")) {
+ } else if (content.equals("CtrlShift2")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_2";
- } else if(content.equals("CtrlShift3")) {
+ } else if (content.equals("CtrlShift3")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_3";
- } else if(content.equals("CtrlShift4")) {
+ } else if (content.equals("CtrlShift4")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_4";
- } else if(content.equals("CtrlShift5")) {
+ } else if (content.equals("CtrlShift5")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_5";
- } else if(content.equals("CtrlShift6")) {
+ } else if (content.equals("CtrlShift6")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_6";
- } else if(content.equals("CtrlShift7")) {
+ } else if (content.equals("CtrlShift7")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_7";
- } else if(content.equals("CtrlShift8")) {
+ } else if (content.equals("CtrlShift8")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_8";
- } else if(content.equals("CtrlShift9")) {
+ } else if (content.equals("CtrlShift9")) {
return "SWT.CTRL | SWT.SHIFT | SWT.KEYPAD_9";
- } else if(content.equals("CtrlShiftA")) {
+ } else if (content.equals("CtrlShiftA")) {
return "SWT.CTRL | SWT.SHIFT | A";
- } else if(content.equals("CtrlShiftB")) {
+ } else if (content.equals("CtrlShiftB")) {
return "SWT.CTRL | SWT.SHIFT | B";
- } else if(content.equals("CtrlShiftC")) {
+ } else if (content.equals("CtrlShiftC")) {
return "SWT.CTRL | SWT.SHIFT | C";
- } else if(content.equals("CtrlShiftD")) {
+ } else if (content.equals("CtrlShiftD")) {
return "SWT.CTRL | SWT.SHIFT | D";
- } else if(content.equals("CtrlShiftE")) {
+ } else if (content.equals("CtrlShiftE")) {
return "SWT.CTRL | SWT.SHIFT | E";
- } else if(content.equals("CtrlShiftF")) {
+ } else if (content.equals("CtrlShiftF")) {
return "SWT.CTRL | SWT.SHIFT | F";
- } else if(content.equals("CtrlShiftF1")) {
+ } else if (content.equals("CtrlShiftF1")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F1";
- } else if(content.equals("CtrlShiftF10")) {
+ } else if (content.equals("CtrlShiftF10")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F10";
- } else if(content.equals("CtrlShiftF11")) {
+ } else if (content.equals("CtrlShiftF11")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F11";
- } else if(content.equals("CtrlShiftF12")) {
+ } else if (content.equals("CtrlShiftF12")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F12";
- } else if(content.equals("CtrlShiftF2")) {
+ } else if (content.equals("CtrlShiftF2")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F2";
- } else if(content.equals("CtrlShiftF3")) {
+ } else if (content.equals("CtrlShiftF3")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F3";
- } else if(content.equals("CtrlShiftF4")) {
+ } else if (content.equals("CtrlShiftF4")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F4";
- } else if(content.equals("CtrlShiftF5")) {
+ } else if (content.equals("CtrlShiftF5")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F5";
- } else if(content.equals("CtrlShiftF6")) {
+ } else if (content.equals("CtrlShiftF6")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F6";
- } else if(content.equals("CtrlShiftF7")) {
+ } else if (content.equals("CtrlShiftF7")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F7";
- } else if(content.equals("CtrlShiftF8")) {
+ } else if (content.equals("CtrlShiftF8")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F8";
- } else if(content.equals("CtrlShiftF9")) {
+ } else if (content.equals("CtrlShiftF9")) {
return "SWT.CTRL | SWT.SHIFT | SWT.F9";
- } else if(content.equals("CtrlShiftH")) {
+ } else if (content.equals("CtrlShiftH")) {
return "SWT.CTRL | SWT.SHIFT | H";
- } else if(content.equals("CtrlShiftI")) {
+ } else if (content.equals("CtrlShiftI")) {
return "SWT.CTRL | SWT.SHIFT | I";
- } else if(content.equals("CtrlShiftJ")) {
+ } else if (content.equals("CtrlShiftJ")) {
return "SWT.CTRL | SWT.SHIFT | J";
- } else if(content.equals("CtrlShiftK")) {
+ } else if (content.equals("CtrlShiftK")) {
return "SWT.CTRL | SWT.SHIFT | K";
- } else if(content.equals("CtrlShiftL")) {
+ } else if (content.equals("CtrlShiftL")) {
return "SWT.CTRL | SWT.SHIFT | L";
- } else if(content.equals("CtrlShiftM")) {
+ } else if (content.equals("CtrlShiftM")) {
return "SWT.CTRL | SWT.SHIFT | M";
- } else if(content.equals("CtrlShiftN")) {
+ } else if (content.equals("CtrlShiftN")) {
return "SWT.CTRL | SWT.SHIFT | N";
- } else if(content.equals("CtrlShiftO")) {
+ } else if (content.equals("CtrlShiftO")) {
return "SWT.CTRL | SWT.SHIFT | O";
- } else if(content.equals("CtrlShiftP")) {
+ } else if (content.equals("CtrlShiftP")) {
return "SWT.CTRL | SWT.SHIFT | P";
- } else if(content.equals("CtrlShiftQ")) {
+ } else if (content.equals("CtrlShiftQ")) {
return "SWT.CTRL | SWT.SHIFT | Q";
- } else if(content.equals("CtrlShiftR")) {
+ } else if (content.equals("CtrlShiftR")) {
return "SWT.CTRL | SWT.SHIFT | R";
- } else if(content.equals("CtrlShiftS")) {
+ } else if (content.equals("CtrlShiftS")) {
return "SWT.CTRL | SWT.SHIFT | S";
- } else if(content.equals("CtrlShiftT")) {
+ } else if (content.equals("CtrlShiftT")) {
return "SWT.CTRL | SWT.SHIFT | T";
- } else if(content.equals("CtrlShiftU")) {
+ } else if (content.equals("CtrlShiftU")) {
return "SWT.CTRL | SWT.SHIFT | U";
- } else if(content.equals("CtrlShiftV")) {
+ } else if (content.equals("CtrlShiftV")) {
return "SWT.CTRL | SWT.SHIFT | V";
- } else if(content.equals("CtrlShiftW")) {
+ } else if (content.equals("CtrlShiftW")) {
return "SWT.CTRL | SWT.SHIFT | W";
- } else if(content.equals("CtrlShiftX")) {
+ } else if (content.equals("CtrlShiftX")) {
return "SWT.CTRL | SWT.SHIFT | X";
- } else if(content.equals("CtrlShiftY")) {
+ } else if (content.equals("CtrlShiftY")) {
return "SWT.CTRL | SWT.SHIFT | Y";
- } else if(content.equals("CtrlShiftZ")) {
+ } else if (content.equals("CtrlShiftZ")) {
return "SWT.CTRL | SWT.SHIFT | Z";
- } else if(content.equals("CtrlShiftEnter")) {
+ } else if (content.equals("CtrlShiftEnter")) {
return "SWT.CTRL | SWT.SHIFT | Enter";
- } else if(content.equals("CtrlShiftSpace")) {
+ } else if (content.equals("CtrlShiftSpace")) {
return "SWT.CTRL | SWT.SHIFT | Space";
- } else if(content.equals("CtrlT")) {
+ } else if (content.equals("CtrlT")) {
return "SWT.CTRL | T";
- } else if(content.equals("CtrlU")) {
+ } else if (content.equals("CtrlU")) {
return "SWT.CTRL | U";
- } else if(content.equals("CtrlV")) {
+ } else if (content.equals("CtrlV")) {
return "SWT.CTRL | V";
- } else if(content.equals("CtrlW")) {
+ } else if (content.equals("CtrlW")) {
return "SWT.CTRL | W";
- } else if(content.equals("CtrlX")) {
+ } else if (content.equals("CtrlX")) {
return "SWT.CTRL | X";
- } else if(content.equals("CtrlY")) {
+ } else if (content.equals("CtrlY")) {
return "SWT.CTRL | Y";
- } else if(content.equals("CtrlZ")) {
+ } else if (content.equals("CtrlZ")) {
return "SWT.CTRL | Z";
- } else if(content.equals("ShiftDel")) {
+ } else if (content.equals("ShiftDel")) {
return "SWT.SHIFT | DEL";
- } else if(content.equals("ShiftF1")) {
+ } else if (content.equals("ShiftF1")) {
return "SWT.SHIFT | SWT.F1";
- } else if(content.equals("ShiftF10")) {
+ } else if (content.equals("ShiftF10")) {
return "SWT.SHIFT | SWT.F10";
- } else if(content.equals("ShiftF11")) {
+ } else if (content.equals("ShiftF11")) {
return "SWT.SHIFT | SWT.F11";
- } else if(content.equals("ShiftF12")) {
+ } else if (content.equals("ShiftF12")) {
return "SWT.SHIFT | SWT.F12";
- } else if(content.equals("ShiftF3")) {
+ } else if (content.equals("ShiftF3")) {
return "SWT.SHIFT | SWT.F2";
- } else if(content.equals("ShiftF3")) {
+ } else if (content.equals("ShiftF3")) {
return "SWT.SHIFT | SWT.F3";
- } else if(content.equals("ShiftF4")) {
+ } else if (content.equals("ShiftF4")) {
return "SWT.SHIFT | SWT.F4";
- } else if(content.equals("ShiftF5")) {
+ } else if (content.equals("ShiftF5")) {
return "SWT.SHIFT | SWT.F5";
- } else if(content.equals("ShiftF6")) {
+ } else if (content.equals("ShiftF6")) {
return "SWT.SHIFT | SWT.F6";
- } else if(content.equals("ShiftF7")) {
+ } else if (content.equals("ShiftF7")) {
return "SWT.SHIFT | SWT.F7";
- } else if(content.equals("ShiftF8")) {
+ } else if (content.equals("ShiftF8")) {
return "SWT.SHIFT | SWT.F8";
- } else if(content.equals("ShiftF9")) {
+ } else if (content.equals("ShiftF9")) {
return "SWT.SHIFT | SWT.F9";
- } else if(content.equals("ShiftIns")) {
+ } else if (content.equals("ShiftIns")) {
return "SWT.SHIFT | SWT.INSERT";
- } else if(content.equals("ShiftEnter")) {
+ } else if (content.equals("ShiftEnter")) {
return "SWT.SHIFT | Enter";
- } else if(content.equals("ShiftSpace")) {
+ } else if (content.equals("ShiftSpace")) {
return "SWT.SHIFT | Space";
- } else if(content.equals("Enter")) {
+ } else if (content.equals("Enter")) {
return "Enter";
- } else if(content.equals("Space")) {
+ } else if (content.equals("Space")) {
return "Space";
} else {
return content;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/animation/Drawing.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/animation/Drawing.java
index 5e2a8855aa6..78c73f45ebc 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/animation/Drawing.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/animation/Drawing.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
* Anyware-tech - add multiple loaders
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/Containment.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/Containment.java
index 425dcf1fd21..3dea6f09de8 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/Containment.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/Containment.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -17,7 +17,7 @@ import java.lang.annotation.Target;
/**
* To annotate which field should be containment
- *
+ *
* @author yyang
*/
@Retention(RetentionPolicy.RUNTIME)
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UI.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UI.java
index 3a18d50fd69..f3b65fc0279 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UI.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UI.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UIBounds.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UIBounds.java
index 570fa7aaa67..7af36740183 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UIBounds.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/annotation/UIBounds.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/IBeforeParsingCallback.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/IBeforeParsingCallback.java
index 4e62b823779..2737074f120 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/IBeforeParsingCallback.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/IBeforeParsingCallback.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ICreatedCallback.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ICreatedCallback.java
index f427d323152..04801ee43fb 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ICreatedCallback.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ICreatedCallback.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ILoadedCallback.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ILoadedCallback.java
index 87fe146038e..a99a3b80e11 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ILoadedCallback.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/callback/ILoadedCallback.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionView.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionView.java
index e73406f83a0..8e5a36c2ef6 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionView.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionView.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.papyrus.xwt.core.ICollectionView;
/**
* Represents a view for grouping, sorting, filtering, and navigating a data
* collection.`
- *
+ *
* @author yyang
*/
public class CollectionView<T> implements ICollectionView<T> {
@@ -107,7 +107,7 @@ public class CollectionView<T> implements ICollectionView<T> {
}
public boolean isEmpty() {
- if(canGroup()) {
+ if (canGroup()) {
return groups.isEmpty();
}
return sourceCollection.isEmpty();
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionViewSource.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionViewSource.java
index 077c5e350b5..4afce9904d0 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionViewSource.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/CollectionViewSource.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -23,7 +23,7 @@ import org.eclipse.papyrus.xwt.XWT;
/**
* The proxy of a CollectionView class.
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class CollectionViewSource {
@@ -35,7 +35,7 @@ public class CollectionViewSource {
/**
* Gets the view object that is currently associated with this instance of CollectionViewSource. This is a dependency property.
- *
+ *
*/
private IObservableCollection view;
@@ -51,14 +51,14 @@ public class CollectionViewSource {
private Class<?> collectionViewType = Object.class;
public Object getSource() {
- if(source == null) {
+ if (source == null) {
source = new ArrayList<Object>();
}
return source;
}
public void setSource(Object source) {
- if(this.source == source) {
+ if (this.source == source) {
return;
}
view = null;
@@ -66,19 +66,19 @@ public class CollectionViewSource {
}
public IObservableCollection getView() {
- if(view == null) {
+ if (view == null) {
Object source = getSource();
- if(!(source instanceof IObservableCollection)) {
+ if (!(source instanceof IObservableCollection)) {
Class<?> elementType = getCollectionViewType();
- if(source.getClass().isArray()) {
- Object[] array = (Object[])source;
+ if (source.getClass().isArray()) {
+ Object[] array = (Object[]) source;
elementType = source.getClass().getComponentType();
source = Arrays.asList(array);
}
- if(source instanceof List<?>) {
- view = new WritableList(XWT.getRealm(), (List<?>)source, elementType);
- } else if(source instanceof Set<?>) {
- view = new WritableSet(XWT.getRealm(), (List<?>)source, elementType);
+ if (source instanceof List<?>) {
+ view = new WritableList(XWT.getRealm(), (List<?>) source, elementType);
+ } else if (source instanceof Set<?>) {
+ view = new WritableSet(XWT.getRealm(), (List<?>) source, elementType);
}
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/GroupDescription.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/GroupDescription.java
index 3975bc4bb57..8e221e7890c 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/GroupDescription.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/GroupDescription.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,7 +12,7 @@ package org.eclipse.papyrus.xwt.collection;
/**
* Provides an abstract base class for types that describe how to divide the items in a collection into groups.
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class GroupDescription {
@@ -25,7 +25,7 @@ public class GroupDescription {
protected String[] groupNames;
/**
- *
+ *
* @return
*/
public String[] getGroupNames() {
@@ -33,7 +33,7 @@ public class GroupDescription {
}
/**
- *
+ *
* @param groupNames
*/
public void setGroupNames(String[] groupNames) {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/ListSortDirection.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/ListSortDirection.java
index 867f60b2a18..88fb6daebfe 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/ListSortDirection.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/ListSortDirection.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,7 +12,7 @@ package org.eclipse.papyrus.xwt.collection;
/**
* Specifies the direction of a sort operation.
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public enum ListSortDirection {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/SortDescription.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/SortDescription.java
index 9eb9331ef16..b7e1d4fb2a5 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/SortDescription.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/collection/SortDescription.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,7 +12,7 @@ package org.eclipse.papyrus.xwt.collection;
/**
* Defines the direction and the property name to be used as the criteria for sorting a collection.
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class SortDescription {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/AbstractMultiValueConverter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/AbstractMultiValueConverter.java
index 09a07ae6a01..b1d0084eb4c 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/AbstractMultiValueConverter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/AbstractMultiValueConverter.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,15 +14,15 @@ import org.eclipse.papyrus.xwt.IMultiValueConverter;
/**
* Default implementation class of IMultiValueConverter
- *
+ *
* @author yyang <yesc.yang@soyatec.com>
*/
public abstract class AbstractMultiValueConverter implements IMultiValueConverter {
public Object convert(Object fromObject) {
- if(!fromObject.getClass().isArray()) {
- fromObject = new Object[]{ fromObject };
+ if (!fromObject.getClass().isArray()) {
+ fromObject = new Object[] { fromObject };
}
- return convert((Object[])fromObject);
+ return convert((Object[]) fromObject);
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/BindingToObject.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/BindingToObject.java
index a022425c8be..962db11fd2d 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/BindingToObject.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/BindingToObject.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.papyrus.xwt.core.IBinding;
/**
* Binding to Object covnerter
- *
+ *
* @author yyang
*/
public class BindingToObject implements IConverter {
@@ -23,7 +23,7 @@ public class BindingToObject implements IConverter {
public static BindingToObject instance = new BindingToObject();
public Object convert(Object fromObject) {
- IBinding binding = (IBinding)fromObject;
+ IBinding binding = (IBinding) fromObject;
return binding.getValue(null);
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToBoolean.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToBoolean.java
index ac8df855a7a..e2fb32ef76a 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToBoolean.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToBoolean.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ import org.eclipse.core.databinding.conversion.IConverter;
/**
* String to Boolean converter
- *
+ *
* @author yyang
*/
public class CollectionToBoolean implements IConverter {
@@ -24,7 +24,7 @@ public class CollectionToBoolean implements IConverter {
public static CollectionToBoolean instance = new CollectionToBoolean();
public Object convert(Object fromObject) {
- Collection<?> collection = (Collection<?>)fromObject;
+ Collection<?> collection = (Collection<?>) fromObject;
return !collection.isEmpty();
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToInteger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToInteger.java
index cc9ce10b764..e9ce9f9a468 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToInteger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/CollectionToInteger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ import org.eclipse.core.databinding.conversion.IConverter;
/**
* String to Boolean converter
- *
+ *
* @author yyang
*/
public class CollectionToInteger implements IConverter {
@@ -24,7 +24,7 @@ public class CollectionToInteger implements IConverter {
public static CollectionToInteger instance = new CollectionToInteger();
public Object convert(Object fromObject) {
- Collection<?> collection = (Collection<?>)fromObject;
+ Collection<?> collection = (Collection<?>) fromObject;
return collection.size();
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/DateToString.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/DateToString.java
index cdaa1d986b3..34c4e1c5ea7 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/DateToString.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/DateToString.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import java.util.Date;
/**
* Date to String converter
- *
+ *
* @author yyang
*/
public class DateToString extends ObjectToString {
@@ -32,13 +32,15 @@ public class DateToString extends ObjectToString {
super(fromType);
}
+ @Override
public Object convert(Object fromObject) {
- if(fromObject == null) {
+ if (fromObject == null) {
return super.convert(null);
}
- return FORMATTER.format((Date)fromObject);
+ return FORMATTER.format((Date) fromObject);
}
+ @Override
public Object getToType() {
return String.class;
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/EnumToString.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/EnumToString.java
index f80d3209b2d..d1158189e77 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/EnumToString.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/EnumToString.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -23,7 +23,7 @@ public class EnumToString implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object)
*/
public Object convert(Object fromObject) {
- return ((Enum<?>)fromObject).toString();
+ return ((Enum<?>) fromObject).toString();
}
/*
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToBoolean.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToBoolean.java
index 28091df5276..aa8cf526e0a 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToBoolean.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToBoolean.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.core.runtime.IStatus;
/**
* Binding to Object covnerter
- *
+ *
* @author yyang
*/
public class IStatusToBoolean implements IConverter {
@@ -30,7 +30,7 @@ public class IStatusToBoolean implements IConverter {
* Object)
*/
public Object convert(Object fromObject) {
- IStatus status = (IStatus)fromObject;
+ IStatus status = (IStatus) fromObject;
return status.isOK();
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToString.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToString.java
index 27086fc73ce..7c74644bb1d 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToString.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/IStatusToString.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.core.runtime.IStatus;
/**
* Binding to Object covnerter
- *
+ *
* @author yyang
*/
public class IStatusToString implements IConverter {
@@ -30,8 +30,8 @@ public class IStatusToString implements IConverter {
* Object)
*/
public Object convert(Object fromObject) {
- IStatus status = (IStatus)fromObject;
- if(status.isOK()) {
+ IStatus status = (IStatus) fromObject;
+ if (status.isOK()) {
return "";
}
return status.getMessage();
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToIObservableCollection.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToIObservableCollection.java
index df911898720..57589794aac 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToIObservableCollection.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToIObservableCollection.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.papyrus.xwt.XWT;
/**
* List to IObservableCollection converter
- *
+ *
* @author yyang
*/
public class ListToIObservableCollection implements IConverter {
@@ -27,8 +27,8 @@ public class ListToIObservableCollection implements IConverter {
public static ListToIObservableCollection instance = new ListToIObservableCollection();
public Object convert(Object fromObject) {
- List<?> list = (List<?>)fromObject;
- return new WritableList(XWT.getRealm(), (List<?>)list, Object.class);
+ List<?> list = (List<?>) fromObject;
+ return new WritableList(XWT.getRealm(), list, Object.class);
}
public Object getFromType() {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToSet.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToSet.java
index e9d673ba305..0a0ca091d64 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToSet.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ListToSet.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -18,7 +18,7 @@ import org.eclipse.core.databinding.conversion.IConverter;
/**
* String to Boolean converter
- *
+ *
* @author yyang
*/
public class ListToSet implements IConverter {
@@ -26,7 +26,7 @@ public class ListToSet implements IConverter {
public static ListToSet instance = new ListToSet();
public Object convert(Object fromObject) {
- List<?> list = (List<?>)fromObject;
+ List<?> list = (List<?>) fromObject;
return new HashSet<Object>(list);
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToBoolean.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToBoolean.java
index 4c1e01e5743..3fbc87d2aa9 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToBoolean.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToBoolean.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,7 +14,7 @@ import org.eclipse.core.databinding.conversion.IConverter;
/**
* String to Boolean converter
- *
+ *
* @author yyang
*/
public class ObjectToBoolean implements IConverter {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToISelection.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToISelection.java
index 59cd56de292..4f0c171054f 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToISelection.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToISelection.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -20,7 +20,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
/**
* Safely SWT context values, it used to avoid a NullPointerException when set
* text values to SWT Widgets.
- *
+ *
* @author jliu
*/
public class ObjectToISelection implements IConverter {
@@ -35,13 +35,13 @@ public class ObjectToISelection implements IConverter {
* Object)
*/
public Object convert(Object fromObject) {
- if(fromObject == null) {
+ if (fromObject == null) {
return new StructuredSelection();
}
- if(fromObject instanceof Collection<?>) {
- return new StructuredSelection(((Collection<?>)fromObject).toArray());
- } else if(fromObject.getClass().isArray()) {
- return new StructuredSelection((Object[])fromObject);
+ if (fromObject instanceof Collection<?>) {
+ return new StructuredSelection(((Collection<?>) fromObject).toArray());
+ } else if (fromObject.getClass().isArray()) {
+ return new StructuredSelection((Object[]) fromObject);
}
return new StructuredSelection(fromObject);
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToObject.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToObject.java
index 02943c56f5f..433a4f4d49f 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToObject.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToObject.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,7 +14,7 @@ import org.eclipse.core.databinding.conversion.IConverter;
/**
* Object to Object converter: null converter
- *
+ *
* @author yyang
*/
public class ObjectToObject implements IConverter {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToString.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToString.java
index 36dbb505f83..e1d3aed2c3a 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToString.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ObjectToString.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.core.databinding.conversion.IConverter;
/**
* Safely SWT context values, it used to avoid a NullPointerException when set text values to SWT Widgets.
- *
+ *
* @author jliu
*/
public class ObjectToString implements IConverter {
@@ -40,7 +40,7 @@ public class ObjectToString implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object)
*/
public Object convert(Object fromObject) {
- if(fromObject == null) {
+ if (fromObject == null) {
return "";
}
return fromObject.toString();
@@ -52,7 +52,7 @@ public class ObjectToString implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#getFromType()
*/
public Object getFromType() {
- if(fromType == null) {
+ if (fromType == null) {
return Object.class;
}
return fromType;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SelectionToBoolean.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SelectionToBoolean.java
index ca3405628d6..032d6ba7f83 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SelectionToBoolean.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SelectionToBoolean.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.jface.viewers.ISelection;
/**
* String to Boolean converter
- *
+ *
* @author yyang
*/
public class SelectionToBoolean implements IConverter {
@@ -23,7 +23,7 @@ public class SelectionToBoolean implements IConverter {
public static SelectionToBoolean instance = new SelectionToBoolean();
public Object convert(Object fromObject) {
- ISelection selection = (ISelection)fromObject;
+ ISelection selection = (ISelection) fromObject;
return !selection.isEmpty();
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SetToIObservableCollection.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SetToIObservableCollection.java
index aa694a9ff8b..3acd35c456e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SetToIObservableCollection.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/SetToIObservableCollection.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.papyrus.xwt.XWT;
/**
* Set to IObservableCollection converter
- *
+ *
* @author yyang
*/
public class SetToIObservableCollection implements IConverter {
@@ -27,8 +27,8 @@ public class SetToIObservableCollection implements IConverter {
public static SetToIObservableCollection instance = new SetToIObservableCollection();
public Object convert(Object fromObject) {
- Set<?> set = (Set<?>)fromObject;
- return new WritableSet(XWT.getRealm(), (Set<?>)set, Object.class);
+ Set<?> set = (Set<?>) fromObject;
+ return new WritableSet(XWT.getRealm(), set, Object.class);
}
public Object getFromType() {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringMultiValueConerter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringMultiValueConerter.java
index 08f558227fd..8d501e6b145 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringMultiValueConerter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringMultiValueConerter.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,24 +12,24 @@ package org.eclipse.papyrus.xwt.converters;
/**
* Default implementation of MultiValueConverter from a string
- *
+ *
* @author yyang <yesc.yang@soyatec.com>
- *
+ *
*/
public class StringMultiValueConerter extends AbstractMultiValueConverter {
private String separatorExpression = null;
public Object[] convertBack(Object value) {
- if(value instanceof Object[]) {
- return (Object[])value;
+ if (value instanceof Object[]) {
+ return (Object[]) value;
}
String valueString = value.toString();
return valueString.split(getSeparatorExpression());
}
public String getSeparatorExpression() {
- if(separatorExpression == null) {
+ if (separatorExpression == null) {
return "[ \t\r\n]+";
}
return separatorExpression;
@@ -40,7 +40,7 @@ public class StringMultiValueConerter extends AbstractMultiValueConverter {
}
protected String getSeparator() {
- if(separatorExpression == null || separatorExpression.length() == 0) {
+ if (separatorExpression == null || separatorExpression.length() == 0) {
return " ";
}
return "" + separatorExpression.charAt(0);
@@ -49,8 +49,8 @@ public class StringMultiValueConerter extends AbstractMultiValueConverter {
public Object convert(Object[] value) {
StringBuffer buffer = new StringBuffer();
String separator = getSeparator();
- for(int i = 0; i < value.length; i++) {
- if(i != 0) {
+ for (int i = 0; i < value.length; i++) {
+ if (i != 0) {
buffer.append(separator);
}
buffer.append(value[i]);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToBoolean.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToBoolean.java
index 3916aede3b1..ce26bdbfee0 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToBoolean.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToBoolean.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.papyrus.xwt.XWTException;
/**
* String to Boolean converter
- *
+ *
* @author yyang
*/
public class StringToBoolean implements IConverter {
@@ -23,12 +23,12 @@ public class StringToBoolean implements IConverter {
public static StringToBoolean instance = new StringToBoolean();
public Object convert(Object fromObject) {
- String str = (String)fromObject;
- if(str == null || "".equalsIgnoreCase(str)) {
+ String str = (String) fromObject;
+ if (str == null || "".equalsIgnoreCase(str)) {
return false;
- } else if("true".equalsIgnoreCase(str)) {
+ } else if ("true".equalsIgnoreCase(str)) {
return true;
- } else if("false".equalsIgnoreCase(str)) {
+ } else if ("false".equalsIgnoreCase(str)) {
return false;
}
throw new XWTException(str + " is not a boolean");
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToColor.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToColor.java
index a057fa83bd3..08ce9d69019 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToColor.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToColor.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ import org.eclipse.swt.graphics.Color;
/**
* String to Color converter
- *
+ *
* @author jliu
*/
public class StringToColor implements IConverter {
@@ -29,7 +29,7 @@ public class StringToColor implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object)
*/
public Object convert(Object fromObject) {
- return ResourceManager.resources.getColor((String)fromObject);
+ return ResourceManager.resources.getColor((String) fromObject);
}
/*
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToDoubleArray.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToDoubleArray.java
index e46de8a76fe..a5c7d3cc6cc 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToDoubleArray.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToDoubleArray.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.papyrus.xwt.XWTException;
/**
* String to double[] converter
- *
+ *
* @author jliu
*/
public class StringToDoubleArray implements IConverter {
@@ -32,10 +32,10 @@ public class StringToDoubleArray implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang. Object)
*/
public Object convert(Object fromObject) {
- String source = (String)fromObject;
+ String source = (String) fromObject;
List<Double> result = new ArrayList<Double>();
StringTokenizer stk = new StringTokenizer(source, ", \t\n\r\f");
- while(stk.hasMoreTokens()) {
+ while (stk.hasMoreTokens()) {
String nextToken = stk.nextToken();
try {
result.add(Double.parseDouble(nextToken.trim()));
@@ -44,7 +44,7 @@ public class StringToDoubleArray implements IConverter {
}
}
double[] intArray = new double[result.size()];
- for(int i = 0; i < result.size(); i++) {
+ for (int i = 0; i < result.size(); i++) {
intArray[i] = result.get(i);
}
return intArray;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToEnum.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToEnum.java
index 48bb8b03ffa..7dee4ba9791 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToEnum.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToEnum.java
@@ -3,9 +3,9 @@
* All rights reserved. This program and the accompanying materials *
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
- * http://www.eclipse.org/legal/epl-v10.html *
- * Contributors: *
- * Soyatec - initial API and implementation *
+ * http://www.eclipse.org/legal/epl-v10.html *
+ * Contributors: *
+ * Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.converters;
@@ -28,15 +28,15 @@ public class StringToEnum implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object)
*/
public Object convert(Object fromObject) {
- if(fromObject == null || "".equals(fromObject)) {
- Class<?> type = (Class<?>)getToType();
+ if (fromObject == null || "".equals(fromObject)) {
+ Class<?> type = (Class<?>) getToType();
Object[] values = type.getEnumConstants();
- if(values != null && values.length > 0) {
+ if (values != null && values.length > 0) {
return values[0];
}
}
- return Enum.valueOf((Class)getToType(), (String)fromObject);
+ return Enum.valueOf((Class) getToType(), (String) fromObject);
}
/*
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFont.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFont.java
index a6701ae7df8..e7568b11496 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFont.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFont.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ import org.eclipse.swt.graphics.Font;
/**
* String to Font converter
- *
+ *
* @author yyang
*/
public class StringToFont implements IConverter {
@@ -24,7 +24,7 @@ public class StringToFont implements IConverter {
public static StringToFont instance = new StringToFont();
public Object convert(Object fromObject) {
- return ResourceManager.resources.getFont((String)fromObject);
+ return ResourceManager.resources.getFont((String) fromObject);
}
public Object getFromType() {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFormAttachment.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFormAttachment.java
index 4db2206f283..34ebda722b0 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFormAttachment.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToFormAttachment.java
@@ -3,9 +3,9 @@
* All rights reserved. This program and the accompanying materials *
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
- * http://www.eclipse.org/legal/epl-v10.html *
- * Contributors: *
- * Soyatec - initial API and implementation *
+ * http://www.eclipse.org/legal/epl-v10.html *
+ * Contributors: *
+ * Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.converters;
@@ -23,7 +23,7 @@ import org.eclipse.swt.layout.FormAttachment;
* <li><FormData top="0,100,20"></li> would be parsed to FormAttachment(0, 100, 20).
* <nl>
* This converter can not parse some arguments which have Control type.
- *
+ *
* @author jliu (jin.liu@soyatec.com)
*/
public class StringToFormAttachment implements IConverter {
@@ -36,14 +36,14 @@ public class StringToFormAttachment implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object)
*/
public Object convert(Object fromObject) {
- if(fromObject == null) {
+ if (fromObject == null) {
return null;
}
String strValue = fromObject.toString();
int numerator = 0, denominator = 100, offset = 0;
List<Integer> intValues = new ArrayList<Integer>();
String[] split = strValue.split(",");
- for(int i = 0; i < split.length; i++) {
+ for (int i = 0; i < split.length; i++) {
String trim = split[i].trim();
try {
int value = Integer.parseInt(trim);
@@ -55,9 +55,9 @@ public class StringToFormAttachment implements IConverter {
int size = intValues.size();
try {
numerator = intValues.get(0);
- if(size == 2) {
+ if (size == 2) {
offset = intValues.get(1);
- } else if(size == 3) {
+ } else if (size == 3) {
denominator = intValues.get(1);
offset = intValues.get(2);
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValidationRule.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValidationRule.java
index a22563550d4..ccb57b1710d 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValidationRule.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValidationRule.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.converters;
@@ -30,7 +30,7 @@ public class StringToIValidationRule implements IConverter {
public Object convert(Object fromObject) {
try {
Class<?> type = XWT.getLoadingContext().loadClass(fromObject.toString());
- if(type == null) {
+ if (type == null) {
throw new XWTException("Class " + fromObject.toString() + " is not found.");
}
return type.newInstance();
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValueConverter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValueConverter.java
index 9ba8d90480f..8a62f02b1e7 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValueConverter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIValueConverter.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.converters;
@@ -30,7 +30,7 @@ public class StringToIValueConverter implements IConverter {
public Object convert(Object fromObject) {
try {
Class<?> type = XWT.getLoadingContext().loadClass(fromObject.toString());
- if(type == null) {
+ if (type == null) {
throw new XWTException("Class " + fromObject.toString() + " is not found.");
}
return type.newInstance();
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToImage.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToImage.java
index f9a9466127d..8cfbba5a940 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToImage.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToImage.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ import org.eclipse.swt.graphics.Image;
/**
* String to Image converter
- *
+ *
* @author jliu
*/
public class StringToImage implements IConverter {
@@ -29,7 +29,7 @@ public class StringToImage implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object)
*/
public Object convert(Object fromObject) {
- return ResourceManager.resources.getImage((String)fromObject);
+ return ResourceManager.resources.getImage((String) fromObject);
}
/*
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIntArray.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIntArray.java
index a64e0ae440d..d4be559d14e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIntArray.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToIntArray.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.papyrus.xwt.XWTException;
/**
* String to int[] converter
- *
+ *
* @author jliu
*/
public class StringToIntArray implements IConverter {
@@ -32,10 +32,10 @@ public class StringToIntArray implements IConverter {
* @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang. Object)
*/
public Object convert(Object fromObject) {
- String source = (String)fromObject;
+ String source = (String) fromObject;
List<Integer> result = new ArrayList<Integer>();
StringTokenizer stk = new StringTokenizer(source, ",");
- while(stk.hasMoreTokens()) {
+ while (stk.hasMoreTokens()) {
String nextToken = stk.nextToken();
try {
result.add(Integer.parseInt(nextToken.trim()));
@@ -44,7 +44,7 @@ public class StringToIntArray implements IConverter {
}
}
int[] intArray = new int[result.size()];
- for(int i = 0; i < result.size(); i++) {
+ for (int i = 0; i < result.size(); i++) {
intArray[i] = result.get(i);
}
return intArray;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToInteger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToInteger.java
index 02be7ae714e..351380727b9 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToInteger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToInteger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -27,7 +27,7 @@ import org.eclipse.swt.layout.GridData;
/**
* String to Integer converter
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class StringToInteger implements IConverter {
@@ -41,15 +41,15 @@ public class StringToInteger implements IConverter {
protected StringToNumberConverter toNumberConverter = StringToNumberConverter.toInteger(false);
public Object convert(Object fromObject) {
- String str = (String)fromObject;
- if(str.indexOf(STYLES_SEP) != -1) {
+ String str = (String) fromObject;
+ if (str.indexOf(STYLES_SEP) != -1) {
List<String> values = new ArrayList<String>();
StringTokenizer stk = new StringTokenizer(str, STYLES_SEP);
- while(stk.hasMoreTokens()) {
+ while (stk.hasMoreTokens()) {
values.add(stk.nextToken());
}
int result = 0;
- for(String value : values) {
+ for (String value : values) {
result |= convertInt(value.trim());
}
return result;
@@ -58,39 +58,39 @@ public class StringToInteger implements IConverter {
}
protected int convertInt(String str) {
- if(str == null || str.equals("")) {
+ if (str == null || str.equals("")) {
return 0;
}
try {
- // Quick solution for numbers.
- return (Integer)toNumberConverter.convert(str);
+ // Quick solution for numbers.
+ return (Integer) toNumberConverter.convert(str);
} catch (Exception e) {
String normalizedStr = str.toUpperCase().trim();
- if(normalizedStr.startsWith(GRIDDATA_PREFIX)) {
+ if (normalizedStr.startsWith(GRIDDATA_PREFIX)) {
return convertGridDataInt(normalizedStr);
}
try {
int index = str.lastIndexOf('.');
- if(str.indexOf('.') != -1) {
+ if (str.indexOf('.') != -1) {
String className = str.substring(0, index);
- if(className.startsWith("(") && className.endsWith("")) {
+ if (className.startsWith("(") && className.endsWith("")) {
className = className.substring(1, className.length() - 1);
Class<?> type = XWT.getLoadingContext().loadClass(className);
- if(type != null) {
+ if (type != null) {
String memberName = str.substring(index + 1);
Field field = type.getField(memberName);
- if(Modifier.isStatic(field.getModifiers())) {
+ if (Modifier.isStatic(field.getModifiers())) {
return field.getInt(null);
}
}
} else {
IMetaclass metaclass = XWT.getMetaclass(className, IConstants.XWT_NAMESPACE);
- if(metaclass != null) {
+ if (metaclass != null) {
Class<?> type = metaclass.getType();
- if(type != null) {
+ if (type != null) {
String memberName = str.substring(index + 1);
Field field = type.getField(memberName);
- if(Modifier.isStatic(field.getModifiers())) {
+ if (Modifier.isStatic(field.getModifiers())) {
return field.getInt(null);
}
}
@@ -108,37 +108,37 @@ public class StringToInteger implements IConverter {
}
protected int convertGridDataInt(String str) {
- if("GridData.BEGINNING".equalsIgnoreCase(str)) {
+ if ("GridData.BEGINNING".equalsIgnoreCase(str)) {
return GridData.BEGINNING;
- } else if("GridData.CENTER".equalsIgnoreCase(str)) {
+ } else if ("GridData.CENTER".equalsIgnoreCase(str)) {
return GridData.CENTER;
- } else if("GridData.END".equalsIgnoreCase(str)) {
+ } else if ("GridData.END".equalsIgnoreCase(str)) {
return GridData.END;
- } else if("GridData.FILL".equalsIgnoreCase(str)) {
+ } else if ("GridData.FILL".equalsIgnoreCase(str)) {
return GridData.FILL;
- } else if("GridData.FILL_BOTH".equalsIgnoreCase(str)) {
+ } else if ("GridData.FILL_BOTH".equalsIgnoreCase(str)) {
return GridData.FILL_BOTH;
- } else if("GridData.FILL_HORIZONTAL".equalsIgnoreCase(str)) {
+ } else if ("GridData.FILL_HORIZONTAL".equalsIgnoreCase(str)) {
return GridData.FILL_HORIZONTAL;
- } else if("GridData.GRAB_HORIZONTAL".equalsIgnoreCase(str)) {
+ } else if ("GridData.GRAB_HORIZONTAL".equalsIgnoreCase(str)) {
return GridData.GRAB_HORIZONTAL;
- } else if("GridData.GRAB_VERTICAL".equalsIgnoreCase(str)) {
+ } else if ("GridData.GRAB_VERTICAL".equalsIgnoreCase(str)) {
return GridData.GRAB_VERTICAL;
- } else if("GridData.HORIZONTAL_ALIGN_BEGINNING".equalsIgnoreCase(str)) {
+ } else if ("GridData.HORIZONTAL_ALIGN_BEGINNING".equalsIgnoreCase(str)) {
return GridData.HORIZONTAL_ALIGN_BEGINNING;
- } else if("GridData.HORIZONTAL_ALIGN_CENTER".equalsIgnoreCase(str)) {
+ } else if ("GridData.HORIZONTAL_ALIGN_CENTER".equalsIgnoreCase(str)) {
return GridData.HORIZONTAL_ALIGN_CENTER;
- } else if("GridData.HORIZONTAL_ALIGN_END".equalsIgnoreCase(str)) {
+ } else if ("GridData.HORIZONTAL_ALIGN_END".equalsIgnoreCase(str)) {
return GridData.HORIZONTAL_ALIGN_END;
- } else if("GridData.HORIZONTAL_ALIGN_FILL".equalsIgnoreCase(str)) {
+ } else if ("GridData.HORIZONTAL_ALIGN_FILL".equalsIgnoreCase(str)) {
return GridData.HORIZONTAL_ALIGN_FILL;
- } else if("GridData.VERTICAL_ALIGN_BEGINNING".equalsIgnoreCase(str)) {
+ } else if ("GridData.VERTICAL_ALIGN_BEGINNING".equalsIgnoreCase(str)) {
return GridData.VERTICAL_ALIGN_BEGINNING;
- } else if("GridData.VERTICAL_ALIGN_CENTER".equalsIgnoreCase(str)) {
+ } else if ("GridData.VERTICAL_ALIGN_CENTER".equalsIgnoreCase(str)) {
return GridData.VERTICAL_ALIGN_CENTER;
- } else if("GridData.VERTICAL_ALIGN_END".equalsIgnoreCase(str)) {
+ } else if ("GridData.VERTICAL_ALIGN_END".equalsIgnoreCase(str)) {
return GridData.VERTICAL_ALIGN_END;
- } else if("GridData.VERTICAL_ALIGN_FILL".equalsIgnoreCase(str)) {
+ } else if ("GridData.VERTICAL_ALIGN_FILL".equalsIgnoreCase(str)) {
return GridData.VERTICAL_ALIGN_FILL;
}
return 0;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToPoint.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToPoint.java
index acdb36963ec..ab0b69175af 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToPoint.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToPoint.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.swt.graphics.Point;
/**
* String to Point converter
- *
+ *
* @author yyang
*/
public class StringToPoint implements IConverter {
@@ -25,10 +25,10 @@ public class StringToPoint implements IConverter {
public Object convert(Object fromObject) {
int x = 0;
int y = 0;
- if(fromObject != null) {
+ if (fromObject != null) {
StringToIntArray convArray = new StringToIntArray();
- int[] array = (int[])convArray.convert(fromObject);
- if(array.length == 2) {
+ int[] array = (int[]) convArray.convert(fromObject);
+ if (array.length == 2) {
x = array[0];
y = array[1];
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToRectangle.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToRectangle.java
index dfb68007de0..c6df69190a8 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToRectangle.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToRectangle.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.swt.graphics.Rectangle;
/**
* String to Rectangle converter
- *
+ *
* @author yyang
*/
public class StringToRectangle implements IConverter {
@@ -27,10 +27,10 @@ public class StringToRectangle implements IConverter {
int y = 0;
int width = 0;
int height = 0;
- if(fromObject != null) {
+ if (fromObject != null) {
StringToIntArray arrayConvertor = new StringToIntArray();
- int[] array = (int[])arrayConvertor.convert(fromObject);
- if(array.length == 4) {
+ int[] array = (int[]) arrayConvertor.convert(fromObject);
+ if (array.length == 4) {
x = array[0];
y = array[1];
width = array[2];
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToType.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToType.java
index fd84ec08468..b27a322cf42 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToType.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToType.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -17,7 +17,7 @@ import org.eclipse.papyrus.xwt.metadata.IMetaclass;
/**
* String to Type converter
- *
+ *
* @author yyang
*/
public class StringToType implements IConverter {
@@ -25,16 +25,16 @@ public class StringToType implements IConverter {
public static StringToType instance = new StringToType();
public Object convert(Object fromObject) {
- String str = (String)fromObject;
+ String str = (String) fromObject;
String typeName = str;
String namespace = IConstants.XWT_NAMESPACE;
int index = str.lastIndexOf(':');
- if(index != -1) {
+ if (index != -1) {
typeName = str.substring(index + 1);
namespace = str.substring(0, index);
}
IMetaclass metaclass = XWT.getMetaclass(typeName, namespace);
- if(metaclass != null) {
+ if (metaclass != null) {
return metaclass.getType();
}
return null;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToURL.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToURL.java
index 8435f87d64b..514fda4ae18 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToURL.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/StringToURL.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.converters;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ValueConverterAdapter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ValueConverterAdapter.java
index 9a17df4712d..a55449c1476 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ValueConverterAdapter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/converters/ValueConverterAdapter.java
@@ -16,9 +16,9 @@ import org.eclipse.papyrus.xwt.XWT;
/**
* The operation to inverse the converter direction.
- *
+ *
* @author yyang
- *
+ *
*/
public class ValueConverterAdapter implements IValueConverter {
@@ -49,11 +49,11 @@ public class ValueConverterAdapter implements IValueConverter {
public static ValueConverterAdapter create(Class<?> sourceType, Class<?> targetType) {
IConverter fromConvertor = XWT.findConvertor(sourceType, targetType);
- if(fromConvertor == null) {
+ if (fromConvertor == null) {
return null;
}
IConverter toConvertor = XWT.findConvertor(targetType, sourceType);
- if(toConvertor == null) {
+ if (toConvertor == null) {
return null;
}
return new ValueConverterAdapter(fromConvertor, toConvertor);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/AbstractEventGroup.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/AbstractEventGroup.java
index 643fececb19..19d58a4b3e8 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/AbstractEventGroup.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/AbstractEventGroup.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -13,7 +13,7 @@ package org.eclipse.papyrus.xwt.core;
import org.eclipse.papyrus.xwt.IEventGroup;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public abstract class AbstractEventGroup implements IEventGroup {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Condition.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Condition.java
index fd5d4b8897a..43f1dee3cd0 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Condition.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Condition.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -18,7 +18,7 @@ import org.eclipse.papyrus.xwt.metadata.IMetaclass;
import org.eclipse.papyrus.xwt.metadata.IProperty;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class Condition {
@@ -89,17 +89,17 @@ public class Condition {
String sourceName = getSourceName();
IBinding binding = getBinding();
Object value = getValue();
- if(value == null) {
+ if (value == null) {
return false;
}
- while(value instanceof IObservableValue) {
- value = ((IObservableValue)value).getValue();
+ while (value instanceof IObservableValue) {
+ value = ((IObservableValue) value).getValue();
}
Object dataObject = TriggerBase.getElementByName(element, sourceName);
- if(propertyName != null) {
- if(cacheData != null) {
+ if (propertyName != null) {
+ if (cacheData != null) {
try {
Object existingValue = cacheData.property.getValue(dataObject);
return Operator.compare(existingValue, operator, cacheData.value);
@@ -111,12 +111,12 @@ public class Condition {
IMetaclass metaclass = XWT.getMetaclass(dataObject);
IProperty prop = metaclass.findProperty(propertyName);
- if(prop != null && value != null) {
+ if (prop != null && value != null) {
cacheData.property = prop;
Class<?> valueType = value.getClass();
IConverter converter = XWT.findConvertor(valueType, prop.getType());
Object trueValue = value;
- if(converter != null) {
+ if (converter != null) {
trueValue = converter.convert(trueValue);
}
cacheData.value = trueValue;
@@ -127,31 +127,31 @@ public class Condition {
LoggerManager.log(e);
}
}
- } else if(binding != null) {
+ } else if (binding != null) {
Object existingValue = binding.getValue(null);
- if(existingValue == null) {
+ if (existingValue == null) {
return false;
}
- while(existingValue instanceof IObservableValue) {
- existingValue = ((IObservableValue)existingValue).getValue();
+ while (existingValue instanceof IObservableValue) {
+ existingValue = ((IObservableValue) existingValue).getValue();
}
Class<?> existingValueType = existingValue.getClass();
Class<?> valueType = value.getClass();
Object normalizedValue = value;
- if(!existingValueType.isAssignableFrom(valueType) && !valueType.isAssignableFrom(existingValueType)) {
+ if (!existingValueType.isAssignableFrom(valueType) && !valueType.isAssignableFrom(existingValueType)) {
IConverter converter = XWT.findConvertor(valueType, existingValueType);
- if(converter != null) {
+ if (converter != null) {
normalizedValue = converter.convert(normalizedValue);
- } else if(value.toString().trim().length() > 0) {
+ } else if (value.toString().trim().length() > 0) {
boolean found = false;
// in case where the value is a boolean
converter = XWT.findConvertor(valueType, Boolean.class);
- if(converter != null) {
+ if (converter != null) {
try {
Object booleanValue = converter.convert(value);
- if(booleanValue != null) {
+ if (booleanValue != null) {
converter = XWT.findConvertor(existingValueType, Boolean.class);
- if(converter != null) {
+ if (converter != null) {
existingValue = converter.convert(existingValue);
normalizedValue = booleanValue;
found = true;
@@ -160,14 +160,14 @@ public class Condition {
} catch (RuntimeException e) {
}
}
- if(!found) {
+ if (!found) {
converter = XWT.findConvertor(valueType, int.class);
- if(converter != null) {
+ if (converter != null) {
try {
Object booleanValue = converter.convert(value);
- if(booleanValue != null) {
+ if (booleanValue != null) {
converter = XWT.findConvertor(existingValueType, int.class);
- if(converter != null) {
+ if (converter != null) {
existingValue = converter.convert(existingValue);
normalizedValue = booleanValue;
found = true;
@@ -177,14 +177,14 @@ public class Condition {
}
}
}
- if(!found) {
+ if (!found) {
converter = XWT.findConvertor(valueType, double.class);
- if(converter != null) {
+ if (converter != null) {
try {
Object booleanValue = converter.convert(value);
- if(booleanValue != null) {
+ if (booleanValue != null) {
converter = XWT.findConvertor(existingValueType, double.class);
- if(converter != null) {
+ if (converter != null) {
existingValue = converter.convert(existingValue);
normalizedValue = booleanValue;
found = true;
@@ -194,14 +194,14 @@ public class Condition {
}
}
}
- if(!found) {
+ if (!found) {
converter = XWT.findConvertor(valueType, String.class);
- if(converter != null) {
+ if (converter != null) {
try {
Object booleanValue = converter.convert(value);
- if(booleanValue != null) {
+ if (booleanValue != null) {
converter = XWT.findConvertor(existingValueType, String.class);
- if(converter != null) {
+ if (converter != null) {
existingValue = converter.convert(existingValue);
normalizedValue = booleanValue;
found = true;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/DataTrigger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/DataTrigger.java
index 7eee717cbde..7dff41bf01e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/DataTrigger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/DataTrigger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -20,7 +20,7 @@ import org.eclipse.papyrus.xwt.internal.utils.UserData;
import org.eclipse.swt.widgets.Widget;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class DataTrigger extends TriggerBase {
@@ -60,8 +60,8 @@ public class DataTrigger extends TriggerBase {
}
public SetterBase[] getSetters() {
- if(setters == null) {
- return Setter.EMPTY_SETTERS;
+ if (setters == null) {
+ return SetterBase.EMPTY_SETTERS;
}
return setters;
}
@@ -82,34 +82,34 @@ public class DataTrigger extends TriggerBase {
public void doHandleChange(boolean update) {
Widget widget = UserData.getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return;
}
Object currentValue = binding.getValue(null);
- if(currentValue == null) {
+ if (currentValue == null) {
return;
}
- while(currentValue instanceof IObservableValue) {
- currentValue = ((IObservableValue)currentValue).getValue();
+ while (currentValue instanceof IObservableValue) {
+ currentValue = ((IObservableValue) currentValue).getValue();
}
Class<?> currentValueType = currentValue.getClass();
Class<?> valueType = value.getClass();
Object normalizedValue = value;
- if(!currentValueType.isAssignableFrom(valueType) && !valueType.isAssignableFrom(currentValueType)) {
+ if (!currentValueType.isAssignableFrom(valueType) && !valueType.isAssignableFrom(currentValueType)) {
IConverter converter = XWT.findConvertor(valueType, currentValueType);
- if(converter != null) {
+ if (converter != null) {
normalizedValue = converter.convert(normalizedValue);
- } else if(value != null && value.toString().trim().length() > 0) {
+ } else if (value != null && value.toString().trim().length() > 0) {
boolean found = false;
// in case where the value is a boolean
converter = XWT.findConvertor(valueType, Boolean.class);
- if(converter != null) {
+ if (converter != null) {
try {
Object booleanValue = converter.convert(value);
- if(booleanValue != null) {
+ if (booleanValue != null) {
converter = XWT.findConvertor(currentValueType, Boolean.class);
- if(converter != null) {
+ if (converter != null) {
currentValue = converter.convert(currentValue);
normalizedValue = booleanValue;
found = true;
@@ -118,14 +118,14 @@ public class DataTrigger extends TriggerBase {
} catch (RuntimeException e) {
}
}
- if(!found) {
+ if (!found) {
converter = XWT.findConvertor(valueType, Integer.class);
- if(converter != null) {
+ if (converter != null) {
try {
Object booleanValue = converter.convert(value);
- if(booleanValue != null) {
+ if (booleanValue != null) {
converter = XWT.findConvertor(currentValueType, Integer.class);
- if(converter != null) {
+ if (converter != null) {
currentValue = converter.convert(currentValue);
normalizedValue = booleanValue;
found = true;
@@ -135,14 +135,14 @@ public class DataTrigger extends TriggerBase {
}
}
}
- if(!found) {
+ if (!found) {
converter = XWT.findConvertor(valueType, Double.class);
- if(converter != null) {
+ if (converter != null) {
try {
Object booleanValue = converter.convert(value);
- if(booleanValue != null) {
+ if (booleanValue != null) {
converter = XWT.findConvertor(currentValueType, Double.class);
- if(converter != null) {
+ if (converter != null) {
currentValue = converter.convert(currentValue);
normalizedValue = booleanValue;
found = true;
@@ -152,14 +152,14 @@ public class DataTrigger extends TriggerBase {
}
}
}
- if(!found) {
+ if (!found) {
converter = XWT.findConvertor(valueType, String.class);
- if(converter != null) {
+ if (converter != null) {
try {
Object booleanValue = converter.convert(value);
- if(booleanValue != null) {
+ if (booleanValue != null) {
converter = XWT.findConvertor(currentValueType, String.class);
- if(converter != null) {
+ if (converter != null) {
currentValue = converter.convert(currentValue);
normalizedValue = booleanValue;
found = true;
@@ -171,16 +171,16 @@ public class DataTrigger extends TriggerBase {
}
}
}
- if(!Operator.compare(currentValue, operator, normalizedValue) && update) {
+ if (!Operator.compare(currentValue, operator, normalizedValue) && update) {
restoreValues();
return;
}
- for(SetterBase setter : getSetters()) {
+ for (SetterBase setter : getSetters()) {
try {
Object oldValue = setter.applyTo(element, update);
- if(!update) {
- if(oldvalues == null) {
+ if (!update) {
+ if (oldvalues == null) {
oldvalues = new HashMap<SetterBase, Object>();
}
oldvalues.put(setter, oldValue);
@@ -192,18 +192,19 @@ public class DataTrigger extends TriggerBase {
}
}
+ @Override
public void prepare(Object target) {
- if(value == null) {
+ if (value == null) {
return;
}
Widget widget = UserData.getWidget(target);
- if(widget == null) {
+ if (widget == null) {
return;
}
Object bindingTarget = null;
- if(binding != null) {
- if(binding instanceof IDynamicBinding) {
- IDynamicBinding dynamicBinding = (IDynamicBinding)binding;
+ if (binding != null) {
+ if (binding instanceof IDynamicBinding) {
+ IDynamicBinding dynamicBinding = (IDynamicBinding) binding;
bindingTarget = dynamicBinding.createBoundSource();
} else {
bindingTarget = binding.getValue(null);
@@ -211,10 +212,10 @@ public class DataTrigger extends TriggerBase {
} else {
bindingTarget = XWT.getDataContext(widget);
}
- if(!(bindingTarget instanceof IObservableValue)) {
+ if (!(bindingTarget instanceof IObservableValue)) {
return;
}
- IObservableValue observableValue = (IObservableValue)bindingTarget;
+ IObservableValue observableValue = (IObservableValue) bindingTarget;
changeListener = new ValueChangeListener(target);
observableValue.addChangeListener(changeListener);
changeListener.doHandleChange(false); // get default value
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/EventTrigger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/EventTrigger.java
index 3831e23f17a..fe3b82930c6 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/EventTrigger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/EventTrigger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -30,7 +30,7 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Widget;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class EventTrigger extends TriggerBase {
@@ -69,12 +69,12 @@ public class EventTrigger extends TriggerBase {
@Override
public void prepare(Object target) {
String routedEvent = getRoutedEvent();
- if(routedEvent != null) {
+ if (routedEvent != null) {
Object source = getElementByName(target, getSourceName());
IMetaclass metaclass = XWT.getMetaclass(source);
IEvent event = metaclass.findEvent(ModelUtils.normalizeEventName(routedEvent));
- if(event == null) {
- if(routedEvent != null && !routedEvent.toLowerCase().endsWith(IEventConstants.SUFFIX_KEY)) {
+ if (event == null) {
+ if (routedEvent != null && !routedEvent.toLowerCase().endsWith(IEventConstants.SUFFIX_KEY)) {
LoggerManager.log("Event " + routedEvent + " is not found in " + source.getClass().getName() + ". Please add a suffix \"Event\"!");
} else {
LoggerManager.log("Event " + routedEvent + " is not found in " + source.getClass().getName());
@@ -82,12 +82,12 @@ public class EventTrigger extends TriggerBase {
return;
}
- for(TriggerAction triggerAction : getActions()) {
+ for (TriggerAction triggerAction : getActions()) {
triggerAction.initialize(target);
}
String name = event.getName();
- if("loadedevent".equalsIgnoreCase(name)) {
+ if ("loadedevent".equalsIgnoreCase(name)) {
Widget widget = UserData.getWidget(source);
IEventController eventController = UserData.updateEventController(source);
RunablePaintAction paintRunnable = createPaintRunnable(source);
@@ -108,6 +108,7 @@ public class EventTrigger extends TriggerBase {
}
}
+ @Override
public void on(Object target) {
}
@@ -128,7 +129,7 @@ public class EventTrigger extends TriggerBase {
}
public void run(Object object, Event event) {
- for(TriggerAction triggerAction : EventTrigger.this.getActions()) {
+ for (TriggerAction triggerAction : EventTrigger.this.getActions()) {
triggerAction.run(event, target, null);
}
}
@@ -154,22 +155,22 @@ public class EventTrigger extends TriggerBase {
public void run() {
count--;
- if(count == 0 && !event.widget.isDisposed()) {
+ if (count == 0 && !event.widget.isDisposed()) {
final Display display = event.widget.getDisplay();
display.syncExec(new Runnable() {
public void run() {
- if(transition) {
- for(TriggerAction triggerAction : getActions()) {
+ if (transition) {
+ for (TriggerAction triggerAction : getActions()) {
triggerAction.initialize(target);
}
} else {
- for(TriggerAction triggerAction : getActions()) {
+ for (TriggerAction triggerAction : getActions()) {
triggerAction.endFinalize(target);
}
}
display.removeFilter(eventType, RunableAction.this);
- if(!event.widget.isDisposed()) {
+ if (!event.widget.isDisposed()) {
event.widget.notifyListeners(eventType, event);
display.addFilter(eventType, RunableAction.this);
}
@@ -183,7 +184,7 @@ public class EventTrigger extends TriggerBase {
Widget widget = UserData.getWidget(target);
String name = event.getName();
this.eventType = Controller.getEventTypeByName(name);
- if(this.eventType != SWT.None) {
+ if (this.eventType != SWT.None) {
widget.getDisplay().addFilter(this.eventType, this);
transition = (this.eventType == XWTMaps.getEvent("swt.move") || this.eventType == XWTMaps.getEvent("swt.resize"));
}
@@ -191,10 +192,10 @@ public class EventTrigger extends TriggerBase {
public void handleEvent(Event event) {
Widget widget = UserData.getWidget(target);
- if(event.widget != widget || widget.isDisposed()) {
+ if (event.widget != widget || widget.isDisposed()) {
return;
}
- if(started) {
+ if (started) {
event.type = SWT.NONE;
return;
}
@@ -205,13 +206,13 @@ public class EventTrigger extends TriggerBase {
try {
this.event = Controller.copy(event);
- if(!transition) {
- for(TriggerAction triggerAction : getActions()) {
+ if (!transition) {
+ for (TriggerAction triggerAction : getActions()) {
triggerAction.initialize(target);
}
}
- for(TriggerAction triggerAction : EventTrigger.this.getActions()) {
+ for (TriggerAction triggerAction : EventTrigger.this.getActions()) {
triggerAction.run(event, target, this);
}
} catch (Exception e) {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IBinding.java
index 53ce68c4fc3..289ce4c9c30 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IBinding.java
@@ -4,21 +4,21 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt.core;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface IBinding {
/**
* The argument is used to determine the filtering. If type is null, no filtering
- *
+ *
* @return
*/
Object getValue(Class<?> type);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/ICollectionView.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/ICollectionView.java
index 2a0bc0a247c..7aeba7d52ec 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/ICollectionView.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/ICollectionView.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -18,21 +18,21 @@ import org.eclipse.papyrus.xwt.collection.SortDescription;
/**
* The interface is implemented by the CollectionView class, which is the base class for Collection
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface ICollectionView<T> {
/**
* Gets a value that indicates whether this view supports filtering via the Filter property.
- *
+ *
* @return
*/
boolean canFilter();
/**
* Gets a value that indicates whether this view supports grouping via the GroupDescriptions property.
- *
+ *
* @return
*/
boolean canGroup();
@@ -40,21 +40,21 @@ public interface ICollectionView<T> {
/**
* Gets a value that indicates whether this view supports sorting via the SortDescriptions property.
- *
+ *
* @return
*/
boolean canSort();
/**
* Gets the current item in the view.
- *
+ *
* @return
*/
T getCurrentItem();
/**
* Gets the ordinal position of the CurrentItem within the view.
- *
+ *
* @return
*/
int getCurrentPosition();
@@ -62,42 +62,42 @@ public interface ICollectionView<T> {
/**
* Returns a value that indicates whether the resulting view is empty.
- *
+ *
* @return
*/
boolean isEmpty();
/**
* Source collection
- *
+ *
* @return
*/
Collection<T> getSourceCollection();
/**
* Gets a collection of GroupDescription objects that describe how the items in the collection are grouped in the view.
- *
+ *
* @return
*/
GroupDescription[] getGroupDescription();
/**
* Gets a collection of SortDescription objects that describe how the items in the collection are sorted in the view.
- *
+ *
* @return
*/
SortDescription[] getSortDescription();
/**
* Gets the top-level groups.
- *
+ *
* @return
*/
Collection<T> getGroups();
/**
* Gets or sets the cultural info for any operations of the view that may differ by culture, such as sorting.
- *
+ *
* @return
*/
Locale getLocale();
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IDynamicBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IDynamicBinding.java
index 527fcc160c1..2fb1a25c154 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IDynamicBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IDynamicBinding.java
@@ -13,7 +13,7 @@ package org.eclipse.papyrus.xwt.core;
import org.eclipse.papyrus.xwt.databinding.IBindingContext;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface IDynamicBinding extends IBinding {
@@ -37,14 +37,14 @@ public interface IDynamicBinding extends IBinding {
/**
* Returns the {@link BindingContext} associated with this binding
- *
+ *
* @return the {@link BindingContext}
*/
IBindingContext getBindingContext();
/**
* Sets the {@link BindingContext} this binding is associated with
- *
+ *
* @param dataBindingContext
*/
void setBindingContext(IBindingContext dataBindingContext);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IElementLoaderFactory.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IElementLoaderFactory.java
index c5af27554e7..074d81c4dd6 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IElementLoaderFactory.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IElementLoaderFactory.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IRenderingContext.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IRenderingContext.java
index 3add2a35aae..98ff0cd76e1 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IRenderingContext.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IRenderingContext.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IVisualElementLoader.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IVisualElementLoader.java
index d17955334ff..9af4e36f3ab 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IVisualElementLoader.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/IVisualElementLoader.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiDataTrigger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiDataTrigger.java
index 4c62f68ea82..43b0821e77e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiDataTrigger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiDataTrigger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -53,17 +53,17 @@ public class MultiDataTrigger extends TriggerBase {
}
public void doHandleChange(boolean update) {
- for(Condition condition : getConditions()) {
- if(!condition.evaluate(element)) {
+ for (Condition condition : getConditions()) {
+ if (!condition.evaluate(element)) {
restoreValues();
return;
}
}
- for(SetterBase setter : getSetters()) {
+ for (SetterBase setter : getSetters()) {
try {
Object oldValue = setter.applyTo(element, update);
- if(oldvalues == null) {
+ if (oldvalues == null) {
oldvalues = new HashMap<SetterBase, Object>();
}
oldvalues.put(setter, oldValue);
@@ -76,23 +76,23 @@ public class MultiDataTrigger extends TriggerBase {
@Override
public void prepare(Object target) {
- if(getConditions().length == 0) {
+ if (getConditions().length == 0) {
return;
}
Widget widget = UserData.getWidget(target);
- if(widget == null) {
+ if (widget == null) {
return;
}
changeListener = new ValueChangeListener(target);
- for(Condition condition : getConditions()) {
+ for (Condition condition : getConditions()) {
String sourceName = condition.getSourceName();
IBinding binding = condition.getBinding();
Object bindingTarget = null;
- if(binding != null) {
- if(binding instanceof IDynamicBinding) {
- IDynamicBinding dynamicBinding = (IDynamicBinding)binding;
+ if (binding != null) {
+ if (binding instanceof IDynamicBinding) {
+ IDynamicBinding dynamicBinding = (IDynamicBinding) binding;
bindingTarget = dynamicBinding.createBoundSource();
} else {
bindingTarget = binding.getValue(null);
@@ -103,15 +103,16 @@ public class MultiDataTrigger extends TriggerBase {
bindingTarget = XWT.getDataContext(sourceWidget);
}
- if(!(bindingTarget instanceof IObservableValue)) {
+ if (!(bindingTarget instanceof IObservableValue)) {
return;
}
- IObservableValue observableValue = (IObservableValue)bindingTarget;
+ IObservableValue observableValue = (IObservableValue) bindingTarget;
observableValue.addChangeListener(changeListener);
}
changeListener.doHandleChange(false);
}
+ @Override
public void on(Object target) {
changeListener.doHandleChange(true);
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiTrigger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiTrigger.java
index 334f47e31c4..70cd419005f 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiTrigger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/MultiTrigger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -47,21 +47,21 @@ public class MultiTrigger extends TriggerBase {
}
public void handleChange(ChangeEvent event) {
- for(Condition condition : getConditions()) {
- if(!condition.evaluate(element)) {
+ for (Condition condition : getConditions()) {
+ if (!condition.evaluate(element)) {
restoreValues();
return;
}
}
- if(oldvalues != null && !oldvalues.isEmpty()) {
+ if (oldvalues != null && !oldvalues.isEmpty()) {
return;
}
- for(SetterBase setter : getSetters()) {
+ for (SetterBase setter : getSetters()) {
try {
Object oldValue = setter.applyTo(element, true);
- if(oldvalues == null) {
+ if (oldvalues == null) {
oldvalues = new HashMap<SetterBase, Object>();
}
oldvalues.put(setter, oldValue);
@@ -78,16 +78,16 @@ public class MultiTrigger extends TriggerBase {
@Override
public void prepare(Object target) {
- if(getConditions().length == 0) {
+ if (getConditions().length == 0) {
return;
}
ValueChangeListener changeListener = new ValueChangeListener(target);
- for(Condition condition : getConditions()) {
+ for (Condition condition : getConditions()) {
String propertyName = condition.getProperty();
String sourceName = condition.getSourceName();
Object source = getElementByName(target, sourceName);
- if(source == null) {
+ if (source == null) {
throw new XWTException("No element is found with the name = " + sourceName);
}
IObservable observableValue = ScopeManager.observeValue(source, source, propertyName, UpdateSourceTrigger.PropertyChanged);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Operator.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Operator.java
index baea4d09a00..77cd7d34d27 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Operator.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Operator.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -22,7 +22,7 @@ public enum Operator {
/**
* The utility helper method, to implement the compare between two objects
- *
+ *
* @param operant1
* @param operator
* @param operant2
@@ -32,35 +32,37 @@ public enum Operator {
public static boolean compare(Object operant1, Operator operator, Object operant2) throws XWTException {
boolean result = false;
- switch(operator) {
+ switch (operator) {
case EQ:
result = objectCompare(operant1, operant2);
break;
case NE:
- if(!objectCompare(operant1, operant2))
+ if (!objectCompare(operant1, operant2)) {
result = true;
+ }
break;
case GT:
- if(numberCompare(operant1, operant2) == 1)
+ if (numberCompare(operant1, operant2) == 1) {
return true;
+ }
break;
case LT:
- if(numberCompare(operant1, operant2) == -1) {
+ if (numberCompare(operant1, operant2) == -1) {
result = true;
}
break;
case GE:
- if(numberCompare(operant1, operant2) == 1 || numberCompare(operant1, operant2) == 0) {
+ if (numberCompare(operant1, operant2) == 1 || numberCompare(operant1, operant2) == 0) {
result = true;
}
break;
case LE:
- if(numberCompare(operant1, operant2) == -1 || numberCompare(operant1, operant2) == 0) {
+ if (numberCompare(operant1, operant2) == -1 || numberCompare(operant1, operant2) == 0) {
result = true;
}
break;
@@ -69,8 +71,8 @@ public enum Operator {
return LikeCompare(operant1, operant2);
case IS_A:
- if(operant2 instanceof Class<?>) {
- return ISACompare(operant1, (Class<?>)operant2);
+ if (operant2 instanceof Class<?>) {
+ return ISACompare(operant1, (Class<?>) operant2);
} else {
throw new XWTException(OperatorExceptionMessage.TYPE_WRONG);
}
@@ -92,7 +94,7 @@ public enum Operator {
* @throws XWTException
*/
private static int numberCompare(Object operant1, Object operant2) throws XWTException {
- if(operant1 == null || operant2 == null) {
+ if (operant1 == null || operant2 == null) {
throw new XWTException(OperatorExceptionMessage.OPRERANR_NULL);
}
Double longoperant1 = convertToDouble(operant1);
@@ -102,63 +104,64 @@ public enum Operator {
/**
* convert the type of operant to the Double
- *
+ *
* @param operant
* @return
* @throws XWTException
*/
private static Double convertToDouble(Object operant) throws XWTException {
- if(operant instanceof Double) {
- return (Double)operant;
+ if (operant instanceof Double) {
+ return (Double) operant;
}
- if(operant instanceof Float) {
- Float floatvalue = (Float)operant;
+ if (operant instanceof Float) {
+ Float floatvalue = (Float) operant;
return Double.parseDouble(String.valueOf(floatvalue));
}
- if(operant instanceof Integer) {
- Integer integer = (Integer)operant;
+ if (operant instanceof Integer) {
+ Integer integer = (Integer) operant;
return Double.parseDouble(String.valueOf(integer));
}
- if(operant instanceof Character) {
- Character character = (Character)operant;
- if(Character.isDigit(character)) {
+ if (operant instanceof Character) {
+ Character character = (Character) operant;
+ if (Character.isDigit(character)) {
int numericValue = Character.getNumericValue(character);
return Double.parseDouble(String.valueOf(numericValue));
}
}
- if(operant instanceof Short) {
- Short shortvalue = (Short)operant;
+ if (operant instanceof Short) {
+ Short shortvalue = (Short) operant;
return Double.parseDouble(String.valueOf(shortvalue));
}
- if(operant instanceof Byte) {
- Byte bytevalue = (Byte)operant;
+ if (operant instanceof Byte) {
+ Byte bytevalue = (Byte) operant;
return Double.parseDouble(String.valueOf(bytevalue));
}
- if(operant instanceof Long) {
- Long floatvalue = (Long)operant;
+ if (operant instanceof Long) {
+ Long floatvalue = (Long) operant;
return Double.parseDouble(String.valueOf(floatvalue));
}
- if(operant instanceof BigDecimal) {
- BigDecimal bigdecimalvalue = (BigDecimal)operant;
+ if (operant instanceof BigDecimal) {
+ BigDecimal bigdecimalvalue = (BigDecimal) operant;
return Double.parseDouble(String.valueOf(bigdecimalvalue));
- } else
+ } else {
throw new XWTException(OperatorExceptionMessage.TYPE_WRONG);
+ }
}
/**
* the compare of two object for NE,EQ
- *
+ *
* @param operant1
* @param operant2
* @return
*/
private static boolean objectCompare(Object operant1, Object operant2) {
- if(operant1 == operant2) {
+ if (operant1 == operant2) {
return true;
}
- if(operant1 != null) {
+ if (operant1 != null) {
return operant1.equals(operant2);
- } else if(operant1 != null) {
+ } else if (operant1 != null) {
return operant2.equals(operant1);
}
return false;
@@ -166,7 +169,7 @@ public enum Operator {
/**
* the compare of two object for ISA
- *
+ *
* @param operant1
* @param operant2
* @return
@@ -178,7 +181,7 @@ public enum Operator {
/**
* the compare of two Double
- *
+ *
* @param operant1
* @param operant2
* @return
@@ -189,19 +192,19 @@ public enum Operator {
/**
* the compare of two String for Like
- *
+ *
* @param operant1
* @param operant2
* @return
* @throws XWTException
*/
private static boolean LikeCompare(Object operant1, Object operant2) throws XWTException {
- if(operant1 == null || operant2 == null) {
+ if (operant1 == null || operant2 == null) {
throw new XWTException(OperatorExceptionMessage.OPRERANR_NULL);
}
- if(operant1 instanceof String && operant2 instanceof String) {
- String operant1String = (String)operant1;
- String operant2String = (String)operant2;
+ if (operant1 instanceof String && operant2 instanceof String) {
+ String operant1String = (String) operant1;
+ String operant2String = (String) operant2;
String queryString = parseRegularExpressionString(operant1String);
Pattern pattern = Pattern.compile(queryString);
Matcher matcher = pattern.matcher(operant2String);
@@ -212,7 +215,7 @@ public enum Operator {
/**
* build the regular expressions
- *
+ *
* @param queryString
* @return
*/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/RadioEventGroup.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/RadioEventGroup.java
index b461bc282ce..49e922e2d69 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/RadioEventGroup.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/RadioEventGroup.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -32,17 +32,17 @@ public class RadioEventGroup extends AbstractEventGroup {
Object host = manager.getHost();
IMetaclass metaclass = XWT.getMetaclass(host);
- EventProperty reaisedEventProperty = (EventProperty)property;
+ EventProperty reaisedEventProperty = (EventProperty) property;
String raisedName = reaisedEventProperty.getEvent().getName();
- for(String name : getEventNames()) {
- if(name.equalsIgnoreCase(raisedName)) {
+ for (String name : getEventNames()) {
+ if (name.equalsIgnoreCase(raisedName)) {
continue;
}
String eventPropertyName = IEventConstants.getEventPropertyName(name);
IProperty eventProperty = metaclass.findProperty(eventPropertyName);
IObservableValue value = manager.getValue(eventProperty);
- if(value != null) {
+ if (value != null) {
value.setValue(false);
}
}
@@ -51,15 +51,15 @@ public class RadioEventGroup extends AbstractEventGroup {
public void registerEvent(IObservableValueListener manager, IProperty property) {
Object host = manager.getHost();
IEventController controller = UserData.findEventController(host);
- if(controller == null) {
+ if (controller == null) {
controller = UserData.updateEventController(host);
}
IMetaclass metaclass = XWT.getMetaclass(host);
- EventProperty reaisedEventProperty = (EventProperty)property;
+ EventProperty reaisedEventProperty = (EventProperty) property;
String raisedName = reaisedEventProperty.getEvent().getName();
- for(String name : getEventNames()) {
- if(name.equalsIgnoreCase(raisedName)) {
+ for (String name : getEventNames()) {
+ if (name.equalsIgnoreCase(raisedName)) {
continue;
}
String eventPropertyName = IEventConstants.getEventPropertyName(name);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Setter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Setter.java
index 4228f20e6d2..e69589f39fe 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Setter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Setter.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.papyrus.xwt.metadata.IProperty;
/**
* Setter of the class Style, which is used to define the in-line XAML style
- *
+ *
* @see Style
* @author yyang
*/
@@ -55,24 +55,25 @@ public class Setter extends SetterBase {
this.value = value;
}
+ @Override
public Object applyTo(Object element, boolean update) {
String propName = getProperty();
Object propValue = getValue();
String targetName = getTargetName();
Object setterTarget = element;
Object oldValue = null;
- if(targetName != null) {
+ if (targetName != null) {
setterTarget = TriggerBase.getElementByName(element, targetName);
}
IMetaclass metaclass = XWT.getMetaclass(setterTarget);
IProperty prop = metaclass.findProperty(propName);
- if(prop != null && propValue != null) {
+ if (prop != null && propValue != null) {
Object toValue = propValue;
Class<?> valueType = propValue.getClass();
Class<?> targetType = prop.getType();
- if(targetType != null && !targetType.isAssignableFrom(valueType)) {
+ if (targetType != null && !targetType.isAssignableFrom(valueType)) {
IConverter converter = XWT.findConvertor(valueType, targetType);
- if(converter != null) {
+ if (converter != null) {
toValue = converter.convert(propValue);
} else {
throw new XWTException("Converter doesn't exist from \"" + valueType.getName() + "\" to \"" + targetType.getName());
@@ -80,7 +81,7 @@ public class Setter extends SetterBase {
}
try {
oldValue = prop.getValue(setterTarget);
- if(update) {
+ if (update) {
prop.setValue(setterTarget, toValue);
}
} catch (Exception e) {
@@ -90,16 +91,17 @@ public class Setter extends SetterBase {
return oldValue;
}
+ @Override
public void undo(Object element, Object value) {
String propName = getProperty();
String targetName = getTargetName();
Object setterTarget = element;
- if(targetName != null) {
+ if (targetName != null) {
setterTarget = TriggerBase.getElementByName(element, targetName);
}
IMetaclass metaclass = XWT.getMetaclass(setterTarget);
IProperty prop = metaclass.findProperty(propName);
- if(prop != null) {
+ if (prop != null) {
try {
prop.setValue(setterTarget, value);
} catch (Exception e) {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/SetterBase.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/SetterBase.java
index b530b2c4107..ebbb28b5253 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/SetterBase.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/SetterBase.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Style.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Style.java
index 9711c0cc5f3..63084d9b007 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Style.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Style.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,7 +12,7 @@ package org.eclipse.papyrus.xwt.core;
/**
* The class defines the in-line XAML style
- *
+ *
* @author yyang
*/
public class Style {
@@ -24,7 +24,7 @@ public class Style {
protected TriggerBase[] triggers;
public TriggerBase[] getTriggers() {
- if(triggers == null) {
+ if (triggers == null) {
return TriggerBase.EMPTY_ARRAY;
}
return triggers;
@@ -43,7 +43,7 @@ public class Style {
}
public SetterBase[] getSetters() {
- if(setters == null) {
+ if (setters == null) {
return SetterBase.EMPTY_SETTERS;
}
return setters;
@@ -54,15 +54,15 @@ public class Style {
}
public void apply(Object target) {
- for(SetterBase setter : getSetters()) {
+ for (SetterBase setter : getSetters()) {
setter.applyTo(target, true);
}
- for(TriggerBase triggerBase : getTriggers()) {
+ for (TriggerBase triggerBase : getTriggers()) {
triggerBase.prepare(target);
}
- for(TriggerBase triggerBase : getTriggers()) {
+ for (TriggerBase triggerBase : getTriggers()) {
triggerBase.on(target);
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Trigger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Trigger.java
index 42b2b8c4ee5..385b933640e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Trigger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/Trigger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -70,7 +70,7 @@ public class Trigger extends TriggerBase {
}
public SetterBase[] getSetters() {
- if(setters == null) {
+ if (setters == null) {
return SetterBase.EMPTY_SETTERS;
}
return setters;
@@ -80,13 +80,15 @@ public class Trigger extends TriggerBase {
this.setters = setters;
}
+ @Override
public void on(Object target) {
}
+ @Override
public void prepare(Object target) {
- if(property != null) {
+ if (property != null) {
final Object source = getElementByName(target, sourceName);
- if(source == null) {
+ if (source == null) {
throw new XWTException("No element is found with the name = " + sourceName);
}
IObservable observableValue = ScopeManager.observeValue(source, source, property, UpdateSourceTrigger.PropertyChanged);
@@ -94,12 +96,12 @@ public class Trigger extends TriggerBase {
public void handleChange(ChangeEvent event) {
Class<?> valueType = JFaceXWTDataBinding.getValueType(source.getClass(), property);
- if(valueType == null) {
+ if (valueType == null) {
LoggerManager.log("Type of the property " + property + " is not found in " + source.getClass().getName());
return;
}
Widget widget = UserData.getWidget(source);
- if(widget == null) {
+ if (widget == null) {
return;
}
@@ -107,40 +109,40 @@ public class Trigger extends TriggerBase {
// test value ==
//
Object realValue = value;
- if(value != null) {
+ if (value != null) {
IConverter converter = XWT.findConvertor(value.getClass(), valueType);
- if(converter != null) {
+ if (converter != null) {
realValue = converter.convert(value);
}
}
Object newValue = event.getSource();
- if(newValue instanceof IObservableValue) {
- IObservableValue observableValue = (IObservableValue)newValue;
+ if (newValue instanceof IObservableValue) {
+ IObservableValue observableValue = (IObservableValue) newValue;
newValue = observableValue.getValue();
}
- if(newValue != null) {
+ if (newValue != null) {
IConverter newConverter = XWT.findConvertor(newValue.getClass(), valueType);
- if(newConverter != null) {
+ if (newConverter != null) {
newValue = newConverter.convert(newValue);
}
}
- if(!Operator.compare(newValue, operator, realValue)) {
+ if (!Operator.compare(newValue, operator, realValue)) {
restoreValues();
- if(oldvalues != null) {
+ if (oldvalues != null) {
oldvalues.clear();
}
return;
}
- if(oldvalues != null && !oldvalues.isEmpty()) {
+ if (oldvalues != null && !oldvalues.isEmpty()) {
return;
}
- for(SetterBase setter : getSetters()) {
+ for (SetterBase setter : getSetters()) {
try {
Object oldValue = setter.applyTo(element, true);
- if(oldvalues == null) {
+ if (oldvalues == null) {
oldvalues = new HashMap<SetterBase, Object>();
}
oldvalues.put(setter, oldValue);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerAction.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerAction.java
index 7bc6314af69..1149bc0fc91 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerAction.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerAction.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerBase.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerBase.java
index 70d514518f0..66638abe59e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerBase.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/core/TriggerBase.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -27,7 +27,7 @@ public abstract class TriggerBase {
protected TriggerAction[] exitActions;
public TriggerAction[] getEntryActions() {
- if(entryActions == null) {
+ if (entryActions == null) {
return TriggerAction.EMPTY_ARRAY;
}
return entryActions;
@@ -38,7 +38,7 @@ public abstract class TriggerBase {
}
public TriggerAction[] getExitActions() {
- if(exitActions == null) {
+ if (exitActions == null) {
return TriggerAction.EMPTY_ARRAY;
}
return exitActions;
@@ -63,21 +63,21 @@ public abstract class TriggerBase {
}
protected void restoreValues() {
- if(oldvalues == null) {
+ if (oldvalues == null) {
return;
}
- for(SetterBase setter : oldvalues.keySet()) {
+ for (SetterBase setter : oldvalues.keySet()) {
setter.undo(element, oldvalues.get(setter));
}
}
}
public static Object getElementByName(Object target, String elementName) {
- if(elementName != null && elementName.length() > 0) {
+ if (elementName != null && elementName.length() > 0) {
Widget widget = UserData.getWidget(target);
- if(widget != null) {
+ if (widget != null) {
Object element = XWT.findElementByName(widget, elementName);
- if(element != null) {
+ if (element != null) {
return element;
}
LoggerManager.log("EventTrigger: Source \n" + elementName + "\n is not found in " + target.getClass().getName());
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AbstractDataBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AbstractDataBinding.java
index 6db1c45ca0a..02002f91737 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AbstractDataBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AbstractDataBinding.java
@@ -20,7 +20,7 @@ import org.eclipse.papyrus.xwt.internal.core.BindingExpressionPath;
import org.eclipse.papyrus.xwt.internal.core.UpdateSourceTrigger;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public abstract class AbstractDataBinding implements IDataBinding {
@@ -55,7 +55,7 @@ public abstract class AbstractDataBinding implements IDataBinding {
/**
* @param dataProvider
- * the dataProvider to set
+ * the dataProvider to set
*/
public void setDataProvider(IDataProvider dataProvider) {
this.dataProvider = dataProvider;
@@ -71,7 +71,7 @@ public abstract class AbstractDataBinding implements IDataBinding {
/**
* Returns the name of the data binding context this binding is associated
* with
- *
+ *
* @return
*/
protected IBindingContext getDataBindingContext() {
@@ -100,7 +100,7 @@ public abstract class AbstractDataBinding implements IDataBinding {
}
/**
- *
+ *
* @return
*/
public BindingMode getMode() {
@@ -108,7 +108,7 @@ public abstract class AbstractDataBinding implements IDataBinding {
}
/**
- *
+ *
* @param mode
*/
public void setMode(BindingMode mode) {
@@ -116,7 +116,7 @@ public abstract class AbstractDataBinding implements IDataBinding {
}
/**
- *
+ *
* @return
*/
protected String getSourceProperty() {
@@ -124,7 +124,7 @@ public abstract class AbstractDataBinding implements IDataBinding {
}
/**
- *
+ *
* @return
*/
protected String getTargetProperty() {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AggregateObservableValue.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AggregateObservableValue.java
index c4495b633f3..286fc2c2b51 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AggregateObservableValue.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/AggregateObservableValue.java
@@ -22,7 +22,7 @@ import org.eclipse.papyrus.xwt.XWT;
/**
* @since 3.2
- *
+ *
*/
public class AggregateObservableValue extends AbstractObservableValue {
@@ -37,7 +37,7 @@ public class AggregateObservableValue extends AbstractObservableValue {
private IValueChangeListener listener = new IValueChangeListener() {
public void handleValueChange(ValueChangeEvent event) {
- if(!updating) {
+ if (!updating) {
fireValueChange(Diffs.createValueDiff(currentValue, doGetValue()));
}
}
@@ -52,27 +52,28 @@ public class AggregateObservableValue extends AbstractObservableValue {
this.converter = converter;
this.observableValues = observableValues;
- for(int i = 0; i < observableValues.length; i++) {
+ for (int i = 0; i < observableValues.length; i++) {
observableValues[i].addValueChangeListener(listener);
}
doGetValue();
}
private static Realm findRealm(IObservableValue[] observableValues) {
- for(IObservableValue observableValue : observableValues) {
+ for (IObservableValue observableValue : observableValues) {
return observableValue.getRealm();
}
return XWT.getRealm();
}
+ @Override
public void doSetValue(Object value) {
Object oldValue = doGetValue();
try {
updating = true;
Object[] values = converter.convertBack(value);
- for(int i = 0; i < observableValues.length; i++) {
- if(i < values.length) {
+ for (int i = 0; i < observableValues.length; i++) {
+ if (i < values.length) {
observableValues[i].setValue(values[i]);
} else {
observableValues[i].setValue(null);
@@ -86,9 +87,10 @@ public class AggregateObservableValue extends AbstractObservableValue {
fireValueChange(Diffs.createValueDiff(oldValue, value));
}
+ @Override
public Object doGetValue() {
Object[] values = new Object[observableValues.length];
- for(int i = 0; i < values.length; i++) {
+ for (int i = 0; i < values.length; i++) {
values[i] = observableValues[i].getValue();
}
return converter.convert(values);
@@ -98,8 +100,9 @@ public class AggregateObservableValue extends AbstractObservableValue {
return String[].class;
}
+ @Override
public synchronized void dispose() {
- for(int i = 0; i < observableValues.length; i++) {
+ for (int i = 0; i < observableValues.length; i++) {
observableValues[i].removeValueChangeListener(listener);
}
super.dispose();
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingContext.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingContext.java
index 9ee6e165908..a107023e0fc 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingContext.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingContext.java
@@ -52,14 +52,14 @@ public class BindingContext implements IBindingContext {
* @see org.eclipse.papyrus.xwt.databinding.IDataBindingContext#getContext()
*/
public org.eclipse.core.databinding.DataBindingContext getContext() {
- if(this.context == null) {
- if(this.realm != null) {
+ if (this.context == null) {
+ if (this.realm != null) {
this.context = new org.eclipse.core.databinding.DataBindingContext(this.realm);
} else {
this.context = new org.eclipse.core.databinding.DataBindingContext(XWT.getRealm());
}
- if(this.parent != null) {
+ if (this.parent != null) {
this.parent.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
@@ -86,9 +86,9 @@ public class BindingContext implements IBindingContext {
* @see org.eclipse.papyrus.xwt.databinding.IDataBindingContext#getStatus()
*/
public AggregateValidationStatus getStatus() {
- if(this.status == null) {
+ if (this.status == null) {
this.status = new AggregateValidationStatus(getContext(), this.statusType);
- if(this.parent != null) {
+ if (this.parent != null) {
this.parent.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
@@ -124,15 +124,16 @@ public class BindingContext implements IBindingContext {
*
* @see org.eclipse.papyrus.xwt.databinding.IDataBindingContext#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
- if(!(obj instanceof BindingContext)) {
+ if (!(obj instanceof BindingContext)) {
return false;
}
org.eclipse.core.databinding.DataBindingContext context = getContext();
- if(context != null) {
- return context.equals(((BindingContext)obj).getContext());
+ if (context != null) {
+ return context.equals(((BindingContext) obj).getContext());
}
- if(((BindingContext)obj).getContext() != null) {
+ if (((BindingContext) obj).getContext() != null) {
return false;
}
return super.equals(obj);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingMode.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingMode.java
index 60bf3f96519..35fc777f1f3 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingMode.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/BindingMode.java
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt.databinding;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public enum BindingMode {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ControlDataBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ControlDataBinding.java
index d51b7eed3b1..a2fe4a57caa 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ControlDataBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ControlDataBinding.java
@@ -20,7 +20,7 @@ import org.eclipse.papyrus.xwt.internal.core.ScopeManager;
import org.eclipse.papyrus.xwt.internal.utils.UserData;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class ControlDataBinding extends AbstractDataBinding {
@@ -38,31 +38,31 @@ public class ControlDataBinding extends AbstractDataBinding {
public Object getValue(Class<?> targetType) {
IObservableValue targetWidget = null;
Object target = getControl();
- if(target != null) {
+ if (target != null) {
targetWidget = ScopeManager.observeValue(target, target, getTargetProperty(), getUpdateSourceTrigger());
}
- if(source == null) {
+ if (source == null) {
return null;
}
Object control = UserData.getWidget(source);
- if(control == null) {
+ if (control == null) {
control = getControl();
}
IObservableValue sourceWidget = ScopeManager.observeValue(control, source, getSourceProperty(), getUpdateSourceTrigger());
- if(targetWidget == null) {
- if(sourceWidget != null) {
- if(targetType != null && !targetType.isInstance(sourceWidget)) {
+ if (targetWidget == null) {
+ if (sourceWidget != null) {
+ if (targetType != null && !targetType.isInstance(sourceWidget)) {
return sourceWidget;
}
Object value = sourceWidget.getValue();
- while(value instanceof IObservableValue) {
- value = ((IObservableValue)value).getValue();
+ while (value instanceof IObservableValue) {
+ value = ((IObservableValue) value).getValue();
}
IValueConverter converter = getConverter();
- if(converter != null) {
+ if (converter != null) {
value = converter.convert(value);
}
return value;
@@ -73,17 +73,17 @@ public class ControlDataBinding extends AbstractDataBinding {
IBindingContext dataBindingContext = getDataBindingContext();
BindingGate bindingGate = new BindingGate(dataBindingContext);
bindingGate.bind(sourceWidget, targetWidget, this);
- if(sourceWidget != null) {
- if(targetType != null && !targetType.isInstance(sourceWidget)) {
+ if (sourceWidget != null) {
+ if (targetType != null && !targetType.isInstance(sourceWidget)) {
return sourceWidget;
}
// convert to final value
Object value = sourceWidget.getValue();
- while(value instanceof IObservableValue) {
- value = ((IObservableValue)value).getValue();
+ while (value instanceof IObservableValue) {
+ value = ((IObservableValue) value).getValue();
}
IValueConverter converter = getConverter();
- if(converter != null) {
+ if (converter != null) {
value = converter.convert(value);
}
return value;
@@ -92,7 +92,7 @@ public class ControlDataBinding extends AbstractDataBinding {
}
/**
- *
+ *
* @return
*/
protected Object getSource() {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/DataBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/DataBinding.java
index 4c1b9e790d8..4164a32a657 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/DataBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/DataBinding.java
@@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.Text;
/**
* The default implementation of the dataBinding object.
- *
+ *
* @author jliu (jin.liu@soyatec.com)
*/
public class DataBinding extends AbstractDataBinding {
@@ -60,65 +60,65 @@ public class DataBinding extends AbstractDataBinding {
* If observableWidget is null, we need only return the data from
* provider.
*/
- if(observableWidget == null) {
- if(observableSource == null) {
+ if (observableWidget == null) {
+ if (observableSource == null) {
// TODO should raise an exception
return null;
}
- if(targetType != null && !targetType.isInstance(observableSource)) {
+ if (targetType != null && !targetType.isInstance(observableSource)) {
return observableSource;
}
// convert to final value
Object value = observableSource;
- if(observableSource instanceof IObservableValue) {
- value = ((IObservableValue)observableSource).getValue();
+ if (observableSource instanceof IObservableValue) {
+ value = ((IObservableValue) observableSource).getValue();
}
return convertedValue(value);
}
BindingGate bindingContext = getBindingGate();
- if(bindingContext != null && observableSource != null) {
+ if (bindingContext != null && observableSource != null) {
Object target = getControl();
- if(target instanceof Text && getTargetProperty().equalsIgnoreCase("text")) {
- if(isSourcePropertyReadOnly()) {
- Text text = (Text)target;
+ if (target instanceof Text && getTargetProperty().equalsIgnoreCase("text")) {
+ if (isSourcePropertyReadOnly()) {
+ Text text = (Text) target;
text.setEditable(false);
}
- } else if(target instanceof Button && getTargetProperty().equalsIgnoreCase("selection")) {
- if(isSourcePropertyReadOnly()) {
- Button button = (Button)target;
+ } else if (target instanceof Button && getTargetProperty().equalsIgnoreCase("selection")) {
+ if (isSourcePropertyReadOnly()) {
+ Button button = (Button) target;
button.setEnabled(false);
}
- } else if((target instanceof Combo || target instanceof CCombo) && getTargetProperty().equalsIgnoreCase("text")) {
- if(isSourcePropertyReadOnly()) {
- Control control = (Control)target;
+ } else if ((target instanceof Combo || target instanceof CCombo) && getTargetProperty().equalsIgnoreCase("text")) {
+ if (isSourcePropertyReadOnly()) {
+ Control control = (Control) target;
control.setEnabled(false);
}
- } else if(target instanceof MenuItem && getTargetProperty().equalsIgnoreCase("selection")) {
- if(isSourcePropertyReadOnly()) {
- MenuItem menuItem = (MenuItem)target;
+ } else if (target instanceof MenuItem && getTargetProperty().equalsIgnoreCase("selection")) {
+ if (isSourcePropertyReadOnly()) {
+ MenuItem menuItem = (MenuItem) target;
menuItem.setEnabled(false);
}
}
bindingContext.bind(observableSource, observableWidget, this);
}
- if(targetType != null && !targetType.isInstance(observableSource)) {
+ if (targetType != null && !targetType.isInstance(observableSource)) {
return observableSource;
}
// convert to final value
Object value = observableSource;
- while(value instanceof IObservableValue) {
- value = ((IObservableValue)value).getValue();
+ while (value instanceof IObservableValue) {
+ value = ((IObservableValue) value).getValue();
}
return convertedValue(value);
}
private BindingGate getBindingGate() {
- if(this.bindingGate == null) {
+ if (this.bindingGate == null) {
IBindingContext dataBindingContext = getDataBindingContext();
this.bindingGate = new BindingGate(dataBindingContext);
}
@@ -128,7 +128,7 @@ public class DataBinding extends AbstractDataBinding {
private Object convertedValue(Object value) {
IValueConverter converter = getConverter();
- if(converter != null) {
+ if (converter != null) {
value = converter.convert(value);
}
return value;
@@ -145,10 +145,10 @@ public class DataBinding extends AbstractDataBinding {
public IObservable getObservableSource(int observeKind) {
IObservable observableSource = getObservableSource();
- if(observableSource == null) {
+ if (observableSource == null) {
IDataProvider dataProvider = getDataProvider();
observableSource = ScopeManager.observe(getControl(), dataProvider.getData(null), getSourcePropertyExpression(), getUpdateSourceTrigger(), observeKind);
- if(observableSource != null) {
+ if (observableSource != null) {
setObservableSource(observableSource);
}
}
@@ -156,25 +156,25 @@ public class DataBinding extends AbstractDataBinding {
}
public IObservable getObservableWidget() {
- if(observableWidget == null) {
+ if (observableWidget == null) {
Object target = getControl();
Object host = getHost();
String targetProperty = getTargetProperty();
targetProperty = ModelUtils.normalizePropertyName(targetProperty);
int observeKind = ScopeManager.AUTO;
- if(host instanceof Viewer && "input".equals(targetProperty)) {
+ if (host instanceof Viewer && "input".equals(targetProperty)) {
// It is possible to use List
getObservableSource(ScopeManager.COLLECTION);
IObservable observableSource = getObservableSource();
- if(observableSource instanceof IObservableList) {
+ if (observableSource instanceof IObservableList) {
return null;
- } else if(observableSource instanceof IObservableSet) {
+ } else if (observableSource instanceof IObservableSet) {
return null;
}
}
try {
BindingExpressionPath path = getTargetPropertyExpression();
- if(path.isEmptyPath()) {
+ if (path.isEmptyPath()) {
return null;
}
observableWidget = ScopeManager.observe(target, host, path, getUpdateSourceTrigger(), observeKind);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/Event.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/Event.java
index 76c1ba0efd8..73876d55356 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/Event.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/Event.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -39,7 +39,7 @@ public class Event {
/**
* @param eventTarget
- * the eventTarget to set
+ * the eventTarget to set
*/
public void setEventTarget(Object eventTarget) {
this.eventTarget = eventTarget;
@@ -54,7 +54,7 @@ public class Event {
/**
* @param oldValue
- * the oldValue to set
+ * the oldValue to set
*/
public void setOldValue(Object oldValue) {
this.oldValue = oldValue;
@@ -69,7 +69,7 @@ public class Event {
/**
* @param newValue
- * the newValue to set
+ * the newValue to set
*/
public void setNewValue(Object newValue) {
this.newValue = newValue;
@@ -84,7 +84,7 @@ public class Event {
/**
* @param eventType
- * the eventType to set
+ * the eventType to set
*/
public void setEventType(String eventType) {
this.eventType = eventType;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventListener.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventListener.java
index 440bb59b597..67b4a2fbc14 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventListener.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventListener.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventManager.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventManager.java
index 7387aac7fc1..c9b842c1494 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventManager.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventManager.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.core.databinding.observable.Realm;
/**
* This class <code>EventManager</code> is used to manage all event listeners for a observed object.
- *
+ *
* @author jliu jin.liu@soyatec.com
*/
public class EventManager {
@@ -39,7 +39,7 @@ public class EventManager {
public static EventManager getEventManager(Object eventTarget, Realm realm) {
EventManager eventManager = managers.get(eventTarget);
- if(eventManager == null || eventManager.realm != realm) {
+ if (eventManager == null || eventManager.realm != realm) {
eventManager = new EventManager(eventTarget, realm);
managers.put(eventTarget, eventManager);
}
@@ -49,14 +49,14 @@ public class EventManager {
public void dispatchEvent(Event event) {
String eventType = event.getEventType();
List<EventListener> listeners = type2listeners.get(eventType);
- for(EventListener l : listeners) {
+ for (EventListener l : listeners) {
l.handleEvent(event);
}
}
public void addEventListener(String eventType, EventListener eventListener) {
List<EventListener> listeners = type2listeners.get(eventType);
- if(listeners == null) {
+ if (listeners == null) {
listeners = new ArrayList<EventListener>();
type2listeners.put(eventType, listeners);
}
@@ -65,7 +65,7 @@ public class EventManager {
public void removeEventListener(String eventType, EventListener eventListener) {
List<EventListener> listeners = type2listeners.get(eventType);
- if(listeners != null) {
+ if (listeners != null) {
listeners.remove(eventListener);
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventPropertyObservableValue.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventPropertyObservableValue.java
index 0744ba44cd5..e4194bfbc87 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventPropertyObservableValue.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/EventPropertyObservableValue.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -26,13 +26,13 @@ public class EventPropertyObservableValue extends XWTObservableValue {
super(Boolean.class, observed, property.getName());
this.property = property;
IEventController controller = UserData.findEventController(observed);
- if(controller == null) {
+ if (controller == null) {
controller = UserData.updateEventController(observed);
}
IEvent event = property.getEvent();
IObservableValueListener manager = UserData.getObservableValueManager(observed);
- if(manager == null) {
+ if (manager == null) {
manager = new ObservableValueManager(observed);
UserData.setObservableValueManager(observed, manager);
}
@@ -50,6 +50,7 @@ public class EventPropertyObservableValue extends XWTObservableValue {
UserData.setLocalData(getObserved(), property.getName(), value);
}
+ @Override
protected Object doGetValue() {
return UserData.getLocalData(getObserved(), property.getName());
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/IBindingContext.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/IBindingContext.java
index 6f4f679943d..4bf65b3b9c2 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/IBindingContext.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/IBindingContext.java
@@ -25,13 +25,13 @@ import org.eclipse.core.databinding.observable.value.IObservableValue;
public interface IBindingContext {
/**
- *
+ *
* @see @see org.eclipse.core.databinding.AggregateValidationStatus#MERGED
*/
public static final int MERGED = org.eclipse.core.databinding.AggregateValidationStatus.MERGED;
/**
- *
+ *
* @see org.eclipse.core.databinding.AggregateValidationStatus#MAX_SEVERITY
*/
public static final int MAX_SEVERITY = org.eclipse.core.databinding.AggregateValidationStatus.MAX_SEVERITY;
@@ -53,7 +53,7 @@ public interface IBindingContext {
/**
* The status type of the status. One of the values
- *
+ *
* @return the statusType
*/
public abstract int getStatusType();
@@ -62,8 +62,7 @@ public interface IBindingContext {
* @param targetObservableValue
* @param modelObservableValue
* @return
- * @see org.eclipse.core.databinding.DataBindingContext#bindValue(org.eclipse.core.databinding.observable.value.IObservableValue,
- * org.eclipse.core.databinding.observable.value.IObservableValue)
+ * @see org.eclipse.core.databinding.DataBindingContext#bindValue(org.eclipse.core.databinding.observable.value.IObservableValue, org.eclipse.core.databinding.observable.value.IObservableValue)
*/
public abstract Binding bindValue(IObservableValue targetObservableValue, IObservableValue modelObservableValue);
@@ -80,8 +79,7 @@ public interface IBindingContext {
* @param targetToModel
* @param modelToTarget
* @return
- * @see org.eclipse.core.databinding.DataBindingContext#bindValue(org.eclipse.core.databinding.observable.value.IObservableValue,
- * org.eclipse.core.databinding.observable.value.IObservableValue, org.eclipse.core.databinding.UpdateValueStrategy,
+ * @see org.eclipse.core.databinding.DataBindingContext#bindValue(org.eclipse.core.databinding.observable.value.IObservableValue, org.eclipse.core.databinding.observable.value.IObservableValue, org.eclipse.core.databinding.UpdateValueStrategy,
* org.eclipse.core.databinding.UpdateValueStrategy)
*/
public abstract Binding bindValue(IObservableValue targetObservableValue, IObservableValue modelObservableValue, UpdateValueStrategy targetToModel, UpdateValueStrategy modelToTarget);
@@ -90,8 +88,7 @@ public interface IBindingContext {
* @param targetObservableList
* @param modelObservableList
* @return
- * @see org.eclipse.core.databinding.DataBindingContext#bindList(org.eclipse.core.databinding.observable.list.IObservableList,
- * org.eclipse.core.databinding.observable.list.IObservableList)
+ * @see org.eclipse.core.databinding.DataBindingContext#bindList(org.eclipse.core.databinding.observable.list.IObservableList, org.eclipse.core.databinding.observable.list.IObservableList)
*/
public abstract Binding bindList(IObservableList targetObservableList, IObservableList modelObservableList);
@@ -101,8 +98,7 @@ public interface IBindingContext {
* @param targetToModel
* @param modelToTarget
* @return
- * @see org.eclipse.core.databinding.DataBindingContext#bindList(org.eclipse.core.databinding.observable.list.IObservableList,
- * org.eclipse.core.databinding.observable.list.IObservableList, org.eclipse.core.databinding.UpdateListStrategy,
+ * @see org.eclipse.core.databinding.DataBindingContext#bindList(org.eclipse.core.databinding.observable.list.IObservableList, org.eclipse.core.databinding.observable.list.IObservableList, org.eclipse.core.databinding.UpdateListStrategy,
* org.eclipse.core.databinding.UpdateListStrategy)
*/
public abstract Binding bindList(IObservableList targetObservableList, IObservableList modelObservableList, UpdateListStrategy targetToModel, UpdateListStrategy modelToTarget);
@@ -111,8 +107,7 @@ public interface IBindingContext {
* @param targetObservableSet
* @param modelObservableSet
* @return
- * @see org.eclipse.core.databinding.DataBindingContext#bindSet(org.eclipse.core.databinding.observable.set.IObservableSet,
- * org.eclipse.core.databinding.observable.set.IObservableSet)
+ * @see org.eclipse.core.databinding.DataBindingContext#bindSet(org.eclipse.core.databinding.observable.set.IObservableSet, org.eclipse.core.databinding.observable.set.IObservableSet)
*/
public abstract Binding bindSet(IObservableSet targetObservableSet, IObservableSet modelObservableSet);
@@ -122,14 +117,13 @@ public interface IBindingContext {
* @param targetToModel
* @param modelToTarget
* @return
- * @see org.eclipse.core.databinding.DataBindingContext#bindSet(org.eclipse.core.databinding.observable.set.IObservableSet,
- * org.eclipse.core.databinding.observable.set.IObservableSet, org.eclipse.core.databinding.UpdateSetStrategy,
+ * @see org.eclipse.core.databinding.DataBindingContext#bindSet(org.eclipse.core.databinding.observable.set.IObservableSet, org.eclipse.core.databinding.observable.set.IObservableSet, org.eclipse.core.databinding.UpdateSetStrategy,
* org.eclipse.core.databinding.UpdateSetStrategy)
*/
public abstract Binding bindSet(IObservableSet targetObservableSet, IObservableSet modelObservableSet, UpdateSetStrategy targetToModel, UpdateSetStrategy modelToTarget);
/**
- *
+ *
* @see org.eclipse.core.databinding.DataBindingContext#dispose()
*/
public abstract void dispose();
@@ -151,6 +145,7 @@ public interface IBindingContext {
* @deprecated
* @see org.eclipse.core.databinding.DataBindingContext#getValidationStatusMap()
*/
+ @Deprecated
public abstract IObservableMap getValidationStatusMap();
/**
@@ -166,13 +161,13 @@ public interface IBindingContext {
public abstract void addValidationStatusProvider(ValidationStatusProvider validationStatusProvider);
/**
- *
+ *
* @see org.eclipse.core.databinding.DataBindingContext#updateModels()
*/
public abstract void updateModels();
/**
- *
+ *
* @see org.eclipse.core.databinding.DataBindingContext#updateTargets()
*/
public abstract void updateTargets();
@@ -199,13 +194,13 @@ public interface IBindingContext {
/**
* @param realm
- * the realm to set
+ * the realm to set
*/
public abstract void setRealm(Realm realm);
/**
* @param statusType
- * the statusType to set
+ * the statusType to set
*/
public abstract void setStatusType(int statusType);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/JFaceXWTDataBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/JFaceXWTDataBinding.java
index 3e693e1b932..6784003a53f 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/JFaceXWTDataBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/JFaceXWTDataBinding.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -44,7 +44,7 @@ import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Text;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class JFaceXWTDataBinding {
@@ -55,22 +55,22 @@ public class JFaceXWTDataBinding {
static final String TEXT = "text";
- public static final Class<?>[] CONTROL_ARGUMENT_TYPES = new Class[]{ Control.class };
+ public static final Class<?>[] CONTROL_ARGUMENT_TYPES = new Class[] { Control.class };
- public static final Class<?>[] VIEWER_ARGUMENT_TYPES = new Class[]{ Viewer.class };
+ public static final Class<?>[] VIEWER_ARGUMENT_TYPES = new Class[] { Viewer.class };
static String[] VIEWERS_PROPERTIES = null;
static {
Method[] methods = ViewerProperties.class.getDeclaredMethods();
VIEWERS_PROPERTIES = new String[methods.length];
- for(int i = 0; i < methods.length; i++) {
+ for (int i = 0; i < methods.length; i++) {
VIEWERS_PROPERTIES[i] = methods[i].getName();
}
}
public static boolean isViewerProperty(String propertyName) {
- for(String name : VIEWERS_PROPERTIES) {
- if(name.equals(propertyName)) {
+ for (String name : VIEWERS_PROPERTIES) {
+ if (name.equals(propertyName)) {
return true;
}
}
@@ -78,13 +78,13 @@ public class JFaceXWTDataBinding {
}
public static Class<?> getValueType(Class<?> type, String propertyName) {
- if(type == null || propertyName == null || propertyName.indexOf(".") != -1) {
+ if (type == null || propertyName == null || propertyName.indexOf(".") != -1) {
return null;
}
try {
IMetaclass metaclass = XWT.getMetaclass(type);
IProperty property = metaclass.findProperty(propertyName);
- if(property != null) {
+ if (property != null) {
return property.getType();
}
} catch (Exception e) {
@@ -94,24 +94,24 @@ public class JFaceXWTDataBinding {
}
public static Object getValue(Object target, String propertyName) {
- if(target == null || propertyName == null || propertyName.indexOf(".") != -1) {
+ if (target == null || propertyName == null || propertyName.indexOf(".") != -1) {
return target;
}
Class<?> type = target.getClass();
try {
BeanInfo beanInfo = java.beans.Introspector.getBeanInfo(type);
PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
- for(PropertyDescriptor pd : propertyDescriptors) {
- if(propertyName.equalsIgnoreCase(pd.getName())) {
+ for (PropertyDescriptor pd : propertyDescriptors) {
+ if (propertyName.equalsIgnoreCase(pd.getName())) {
Method readMethod = pd.getReadMethod();
- if(readMethod != null) {
+ if (readMethod != null) {
return readMethod.invoke(target);
}
}
}
Field[] fields = type.getDeclaredFields();
- for(Field field : fields) {
- if(propertyName.equalsIgnoreCase(field.getName())) {
+ for (Field field : fields) {
+ if (propertyName.equalsIgnoreCase(field.getName())) {
Object object = field.get(target);
return object;
}
@@ -128,50 +128,50 @@ public class JFaceXWTDataBinding {
try {
BeanInfo beanInfo = java.beans.Introspector.getBeanInfo(type);
PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
- for(PropertyDescriptor pd : propertyDescriptors) {
- if(propertyName.equals(pd.getName())) {
+ for (PropertyDescriptor pd : propertyDescriptors) {
+ if (propertyName.equals(pd.getName())) {
Method writeMethod = pd.getWriteMethod();
- if(writeMethod == null) {
+ if (writeMethod == null) {
return;
}
- if(!writeMethod.isAccessible()) {
+ if (!writeMethod.isAccessible()) {
writeMethod.setAccessible(true);
}
Class<?>[] parameterTypes = writeMethod.getParameterTypes();
Class targetType = parameterTypes[0];
- if(targetType != value.getClass()) {
- if(targetType.isEnum() && value instanceof String) {
+ if (targetType != value.getClass()) {
+ if (targetType.isEnum() && value instanceof String) {
try {
- writeMethod.invoke(target, new Object[]{ Enum.valueOf(targetType, (String)value) });
+ writeMethod.invoke(target, new Object[] { Enum.valueOf(targetType, (String) value) });
return;
} catch (Exception e) {
}
}
IConverter c = XWT.findConvertor(value.getClass(), targetType);
- if(c != null) {
+ if (c != null) {
value = c.convert(value);
}
}
- writeMethod.invoke(target, new Object[]{ value });
+ writeMethod.invoke(target, new Object[] { value });
return;
}
}
Field[] fields = type.getDeclaredFields();
- for(Field field : fields) {
- if(propertyName.equals(field.getName())) {
- if(!field.isAccessible()) {
+ for (Field field : fields) {
+ if (propertyName.equals(field.getName())) {
+ if (!field.isAccessible()) {
field.setAccessible(true);
}
Class fieldType = field.getType();
- if(fieldType.isEnum() && value instanceof String) {
+ if (fieldType.isEnum() && value instanceof String) {
try {
- field.set(target, Enum.valueOf(fieldType, (String)value));
+ field.set(target, Enum.valueOf(fieldType, (String) value));
return;
} catch (Exception e) {
}
}
IConverter c = XWT.findConvertor(value.getClass(), fieldType);
- if(c != null) {
+ if (c != null) {
value = c.convert(value);
}
field.set(target, value);
@@ -181,7 +181,7 @@ public class JFaceXWTDataBinding {
IMetaclass metaclass = XWT.getMetaclass(type);
IProperty property = metaclass.findProperty(propertyName);
- if(property != null) {
+ if (property != null) {
property.setValue(target, value);
}
} catch (Exception e) {
@@ -190,13 +190,13 @@ public class JFaceXWTDataBinding {
}
public static boolean isPropertyReadOnly(Class<?> type, String propertyName) {
- if(type == null || propertyName == null || propertyName.indexOf(".") != -1) {
+ if (type == null || propertyName == null || propertyName.indexOf(".") != -1) {
return true;
}
try {
IMetaclass metaclass = XWT.getMetaclass(type);
IProperty property = metaclass.findProperty(propertyName);
- if(property != null) {
+ if (property != null) {
return property.isReadOnly();
}
} catch (Exception e) {
@@ -211,9 +211,9 @@ public class JFaceXWTDataBinding {
Method method = null;
try {
try {
- method = type.getMethod("addPropertyChangeListener", new Class[]{ String.class, PropertyChangeListener.class });
+ method = type.getMethod("addPropertyChangeListener", new Class[] { String.class, PropertyChangeListener.class });
} catch (NoSuchMethodException e) {
- method = type.getMethod("addPropertyChangeListener", new Class[]{ PropertyChangeListener.class });
+ method = type.getMethod("addPropertyChangeListener", new Class[] { PropertyChangeListener.class });
}
} catch (SecurityException e) {
} catch (NoSuchMethodException e) {
@@ -223,55 +223,55 @@ public class JFaceXWTDataBinding {
public static Class<?> toType(Object target) {
Class<?> type = null;
- if(target instanceof IObservableValue) {
- IObservableValue value = (IObservableValue)target;
+ if (target instanceof IObservableValue) {
+ IObservableValue value = (IObservableValue) target;
Object valueType = value.getValueType();
- if(valueType instanceof Class<?>) {
- type = (Class<?>)valueType;
+ if (valueType instanceof Class<?>) {
+ type = (Class<?>) valueType;
}
- } else if(target instanceof Class<?>) {
- type = (Class<?>)target;
+ } else if (target instanceof Class<?>) {
+ type = (Class<?>) target;
} else {
type = target.getClass();
}
- if(type == null) {
+ if (type == null) {
return Object.class;
}
return type;
}
public static boolean isValueProperty(Class<?> object, String propertyName) {
- if(propertyName == null) {
+ if (propertyName == null) {
return false;
}
- if(Viewer.class.isAssignableFrom(object)) {
+ if (Viewer.class.isAssignableFrom(object)) {
return isViewerValueProperty(object, propertyName);
- } else if(MenuItem.class.isAssignableFrom(object)) {
+ } else if (MenuItem.class.isAssignableFrom(object)) {
//
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=280157
// testcase:
// org.eclipse.papyrus.xwt.tests.databinding.bindcontrol.BindMenuItem
//
- if(ENABLED.equalsIgnoreCase(propertyName)) {
+ if (ENABLED.equalsIgnoreCase(propertyName)) {
return true;
- } else if(SELECTION.equalsIgnoreCase(propertyName)) {
+ } else if (SELECTION.equalsIgnoreCase(propertyName)) {
return true;
}
}
boolean isProperty = isControlValueProperty(object, propertyName);
- if(isProperty) {
+ if (isProperty) {
return true;
}
return false;
}
public static IObservable observeWidget(Object object, String propertyName, UpdateSourceTrigger updateSourceTrigger, int observedKind) {
- if(propertyName == null) {
+ if (propertyName == null) {
return null;
}
try {
- switch(observedKind) {
+ switch (observedKind) {
case ScopeManager.AUTO:
return observePropertyValue(object, propertyName, updateSourceTrigger);
case ScopeManager.COLLECTION:
@@ -289,43 +289,43 @@ public class JFaceXWTDataBinding {
}
protected static IObservable observePropertyValue(Object object, String propertyName, UpdateSourceTrigger updateSourceTrigger) {
- if(object instanceof Viewer) {
- if("input".equals(propertyName)) {
- Viewer viewer = (Viewer)object;
- SimpleValueProperty property = (SimpleValueProperty)ViewerProperties.input();
+ if (object instanceof Viewer) {
+ if ("input".equals(propertyName)) {
+ Viewer viewer = (Viewer) object;
+ SimpleValueProperty property = (SimpleValueProperty) ViewerProperties.input();
IObservableValue observableValue = new SimplePropertyObservableValue(XWT.getRealm(), viewer, property);
return new TypedViewerObservableValueDecorator(observableValue, viewer);
- } else if("singleSelection".equals(propertyName)) {
- Viewer viewer = (Viewer)object;
- SimpleValueProperty property = (SimpleValueProperty)ViewerProperties.singleSelection();
+ } else if ("singleSelection".equals(propertyName)) {
+ Viewer viewer = (Viewer) object;
+ SimpleValueProperty property = (SimpleValueProperty) ViewerProperties.singleSelection();
IObservableValue observableValue = new SimplePropertyObservableValue(XWT.getRealm(), viewer, property);
return new TypedViewerObservableValueDecorator(observableValue, viewer);
}
- return observePropertyValue((Viewer)object, propertyName, updateSourceTrigger);
- } else if(object instanceof MenuItem) {
+ return observePropertyValue((Viewer) object, propertyName, updateSourceTrigger);
+ } else if (object instanceof MenuItem) {
//
// TODO https://bugs.eclipse.org/bugs/show_bug.cgi?id=280157
// testcase:
// org.eclipse.papyrus.xwt.tests.databinding.bindcontrol.BindMenuItem
//
- if(ENABLED.equalsIgnoreCase(propertyName)) {
- return new MenuItemEnabledObservableValue((MenuItem)object);
- } else if(SELECTION.equalsIgnoreCase(propertyName)) {
- return new MenuItemSelectionObservableValue((MenuItem)object);
+ if (ENABLED.equalsIgnoreCase(propertyName)) {
+ return new MenuItemEnabledObservableValue((MenuItem) object);
+ } else if (SELECTION.equalsIgnoreCase(propertyName)) {
+ return new MenuItemSelectionObservableValue((MenuItem) object);
}
- } else if(object instanceof Control) {
- return observePropertyValue((Control)object, propertyName, updateSourceTrigger);
+ } else if (object instanceof Control) {
+ return observePropertyValue((Control) object, propertyName, updateSourceTrigger);
}
return null;
}
protected static boolean isControlValueProperty(Class<?> type, String propertyName) {
- if(TEXT.equalsIgnoreCase(propertyName)) {
- if(Text.class.isAssignableFrom(type)) {
+ if (TEXT.equalsIgnoreCase(propertyName)) {
+ if (Text.class.isAssignableFrom(type)) {
return true;
}
// widget button is not supported at 3.4 version.
- if(SWT.getVersion() == 3449 && Button.class.isAssignableFrom(type)) {
+ if (SWT.getVersion() == 3449 && Button.class.isAssignableFrom(type)) {
return false;
}
}
@@ -333,12 +333,12 @@ public class JFaceXWTDataBinding {
Method method;
try {
method = SWTObservables.class.getMethod(getterName, CONTROL_ARGUMENT_TYPES);
- if(method == null) {
- for(Method element : SWTObservables.class.getMethods()) {
- if(element.getParameterTypes().length != 0) {
+ if (method == null) {
+ for (Method element : SWTObservables.class.getMethods()) {
+ if (element.getParameterTypes().length != 0) {
continue;
}
- if(element.getName().equalsIgnoreCase(getterName)) {
+ if (element.getName().equalsIgnoreCase(getterName)) {
return true;
}
}
@@ -348,17 +348,17 @@ public class JFaceXWTDataBinding {
}
IMetaclass mateclass = XWT.getMetaclass(type);
IProperty property = mateclass.findProperty(propertyName);
- if(property instanceof EventProperty) {
+ if (property instanceof EventProperty) {
return true;
}
return false;
}
protected static IObservableValue observePropertyValue(Control control, String propertyName, UpdateSourceTrigger updateSourceTrigger) {
- if(TEXT.equalsIgnoreCase(propertyName)) {
- if(control instanceof Text || control instanceof StyledText) {
+ if (TEXT.equalsIgnoreCase(propertyName)) {
+ if (control instanceof Text || control instanceof StyledText) {
int event = SWT.None;
- switch(updateSourceTrigger) {
+ switch (updateSourceTrigger) {
case Default:
event = SWT.FocusOut;
break;
@@ -372,44 +372,44 @@ public class JFaceXWTDataBinding {
throw new IllegalStateException("UpdateSourceTrigger of value " + updateSourceTrigger.name());
}
IObservableValue observableValue = SWTObservables.observeText(control, event);
- if(observableValue != null) {
+ if (observableValue != null) {
return observableValue;
}
}
// widget button is not supported at 3.4 version.
- if(SWT.getVersion() == 3449 && control instanceof Button) {
+ if (SWT.getVersion() == 3449 && control instanceof Button) {
return null;
}
try {
IObservableValue observableValue = SWTObservables.observeText(control);
- if(observableValue != null) {
+ if (observableValue != null) {
return observableValue;
}
} catch (IllegalArgumentException e) {
throw new XWTException(e);
}
} else {
- if(propertyName == null) {
+ if (propertyName == null) {
return null;
}
String getterName = "observe" + propertyName.substring(0, 1).toUpperCase() + propertyName.substring(1);
Method method;
try {
method = SWTObservables.class.getMethod(getterName, CONTROL_ARGUMENT_TYPES);
- if(method == null) {
- for(Method element : SWTObservables.class.getMethods()) {
- if(element.getParameterTypes().length != 0) {
+ if (method == null) {
+ for (Method element : SWTObservables.class.getMethods()) {
+ if (element.getParameterTypes().length != 0) {
continue;
}
- if(element.getName().equalsIgnoreCase(getterName)) {
+ if (element.getName().equalsIgnoreCase(getterName)) {
method = element;
break;
}
}
}
- if(method != null) {
- IObservableValue observableValue = (IObservableValue)method.invoke(null, control);
- if(observableValue != null) {
+ if (method != null) {
+ IObservableValue observableValue = (IObservableValue) method.invoke(null, control);
+ if (observableValue != null) {
return observableValue;
}
}
@@ -419,8 +419,8 @@ public class JFaceXWTDataBinding {
}
IMetaclass mateclass = XWT.getMetaclass(control);
IProperty property = mateclass.findProperty(propertyName);
- if(property instanceof EventProperty) {
- return new EventPropertyObservableValue(control, (EventProperty)property);
+ if (property instanceof EventProperty) {
+ return new EventPropertyObservableValue(control, (EventProperty) property);
}
return null;
}
@@ -429,12 +429,12 @@ public class JFaceXWTDataBinding {
String getterName = "observe" + property.substring(0, 1).toUpperCase() + property.substring(1);
try {
Method method = ViewersObservables.class.getMethod(getterName, VIEWER_ARGUMENT_TYPES);
- if(method == null) {
- for(Method element : ViewersObservables.class.getMethods()) {
- if(element.getParameterTypes().length != 0) {
+ if (method == null) {
+ for (Method element : ViewersObservables.class.getMethods()) {
+ if (element.getParameterTypes().length != 0) {
continue;
}
- if(element.getName().equalsIgnoreCase(getterName)) {
+ if (element.getName().equalsIgnoreCase(getterName)) {
return true;
}
}
@@ -450,20 +450,20 @@ public class JFaceXWTDataBinding {
Method method;
try {
method = ViewersObservables.class.getMethod(getterName, VIEWER_ARGUMENT_TYPES);
- if(method == null) {
- for(Method element : ViewersObservables.class.getMethods()) {
- if(element.getParameterTypes().length != 0) {
+ if (method == null) {
+ for (Method element : ViewersObservables.class.getMethods()) {
+ if (element.getParameterTypes().length != 0) {
continue;
}
- if(element.getName().equalsIgnoreCase(getterName)) {
+ if (element.getName().equalsIgnoreCase(getterName)) {
method = element;
break;
}
}
}
- if(method != null) {
- IObservable observableValue = (IObservable)method.invoke(null, viewer);
- if(observableValue != null) {
+ if (method != null) {
+ IObservable observableValue = (IObservable) method.invoke(null, viewer);
+ if (observableValue != null) {
return observableValue;
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ListToArrayObservableValue.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ListToArrayObservableValue.java
index c8fc9d322b3..c5c45f8b33d 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ListToArrayObservableValue.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/ListToArrayObservableValue.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -24,7 +24,7 @@ import org.eclipse.core.databinding.observable.value.IObservableValue;
/**
* Manage the Array to List and then update from List to Array
- *
+ *
* @author yyang
*/
public class ListToArrayObservableValue extends AbstractObservableValue {
@@ -57,10 +57,12 @@ public class ListToArrayObservableValue extends AbstractObservableValue {
});
}
+ @Override
protected Object doGetValue() {
return source;
}
+ @Override
protected void doSetValue(Object value) {
super.doSetValue(value);
}
@@ -80,9 +82,9 @@ public class ListToArrayObservableValue extends AbstractObservableValue {
protected void handleChange() {
try {
- Object elements = Array.newInstance((Class<?>)getValueType(), source.size());
- Object[] objects = source.toArray((Object[])elements);
- if(cacheData == null) {
+ Object elements = Array.newInstance((Class<?>) getValueType(), source.size());
+ Object[] objects = source.toArray((Object[]) elements);
+ if (cacheData == null) {
cacheData = target.getValue();
}
target.setValue(objects);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/TypedViewerObservableValueDecorator.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/TypedViewerObservableValueDecorator.java
index 86855d66a73..dfe6df7bed0 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/TypedViewerObservableValueDecorator.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/TypedViewerObservableValueDecorator.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -32,15 +32,15 @@ public class TypedViewerObservableValueDecorator extends ViewerObservableValueDe
@Override
public boolean equals(Object obj) {
- if(!(obj instanceof TypedViewerObservableValueDecorator)) {
+ if (!(obj instanceof TypedViewerObservableValueDecorator)) {
return false;
}
- TypedViewerObservableValueDecorator decorator = (TypedViewerObservableValueDecorator)obj;
- if(elementType != null) {
- if(!elementType.equals(decorator.elementType)) {
+ TypedViewerObservableValueDecorator decorator = (TypedViewerObservableValueDecorator) obj;
+ if (elementType != null) {
+ if (!elementType.equals(decorator.elementType)) {
return false;
}
- } else if(decorator.elementType != null) {
+ } else if (decorator.elementType != null) {
return false;
}
return super.equals(obj);
@@ -48,7 +48,7 @@ public class TypedViewerObservableValueDecorator extends ViewerObservableValueDe
@Override
public int hashCode() {
- if(elementType == null) {
+ if (elementType == null) {
return super.hashCode();
}
return elementType.hashCode() * super.hashCode();
@@ -57,7 +57,7 @@ public class TypedViewerObservableValueDecorator extends ViewerObservableValueDe
@Override
public Object getValueType() {
Object elementType = getElementType();
- if(elementType != null) {
+ if (elementType != null) {
return elementType;
}
return super.getValueType();
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/XWTObservableValue.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/XWTObservableValue.java
index 5da1f172c7a..4289370fcfe 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/XWTObservableValue.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/databinding/XWTObservableValue.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -20,7 +20,7 @@ import org.eclipse.papyrus.xwt.XWT;
/**
* Notes: Binding type is java.lang.String.
- *
+ *
* @author jliu (jin.liu@soyatec.com)
*/
public abstract class XWTObservableValue extends AbstractObservableValue implements IObserving {
@@ -38,7 +38,7 @@ public abstract class XWTObservableValue extends AbstractObservableValue impleme
private boolean updating = false;
/**
- *
+ *
*/
public XWTObservableValue(Class<?> valueType, Object observed, String path) {
super(XWT.getRealm());
@@ -52,11 +52,11 @@ public abstract class XWTObservableValue extends AbstractObservableValue impleme
* Add listener to observed.
*/
private void init() {
- if(eventListener == null) {
+ if (eventListener == null) {
eventListener = new EventListener() {
public void handleEvent(Event evt) {
- if(!updating) {
+ if (!updating) {
final ValueDiff diff = Diffs.createValueDiff(evt.getOldValue(), evt.getNewValue());
getRealm().exec(new Runnable() {
@@ -84,11 +84,12 @@ public abstract class XWTObservableValue extends AbstractObservableValue impleme
*
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doSetValue(java.lang.Object)
*/
+ @Override
protected void doSetValue(Object value) {
updating = true;
Object oldValue = doGetValue();
value = convert(oldValue == null ? null : oldValue.getClass(), value);
- if(!Util.equals(oldValue, value)) {
+ if (!Util.equals(oldValue, value)) {
doSetApprovedValue(value);
fireValueChange(Diffs.createValueDiff(oldValue, value));
eventManager.dispatchEvent(new Event(observed, oldValue, value, getPath()));
@@ -101,12 +102,12 @@ public abstract class XWTObservableValue extends AbstractObservableValue impleme
* @return
*/
protected Object convert(Class type, Object value) {
- if(value != null) {
- if(type != null && type.isEnum() && value instanceof String) {
- return Enum.valueOf(type, (String)value);
+ if (value != null) {
+ if (type != null && type.isEnum() && value instanceof String) {
+ return Enum.valueOf(type, (String) value);
}
- IConverter c = XWT.findConvertor(value.getClass(), (Class<?>)getValueType());
- if(c != null) {
+ IConverter c = XWT.findConvertor(value.getClass(), getValueType());
+ if (c != null) {
return c.convert(value);
}
}
@@ -123,6 +124,7 @@ public abstract class XWTObservableValue extends AbstractObservableValue impleme
*
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doGetValue()
*/
+ @Override
protected Object doGetValue() {
return observed;
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/AbstractDataProvider.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/AbstractDataProvider.java
index e325a673093..f5d013b2d47 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/AbstractDataProvider.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/AbstractDataProvider.java
@@ -52,7 +52,7 @@ public abstract class AbstractDataProvider implements IDataProvider {
public IObservable observe(Object data, String path, Object elementType, int observeKind) {
Object type = null;
- if(elementType == null) {
+ if (elementType == null) {
type = getModelService().toModelType(data);
} else {
type = elementType;
@@ -60,62 +60,62 @@ public abstract class AbstractDataProvider implements IDataProvider {
Object propertyType = getModelService().toModelPropertyType(type, path);
Class<?> propertyTypeClass = null;
- if(propertyType instanceof Class<?>) {
- propertyTypeClass = (Class<?>)propertyType;
- if(IBinding.class.isAssignableFrom(propertyTypeClass)) {
+ if (propertyType instanceof Class<?>) {
+ propertyTypeClass = (Class<?>) propertyType;
+ if (IBinding.class.isAssignableFrom(propertyTypeClass)) {
return null;
}
}
- switch(observeKind) {
+ switch (observeKind) {
case ScopeManager.AUTO:
- if(propertyTypeClass != null && (propertyTypeClass.isArray() || List.class.isAssignableFrom(propertyTypeClass))) {
- if(data instanceof IObservableValue) {
- IObservableValue observable = (IObservableValue)data;
+ if (propertyTypeClass != null && (propertyTypeClass.isArray() || List.class.isAssignableFrom(propertyTypeClass))) {
+ if (data instanceof IObservableValue) {
+ IObservableValue observable = (IObservableValue) data;
return observeDetailList(observable, type, path, propertyType);
}
return observeList(data, path);
- } else if(propertyTypeClass != null && (Set.class.isAssignableFrom(propertyTypeClass))) {
- if(data instanceof IObservableValue) {
- IObservableValue observable = (IObservableValue)data;
+ } else if (propertyTypeClass != null && (Set.class.isAssignableFrom(propertyTypeClass))) {
+ if (data instanceof IObservableValue) {
+ IObservableValue observable = (IObservableValue) data;
return observeDetailSet(observable, type, path, propertyType);
}
return observeSet(data, path);
} else {
- if(data instanceof IObservableValue) {
- IObservableValue observable = (IObservableValue)data;
+ if (data instanceof IObservableValue) {
+ IObservableValue observable = (IObservableValue) data;
return observeDetailValue(observable, type, path, propertyType);
}
return observeValue(data, path);
}
case ScopeManager.VALUE:
- if(data instanceof IObservableValue) {
- IObservableValue observable = (IObservableValue)data;
+ if (data instanceof IObservableValue) {
+ IObservableValue observable = (IObservableValue) data;
return observeDetailValue(observable, type, path, propertyType);
}
return observeValue(data, path);
case ScopeManager.COLLECTION:
- if(propertyTypeClass != null && Set.class.isAssignableFrom(propertyTypeClass)) {
- if(data instanceof IObservableValue) {
- IObservableValue observable = (IObservableValue)data;
+ if (propertyTypeClass != null && Set.class.isAssignableFrom(propertyTypeClass)) {
+ if (data instanceof IObservableValue) {
+ IObservableValue observable = (IObservableValue) data;
return observeDetailSet(observable, type, path, propertyType);
}
return observeSet(data, path);
}
- if(data instanceof IObservableValue) {
- IObservableValue observable = (IObservableValue)data;
+ if (data instanceof IObservableValue) {
+ IObservableValue observable = (IObservableValue) data;
return observeDetailList(observable, type, path, propertyType);
}
return observeList(data, path);
case ScopeManager.SET:
- if(data instanceof IObservableValue) {
- IObservableValue observable = (IObservableValue)data;
+ if (data instanceof IObservableValue) {
+ IObservableValue observable = (IObservableValue) data;
return observeDetailSet(observable, type, path, propertyType);
}
return observeSet(data, path);
case ScopeManager.LIST:
- if(data instanceof IObservableValue) {
- IObservableValue observable = (IObservableValue)data;
+ if (data instanceof IObservableValue) {
+ IObservableValue observable = (IObservableValue) data;
return observeDetailList(observable, type, path, propertyType);
}
return observeList(data, path);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/IObjectDataProvider.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/IObjectDataProvider.java
index 668af6c9ed0..6eead72aa82 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/IObjectDataProvider.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/IObjectDataProvider.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.dataproviders;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/ObjectDataProvider.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/ObjectDataProvider.java
index 04e4db8ee5d..b945f10a8ab 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/ObjectDataProvider.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/dataproviders/ObjectDataProvider.java
@@ -49,7 +49,7 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
IMetaclass metaclass = XWT.getMetaclass(type);
IProperty property = metaclass.findProperty(propertyName);
- if(property == null) {
+ if (property == null) {
throw new XWTException(" Property \"" + propertyName + "\" is not found in the class " + metaclass.getType().getName());
}
return property.getType();
@@ -91,7 +91,7 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
* org.eclipse.papyrus.xwt.dataproviders.IObjectDataProvider#getObjectInstance()
*/
public Object getObjectInstance() {
- if(objectInstance == null && objectType != null) {
+ if (objectInstance == null && objectType != null) {
try {
objectInstance = objectType.newInstance();
} catch (Exception e) {
@@ -107,7 +107,7 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
* @see org.eclipse.papyrus.xwt.dataproviders.IObjectDataProvider#getObjectType()
*/
public Class<?> getObjectType() {
- if(objectType == null && objectInstance != null) {
+ if (objectType == null && objectInstance != null) {
objectType = objectInstance.getClass();
}
return objectType;
@@ -159,20 +159,20 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
protected Object getTarget() {
Object target = getObjectInstance();
- if(target == null) {
+ if (target == null) {
return null;
}
Class<?> targetType = getObjectType();
Method method = null;
- if(methodName != null) {
+ if (methodName != null) {
List<Class<?>> paras = new ArrayList<Class<?>>();
- if(methodParameters != null) {
- for(Object p : methodParameters) {
+ if (methodParameters != null) {
+ for (Object p : methodParameters) {
paras.add(p.getClass());
}
}
try {
- if(paras.isEmpty()) {
+ if (paras.isEmpty()) {
method = targetType.getDeclaredMethod(methodName);
return method.invoke(target);
} else {
@@ -196,7 +196,7 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
* org.eclipse.papyrus.xwt.dataproviders.IDataProvider#getData(java.lang.String)
*/
public Object getData(String path) {
- if(path == null) {
+ if (path == null) {
return getTarget();
}
return getData(getTarget(), path);
@@ -209,14 +209,14 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
* org.eclipse.papyrus.xwt.dataproviders.IDataProvider#getData(java.lang.String)
*/
public Object getData(Object object, String path) {
- if(object instanceof IObservableValue) {
- object = ((IObservableValue)object).getValue();
+ if (object instanceof IObservableValue) {
+ object = ((IObservableValue) object).getValue();
}
- if(path == null || path.trim().length() == 0 || path.equals(".")) {
+ if (path == null || path.trim().length() == 0 || path.equals(".")) {
return JFaceXWTDataBinding.getValue(object, null);
}
int index = path.indexOf(".");
- while(index != -1 && object != null) {
+ while (index != -1 && object != null) {
object = JFaceXWTDataBinding.getValue(object, path.substring(0, index));
path = path.substring(index + 1);
index = path.indexOf(".");
@@ -225,11 +225,11 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
}
public void setData(Object object, String path, Object value) {
- if(object instanceof IObservableValue) {
- object = ((IObservableValue)object).getValue();
+ if (object instanceof IObservableValue) {
+ object = ((IObservableValue) object).getValue();
}
int index = path.indexOf(".");
- while(index != -1 && object != null) {
+ while (index != -1 && object != null) {
object = JFaceXWTDataBinding.getValue(object, path.substring(0, index));
path = path.substring(index + 1);
index = path.indexOf(".");
@@ -250,11 +250,11 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
*/
public Class<?> getDataType(String path) {
Object target = getTarget();
- if(target == null) {
+ if (target == null) {
return null;
}
Class<?> type = JFaceXWTDataBinding.toType(target);
- if(path == null) {
+ if (path == null) {
return type;
}
return JFaceXWTDataBinding.getValueType(type, path);
@@ -262,21 +262,22 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
/**
* check if the property is read only
- *
+ *
* @param path
* @return
*/
+ @Override
public boolean isPropertyReadOnly(String path) {
Object target = getTarget();
- if(target == null || path == null) {
+ if (target == null || path == null) {
return true;
}
- if(target instanceof IBinding) {
- target = ((IBinding)target).getValue(null);
+ if (target instanceof IBinding) {
+ target = ((IBinding) target).getValue(null);
}
Class<?> type = JFaceXWTDataBinding.toType(target);
int index = path.indexOf(".");
- while(index != -1 && target != null) {
+ while (index != -1 && target != null) {
type = JFaceXWTDataBinding.getValueType(type, path.substring(0, index));
path = path.substring(index + 1);
index = path.indexOf(".");
@@ -286,54 +287,59 @@ public class ObjectDataProvider extends AbstractDataProvider implements IObjectD
@Override
protected IObservableValue observeValue(Object bean, String propertyName) {
- if(JFaceXWTDataBinding.isBeanSupport(bean)) {
+ if (JFaceXWTDataBinding.isBeanSupport(bean)) {
return BeansObservables.observeValue(XWT.getRealm(), bean, propertyName);
}
return PojoObservables.observeValue(XWT.getRealm(), bean, propertyName);
}
+ @Override
protected IObservableList observeList(Object bean, String propertyName) {
- if(JFaceXWTDataBinding.isBeanSupport(bean)) {
+ if (JFaceXWTDataBinding.isBeanSupport(bean)) {
return BeansObservables.observeList(XWT.getRealm(), bean, propertyName);
}
return PojoObservables.observeList(XWT.getRealm(), bean, propertyName);
}
+ @Override
protected IObservableSet observeSet(Object bean, String propertyName) {
- if(JFaceXWTDataBinding.isBeanSupport(bean)) {
+ if (JFaceXWTDataBinding.isBeanSupport(bean)) {
return BeansObservables.observeSet(XWT.getRealm(), bean, propertyName);
}
return PojoObservables.observeSet(XWT.getRealm(), bean, propertyName);
}
+ @Override
protected IObservableList observeDetailList(IObservableValue bean, Object elementType, String propertyName, Object propertyType) {
- if(JFaceXWTDataBinding.isBeanSupport(bean)) {
- return BeansObservables.observeDetailList(bean, propertyName, (Class<?>)propertyType);
+ if (JFaceXWTDataBinding.isBeanSupport(bean)) {
+ return BeansObservables.observeDetailList(bean, propertyName, (Class<?>) propertyType);
}
- return PojoObservables.observeDetailList(bean, propertyName, (Class<?>)propertyType);
+ return PojoObservables.observeDetailList(bean, propertyName, (Class<?>) propertyType);
}
+ @Override
protected IObservableSet observeDetailSet(IObservableValue bean, Object elementType, String propertyName, Object propertyType) {
- if(JFaceXWTDataBinding.isBeanSupport(bean)) {
- return BeansObservables.observeDetailSet(bean, propertyName, (Class<?>)propertyType);
+ if (JFaceXWTDataBinding.isBeanSupport(bean)) {
+ return BeansObservables.observeDetailSet(bean, propertyName, (Class<?>) propertyType);
}
- return PojoObservables.observeDetailSet(bean, propertyName, (Class<?>)propertyType);
+ return PojoObservables.observeDetailSet(bean, propertyName, (Class<?>) propertyType);
}
@Override
protected IObservableValue observeDetailValue(IObservableValue master, Object elementType, String propertyName, Object propertyType) {
- Class<?> beanClass = (Class<?>)elementType;
- if(beanClass == null && master.getValueType() instanceof Class<?>) {
- beanClass = (Class<?>)master.getValueType();
+ Class<?> beanClass = (Class<?>) elementType;
+ if (beanClass == null && master.getValueType() instanceof Class<?>) {
+ beanClass = (Class<?>) master.getValueType();
}
- if(JFaceXWTDataBinding.isBeanSupport(beanClass)) {
- return BeanProperties.value(beanClass, propertyName, (Class<?>)propertyType).observeDetail(master);
+ if (JFaceXWTDataBinding.isBeanSupport(beanClass)) {
+ return BeanProperties.value(beanClass, propertyName, (Class<?>) propertyType).observeDetail(master);
}
- return PojoProperties.value(beanClass, propertyName, (Class<?>)propertyType).observeDetail(master);
+ return PojoProperties.value(beanClass, propertyName, (Class<?>) propertyType).observeDetail(master);
}
+ @Override
public IValueProperty createValueProperty(Object type, String propertyName) {
- if(JFaceXWTDataBinding.isBeanSupport(type)) {
+ if (JFaceXWTDataBinding.isBeanSupport(type)) {
return BeanProperties.value(JFaceXWTDataBinding.toType(type), propertyName);
}
return PojoProperties.value(JFaceXWTDataBinding.toType(type), propertyName);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Color.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Color.java
index d111d2417a8..7d56cd89b06 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Color.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Color.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,7 +12,7 @@ package org.eclipse.papyrus.xwt.graphics;
/**
* Color consists of four elements: alpha, blue, green and red.
- *
+ *
* @author yyang
*/
public class Color {
@@ -67,7 +67,7 @@ public class Color {
}
public org.eclipse.swt.graphics.Color toSWTColor() {
- if(swtColor == null) {
+ if (swtColor == null) {
swtColor = new org.eclipse.swt.graphics.Color(null, red, green, blue);
}
return swtColor;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Point.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Point.java
index aa4f5bc311c..0d6f52524a7 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Point.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Point.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -12,12 +12,12 @@ package org.eclipse.papyrus.xwt.graphics;
/**
* Color consists of four elements: alpha, blue, green and red.
- *
+ *
* @author yyang
*/
public class Point {
- public static final Point[] EMPTY_ARRAY = new Point[]{};
+ public static final Point[] EMPTY_ARRAY = new Point[] {};
private double x;
@@ -49,10 +49,10 @@ public class Point {
@Override
public boolean equals(Object obj) {
- if(!(obj instanceof Point)) {
+ if (!(obj instanceof Point)) {
return false;
}
- Point point = (Point)obj;
+ Point point = (Point) obj;
return x == point.getX() && y == point.getY();
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Rect.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Rect.java
index 84c48a98984..f4d581e2fac 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Rect.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/graphics/Rect.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,7 +14,7 @@ import org.eclipse.swt.graphics.Rectangle;
/**
* Color consists of four elements: alpha, blue, green and red.
- *
+ *
* @author yyang
*/
public class Rect {
@@ -78,10 +78,10 @@ public class Rect {
@Override
public boolean equals(Object obj) {
- if(!(obj instanceof Rect)) {
+ if (!(obj instanceof Rect)) {
return false;
}
- Rect rect = (Rect)obj;
+ Rect rect = (Rect) obj;
return x == rect.getX() && y == rect.getY() && width == rect.getWidth() && height == rect.getHeight();
}
@@ -93,11 +93,11 @@ public class Rect {
/**
* Returns <code>true</code> if the point specified by the arguments is
* inside the area specified by the receiver, and <code>false</code> otherwise.
- *
+ *
* @param x
- * the x coordinate of the point to test for containment
+ * the x coordinate of the point to test for containment
* @param y
- * the y coordinate of the point to test for containment
+ * the y coordinate of the point to test for containment
* @return <code>true</code> if the rectangle contains the point and <code>false</code> otherwise
*/
public boolean contains(double x, double y) {
@@ -107,15 +107,15 @@ public class Rect {
/**
* Returns <code>true</code> if the given point is inside the area specified
* by the receiver, and <code>false</code> otherwise.
- *
+ *
* @param pt
- * the point to test for containment
+ * the point to test for containment
* @return <code>true</code> if the rectangle contains the point and <code>false</code> otherwise
- *
+ *
* @exception IllegalArgumentException
- * <ul>
- * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
- * </ul>
+ * <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
*/
public boolean contains(Point pt) {
return contains(pt.getX(), pt.getY());
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CanExecuteChangedListener.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CanExecuteChangedListener.java
index 036d5174ac1..e970c4eba81 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CanExecuteChangedListener.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CanExecuteChangedListener.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -13,7 +13,7 @@ package org.eclipse.papyrus.xwt.input;
import java.beans.PropertyChangeListener;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface CanExecuteChangedListener extends PropertyChangeListener {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CommandBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CommandBinding.java
index 43dd85e1dea..5d218ec853c 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CommandBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/CommandBinding.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,7 +14,7 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeSupport;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class CommandBinding {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ICommand.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ICommand.java
index ef7e905f582..f0d01c3c692 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ICommand.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ICommand.java
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt.input;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public interface ICommand {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/InputBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/InputBinding.java
index 98f5fa81592..8482f6c0b31 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/InputBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/InputBinding.java
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt.input;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class InputBinding {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyBinding.java
index 4a0cbf26ee4..59cb926695b 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyBinding.java
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt.input;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class KeyBinding extends InputBinding {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyGesture.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyGesture.java
index 3393500d72b..b8b3987c614 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyGesture.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/KeyGesture.java
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt.input;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class KeyGesture {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ModifierKeys.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ModifierKeys.java
index 7e221b9645c..77af985bac1 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ModifierKeys.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/ModifierKeys.java
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt.input;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public enum ModifierKeys {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/MouseAction.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/MouseAction.java
index ab9695580a4..3aefbb34e58 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/MouseAction.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/MouseAction.java
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
package org.eclipse.papyrus.xwt.input;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public enum MouseAction {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/RoutedCommand.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/RoutedCommand.java
index 92d52665286..fa11122427d 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/RoutedCommand.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/input/RoutedCommand.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -14,7 +14,7 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeSupport;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class RoutedCommand implements ICommand {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Binding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Binding.java
index fcfd5b3c162..55ae3dc40a8 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Binding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Binding.java
@@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Widget;
/**
* Generic Binding definition
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class Binding extends DynamicBinding {
@@ -55,14 +55,14 @@ public class Binding extends DynamicBinding {
* <p>
* Default
* </p>
- *
+ *
*/
private UpdateSourceTrigger updateSourceTrigger = UpdateSourceTrigger.Default;
private BindingExpressionPath pathSegments;
public BindingExpressionPath getPathPropertySegments() {
- if(pathSegments == null) {
+ if (pathSegments == null) {
pathSegments = new BindingExpressionPath(getPath());
}
return pathSegments;
@@ -94,8 +94,8 @@ public class Binding extends DynamicBinding {
public void setSource(Object source) {
this.source = source;
- if(this.source instanceof IObservable) {
- this.observableSource = (IObservable)this.source;
+ if (this.source instanceof IObservable) {
+ this.observableSource = (IObservable) this.source;
}
}
@@ -112,45 +112,45 @@ public class Binding extends DynamicBinding {
}
protected Object getSourceObject() {
- if(source != null) {
+ if (source != null) {
return source;
- } else if(elementName != null) {
+ } else if (elementName != null) {
return XWT.findElementByName(getControl(), elementName);
}
return null;
}
protected boolean isSelfBinding(Object data) {
- if(data != this) {
+ if (data != this) {
return false;
}
- Binding binding = (Binding)data;
+ Binding binding = (Binding) data;
return BindingExpressionPath.isEmptyPath(binding.getPath());
}
public Object createBoundSource() {
Object control = getControl();
Object source = getSourceObject();
- if(source == null) {
+ if (source == null) {
source = XWT.getDataContext(control, IDynamicBinding.class);
Object localDataContext = UserData.getLocalDataContext(control);
- if(localDataContext == this) {
+ if (localDataContext == this) {
return source;
}
}
- if(source instanceof IDynamicBinding) {
- Object value = ((IDynamicBinding)source).createBoundSource();
- if(value != null && path != null) {
+ if (source instanceof IDynamicBinding) {
+ Object value = ((IDynamicBinding) source).createBoundSource();
+ if (value != null && path != null) {
Widget widget = UserData.getWidget(value);
- if(widget == null) {
+ if (widget == null) {
widget = UserData.getWidget(control);
}
return ScopeManager.observeValue(widget, value, getPathPropertySegments(), getUpdateSourceTrigger());
}
}
- if(source != null && !BindingExpressionPath.isEmptyPath(path)) {
+ if (source != null && !BindingExpressionPath.isEmptyPath(path)) {
Widget widget = UserData.getWidget(source);
- if(widget == null) {
+ if (widget == null) {
widget = UserData.getWidget(control);
}
return ScopeManager.observeValue(widget, source, getPathPropertySegments(), getUpdateSourceTrigger());
@@ -160,38 +160,38 @@ public class Binding extends DynamicBinding {
public boolean isSourceControl() {
Object source = getSourceObject();
- if(source == null) {
+ if (source == null) {
Object dataContextHost = getDataContextHost();
- if(dataContextHost != null) {
+ if (dataContextHost != null) {
source = UserData.getLocalDataContext(dataContextHost);
}
}
- if(source instanceof IDynamicBinding) {
- return ((IDynamicBinding)source).isSourceControl();
+ if (source instanceof IDynamicBinding) {
+ return ((IDynamicBinding) source).isSourceControl();
}
- if(source instanceof IBinding) {
- source = ((IBinding)source).getValue(null);
+ if (source instanceof IBinding) {
+ source = ((IBinding) source).getValue(null);
}
- if(path == null) {
+ if (path == null) {
return false;
}
int index = BindingExpressionPath.lastIndexOf(path);
- if(index == -1) {
+ if (index == -1) {
return (source instanceof Control || source instanceof Viewer);
}
- if(source instanceof IDataProvider) {
+ if (source instanceof IDataProvider) {
return false;
}
String parentPath = path.substring(0, index);
IObservable observable = ScopeManager.observeValue(getControl(), source, parentPath, getUpdateSourceTrigger());
- if(observable != null) {
- IObservableValue observableValue = (IObservableValue)observable;
+ if (observable != null) {
+ IObservableValue observableValue = (IObservableValue) observable;
Object type = observableValue.getValueType();
- if(type != null) {
+ if (type != null) {
return UserData.isUIElementType(type);
}
}
@@ -200,14 +200,14 @@ public class Binding extends DynamicBinding {
public Object getValue(Class<?> targetType) {
Object dataContext = getSourceObject();
- if(dataContext == null) {
+ if (dataContext == null) {
Object dataContextHost = getDataContextHost();
- if(dataContextHost != null) {
+ if (dataContextHost != null) {
dataContext = UserData.getLocalDataContext(dataContextHost);
- if(dataContext instanceof IDynamicBinding) {
- IDynamicBinding dynamicBinding = (IDynamicBinding)dataContext;
+ if (dataContext instanceof IDynamicBinding) {
+ IDynamicBinding dynamicBinding = (IDynamicBinding) dataContext;
Object boundSource = dynamicBinding.createBoundSource();
- if(boundSource != null) {
+ if (boundSource != null) {
dataContext = boundSource;
}
}
@@ -215,14 +215,14 @@ public class Binding extends DynamicBinding {
}
// direct binding
- if(dataContext instanceof IBinding) {
- dataContext = ((IBinding)dataContext).getValue(null);
+ if (dataContext instanceof IBinding) {
+ dataContext = ((IBinding) dataContext).getValue(null);
}
IDataProvider dataProvider = getDataProvider(dataContext);
try {
- if(isSourceControl()) {
+ if (isSourceControl()) {
ControlDataBinding controlDataBinding = new ControlDataBinding(dataContext, this, dataProvider);
return controlDataBinding.getValue(targetType);
}
@@ -231,10 +231,10 @@ public class Binding extends DynamicBinding {
}
DataBinding dataBinding = null;
- if(dataProvider != null && (path != null || dataContext instanceof IObservable)) {
+ if (dataProvider != null && (path != null || dataContext instanceof IObservable)) {
dataBinding = new DataBinding(this, dataProvider);
}
- if(dataBinding != null) {
+ if (dataBinding != null) {
return dataBinding.getValue(targetType);
}
return convertedValue(dataContext);
@@ -242,7 +242,7 @@ public class Binding extends DynamicBinding {
private Object convertedValue(Object value) {
IValueConverter converter = getConverter();
- if(converter != null) {
+ if (converter != null) {
value = converter.convert(value);
}
return value;
@@ -267,7 +267,7 @@ public class Binding extends DynamicBinding {
/**
* Returns the validationRules for the binding
- *
+ *
* @return the array of validationRules
*/
public IValidationRule[] getValidationRules() {
@@ -276,11 +276,11 @@ public class Binding extends DynamicBinding {
/**
* Sets a single validationRule
- *
+ *
* @param validator
*/
public IValidationRule getValidationRule() {
- if(this.validationRules != null && this.validationRules.length > 0) {
+ if (this.validationRules != null && this.validationRules.length > 0) {
return this.validationRules[0];
}
return null;
@@ -288,7 +288,7 @@ public class Binding extends DynamicBinding {
/**
* Set the validationRules for the binding
- *
+ *
* @param validators
*/
public void setValidationRules(IValidationRule[] validationRules) {
@@ -297,11 +297,11 @@ public class Binding extends DynamicBinding {
/**
* Sets a single validationRule
- *
+ *
* @param validator
*/
public void setValidationRule(IValidationRule validationRule) {
- this.validationRules = new IValidationRule[]{ validationRule };
+ this.validationRules = new IValidationRule[] { validationRule };
}
public void reset() {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingExpressionPath.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingExpressionPath.java
index 975ce2bd512..4accebe278a 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingExpressionPath.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingExpressionPath.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -25,7 +25,7 @@ public class BindingExpressionPath {
protected String[] segments;
public BindingExpressionPath(String value) {
- if(value == null) {
+ if (value == null) {
return;
}
this.fullPath = value;
@@ -38,40 +38,37 @@ public class BindingExpressionPath {
int stripStart = 0;
int stripEnd = 0;
char[] array = value.toCharArray();
- for(int i = 0; i < array.length; i++) {
- switch(array[i]) {
- case '}':
- {
+ for (int i = 0; i < array.length; i++) {
+ switch (array[i]) {
+ case '}': {
Character character = separators.pop();
- if(character.charValue() != '{') {
+ if (character.charValue() != '{') {
throw new XWTException("Syntax error is binding expression " + value + " at " + i);
}
}
level--;
break;
- case ']':
- {
+ case ']': {
Character character = separators.pop();
- if(character.charValue() != '[') {
+ if (character.charValue() != '[') {
throw new XWTException("Syntax error is binding expression " + value + " at " + i);
}
}
level--;
break;
- case ')':
- {
+ case ')': {
Character character = separators.pop();
- if(character.charValue() != '(') {
+ if (character.charValue() != '(') {
throw new XWTException("Syntax error is binding expression " + value + " at " + i);
}
}
level--;
- if(level == 0) {
+ if (level == 0) {
stripEnd = i - 1;
}
break;
case '(':
- if(level == 0) {
+ if (level == 0) {
stripStart = i + 1;
}
separators.push(array[i]);
@@ -83,7 +80,7 @@ public class BindingExpressionPath {
level++;
break;
case '.':
- if(level == 0) {
+ if (level == 0) {
String element = value.substring(start, i);
element = ModelUtils.normalizePropertyName(element);
collector.add(element);
@@ -93,7 +90,7 @@ public class BindingExpressionPath {
break;
}
}
- if(level == 0) {
+ if (level == 0) {
String element = value.substring(start, array.length);
element = ModelUtils.normalizePropertyName(element);
collector.add(element);
@@ -105,16 +102,16 @@ public class BindingExpressionPath {
}
private void updateStripped(String value, int stripStart, int stripEnd, String element) {
- if(stripStart != 0) {
+ if (stripStart != 0) {
element = value.substring(stripStart, stripEnd + 1);
int index = element.lastIndexOf('.');
- if(index != -1) {
+ if (index != -1) {
element = element.substring(index + 1);
}
element = ModelUtils.normalizePropertyName(element);
}
- if(this.stripedPath == null) {
+ if (this.stripedPath == null) {
this.stripedPath = element;
} else {
this.stripedPath += "." + element;
@@ -145,30 +142,27 @@ public class BindingExpressionPath {
int level = 0;
Stack<Character> separators = new Stack<Character>();
char[] array = value.toCharArray();
- for(int i = array.length - 1; i >= 0; i--) {
- switch(array[i]) {
- case '{':
- {
+ for (int i = array.length - 1; i >= 0; i--) {
+ switch (array[i]) {
+ case '{': {
Character character = separators.pop();
- if(character.charValue() != '}') {
+ if (character.charValue() != '}') {
throw new XWTException("Syntax error is binding expression " + value + " at " + i);
}
}
level--;
break;
- case '[':
- {
+ case '[': {
Character character = separators.pop();
- if(character.charValue() != '}') {
+ if (character.charValue() != '}') {
throw new XWTException("Syntax error is binding expression " + value + " at " + i);
}
}
level--;
break;
- case '(':
- {
+ case '(': {
Character character = separators.pop();
- if(character.charValue() != ')') {
+ if (character.charValue() != ')') {
throw new XWTException("Syntax error is binding expression " + value + " at " + i);
}
}
@@ -181,13 +175,13 @@ public class BindingExpressionPath {
level++;
break;
case '.':
- if(level == 0) {
+ if (level == 0) {
return i;
}
break;
}
- if(array[i] == '.') {
+ if (array[i] == '.') {
}
}
return -1;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingGate.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingGate.java
index b5ff8b15466..57780bd495b 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingGate.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/BindingGate.java
@@ -56,15 +56,15 @@ public class BindingGate {
* org.eclipse.core.databinding.observable.value.IObservableValue)
*/
public Binding bind(IObservable source, IObservable target, IDataBindingInfo dataBinding) {
- if(source instanceof IObservableValue && target instanceof IObservableValue) {
- return bindValue((IObservableValue)source, (IObservableValue)target, dataBinding);
- } else if(source instanceof IObservableSet && target instanceof IObservableSet) {
+ if (source instanceof IObservableValue && target instanceof IObservableValue) {
+ return bindValue((IObservableValue) source, (IObservableValue) target, dataBinding);
+ } else if (source instanceof IObservableSet && target instanceof IObservableSet) {
IValueConverter converter = null;
int sourceToTargetPolicy = UpdateSetStrategy.POLICY_UPDATE;
int targetToSourcePolicy = UpdateSetStrategy.POLICY_UPDATE;
// Set policy to UpdateValueStrategy.
- if(dataBinding != null) {
- switch(dataBinding.getMode()) {
+ if (dataBinding != null) {
+ switch (dataBinding.getMode()) {
case OneWay:
targetToSourcePolicy = UpdateSetStrategy.POLICY_NEVER;
break;
@@ -79,14 +79,14 @@ public class BindingGate {
}
UpdateSetStrategy sourceToTarget = new UpdateSetStrategy(sourceToTargetPolicy);
UpdateSetStrategy targetToSource = new UpdateSetStrategy(targetToSourcePolicy);
- return bindSet((IObservableSet)target, (IObservableSet)source, targetToSource, sourceToTarget, converter);
- } else if(source instanceof IObservableList && target instanceof IObservableList) {
+ return bindSet((IObservableSet) target, (IObservableSet) source, targetToSource, sourceToTarget, converter);
+ } else if (source instanceof IObservableList && target instanceof IObservableList) {
IValueConverter converter = null;
int sourceToTargetPolicy = UpdateListStrategy.POLICY_UPDATE;
int targetToSourcePolicy = UpdateListStrategy.POLICY_UPDATE;
// Set policy to UpdateValueStrategy.
- if(dataBinding != null) {
- switch(dataBinding.getMode()) {
+ if (dataBinding != null) {
+ switch (dataBinding.getMode()) {
case OneWay:
targetToSourcePolicy = UpdateListStrategy.POLICY_NEVER;
break;
@@ -101,7 +101,7 @@ public class BindingGate {
}
UpdateListStrategy sourceToTarget = new UpdateListStrategy(sourceToTargetPolicy);
UpdateListStrategy targetToSource = new UpdateListStrategy(targetToSourcePolicy);
- return bindList((IObservableList)target, (IObservableList)source, targetToSource, sourceToTarget, converter);
+ return bindList((IObservableList) target, (IObservableList) source, targetToSource, sourceToTarget, converter);
}
throw new IllegalStateException();
@@ -116,7 +116,7 @@ public class BindingGate {
* org.eclipse.core.databinding.observable.value.IObservableValue)
*/
public Binding bindList(IObservableList source, IObservableList target, UpdateListStrategy sourceToTarget, UpdateListStrategy targetToSource, IValueConverter converter) {
- if(converter != null) {
+ if (converter != null) {
return bindList(source, target, sourceToTarget, targetToSource, converter, new InverseValueConverter(converter));
} else {
return bindList(source, target, sourceToTarget, targetToSource, null, null);
@@ -124,32 +124,32 @@ public class BindingGate {
}
/**
- *
+ *
* @param source
* @param target
* @param sourceToTarget
- * if it is null, the default converter will be update policy
+ * if it is null, the default converter will be update policy
* @param targetToSource
- * if it is null, the default converter will be update policy
+ * if it is null, the default converter will be update policy
* @param sourceToTargetConvertor
- * if it is null, the default converter will be used
+ * if it is null, the default converter will be used
* @param targetToSourceConvertor
- * if it is null, the default converter will be used
+ * if it is null, the default converter will be used
*/
public Binding bindList(IObservableList source, IObservableList target, UpdateListStrategy sourceToTarget, UpdateListStrategy targetToSource, IConverter sourceToTargetConvertor, IConverter targetToSourceConvertor) {
- if(source != null && target != null) {
- if(sourceToTarget == null) {
+ if (source != null && target != null) {
+ if (sourceToTarget == null) {
sourceToTarget = new UpdateListStrategy(UpdateListStrategy.POLICY_UPDATE);
}
- if(targetToSource == null) {
+ if (targetToSource == null) {
targetToSource = new UpdateListStrategy(UpdateListStrategy.POLICY_UPDATE);
}
- if(sourceToTargetConvertor != null) {
+ if (sourceToTargetConvertor != null) {
sourceToTarget.setConverter(sourceToTargetConvertor);
}
- if(targetToSourceConvertor != null) {
+ if (targetToSourceConvertor != null) {
targetToSource.setConverter(targetToSourceConvertor);
}
@@ -167,7 +167,7 @@ public class BindingGate {
* org.eclipse.core.databinding.observable.value.IObservableValue)
*/
public Binding bindSet(IObservableSet source, IObservableSet target, UpdateSetStrategy sourceToTarget, UpdateSetStrategy targetToSource, IValueConverter converter) {
- if(converter != null) {
+ if (converter != null) {
return bindSet(source, target, sourceToTarget, targetToSource, converter, new InverseValueConverter(converter));
} else {
return bindSet(source, target, sourceToTarget, targetToSource, null, null);
@@ -175,32 +175,32 @@ public class BindingGate {
}
/**
- *
+ *
* @param source
* @param target
* @param sourceToTarget
- * if it is null, the default converter will be update policy
+ * if it is null, the default converter will be update policy
* @param targetToSource
- * if it is null, the default converter will be update policy
+ * if it is null, the default converter will be update policy
* @param sourceToTargetConvertor
- * if it is null, the default converter will be used
+ * if it is null, the default converter will be used
* @param targetToSourceConvertor
- * if it is null, the default converter will be used
+ * if it is null, the default converter will be used
*/
public Binding bindSet(IObservableSet source, IObservableSet target, UpdateSetStrategy sourceToTarget, UpdateSetStrategy targetToSource, IConverter sourceToTargetConvertor, IConverter targetToSourceConvertor) {
- if(source != null && target != null) {
- if(sourceToTarget == null) {
+ if (source != null && target != null) {
+ if (sourceToTarget == null) {
sourceToTarget = new UpdateSetStrategy(UpdateSetStrategy.POLICY_UPDATE);
}
- if(targetToSource == null) {
+ if (targetToSource == null) {
targetToSource = new UpdateSetStrategy(UpdateSetStrategy.POLICY_UPDATE);
}
- if(sourceToTargetConvertor != null) {
+ if (sourceToTargetConvertor != null) {
sourceToTarget.setConverter(sourceToTargetConvertor);
}
- if(targetToSourceConvertor != null) {
+ if (targetToSourceConvertor != null) {
targetToSource.setConverter(targetToSourceConvertor);
}
@@ -210,32 +210,32 @@ public class BindingGate {
}
/**
- *
+ *
* @param source
* @param target
* @param sourceToTarget
- * if it is null, the default converter will be update policy
+ * if it is null, the default converter will be update policy
* @param targetToSource
- * if it is null, the default converter will be update policy
+ * if it is null, the default converter will be update policy
* @param sourceToTargetConvertor
- * if it is null, the default converter will be used
+ * if it is null, the default converter will be used
* @param targetToSourceConvertor
- * if it is null, the default converter will be used
+ * if it is null, the default converter will be used
*/
public Binding bind(IObservableList source, IObservableList target, UpdateListStrategy sourceToTarget, UpdateListStrategy targetToSource, IConverter sourceToTargetConvertor, IConverter targetToSourceConvertor) {
- if(source != null && target != null) {
- if(sourceToTarget == null) {
+ if (source != null && target != null) {
+ if (sourceToTarget == null) {
sourceToTarget = new UpdateListStrategy(UpdateListStrategy.POLICY_UPDATE);
}
- if(targetToSource == null) {
+ if (targetToSource == null) {
targetToSource = new UpdateListStrategy(UpdateListStrategy.POLICY_UPDATE);
}
- if(sourceToTargetConvertor != null) {
+ if (sourceToTargetConvertor != null) {
sourceToTarget.setConverter(sourceToTargetConvertor);
}
- if(targetToSourceConvertor != null) {
+ if (targetToSourceConvertor != null) {
targetToSource.setConverter(targetToSourceConvertor);
}
@@ -258,8 +258,8 @@ public class BindingGate {
int sourceToTargetPolicy = UpdateValueStrategy.POLICY_UPDATE;
int targetToSourcePolicy = UpdateValueStrategy.POLICY_UPDATE;
// Set policy to UpdateValueStrategy.
- if(dataBinding != null) {
- switch(dataBinding.getMode()) {
+ if (dataBinding != null) {
+ switch (dataBinding.getMode()) {
case OneWay:
targetToSourcePolicy = UpdateValueStrategy.POLICY_NEVER;
break;
@@ -282,9 +282,9 @@ public class BindingGate {
}
private void bindValidators(IValidationRule[] validators, UpdateValueStrategy sourceToTarget, UpdateValueStrategy targetToSource) {
- if(validators != null) {
- for(IValidationRule validator : validators) {
- switch(validator.getBindingMode()) {
+ if (validators != null) {
+ for (IValidationRule validator : validators) {
+ switch (validator.getBindingMode()) {
case SourceToTarget:
addValidatorToStrategy(sourceToTarget, validator);
break;
@@ -301,7 +301,7 @@ public class BindingGate {
}
private void addValidatorToStrategy(UpdateValueStrategy strategy, IValidationRule validator) {
- switch(validator.getPhase()) {
+ switch (validator.getPhase()) {
case AfterGet:
strategy.setAfterGetValidator(validator);
break;
@@ -323,7 +323,7 @@ public class BindingGate {
* org.eclipse.core.databinding.observable.value.IObservableValue)
*/
public Binding bind(IObservableValue source, IObservableValue target, UpdateValueStrategy sourceToTarget, UpdateValueStrategy targetToSource, IValueConverter converter) {
- if(converter != null) {
+ if (converter != null) {
return bind(source, target, sourceToTarget, targetToSource, converter, new InverseValueConverter(converter));
} else {
return bind(source, target, sourceToTarget, targetToSource, null, null);
@@ -331,69 +331,69 @@ public class BindingGate {
}
/**
- *
+ *
* @param source
* @param target
* @param sourceToTarget
- * if it is null, the default converter will be update policy
+ * if it is null, the default converter will be update policy
* @param targetToSource
- * if it is null, the default converter will be update policy
+ * if it is null, the default converter will be update policy
* @param sourceToTargetConvertor
- * if it is null, the default converter will be used
+ * if it is null, the default converter will be used
* @param targetToSourceConvertor
- * if it is null, the default converter will be used
+ * if it is null, the default converter will be used
*/
public Binding bind(IObservableValue source, IObservableValue target, UpdateValueStrategy sourceToTarget, UpdateValueStrategy targetToSource, IConverter sourceToTargetConvertor, IConverter targetToSourceConvertor) {
- if(source != null && target != null) {
- if(sourceToTarget == null) {
+ if (source != null && target != null) {
+ if (sourceToTarget == null) {
sourceToTarget = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
}
- if(targetToSource == null) {
+ if (targetToSource == null) {
targetToSource = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
}
// Add converter to UpdateValueStrategy.
IDataProvider sourceDataProvider = XWT.findDataProvider(source);
Object sourceValueType = sourceDataProvider.getDataType(null);
- if(sourceValueType == null) {
+ if (sourceValueType == null) {
sourceValueType = Object.class;
}
IDataProvider targetDataProvider = XWT.findDataProvider(target);
Object targetValueType = targetDataProvider.getDataType(null);
- if(targetValueType == null) {
+ if (targetValueType == null) {
targetValueType = Object.class;
}
- Class<?> sourceType = (sourceValueType instanceof Class<?>) ? (Class<?>)sourceValueType : sourceValueType.getClass();
- Class<?> targetType = (targetValueType instanceof Class<?>) ? (Class<?>)targetValueType : targetValueType.getClass();
- if(sourceType == null) {
+ Class<?> sourceType = (sourceValueType instanceof Class<?>) ? (Class<?>) sourceValueType : sourceValueType.getClass();
+ Class<?> targetType = (targetValueType instanceof Class<?>) ? (Class<?>) targetValueType : targetValueType.getClass();
+ if (sourceType == null) {
sourceType = Object.class;
} else {
sourceType = ObjectUtil.normalizedType(sourceType);
}
- if(targetType == null) {
+ if (targetType == null) {
targetType = Object.class;
} else {
targetType = ObjectUtil.normalizedType(targetType);
}
- if(sourceToTarget.getUpdatePolicy() != UpdateValueStrategy.POLICY_NEVER) {
- if(sourceToTargetConvertor != null) {
+ if (sourceToTarget.getUpdatePolicy() != UpdateValueStrategy.POLICY_NEVER) {
+ if (sourceToTargetConvertor != null) {
sourceToTarget.setConverter(sourceToTargetConvertor);
- } else if(!targetType.isAssignableFrom(sourceType)) {
+ } else if (!targetType.isAssignableFrom(sourceType)) {
IConverter m2t = XWT.findConvertor(sourceType, targetType);
- if(m2t != null) {
+ if (m2t != null) {
sourceToTarget.setConverter(m2t);
}
}
}
- if(targetToSource.getUpdatePolicy() != UpdateValueStrategy.POLICY_NEVER) {
- if(targetToSourceConvertor != null) {
+ if (targetToSource.getUpdatePolicy() != UpdateValueStrategy.POLICY_NEVER) {
+ if (targetToSourceConvertor != null) {
targetToSource.setConverter(targetToSourceConvertor);
- } else if(!sourceType.isAssignableFrom(targetType)) {
+ } else if (!sourceType.isAssignableFrom(targetType)) {
IConverter t2m = XWT.findConvertor(targetType, sourceType);
- if(t2m != null) {
+ if (t2m != null) {
targetToSource.setConverter(t2m);
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Core.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Core.java
index f28065ffbc5..8616058bd99 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Core.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/Core.java
@@ -4,11 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
* Christian W. Damus (CEA) - bug 417409
- *
+ *
*******************************************************************************/
package org.eclipse.papyrus.xwt.internal.core;
@@ -123,8 +123,8 @@ public class Core {
public void printInfo(String message, Tracking tracking, Set<Tracking> trackType) {
String printMessage = "";
- if(trackType != null && trackType.size() > 0) {
- if(trackType.contains(tracking)) {
+ if (trackType != null && trackType.size() > 0) {
+ if (trackType.contains(tracking)) {
printMessage = messageMap.get(tracking);
}
}
@@ -132,14 +132,14 @@ public class Core {
}
public void addMessage(String message, Tracking tracking) {
- if(messageMap.containsKey(tracking)) {
+ if (messageMap.containsKey(tracking)) {
messageMap.remove(tracking);
}
messageMap.put(tracking, message);
}
public void removeMessage(Tracking tracking) {
- if(messageMap.containsKey(tracking)) {
+ if (messageMap.containsKey(tracking)) {
messageMap.remove(tracking);
}
}
@@ -158,7 +158,7 @@ public class Core {
* @see org.eclipse.papyrus.xwt.IXWTLoader#getLogger()
*/
public ILogger getLogger() {
- if(logger == null) {
+ if (logger == null) {
return Core.nullLog;
}
return logger;
@@ -182,7 +182,7 @@ public class Core {
}
/**
- *
+ *
* @param nsmapace
* @param handler
*/
@@ -191,7 +191,7 @@ public class Core {
}
/**
- *
+ *
* @param nsmapace
*/
public void unregisterNamespaceHandler(String nsmapace) {
@@ -199,7 +199,7 @@ public class Core {
}
/**
- *
+ *
* @param nsmapace
* @return
*/
@@ -213,7 +213,7 @@ public class Core {
public IConverter getConverter(Class<?> type) {
IConverter converter = converters.get(type);
- if(converter != null) {
+ if (converter != null) {
return converter;
}
@@ -232,14 +232,14 @@ public class Core {
* java.lang.Class)
*/
public IConverter findConvertor(Class<?> source, Class<?> target) {
- if(source == target || (source != Object.class && source.isAssignableFrom(target))) {
+ if (source == target || (source != Object.class && source.isAssignableFrom(target))) {
return ObjectToObject.instance;
}
- if(String.class == source && target.isEnum()) {
+ if (String.class == source && target.isEnum()) {
return new StringToEnum(target);
}
- ValueConvertorRegister convertorRegister = (ValueConvertorRegister)getService(ValueConvertorRegister.class);
- if(convertorRegister == null) {
+ ValueConvertorRegister convertorRegister = (ValueConvertorRegister) getService(ValueConvertorRegister.class);
+ if (convertorRegister == null) {
return null;
}
return convertorRegister.findConverter(source, target);
@@ -253,9 +253,9 @@ public class Core {
* .conversion.IConverter)
*/
public void registerConvertor(IConverter converter) {
- Class<?> source = (Class<?>)converter.getFromType();
- Class<?> target = (Class<?>)converter.getToType();
- ValueConvertorRegister convertorRegister = (ValueConvertorRegister)getService(ValueConvertorRegister.class);
+ Class<?> source = (Class<?>) converter.getFromType();
+ Class<?> target = (Class<?>) converter.getToType();
+ ValueConvertorRegister convertorRegister = (ValueConvertorRegister) getService(ValueConvertorRegister.class);
convertorRegister.register(source, target, converter);
}
@@ -263,8 +263,8 @@ public class Core {
try {
Method method = converter.getDeclaredMethod(methodName);
Object object = method.invoke(null);
- if(object instanceof IConverter) {
- registerConvertor((IConverter)object);
+ if (object instanceof IConverter) {
+ registerConvertor((IConverter) object);
}
} catch (SecurityException e) {
} catch (IllegalArgumentException e) {
@@ -276,14 +276,14 @@ public class Core {
public void registerConvertor(Class<?> converterType, String methodName, boolean value) {
IConverter converter = loadConvertor(converterType, methodName, value);
- if(converter != null) {
+ if (converter != null) {
registerConvertor(converter);
}
}
public void registerConvertor(ValueConvertorRegister convertorRegister, Class<?> source, Class<?> target, Class<?> converterType, String methodName, boolean value) {
IConverter converter = loadConvertor(converterType, methodName, value);
- if(converter != null) {
+ if (converter != null) {
convertorRegister.register(source, target, converter);
}
}
@@ -292,8 +292,8 @@ public class Core {
try {
Method method = converter.getDeclaredMethod(methodName);
Object object = method.invoke(null, value);
- if(object instanceof IConverter) {
- return (IConverter)object;
+ if (object instanceof IConverter) {
+ return (IConverter) object;
}
} catch (SecurityException e) {
} catch (IllegalArgumentException e) {
@@ -310,8 +310,8 @@ public class Core {
* @see org.eclipse.papyrus.xwt.IXWTLoader#getConverterService()
*/
public ConverterService getConverterService() {
- ConverterService service = (ConverterService)getService(ConverterService.class);
- if(service == null) {
+ ConverterService service = (ConverterService) getService(ConverterService.class);
+ if (service == null) {
service = new ConverterService();
registerService(ConverterService.class, service);
service.register(Object.class, new IConverter() {
@@ -339,7 +339,7 @@ public class Core {
* org.eclipse.papyrus.xwt.IXWTLoader#addTracking(org.eclipse.papyrus.xwt.Tracking)
*/
public void addTracking(Tracking tracking) {
- if(!trackingSet.contains(tracking)) {
+ if (!trackingSet.contains(tracking)) {
trackingSet.add(tracking);
}
}
@@ -370,7 +370,7 @@ public class Core {
* org.eclipse.papyrus.xwt.IXWTLoader#removeTracking(org.eclipse.papyrus.xwt.Tracking)
*/
public void removeTracking(Tracking tracking) {
- if(trackingSet.contains(tracking)) {
+ if (trackingSet.contains(tracking)) {
trackingSet.remove(tracking);
}
}
@@ -450,7 +450,7 @@ public class Core {
* .IDataProviderFactory)
*/
public void addDataProviderFactory(String name, IDataProviderFactory dataProviderFactory) {
- if(dataProviderFactory == null) {
+ if (dataProviderFactory == null) {
return;
}
dataProviderFactories.put(name, dataProviderFactory);
@@ -474,7 +474,7 @@ public class Core {
* .xwt.IDataProviderFactory)
*/
public void removeDataProviderFactory(String name) {
- if(name == null) {
+ if (name == null) {
return;
}
dataProviderFactories.remove(name);
@@ -488,12 +488,12 @@ public class Core {
* .xwt.IDataProviderFactory)
*/
public void removeDataProviderFactory(IDataProviderFactory dataProviderFactory) {
- if(dataProviderFactory == null) {
+ if (dataProviderFactory == null) {
return;
}
- for(String name : dataProviderFactories.keySet()) {
+ for (String name : dataProviderFactories.keySet()) {
IDataProviderFactory value = dataProviderFactories.get(name);
- if(dataProviderFactory == value) {
+ if (dataProviderFactory == value) {
dataProviderFactories.remove(name);
}
}
@@ -514,12 +514,12 @@ public class Core {
* @see org.eclipse.papyrus.xwt.IXWTLoader#findDataProvider(java.lang.Object)
*/
public IDataProvider findDataProvider(Object dataContext) {
- if(dataContext instanceof IDataProvider) {
- return (IDataProvider)dataContext;
+ if (dataContext instanceof IDataProvider) {
+ return (IDataProvider) dataContext;
}
- for(IDataProviderFactory factory : dataProviderFactories.values()) {
+ for (IDataProviderFactory factory : dataProviderFactories.values()) {
IDataProvider dataProvider = factory.create(dataContext);
- if(dataProvider != null) {
+ if (dataProvider != null) {
return dataProvider;
}
}
@@ -534,7 +534,7 @@ public class Core {
* @see org.eclipse.papyrus.xwt.IXWTLoader#getLoadingContext()
*/
public ILoadingContext getLoadingContext() {
- if(_loadingContext == null) {
+ if (_loadingContext == null) {
return DefaultLoadingContext.defaultLoadingContext;
}
return _loadingContext;
@@ -564,22 +564,22 @@ public class Core {
}
public IMetaclass findMetaclass(Object object) {
- if(object instanceof Class<?>) {
- return getMetaclassService().findMetaclass((Class<?>)object);
+ if (object instanceof Class<?>) {
+ return getMetaclassService().findMetaclass((Class<?>) object);
}
return getMetaclassService().findMetaclass(object.getClass());
}
public IMetaclass getMetaclass(Object object) {
- if(object instanceof Class<?>) {
- return getMetaclassService().getMetaclass((Class<?>)object);
+ if (object instanceof Class<?>) {
+ return getMetaclassService().getMetaclass((Class<?>) object);
}
return getMetaclassService().getMetaclass(object.getClass());
}
public IMetaclass getMetaclass(Object object, String namespace) {
- if(object instanceof Class) {
- return getMetaclassService().getMetaclass((Class<?>)object, namespace);
+ if (object instanceof Class) {
+ return getMetaclassService().getMetaclass((Class<?>) object, namespace);
}
return getMetaclassService().getMetaclass(object.getClass(), namespace);
}
@@ -618,7 +618,7 @@ public class Core {
protected Object createCLRElement(IRenderingContext context, Element element, Map<String, Object> options) {
IVisualElementLoader loader = findElementLoader(element);
- if(loader != null) {
+ if (loader != null) {
return loader.createUIElement(element, options);
}
loader = createElementLoader(context, element);
@@ -629,10 +629,10 @@ public class Core {
protected IVisualElementLoader findElementLoader(DocumentObject element) {
IVisualElementLoader loader = elementsLoaders.get(element);
- if(loader != null) {
+ if (loader != null) {
return loader;
}
- if(element.getParent() != null) {
+ if (element.getParent() != null) {
return findElementLoader(element.getParent());
}
return null;
@@ -655,11 +655,11 @@ public class Core {
public IUIResource loadAsResource(InputStream stream, URL input, IBeforeParsingCallback parsingCallback) throws Exception {
ElementManager manager = new ElementManager();
Element element = null;
- if(stream == null) {
+ if (stream == null) {
element = manager.load(input, parsingCallback);
} else {
InputStream inputStream = stream;
- if(parsingCallback != null) {
+ if (parsingCallback != null) {
int size = stream.read();
byte[] buffer = new byte[size];
stream.read(buffer);
@@ -675,36 +675,36 @@ public class Core {
}
public Object load(ILoadingContext loadingContext, IUIResource pattern, Map<String, Object> options) throws Exception {
- UIResource uiResource = (UIResource)pattern;
+ UIResource uiResource = (UIResource) pattern;
Control control = null;
ElementManager manager = new ElementManager(uiResource.getURL());
Element element = uiResource.getContent();
IRenderingContext context = new ExtensionContext(loadingContext, manager, element.getNamespace());
Object visual = createCLRElement(context, element, options);
- if(visual instanceof Control) {
- control = (Control)visual;
- } else if(visual instanceof Viewer) {
- control = ((Viewer)visual).getControl();
+ if (visual instanceof Control) {
+ control = (Control) visual;
+ } else if (visual instanceof Viewer) {
+ control = ((Viewer) visual).getControl();
} else {
Class<?> jfaceWindow = Class.forName("org.eclipse.jface.window.Window");
- if(jfaceWindow != null && jfaceWindow.isInstance(visual)) {
+ if (jfaceWindow != null && jfaceWindow.isInstance(visual)) {
Method createMethod = jfaceWindow.getDeclaredMethod("create");
createMethod.invoke(visual);
Method method = jfaceWindow.getDeclaredMethod("getShell");
- control = (Control)method.invoke(visual);
+ control = (Control) method.invoke(visual);
}
}
- if(control instanceof Composite) {
+ if (control instanceof Composite) {
Object parent = options.get(IXWTLoader.CONTAINER_PROPERTY);
Object designMode = options.get(IXWTLoader.DESIGN_MODE_PROPERTY);
- if(parent instanceof Composite) {
- Composite parentComposite = (Composite)parent;
- if(parentComposite.getLayout() == null || designMode == Boolean.TRUE) {
+ if (parent instanceof Composite) {
+ Composite parentComposite = (Composite) parent;
+ if (parentComposite.getLayout() == null || designMode == Boolean.TRUE) {
autoLayout(parentComposite, element);
}
- } else if(parent == null || designMode == Boolean.TRUE) {
- if(control instanceof Shell) {
+ } else if (parent == null || designMode == Boolean.TRUE) {
+ if (control instanceof Shell) {
autoLayout(control, element);
} else {
autoLayout(control.getShell(), element);
@@ -719,24 +719,24 @@ public class Core {
long start = System.currentTimeMillis();
Control control = null;
ElementManager manager = new ElementManager();
- if(input != null) {
+ if (input != null) {
Element element = null;
IElementCache cache = getCache(options);
element = cache.getElement(input);
- if(element != null) {
+ if (element != null) {
manager.setRootElement(element);
-
+
// Got an element from the cache, so we don't need an input stream
- if(stream != null) {
+ if (stream != null) {
stream.close();
}
} else {
- if(stream == null) {
- element = manager.load(input, (IBeforeParsingCallback)options.get(IXWTLoader.BEFORE_PARSING_CALLBACK));
+ if (stream == null) {
+ element = manager.load(input, (IBeforeParsingCallback) options.get(IXWTLoader.BEFORE_PARSING_CALLBACK));
} else {
- IBeforeParsingCallback callback = (IBeforeParsingCallback)options.get(IXWTLoader.BEFORE_PARSING_CALLBACK);
+ IBeforeParsingCallback callback = (IBeforeParsingCallback) options.get(IXWTLoader.BEFORE_PARSING_CALLBACK);
InputStream inputStream = stream;
- if(callback != null) {
+ if (callback != null) {
int size = stream.read();
byte[] buffer = new byte[size];
stream.read(buffer);
@@ -749,46 +749,46 @@ public class Core {
element = manager.load(inputStream, input);
}
- if(cache != null) {
+ if (cache != null) {
cache.cache(input, element);
}
}
-
+
IRenderingContext context = new ExtensionContext(loadingContext, manager, manager.getRootElement().getNamespace());
Object visual = createCLRElement(context, element, options);
- if(TRACE_BENCH) {
+ if (TRACE_BENCH) {
System.out.println("Loaded: " + (System.currentTimeMillis() - start) + " " + input.toString());
}
- if(visual instanceof Control) {
- control = (Control)visual;
- } else if(visual instanceof Viewer) {
- control = ((Viewer)visual).getControl();
+ if (visual instanceof Control) {
+ control = (Control) visual;
+ } else if (visual instanceof Viewer) {
+ control = ((Viewer) visual).getControl();
} else {
Class<?> jfaceWindow = Class.forName("org.eclipse.jface.window.Window");
- if(jfaceWindow != null && jfaceWindow.isInstance(visual)) {
+ if (jfaceWindow != null && jfaceWindow.isInstance(visual)) {
Method createMethod = jfaceWindow.getDeclaredMethod("create");
createMethod.invoke(visual);
Method method = jfaceWindow.getDeclaredMethod("getShell");
- control = (Control)method.invoke(visual);
+ control = (Control) method.invoke(visual);
}
}
Object parent = options.get(IXWTLoader.CONTAINER_PROPERTY);
Object designMode = options.get(IXWTLoader.DESIGN_MODE_PROPERTY);
- if(control instanceof Composite) {
- if(parent instanceof Composite) {
- Composite parentComposite = (Composite)parent;
- if(parentComposite.getLayout() == null || designMode == Boolean.TRUE) {
+ if (control instanceof Composite) {
+ if (parent instanceof Composite) {
+ Composite parentComposite = (Composite) parent;
+ if (parentComposite.getLayout() == null || designMode == Boolean.TRUE) {
autoLayout(parentComposite, element);
}
- } else if(parent == null || designMode == Boolean.TRUE) {
- if(control instanceof Shell) {
+ } else if (parent == null || designMode == Boolean.TRUE) {
+ if (control instanceof Shell) {
autoLayout(control, element);
} else {
autoLayoutShell(control, element);
}
}
- } else if(control != null && (parent == null || designMode == Boolean.TRUE)) {
+ } else if (control != null && (parent == null || designMode == Boolean.TRUE)) {
autoLayoutShell(control, element);
}
}
@@ -797,56 +797,56 @@ public class Core {
private IElementCache getCache(Map<String, Object> options) {
Object option = (options == null) ? IElementCache.NULL : options.get(XML_CACHE_PROPERTY);
- if(option instanceof Boolean) {
+ if (option instanceof Boolean) {
// Enable caching according to the option
- if(((Boolean)option).booleanValue()) {
+ if (((Boolean) option).booleanValue()) {
option = new DefaultElementCache();
} else {
option = IElementCache.NULL;
}
options.put(XML_CACHE_PROPERTY, option);
- } else if(option instanceof Number) {
+ } else if (option instanceof Number) {
// create a default cache of this size
- option = new DefaultElementCache(((Number)option).intValue());
+ option = new DefaultElementCache(((Number) option).intValue());
options.put(XML_CACHE_PROPERTY, option);
- } else if(!(option instanceof IElementCache)) {
+ } else if (!(option instanceof IElementCache)) {
option = IElementCache.NULL;
options.put(XML_CACHE_PROPERTY, option);
}
- return (IElementCache)option;
+ return (IElementCache) option;
}
-
+
protected void autoLayout(Control composite, Element element) {
- if(element == null) {
+ if (element == null) {
return;
}
Attribute bounds = element.getAttribute("Bounds");
- if(bounds == null) {
+ if (bounds == null) {
bounds = element.getAttribute("Bounds", IConstants.XWT_NAMESPACE);
}
Attribute size = element.getAttribute("Size");
- if(size == null) {
+ if (size == null) {
size = element.getAttribute("Size", IConstants.XWT_NAMESPACE);
}
- if(bounds == null && size == null) {
+ if (bounds == null && size == null) {
composite.pack();
}
}
protected void autoLayoutShell(Control control, Element element) {
- if(element == null) {
+ if (element == null) {
return;
}
Attribute bounds = element.getAttribute("Bounds");
- if(bounds == null) {
+ if (bounds == null) {
bounds = element.getAttribute("Bounds", IConstants.XWT_NAMESPACE);
}
Attribute size = element.getAttribute("Size");
- if(size == null) {
+ if (size == null) {
size = element.getAttribute("Size", IConstants.XWT_NAMESPACE);
}
- if(bounds == null && size == null) {
+ if (bounds == null && size == null) {
control.pack();
} else {
Shell shell = control.getShell();
@@ -921,14 +921,14 @@ public class Core {
/**
* Check if the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public boolean isFileResolveType(Class<?> type) {
- for(Class<?> resolveType : resolveTypes) {
- if(resolveType.isAssignableFrom(type)) {
+ for (Class<?> resolveType : resolveTypes) {
+ if (resolveType.isAssignableFrom(type)) {
return true;
}
}
@@ -937,22 +937,22 @@ public class Core {
/**
* Register the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public void registerFileResolveType(Class<?> type) {
- if(!resolveTypes.contains(type)) {
+ if (!resolveTypes.contains(type)) {
resolveTypes.add(type);
}
}
/**
* Register the value of a property is to resolve.
- *
+ *
* @param type
- * type of property
+ * type of property
* @return
*/
public void unregisterFileResolveType(Class<?> type) {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DataBindingTrack.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DataBindingTrack.java
index 0dc91f5d574..4474146642a 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DataBindingTrack.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DataBindingTrack.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -33,7 +33,7 @@ import org.eclipse.swt.widgets.Widget;
/**
* @author liang.zhang
- *
+ *
*/
public class DataBindingTrack {
@@ -65,11 +65,11 @@ public class DataBindingTrack {
private int validateParentElementError(Element bindingElement) {
int isError = 0;
- if(!bindingError.equals("")) {
+ if (!bindingError.equals("")) {
Object parentObj = bindingElement.getParent();
- while(parentObj != null) {
- bindingElement = (Element)parentObj;
- if(errorElements.contains(bindingElement.getId())) {
+ while (parentObj != null) {
+ bindingElement = (Element) parentObj;
+ if (errorElements.contains(bindingElement.getId())) {
isError = 1;
break;
}
@@ -80,8 +80,8 @@ public class DataBindingTrack {
}
private String getCurrentWidgetPosition(Element element) {
- if(element.getParent() != null) {
- return " " + getCurrentWidgetPosition((Element)element.getParent());
+ if (element.getParent() != null) {
+ return " " + getCurrentWidgetPosition((Element) element.getParent());
}
return "";
}
@@ -90,27 +90,27 @@ public class DataBindingTrack {
StringBuffer message = new StringBuffer("");
Iterator<Element> widgetIt = widgetList.iterator();
Set<Element> keys = bindingMap.keySet();
- while(widgetIt.hasNext()) {
+ while (widgetIt.hasNext()) {
Element element = widgetIt.next();
int parentHasError = validateParentElementError(element);
- if(parentHasError == 0) {
+ if (parentHasError == 0) {
String content = getCurrentWidgetPosition(element);
- if(!message.toString().equals("")) {
+ if (!message.toString().equals("")) {
content += "+ ";
}
content = content + element.getName();
- if(XWT.isTracking(Tracking.NAME)) {
+ if (XWT.isTracking(Tracking.NAME)) {
Attribute nameAttr = element.getAttribute("Name");
- if(nameAttr == null) {
+ if (nameAttr == null) {
nameAttr = element.getAttribute(IConstants.XWT_X_NAMESPACE, "Name");
}
- if(nameAttr != null) {
+ if (nameAttr != null) {
content += " <" + nameAttr.getContent() + ">";
}
}
message.append(content);
- if(XWT.isTracking(Tracking.DATABINDING)) {
- if(keys.contains(element)) {
+ if (XWT.isTracking(Tracking.DATABINDING)) {
+ if (keys.contains(element)) {
message.append(bindingMap.get(element));
} else {
message.append("\n");
@@ -127,25 +127,27 @@ public class DataBindingTrack {
public void tracking(Object swtObject, Element element, Object dataContext) {
String bindingMessage = "";
- if(swtObject instanceof Binding) {
+ if (swtObject instanceof Binding) {
String error = "";
- Binding newInstance = (Binding)swtObject;
+ Binding newInstance = (Binding) swtObject;
String path = null;
Attribute attr = element.getAttribute("Path");
- if(null == attr)
+ if (null == attr) {
attr = element.getAttribute("path");
- if(null != attr)
+ }
+ if (null != attr) {
path = attr.getContent();
+ }
Object dataContext2 = null;
try {
dataContext2 = newInstance.getValue(null);
- if(path != null && path.length() > 0) {
+ if (path != null && path.length() > 0) {
String[] paths = path.trim().split("\\.");
- if(paths.length > 1) {
+ if (paths.length > 1) {
String path1 = "";
- for(int i = 0; i < paths.length - 1; i++) {
+ for (int i = 0; i < paths.length - 1; i++) {
path1 = paths[i];
- if(dataContext2 != null) {
+ if (dataContext2 != null) {
dataContext2 = getObserveData(dataContext2, path1);
}
}
@@ -156,26 +158,26 @@ public class DataBindingTrack {
setBindingErrorMessage("-> Error");
error = "-> Error";
}
- if(dataContext2 != null) {
+ if (dataContext2 != null) {
bindingMessage = " (DataContext=" + dataContext2.getClass().getSimpleName() + ", Path=" + path + ")" + error + "\n";
- addBindingMessageToMap((Element)element.getParent().getParent(), bindingMessage);// bindingMap.put((Element) element.getParent().getParent(), bindingMessage);
+ addBindingMessageToMap((Element) element.getParent().getParent(), bindingMessage);// bindingMap.put((Element) element.getParent().getParent(), bindingMessage);
}
- } else if(swtObject instanceof Widget) {
+ } else if (swtObject instanceof Widget) {
addWidgetElement(element);
- if(dataContext != null) {
+ if (dataContext != null) {
bindingMessage = " (DataContext=" + dataContext.getClass().getSimpleName() + ")\n";
addBindingMessageToMap(element, bindingMessage);
}
- } else if(JFacesHelper.isViewer(swtObject)) {
- if(dataContext != null) {
+ } else if (JFacesHelper.isViewer(swtObject)) {
+ if (dataContext != null) {
bindingMessage = " (DataContext=" + dataContext.getClass().getSimpleName() + ")\n";
addBindingMessageToMap(element, bindingMessage);// bindingMap.put(element, bindingMessage);
}
- } else if(element.attributeNames(IConstants.XWT_X_NAMESPACE).length > 0) {
+ } else if (element.attributeNames(IConstants.XWT_X_NAMESPACE).length > 0) {
// ??
- if(element.getParent() != null && element.getParent().getParent() != null) {
+ if (element.getParent() != null && element.getParent().getParent() != null) {
bindingMessage = " (DataContext=" + element.getName() + ")\n";
- addBindingMessageToMap((Element)element.getParent().getParent(), bindingMessage);// bindingMap.put((Element) element.getParent().getParent(), bindingMessage);
+ addBindingMessageToMap((Element) element.getParent().getParent(), bindingMessage);// bindingMap.put((Element) element.getParent().getParent(), bindingMessage);
}
}
}
@@ -184,7 +186,7 @@ public class DataBindingTrack {
try {
Class<?> dataContextClass = dataContext.getClass();
Method getMethod = ObjectUtil.findGetter(dataContextClass, path, null);
- if(getMethod != null) {
+ if (getMethod != null) {
return getMethod.invoke(dataContext);
}
} catch (SecurityException e) {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicBinding.java
index 370a43eff52..cd5c7e8295e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicBinding.java
@@ -29,7 +29,7 @@ import org.eclipse.swt.widgets.Widget;
/**
* Generic Binding definition
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public abstract class DynamicBinding implements IDynamicBinding {
@@ -59,7 +59,7 @@ public abstract class DynamicBinding implements IDynamicBinding {
* @see org.eclipse.papyrus.xwt.core.IDynamicBinding#getContextName()
*/
public IBindingContext getBindingContext() {
- if(this.bindingContext == null) {
+ if (this.bindingContext == null) {
Object element = (control == null ? host : control);
this.bindingContext = XWT.getBindingContext(element);
}
@@ -95,7 +95,7 @@ public abstract class DynamicBinding implements IDynamicBinding {
/**
* @param type
- * the type to set
+ * the type to set
*/
public void setType(String type) {
this.type = type;
@@ -122,16 +122,16 @@ public abstract class DynamicBinding implements IDynamicBinding {
protected Object getDataContextHost() {
Object control = getControl();
- if(control == null) {
+ if (control == null) {
return null;
}
Object data = UserData.getLocalDataContext(control);
- if(data == null || data == this) {
- if(data == null && UserData.hasLocalData(control, IUserDataConstants.XWT_DATACONTEXT_KEY)) {
+ if (data == null || data == this) {
+ if (data == null && UserData.hasLocalData(control, IUserDataConstants.XWT_DATACONTEXT_KEY)) {
return control;
}
Widget parent = UserData.getParent(control);
- if(parent != null) {
+ if (parent != null) {
return UserData.getDataContextHost(parent);
}
return null;
@@ -140,16 +140,16 @@ public abstract class DynamicBinding implements IDynamicBinding {
}
protected Object getDataContext() {
- if(control != null) {
+ if (control != null) {
return UserData.getDataContext(control);
}
return null;
}
protected IDataProvider getDataProvider(Object dataContext) {
- if(dataContext != null) {
- if(dataContext instanceof IDataProvider) {
- return (IDataProvider)dataContext;
+ if (dataContext != null) {
+ if (dataContext instanceof IDataProvider) {
+ return (IDataProvider) dataContext;
} else {
return xwtLoader.findDataProvider(dataContext);
}
@@ -162,16 +162,16 @@ public abstract class DynamicBinding implements IDynamicBinding {
}
protected Rectangle getControlBounds() {
- Widget widget = (Widget)getControl();
- if(widget instanceof Control) {
- Control control = (Control)widget;
+ Widget widget = (Widget) getControl();
+ if (widget instanceof Control) {
+ Control control = (Control) widget;
return control.getBounds();
}
Method drawMethod = findBoundsMethod(widget.getClass());
- if(drawMethod != null) {
+ if (drawMethod != null) {
try {
drawMethod.setAccessible(true);
- return (Rectangle)drawMethod.invoke(widget);
+ return (Rectangle) drawMethod.invoke(widget);
} catch (Exception e) {
throw new XWTException(e);
}
@@ -181,13 +181,13 @@ public abstract class DynamicBinding implements IDynamicBinding {
}
protected Control findHostControl() {
- Widget widget = (Widget)getControl();
+ Widget widget = (Widget) getControl();
Control host;
- if(widget instanceof Item) {
- Item item = (Item)widget;
- host = (Control)XWT.findParent(item, Control.class);
- } else if(widget instanceof Control) {
- host = (Control)widget;
+ if (widget instanceof Item) {
+ Item item = (Item) widget;
+ host = (Control) XWT.findParent(item, Control.class);
+ } else if (widget instanceof Control) {
+ host = (Control) widget;
} else {
throw new XWTException();
}
@@ -195,27 +195,27 @@ public abstract class DynamicBinding implements IDynamicBinding {
}
private Method findBoundsMethod(Class<?> type) {
- for(Method method : type.getDeclaredMethods()) {
- if(method.getAnnotation(UIBounds.class) != null && method.getTypeParameters().length == 0 && method.getReturnType() == Rectangle.class) {
+ for (Method method : type.getDeclaredMethods()) {
+ if (method.getAnnotation(UIBounds.class) != null && method.getTypeParameters().length == 0 && method.getReturnType() == Rectangle.class) {
return method;
}
}
Class<?> supertype = type.getSuperclass();
- if(supertype != null && supertype != Widget.class) {
+ if (supertype != null && supertype != Widget.class) {
Method method = findBoundsMethod(supertype);
- if(method != null) {
+ if (method != null) {
return method;
}
}
- for(Class<?> anInterface : type.getInterfaces()) {
+ for (Class<?> anInterface : type.getInterfaces()) {
Method method = findBoundsMethod(anInterface);
- if(method != null) {
+ if (method != null) {
return method;
}
}
try {
Method method = type.getDeclaredMethod("getBounds");
- if(method.getReturnType() == Rectangle.class) {
+ if (method.getReturnType() == Rectangle.class) {
return method;
}
} catch (Exception e) {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicValueBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicValueBinding.java
index 70d56d631ec..0db8c21cdba 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicValueBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/DynamicValueBinding.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassManager.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassManager.java
index d8a5a92cd53..13cd5781c6e 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassManager.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassManager.java
@@ -51,7 +51,7 @@ public class MetaclassManager {
public void register(IMetaclass metaclass) {
Class<?> type = metaclass.getType();
- if(classRegister.contains(type)) {
+ if (classRegister.contains(type)) {
return;
}
String key = type.getSimpleName();
@@ -65,12 +65,12 @@ public class MetaclassManager {
public IMetaclass register(Class<?> javaClass, IMetaclass superMetaclass) {
IMetaclass metaclass = getMetaclass(javaClass);
- if(metaclass != null) {
+ if (metaclass != null) {
return metaclass;
}
- if(superMetaclass == null) {
+ if (superMetaclass == null) {
Class<?> superclass = javaClass.getSuperclass();
- if(superclass != null && superclass != Object.class) {
+ if (superclass != null && superclass != Object.class) {
register(superclass, null);
}
superMetaclass = getMetaclass(superclass);
@@ -81,9 +81,9 @@ public class MetaclassManager {
}
protected IMetaclass createMetaclass(Class<?> javaClass, IMetaclass superMetaclass) {
- if(service != null) {
+ if (service != null) {
IMetaclassFactory factory = service.findFactory(javaClass);
- if(factory != null) {
+ if (factory != null) {
return factory.create(javaClass, superMetaclass, xwtLoader);
}
}
@@ -93,30 +93,30 @@ public class MetaclassManager {
public IMetaclass getMetaclass(ILoadingContext context, String name, String namespace) {
IMetaclass metaclass = nameRegister.get(name);
- if(metaclass != null) {
- if(namespace == null || namespace.equals(IConstants.XWT_NAMESPACE)) {
+ if (metaclass != null) {
+ if (namespace == null || namespace.equals(IConstants.XWT_NAMESPACE)) {
return metaclass;
}
- if(namespace != null && namespace.startsWith(IConstants.XAML_CLR_NAMESPACE_PROTO)) {
+ if (namespace != null && namespace.startsWith(IConstants.XAML_CLR_NAMESPACE_PROTO)) {
String packageName = namespace.substring(IConstants.XAML_CLR_NAMESPACE_PROTO.length());
int index = packageName.indexOf('=');
- if(index != -1) {
+ if (index != -1) {
packageName = packageName.substring(0, index);
}
// if using default package(null), use only name as class name,
// else use package.class as class name
String className = packageName.length() == 0 ? name : (packageName + "." + name);
- if(metaclass.getType().getName().equals(className)) {
+ if (metaclass.getType().getName().equals(className)) {
return metaclass;
}
}
}
- if(namespace == null || !namespace.startsWith(IConstants.XAML_CLR_NAMESPACE_PROTO)) {
+ if (namespace == null || !namespace.startsWith(IConstants.XAML_CLR_NAMESPACE_PROTO)) {
return null;
}
String packageName = namespace.substring(IConstants.XAML_CLR_NAMESPACE_PROTO.length());
int index = packageName.indexOf('=');
- if(index != -1) {
+ if (index != -1) {
packageName = packageName.substring(0, index);
}
// if using default package(null), use only name as class name, else use
@@ -124,7 +124,7 @@ public class MetaclassManager {
String className = packageName.length() == 0 ? name : (packageName + "." + name);
// try {
Class<?> type = ClassLoaderUtil.loadClass(context, className);
- if(type == null) {
+ if (type == null) {
throw new XWTException("Cannot load " + className);
}
metaclass = register(type, null);
@@ -135,25 +135,25 @@ public class MetaclassManager {
}
public IMetaclass getMetaclass(Object object) {
- if(object instanceof Class) {
- return getMetaclass((Class<?>)object);
- } else if(object instanceof String) {
- return getMetaclass((String)object);
+ if (object instanceof Class) {
+ return getMetaclass((Class<?>) object);
+ } else if (object instanceof String) {
+ return getMetaclass(object);
}
Class<?> type = object.getClass();
return getMetaclass(type);
}
public IMetaclass getMetaclass(Class<?> type) {
- if(classRegister.contains(type)) {
+ if (classRegister.contains(type)) {
IMetaclass metaclass = nameRegister.get(type.getSimpleName());
- if(metaclass != null && metaclass.getType() == type) {
+ if (metaclass != null && metaclass.getType() == type) {
return metaclass;
}
}
- if(parent != null) {
+ if (parent != null) {
IMetaclass metaclass = parent.getMetaclass(type);
- if(metaclass != null) {
+ if (metaclass != null) {
return metaclass;
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassService.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassService.java
index 7ed56b7e9db..9bbb1195948 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassService.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MetaclassService.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -38,7 +38,7 @@ public class MetaclassService {
public IMetaclass getMetaclass(ILoadingContext context, String name, String namespace) {
MetaclassManager manager = map.get(namespace);
- if(manager == null) {
+ if (manager == null) {
manager = new MetaclassManager(this, map.get(IConstants.XWT_NAMESPACE), xwtLoader);
map.put(namespace, manager);
}
@@ -47,7 +47,7 @@ public class MetaclassService {
public IMetaclass findMetaclass(Class<?> type) {
MetaclassManager manager = map.get(IConstants.XWT_NAMESPACE);
- if(manager == null) {
+ if (manager == null) {
return null;
}
return manager.getMetaclass(type);
@@ -55,24 +55,24 @@ public class MetaclassService {
public IMetaclass getMetaclass(Class<?> type) {
MetaclassManager manager = map.get(IConstants.XWT_NAMESPACE);
- if(manager == null) {
+ if (manager == null) {
return null;
}
IMetaclass metaclass = manager.getMetaclass(type);
- if(metaclass == null) {
+ if (metaclass == null) {
String packageName = "";
Package packageObject = type.getPackage();
- if(packageObject != null) {
+ if (packageObject != null) {
packageName = packageObject.getName();
}
String key = IConstants.XAML_CLR_NAMESPACE_PROTO + ":" + packageName;
MetaclassManager childManager = map.get(key);
- if(childManager == null) {
+ if (childManager == null) {
childManager = new MetaclassManager(this, manager, xwtLoader);
map.put(key, childManager);
}
metaclass = childManager.getMetaclass(type);
- if(metaclass == null) {
+ if (metaclass == null) {
childManager.register(type);
metaclass = childManager.getMetaclass(type);
}
@@ -82,14 +82,14 @@ public class MetaclassService {
public IMetaclass getMetaclass(Class<?> type, String namespace) {
MetaclassManager manager = map.get(namespace);
- if(manager == null) {
+ if (manager == null) {
manager = new MetaclassManager(this, null, xwtLoader);
map.put(namespace, manager);
}
IMetaclass metaclass = manager.getMetaclass(type);
- if(metaclass == null) {
+ if (metaclass == null) {
metaclass = manager.getMetaclass(type);
- if(metaclass == null) {
+ if (metaclass == null) {
manager.register(type);
metaclass = manager.getMetaclass(type);
}
@@ -99,7 +99,7 @@ public class MetaclassService {
public IMetaclass register(Class<?> metaclass, String namespace) {
MetaclassManager manager = map.get(namespace);
- if(manager == null) {
+ if (manager == null) {
throw new IllegalStateException();
}
return manager.register(metaclass);
@@ -107,7 +107,7 @@ public class MetaclassService {
public IMetaclass register(Class<?> metaclass, String namespace, IMetaclass superMetaclass) {
MetaclassManager manager = map.get(namespace);
- if(manager == null) {
+ if (manager == null) {
throw new IllegalStateException();
}
return manager.register(metaclass, superMetaclass);
@@ -115,7 +115,7 @@ public class MetaclassService {
public void register(IMetaclass metaclass, String namespace) {
MetaclassManager manager = map.get(namespace);
- if(manager == null) {
+ if (manager == null) {
manager = new MetaclassManager(this, null, xwtLoader);
map.put(namespace, manager);
}
@@ -124,7 +124,7 @@ public class MetaclassService {
public Collection<IMetaclass> getAllMetaclasses(String namespace) {
MetaclassManager manager = map.get(namespace);
- if(manager == null) {
+ if (manager == null) {
throw new IllegalStateException();
}
return manager.getAllMetaclasses();
@@ -139,9 +139,9 @@ public class MetaclassService {
}
public IMetaclassFactory findFactory(Class<?> javaClass) {
- for(int i = factories.size() - 1; i >= 0; i--) {
+ for (int i = factories.size() - 1; i >= 0; i--) {
IMetaclassFactory factory = factories.get(i);
- if(factory.isFactoryOf(javaClass)) {
+ if (factory.isFactoryOf(javaClass)) {
return factory;
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MultiBinding.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MultiBinding.java
index 615009fbc49..c2a6094a2c3 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MultiBinding.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/MultiBinding.java
@@ -33,7 +33,7 @@ import org.eclipse.swt.widgets.Text;
/**
* Support the aggregation of data binding
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
@@ -54,7 +54,7 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
* <p>
* Default
* </p>
- *
+ *
*/
private UpdateSourceTrigger updateSourceTrigger = UpdateSourceTrigger.Default;
@@ -77,7 +77,7 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
}
public IMultiValueConverter getConverter() {
- if(valueConverter == null) {
+ if (valueConverter == null) {
valueConverter = new StringMultiValueConerter();
}
return valueConverter;
@@ -88,8 +88,8 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
}
public boolean isSourcePropertyReadOnly() {
- for(Binding binding : bindings) {
- if(binding.isSourcePropertyReadOnly()) {
+ for (Binding binding : bindings) {
+ if (binding.isSourcePropertyReadOnly()) {
return true;
}
}
@@ -97,13 +97,13 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
}
public Object getValue(Class<?> targetType) {
- if(observableValue == null) {
+ if (observableValue == null) {
IObservableValue[] values = new IObservableValue[bindings.length];
- for(int i = 0; i < values.length; i++) {
+ for (int i = 0; i < values.length; i++) {
bindings[i].getValue(targetType);
IObservable observable = bindings[i].getObservableSource();
- if(observable instanceof IObservableValue) {
- values[i] = (IObservableValue)observable;
+ if (observable instanceof IObservableValue) {
+ values[i] = (IObservableValue) observable;
} else {
LoggerManager.log("Binding expression has a problem with " + bindings[i].getPath());
return null;
@@ -116,28 +116,28 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
IObservableValue observableWidget = getObservableWidget();
IDataProvider dataProvider = getDataProvider();
- if(dataProvider != null) {
+ if (dataProvider != null) {
BindingGate bindingGate = getBindingGate();
- if(bindingGate != null) {
+ if (bindingGate != null) {
Object target = getControl();
- if(target instanceof Text && getType().equalsIgnoreCase("text")) {
- if(isSourcePropertyReadOnly()) {
- Text text = (Text)target;
+ if (target instanceof Text && getType().equalsIgnoreCase("text")) {
+ if (isSourcePropertyReadOnly()) {
+ Text text = (Text) target;
text.setEditable(false);
}
- } else if(target instanceof Button && getType().equalsIgnoreCase("selection")) {
- if(isSourcePropertyReadOnly()) {
- Button button = (Button)target;
+ } else if (target instanceof Button && getType().equalsIgnoreCase("selection")) {
+ if (isSourcePropertyReadOnly()) {
+ Button button = (Button) target;
button.setEnabled(false);
}
- } else if((target instanceof Combo || target instanceof CCombo) && getType().equalsIgnoreCase("text")) {
- if(isSourcePropertyReadOnly()) {
- Control control = (Control)target;
+ } else if ((target instanceof Combo || target instanceof CCombo) && getType().equalsIgnoreCase("text")) {
+ if (isSourcePropertyReadOnly()) {
+ Control control = (Control) target;
control.setEnabled(false);
}
- } else if(target instanceof MenuItem && getType().equalsIgnoreCase("selection")) {
- if(isSourcePropertyReadOnly()) {
- MenuItem menuItem = (MenuItem)target;
+ } else if (target instanceof MenuItem && getType().equalsIgnoreCase("selection")) {
+ if (isSourcePropertyReadOnly()) {
+ MenuItem menuItem = (MenuItem) target;
menuItem.setEnabled(false);
}
}
@@ -145,14 +145,14 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
bindingGate.bind(observableValue, observableWidget, this);
}
- if(targetType == null || !targetType.isInstance(observableValue)) {
+ if (targetType == null || !targetType.isInstance(observableValue)) {
return observableValue.getValue();
}
return observableValue;
}
private BindingGate getBindingGate() {
- if(this.bindingGate == null) {
+ if (this.bindingGate == null) {
IBindingContext dataBindingContext = XWT.getBindingContext(getControl());
this.bindingGate = new BindingGate(dataBindingContext);
}
@@ -161,7 +161,7 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
}
public IObservableValue getObservableWidget() {
- if(observableWidget == null) {
+ if (observableWidget == null) {
Object target = getControl();
Object host = getHost();
try {
@@ -176,12 +176,12 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
Object control = getControl();
Object source = XWT.getDataContext(control);
Object localDataContext = UserData.getLocalDataContext(control);
- if(localDataContext == this) {
+ if (localDataContext == this) {
return source;
}
- if(source instanceof IDynamicBinding) {
- return ((IDynamicBinding)source).createBoundSource();
+ if (source instanceof IDynamicBinding) {
+ return ((IDynamicBinding) source).createBoundSource();
}
return source;
}
@@ -189,18 +189,18 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
public boolean isSourceControl() {
Object source = null;
Object dataContextHost = getDataContextHost();
- if(dataContextHost != null) {
+ if (dataContextHost != null) {
source = UserData.getLocalDataContext(dataContextHost);
}
- if(source instanceof IDynamicBinding) {
- return ((IDynamicBinding)source).isSourceControl();
+ if (source instanceof IDynamicBinding) {
+ return ((IDynamicBinding) source).isSourceControl();
}
return false;
}
public BindingExpressionPath getTargettPropertyExpression() {
- if(targetPropertySegments == null) {
+ if (targetPropertySegments == null) {
targetPropertySegments = new BindingExpressionPath(getType());
}
return targetPropertySegments;
@@ -215,7 +215,7 @@ public class MultiBinding extends DynamicBinding implements IDataBindingInfo {
}
public void reset() {
- for(Binding binding : bindings) {
+ for (Binding binding : bindings) {
binding.reset();
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeKeeper.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeKeeper.java
index ef5d159029c..c122c67989d 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeKeeper.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeKeeper.java
@@ -46,23 +46,23 @@ public class ScopeKeeper implements DisposeListener {
private List<IChangeListener> changeListeners = Collections.emptyList();
public void handleChange(ChangeEvent event) {
- for(IChangeListener changeListener : changeListeners) {
+ for (IChangeListener changeListener : changeListeners) {
changeListener.handleChange(event);
}
// notify to parent as well.
Widget parent = UserData.getTreeParent(host);
ScopeKeeper scopeKeeper = UserData.findScopeKeeper(parent);
- if(scopeKeeper != null) {
+ if (scopeKeeper != null) {
scopeKeeper.fireChangeListener(event);
}
}
public boolean addChangeListener(IChangeListener listener) {
- if(changeListeners.contains(listener)) {
+ if (changeListeners.contains(listener)) {
return false;
}
- if(changeListeners == Collections.EMPTY_LIST) {
+ if (changeListeners == Collections.EMPTY_LIST) {
changeListeners = new ArrayList<IChangeListener>();
}
changeListeners.add(listener);
@@ -87,10 +87,10 @@ public class ScopeKeeper implements DisposeListener {
public void widgetDisposed(DisposeEvent e) {
Widget source = e.widget;
- if(source == host) {
- for(HashMap<Object, HashMap<String, IObservable>> hashMap : bindingData.values()) {
- for(HashMap<String, IObservable> map : hashMap.values()) {
- for(IObservable observable : map.values()) {
+ if (source == host) {
+ for (HashMap<Object, HashMap<String, IObservable>> hashMap : bindingData.values()) {
+ for (HashMap<String, IObservable> map : hashMap.values()) {
+ for (IObservable observable : map.values()) {
observable.removeChangeListener(changeListenerSupport);
}
}
@@ -98,9 +98,9 @@ public class ScopeKeeper implements DisposeListener {
changeListenerSupport.dispose();
}
HashMap<Object, HashMap<String, IObservable>> hashMap = bindingData.get(source);
- if(hashMap != null) {
- for(HashMap<String, IObservable> map : hashMap.values()) {
- for(IObservable observable : map.values()) {
+ if (hashMap != null) {
+ for (HashMap<String, IObservable> map : hashMap.values()) {
+ for (IObservable observable : map.values()) {
observable.removeChangeListener(changeListenerSupport);
}
}
@@ -118,7 +118,7 @@ public class ScopeKeeper implements DisposeListener {
public Object getNamedObject(String name) {
Object object = nameMap.get(name);
- if(object != null) {
+ if (object != null) {
return object;
}
return parent == null ? null : parent.getNamedObject(name);
@@ -129,7 +129,7 @@ public class ScopeKeeper implements DisposeListener {
}
public boolean containsName(String name) {
- if(nameMap.containsKey(name)) {
+ if (nameMap.containsKey(name)) {
return true;
}
return parent == null ? false : parent.containsName(name);
@@ -138,7 +138,7 @@ public class ScopeKeeper implements DisposeListener {
/**
* Register a change listener. The second call to register a same listener
* has no effect.
- *
+ *
* @param listener
*/
public boolean addChangeListener(IChangeListener listener) {
@@ -147,7 +147,7 @@ public class ScopeKeeper implements DisposeListener {
/**
* Remove the registered change listener
- *
+ *
* @param listener
*/
public void removeChangeListener(IChangeListener listener) {
@@ -159,24 +159,24 @@ public class ScopeKeeper implements DisposeListener {
}
void addObservableValue(Widget widget, Object data, String property, IObservable value) {
- if(widget == null) {
+ if (widget == null) {
widget = host;
} else {
widget.addDisposeListener(this);
}
HashMap<Object, HashMap<String, IObservable>> widgetData = bindingData.get(widget);
- if(widgetData == null) {
+ if (widgetData == null) {
widgetData = new HashMap<Object, HashMap<String, IObservable>>();
bindingData.put(widget, widgetData);
}
HashMap<String, IObservable> objectData = widgetData.get(data);
- if(objectData == null) {
+ if (objectData == null) {
objectData = new HashMap<String, IObservable>();
widgetData.put(data, objectData);
}
- if(objectData.containsKey(property)) {
+ if (objectData.containsKey(property)) {
throw new IllegalStateException();
}
objectData.put(property, value);
@@ -186,8 +186,8 @@ public class ScopeKeeper implements DisposeListener {
IObservableValue getObservableValue(Widget control, Object data, String property) {
IObservable observable = getObservable(control, data, property);
- if(observable instanceof IObservableValue) {
- return (IObservableValue)observable;
+ if (observable instanceof IObservableValue) {
+ return (IObservableValue) observable;
}
return null;
@@ -195,28 +195,28 @@ public class ScopeKeeper implements DisposeListener {
IObservableList getObservableList(Widget control, Object data, String property) {
IObservable observable = getObservable(control, data, property);
- if(observable instanceof IObservableList) {
- return (IObservableList)observable;
+ if (observable instanceof IObservableList) {
+ return (IObservableList) observable;
}
return null;
}
IObservableSet getObservableSet(Widget control, Object data, String property) {
IObservable observable = getObservable(control, data, property);
- if(observable instanceof IObservableSet) {
- return (IObservableSet)observable;
+ if (observable instanceof IObservableSet) {
+ return (IObservableSet) observable;
}
return null;
}
IObservable localGetObservable(Widget control, Object data, String property) {
// find locally
- for(HashMap<Object, HashMap<String, IObservable>> widgetData : bindingData.values()) {
- if(widgetData != null) {
+ for (HashMap<Object, HashMap<String, IObservable>> widgetData : bindingData.values()) {
+ if (widgetData != null) {
HashMap<String, IObservable> objectData = widgetData.get(data);
- if(objectData != null) {
+ if (objectData != null) {
IObservable observable = objectData.get(property);
- if(observable != null) {
+ if (observable != null) {
return observable;
}
}
@@ -228,14 +228,14 @@ public class ScopeKeeper implements DisposeListener {
IObservable getObservable(Widget control, Object data, String property) {
// find locally
IObservable observable = localGetObservable(control, data, property);
- if(observable != null) {
+ if (observable != null) {
return observable;
}
// find in other ScopeKeeper and then keep it in this ScopeKeeper.
Widget rootWidget = UserData.findRootWidget(control);
observable = deepFindObservable(rootWidget, data, property);
- if(observable != null) {
+ if (observable != null) {
addObservableValue(control, data, property, observable);
}
return observable;
@@ -243,17 +243,17 @@ public class ScopeKeeper implements DisposeListener {
static IObservable deepFindObservable(Widget control, Object data, String property) {
ScopeKeeper scopeKeeper = UserData.getLocalScopeKeeper(control);
- if(scopeKeeper != null) {
+ if (scopeKeeper != null) {
IObservable observable = scopeKeeper.localGetObservable(control, data, property);
- if(observable != null) {
+ if (observable != null) {
return observable;
}
}
- if(control instanceof Composite) {
- Composite composite = (Composite)control;
- for(Control child : composite.getChildren()) {
+ if (control instanceof Composite) {
+ Composite composite = (Composite) control;
+ for (Control child : composite.getChildren()) {
IObservable observable = deepFindObservable(child, data, property);
- if(observable != null) {
+ if (observable != null) {
return observable;
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeManager.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeManager.java
index 51496c5cb0b..cbe5598a4bb 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeManager.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/ScopeManager.java
@@ -57,7 +57,7 @@ public class ScopeManager {
public static IObservableList observableList(Object control, Object value, String fullPath, UpdateSourceTrigger updateSourceTrigger) {
try {
- return (IObservableList)observe(control, value, fullPath, updateSourceTrigger, ScopeManager.LIST);
+ return (IObservableList) observe(control, value, fullPath, updateSourceTrigger, ScopeManager.LIST);
} catch (Exception e) {
}
return null;
@@ -65,7 +65,7 @@ public class ScopeManager {
public static IObservableSet observableSet(Object control, Object value, String fullPath, UpdateSourceTrigger updateSourceTrigger) {
try {
- return (IObservableSet)observe(control, value, fullPath, updateSourceTrigger, ScopeManager.SET);
+ return (IObservableSet) observe(control, value, fullPath, updateSourceTrigger, ScopeManager.SET);
} catch (Exception e) {
}
return null;
@@ -73,7 +73,7 @@ public class ScopeManager {
/**
* Reserved only for the calling from XWTLoader
- *
+ *
* @param context
* @param data
* @param propertyName
@@ -81,7 +81,7 @@ public class ScopeManager {
*/
public static IObservableValue findObservableValue(Object context, Object control, Object data, String propertyName) {
ScopeKeeper scope = UserData.findScopeKeeper(context);
- if(control == null) {
+ if (control == null) {
control = context;
}
return scope.getObservableValue(UserData.getWidget(control), data, propertyName);
@@ -89,7 +89,7 @@ public class ScopeManager {
/**
* Reserved only for the calling from XWTLoader
- *
+ *
* @param context
* @param data
* @param propertyName
@@ -97,7 +97,7 @@ public class ScopeManager {
*/
public static IObservableSet findObservableSet(Object context, Object control, Object data, String propertyName) {
ScopeKeeper scope = UserData.findScopeKeeper(context);
- if(control == null) {
+ if (control == null) {
control = context;
}
return scope.getObservableSet(UserData.getWidget(control), data, propertyName);
@@ -105,7 +105,7 @@ public class ScopeManager {
/**
* Reserved only for the calling from XWTLoader
- *
+ *
* @param context
* @param data
* @param propertyName
@@ -113,7 +113,7 @@ public class ScopeManager {
*/
public static IObservableList findObservableList(Object context, Object control, Object data, String propertyName) {
ScopeKeeper scope = UserData.findScopeKeeper(context);
- if(control == null) {
+ if (control == null) {
control = context;
}
return scope.getObservableList(UserData.getWidget(control), data, propertyName);
@@ -151,20 +151,20 @@ public class ScopeManager {
this.value = targetValue;
widget = UserData.getWidget(control);
ScopeKeeper scopeManager = UserData.findScopeKeeper(widget);
- if(scopeManager == null) {
+ if (scopeManager == null) {
return null;
}
- if(expressionPath.getFullPath() == null) {
- if(targetValue instanceof IObservable) {
- return (IObservable)targetValue;
+ if (expressionPath.getFullPath() == null) {
+ if (targetValue instanceof IObservable) {
+ return (IObservable) targetValue;
}
}
IObservable observable = scopeManager.getObservable(widget, value, expressionPath.getStripedPath());
- if(observable != null) {
- while(observable instanceof IObservableValue && ((IObservableValue)observable).getValue() instanceof IObservable) {
- observable = (IObservable)((IObservableValue)observable).getValue();
+ if (observable != null) {
+ while (observable instanceof IObservableValue && ((IObservableValue) observable).getValue() instanceof IObservable) {
+ observable = (IObservable) ((IObservableValue) observable).getValue();
}
return observable;
}
@@ -173,22 +173,22 @@ public class ScopeManager {
currentPath = null;
Object type = elementType;
String[] segments = expressionPath.getSegments();
- if(segments == null || segments.length == 0) {
+ if (segments == null || segments.length == 0) {
String segment = ModelUtils.normalizePropertyName(expressionPath.getFullPath());
observable = resolveObservablevalue(scopeManager, dataValue, type, segment);
} else {
- if(observeKind == COLLECTION) {
+ if (observeKind == COLLECTION) {
// if the first is viewers' property
- if(!JFaceXWTDataBinding.isViewerProperty(segments[0])) {
+ if (!JFaceXWTDataBinding.isViewerProperty(segments[0])) {
int kindValue = VALUE;
Object targetValueType = dataValue;
- if(dataValue instanceof IObservableValue) {
- targetValueType = ((IObservableValue)dataValue).getValueType();
+ if (dataValue instanceof IObservableValue) {
+ targetValueType = ((IObservableValue) dataValue).getValueType();
}
Object propertyType = dataProvider.getModelService().toModelPropertyType(targetValueType, segments[0]);
- if(propertyType instanceof Class<?>) {
- Class<?> propertyTypeClass = (Class<?>)propertyType;
- if(Collection.class.isAssignableFrom(propertyTypeClass) || propertyTypeClass.isArray()) {
+ if (propertyType instanceof Class<?>) {
+ Class<?> propertyTypeClass = (Class<?>) propertyType;
+ if (Collection.class.isAssignableFrom(propertyTypeClass) || propertyTypeClass.isArray()) {
kindValue = COLLECTION;
}
}
@@ -198,21 +198,21 @@ public class ScopeManager {
int size = segments.length;
int lastObserveKind = observeKind;
observeKind = VALUE;
- for(int i = 0; i < size; i++) {
+ for (int i = 0; i < size; i++) {
String segment = segments[i];
- if(i == (size - 1)) {
+ if (i == (size - 1)) {
observeKind = lastObserveKind;
}
observable = resolveObservablevalue(scopeManager, dataValue, type, segment);
// Hasan: As long as this is already an IObservableValue we
// should look deep into the chain
- while(observable instanceof IObservableValue && ((IObservableValue)observable).getValue() instanceof IObservable) {
- observable = (IObservable)((IObservableValue)observable).getValue();
+ while (observable instanceof IObservableValue && ((IObservableValue) observable).getValue() instanceof IObservable) {
+ observable = (IObservable) ((IObservableValue) observable).getValue();
}
dataValue = observable;
- if(i != size - 1) {
+ if (i != size - 1) {
type = dataProvider.getModelService().toModelType(dataValue);
- if(type != null) {
+ if (type != null) {
dataProvider = XWT.findDataProvider(type);
}
}
@@ -222,60 +222,60 @@ public class ScopeManager {
}
private IObservable resolveObservablevalue(ScopeKeeper scopeManager, Object dataValue, Object type, String segment) {
- if(!BindingExpressionPath.isEmptyPath(segment)) {
+ if (!BindingExpressionPath.isEmptyPath(segment)) {
int length = segment.length();
- if(length > 1 && segment.charAt(0) == '(' && segment.charAt(length - 1) == ')') {
+ if (length > 1 && segment.charAt(0) == '(' && segment.charAt(length - 1) == ')') {
// It is class
String path = segment.substring(1, segment.length() - 1);
int index = path.lastIndexOf('.');
- if(index != -1) {
+ if (index != -1) {
String className = path.substring(0, index);
segment = path.substring(index + 1);
type = dataProvider.getModelService().loadModelType(className);
- if(type == null) {
+ if (type == null) {
type = dataProvider.getModelService().loadModelType(path);
- if(type != null) {
+ if (type != null) {
segment = null;
}
}
- if(type == null) {
+ if (type == null) {
throw new XWTException("Class " + className + " not found");
}
dataProvider = XWT.findDataProvider(type);
}
}
}
- if(currentPath == null) {
+ if (currentPath == null) {
currentPath = segment;
- } else if(segment != null) {
+ } else if (segment != null) {
currentPath = currentPath + '.' + segment;
}
IObservable segmentValue = scopeManager.getObservableValue(widget, value, currentPath);
try {
- if(segmentValue == null) {
- if(segment != null) {
+ if (segmentValue == null) {
+ if (segment != null) {
segmentValue = createValueProperty(dataValue, segment, type);
- if(segmentValue == null) {
+ if (segmentValue == null) {
throw new XWTException(" Property " + segment + " is not found in " + expressionPath.getFullPath());
// maybe to
// raise an
// exception
}
scopeManager.addObservableValue(widget, value, currentPath, segmentValue);
- } else if(dataValue instanceof IObservable) {
- segmentValue = (IObservable)dataValue;
+ } else if (dataValue instanceof IObservable) {
+ segmentValue = (IObservable) dataValue;
}
- } else if(segment == null && type != null) {
- if(segmentValue instanceof TypedViewerObservableValueDecorator) {
- TypedViewerObservableValueDecorator typedViewerObservableValueDecorator = (TypedViewerObservableValueDecorator)segmentValue;
+ } else if (segment == null && type != null) {
+ if (segmentValue instanceof TypedViewerObservableValueDecorator) {
+ TypedViewerObservableValueDecorator typedViewerObservableValueDecorator = (TypedViewerObservableValueDecorator) segmentValue;
typedViewerObservableValueDecorator.setElementType(type);
}
}
} catch (IllegalArgumentException e) {
// Property is not found
String message = e.getMessage();
- if(!message.startsWith("Could not find property with name")) {
+ if (!message.startsWith("Could not find property with name")) {
throw e;
}
throw new XWTException(" Property " + segment + " is not found in " + expressionPath.getFullPath()); // maybe
@@ -290,44 +290,44 @@ public class ScopeManager {
protected IObservable createValueProperty(Object object, String propertyName, Object targetType) {
IObservable observable = null;
Object type = null;
- if(targetType == null) {
+ if (targetType == null) {
type = dataProvider.getModelService().toModelType(object);
} else {
type = targetType;
}
- if(UserData.getWidget(object) != null) {
+ if (UserData.getWidget(object) != null) {
observable = JFaceXWTDataBinding.observeWidget(object, propertyName, updateSourceTrigger, observeKind);
}
- if(observable == null && dataProvider instanceof IObjectDataProvider) {
+ if (observable == null && dataProvider instanceof IObjectDataProvider) {
IMetaclass mateclass = XWT.getMetaclass(type);
IProperty property = mateclass.findProperty(propertyName);
- if(property instanceof EventProperty) {
- observable = new EventPropertyObservableValue(object, (EventProperty)property);
+ if (property instanceof EventProperty) {
+ observable = new EventPropertyObservableValue(object, (EventProperty) property);
}
}
- if(observable != null) {
+ if (observable != null) {
return observable;
}
observable = dataProvider.observe(object, propertyName, type, observeKind);
- if(observable instanceof IObservableValue) {
- IObservableValue activeValue = (IObservableValue)observable;
+ if (observable instanceof IObservableValue) {
+ IObservableValue activeValue = (IObservableValue) observable;
Object valueType = activeValue.getValueType();
- if(valueType instanceof Class<?>) {
+ if (valueType instanceof Class<?>) {
// TODO maybe need to moved in IDataProvider
- Class<?> classType = (Class<?>)valueType;
- if(valueType != null && classType.isArray()) {
+ Class<?> classType = (Class<?>) valueType;
+ if (valueType != null && classType.isArray()) {
// Create a IObserableValue to handle the connection
// between
// Array and List
Object values = dataProvider.getData(propertyName);
ArrayList<Object> array = new ArrayList<Object>();
- if(values != null) {
- for(Object value : (Object[])values) {
+ if (values != null) {
+ for (Object value : (Object[]) values) {
array.add(value);
}
}
@@ -357,11 +357,11 @@ public class ScopeManager {
}
public static IObservableValue observeValue(Object control, Object value, BindingExpressionPath expressionPath, UpdateSourceTrigger updateSourceTrigger) {
- if(value == null) {
+ if (value == null) {
value = control;
}
ObservableValueBuilder builder = new ObservableValueBuilder(control, null, expressionPath, updateSourceTrigger, ScopeManager.VALUE);
- return (IObservableValue)builder.observe(value);
+ return (IObservableValue) builder.observe(value);
}
public static IObservable observe(Object control, Object value, BindingExpressionPath expressionPath, UpdateSourceTrigger updateSourceTrigger) {
@@ -377,7 +377,7 @@ public class ScopeManager {
}
public static IObservable observe(Object control, Object value, BindingExpressionPath expressionPath, UpdateSourceTrigger updateSourceTrigger, int observeKind) {
- if(value == null) {
+ if (value == null) {
value = control;
}
ObservableValueBuilder builder = new ObservableValueBuilder(control, null, expressionPath, updateSourceTrigger, observeKind);
@@ -386,20 +386,20 @@ public class ScopeManager {
public static IObservableValue observeValue(Object control, Object value, Class<?> type, BindingExpressionPath expressionPath, UpdateSourceTrigger updateSourceTrigger) {
ObservableValueBuilder builder = new ObservableValueBuilder(control, type, expressionPath, updateSourceTrigger, ScopeManager.VALUE);
- return (IObservableValue)builder.observe(value);
+ return (IObservableValue) builder.observe(value);
}
public static IValueProperty createValueProperty(Object control, Object type, BindingExpressionPath expressionPath) {
IValueProperty valueProperty = null;
String[] segments = expressionPath.getSegments();
- if(segments == null || segments.length == 0) {
+ if (segments == null || segments.length == 0) {
String segment = expressionPath.getFullPath();
valueProperty = doCreateValueProperty(type, segment);
} else {
- for(String segment : segments) {
+ for (String segment : segments) {
IValueProperty segmentValueProperty = doCreateValueProperty(type, segment);
- if(valueProperty == null) {
+ if (valueProperty == null) {
valueProperty = segmentValueProperty;
} else {
valueProperty = valueProperty.value(segmentValueProperty);
@@ -418,7 +418,7 @@ public class ScopeManager {
/**
* Reserved only for the calling from XWTLoader
- *
+ *
* @param context
* @param data
* @param propertyName
@@ -426,25 +426,25 @@ public class ScopeManager {
*/
public static boolean isPropertyReadOnly(IDataProvider dataProvider, BindingExpressionPath expressionPath) {
String[] segments = expressionPath.getSegments();
- if(segments == null || segments.length == 0) {
+ if (segments == null || segments.length == 0) {
String segment = expressionPath.getFullPath();
return dataProvider.isPropertyReadOnly(segment);
} else {
Object type = null;
int last = segments.length - 1;
- for(int i = 0; i < last; i++) {
+ for (int i = 0; i < last; i++) {
String segment = segments[i];
int length = segment.length();
- if(length > 1 && segment.charAt(0) == '(' && segment.charAt(length - 1) == ')') {
+ if (length > 1 && segment.charAt(0) == '(' && segment.charAt(length - 1) == ')') {
// It is class
String path = segment.substring(1, segment.length() - 1);
int index = path.lastIndexOf('.');
- if(index != -1) {
+ if (index != -1) {
String className = path.substring(0, index);
segment = path.substring(index + 1);
type = dataProvider.getModelService().loadModelType(className);
- if(type == null) {
+ if (type == null) {
throw new XWTException("Class " + className + " not found");
}
dataProvider = XWT.findDataProvider(type);
@@ -453,9 +453,9 @@ public class ScopeManager {
type = dataProvider.getDataType(segment);
- if(type != null) {
+ if (type != null) {
dataProvider = XWT.findDataProvider(type);
- if(dataProvider == null) {
+ if (dataProvider == null) {
throw new XWTException("Data probider is not found for the type " + type.toString());
}
} else {
@@ -465,15 +465,15 @@ public class ScopeManager {
String segment = segments[last];
int length = segment.length();
- if(length > 1 && segment.charAt(0) == '(' && segment.charAt(length - 1) == ')') {
+ if (length > 1 && segment.charAt(0) == '(' && segment.charAt(length - 1) == ')') {
// It is class
String path = segment.substring(1, segment.length() - 1);
int index = path.lastIndexOf('.');
- if(index != -1) {
+ if (index != -1) {
String className = path.substring(0, index);
segment = path.substring(index + 1);
type = dataProvider.getModelService().loadModelType(className);
- if(type == null) {
+ if (type == null) {
throw new XWTException("Class " + className + " not found");
}
dataProvider = XWT.findDataProvider(type);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/UpdateSourceTrigger.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/UpdateSourceTrigger.java
index 399a682aab8..373f6ff7439 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/UpdateSourceTrigger.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/core/UpdateSourceTrigger.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -15,12 +15,10 @@ package org.eclipse.papyrus.xwt.internal.core;
* Default
* </p>
* <p>
- * The default UpdateSourceTrigger value of the binding target property. The default value for most dependency properties is PropertyChanged, while
- * the Text property has a default value of LostFocus.
+ * The default UpdateSourceTrigger value of the binding target property. The default value for most dependency properties is PropertyChanged, while the Text property has a default value of LostFocus.
* </p>
* <p>
- * A programmatic way to determine the default UpdateSourceTrigger value of a dependency property is to get the property metadata of the property
- * using GetMetadata and then check the value of the DefaultUpdateSourceTrigger property.
+ * A programmatic way to determine the default UpdateSourceTrigger value of a dependency property is to get the property metadata of the property using GetMetadata and then check the value of the DefaultUpdateSourceTrigger property.
* </p>
* <p/>
* <p>
@@ -36,9 +34,9 @@ package org.eclipse.papyrus.xwt.internal.core;
* <p>
* Updates the binding source whenever the binding target element loses focus.
* </p>
- *
+ *
* @author yyang
- *
+ *
*/
public enum UpdateSourceTrigger {
Default, PropertyChanged, LostFocus;
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/AbstractMenuItemObservableValue.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/AbstractMenuItemObservableValue.java
index e6eb29617ad..1d94deb91f9 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/AbstractMenuItemObservableValue.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/AbstractMenuItemObservableValue.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.internal.databinding.menuitem;
@@ -18,7 +18,7 @@ import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.MenuItem;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public abstract class AbstractMenuItemObservableValue extends AbstractObservableValue {
@@ -27,7 +27,7 @@ public abstract class AbstractMenuItemObservableValue extends AbstractObservable
/**
* Standard constructor for a MenuItem ObservableValue. Makes sure that the observable gets disposed when the MenuItem is disposed.
- *
+ *
* @param widget
*/
protected AbstractMenuItemObservableValue(MenuItem menuItem) {
@@ -36,7 +36,7 @@ public abstract class AbstractMenuItemObservableValue extends AbstractObservable
/**
* Constructor that allows for the setting of the realm. Makes sure that the observable gets disposed when the MenuItem is disposed.
- *
+ *
* @param realm
* @param widget
* @since 1.2
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemEnabledObservableValue.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemEnabledObservableValue.java
index decf0505e80..d9fcd47cee1 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemEnabledObservableValue.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemEnabledObservableValue.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.internal.databinding.menuitem;
@@ -14,7 +14,7 @@ import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.swt.widgets.MenuItem;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class MenuItemEnabledObservableValue extends AbstractMenuItemObservableValue {
@@ -36,7 +36,8 @@ public class MenuItemEnabledObservableValue extends AbstractMenuItemObservableVa
return Boolean.class;
}
+ @Override
protected void doSetValue(Object value) {
- getMenuItem().setEnabled((Boolean)value);
+ getMenuItem().setEnabled((Boolean) value);
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemSelectionObservableValue.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemSelectionObservableValue.java
index a3efcb2b0fe..9e4f05d0a75 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemSelectionObservableValue.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/databinding/menuitem/MenuItemSelectionObservableValue.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.internal.databinding.menuitem;
@@ -14,7 +14,7 @@ import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.swt.widgets.MenuItem;
/**
- *
+ *
* @author yyang (yves.yang@soyatec.com)
*/
public class MenuItemSelectionObservableValue extends AbstractMenuItemObservableValue {
@@ -36,7 +36,8 @@ public class MenuItemSelectionObservableValue extends AbstractMenuItemObservable
return Boolean.class;
}
+ @Override
protected void doSetValue(Object value) {
- getMenuItem().setSelection((Boolean)value);
+ getMenuItem().setSelection((Boolean) value);
}
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ClassLoaderUtil.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ClassLoaderUtil.java
index 577d6f4c2a0..14c89d7e9df 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ClassLoaderUtil.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ClassLoaderUtil.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -21,22 +21,22 @@ import org.eclipse.papyrus.xwt.internal.xml.Element;
public class ClassLoaderUtil {
- static final String[] DefaultPackages = new String[]{
- /*
- * UIElement.class.getPackage().getName(), Validation.class.getPackage().getName(), Timeline.class.getPackage().getName(),
- * Binding.class.getPackage().getName(),
- */};
+ static final String[] DefaultPackages = new String[] {
+ /*
+ * UIElement.class.getPackage().getName(), Validation.class.getPackage().getName(), Timeline.class.getPackage().getName(),
+ * Binding.class.getPackage().getName(),
+ */};
static public Class<?> loadClass(ILoadingContext loadingContext, String className) {
Class<?> type = doLoadClass(loadingContext, className);
- if(type != null) {
+ if (type != null) {
return type;
}
int index = className.indexOf('.');
- if(index == -1) {
- for(String packageName : DefaultPackages) {
+ if (index == -1) {
+ for (String packageName : DefaultPackages) {
type = doLoadClass(loadingContext, packageName + "." + className);
- if(type != null) {
+ if (type != null) {
return type;
}
}
@@ -46,7 +46,7 @@ public class ClassLoaderUtil {
private static Class<?> doLoadClass(ILoadingContext loadingContext, String className) {
Class<?> type = loadingContext.loadClass(className);
- if(type != null) {
+ if (type != null) {
return type;
}
try {
@@ -65,14 +65,14 @@ public class ClassLoaderUtil {
try {
Field field = type.getField(memberName);
- if(raiseException && !Modifier.isStatic(field.getModifiers())) {
+ if (raiseException && !Modifier.isStatic(field.getModifiers())) {
throw new IllegalStateException(type.getName() + "." + memberName + " is not static member.");
}
return field.get(null);
} catch (Exception e) {
- if(e instanceof NoSuchFieldException) {
+ if (e instanceof NoSuchFieldException) {
Method method = ObjectUtil.findGetter(type, memberName, null);
- if(raiseException && (method == null || !Modifier.isStatic(method.getModifiers()))) {
+ if (raiseException && (method == null || !Modifier.isStatic(method.getModifiers()))) {
throw new IllegalStateException(type.getName() + "." + memberName + " is not static member.");
}
try {
@@ -81,7 +81,7 @@ public class ClassLoaderUtil {
e = exception;
}
}
- if(raiseException) {
+ if (raiseException) {
e.printStackTrace();
throw new IllegalStateException(e);
}
@@ -93,19 +93,19 @@ public class ClassLoaderUtil {
String name = element.getName();
String namespace = element.getNamespace();
Object value = doLoadMember(loadingContext, name, namespace);
- if(value != null) {
+ if (value != null) {
return value;
}
String content = element.getContent();
- if(content == null) {
+ if (content == null) {
DocumentObject member = element.getAttribute(IConstants.XWT_NAMESPACE, IConstants.XAML_X_STATIC_MEMBER);
- if(member == null) {
+ if (member == null) {
member = element;
}
- if(member != null) {
+ if (member != null) {
content = member.getContent();
- if(content == null) {
- for(DocumentObject documentObject : member.getChildren()) {
+ if (content == null) {
+ for (DocumentObject documentObject : member.getChildren()) {
String ns = documentObject.getNamespace();
String n = documentObject.getName();
return doLoadMember(loadingContext, n, ns);
@@ -113,7 +113,7 @@ public class ClassLoaderUtil {
}
}
} else {
- if(IConstants.XAML_X_STATIC.equals(name) && IConstants.XWT_X_NAMESPACE.equals(namespace)) {
+ if (IConstants.XAML_X_STATIC.equals(name) && IConstants.XWT_X_NAMESPACE.equals(namespace)) {
namespace = IConstants.XWT_NAMESPACE;
return doLoadMember(loadingContext, content, namespace);
}
@@ -124,7 +124,7 @@ public class ClassLoaderUtil {
protected static Object doLoadMember(ILoadingContext loadingContext, String name, String namespace) {
int lastIndex = name.lastIndexOf('.');
- if(lastIndex == -1) {
+ if (lastIndex == -1) {
throw new IllegalStateException("Separator '.' is missing in:" + name);
}
String className = name.substring(0, lastIndex);
@@ -132,7 +132,7 @@ public class ClassLoaderUtil {
try {
Class<?> type = NamespaceHelper.loadCLRClass(loadingContext, className, namespace);
- if(type != null) {
+ if (type != null) {
return ClassLoaderUtil.loadMember(loadingContext, type, memberName, true);
}
} catch (ClassNotFoundException e) {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/DocumentObjectSorter.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/DocumentObjectSorter.java
index 9330cfb1b2e..03b4e8bdb01 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/DocumentObjectSorter.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/DocumentObjectSorter.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.internal.utils;
@@ -28,29 +28,29 @@ public class DocumentObjectSorter {
public static List<DocumentObject> sortWithAttr(DocumentObject[] sourceArray, Comparator<Element> comparator, String attrName) {
List<DocumentObject> columnsList = new LinkedList<DocumentObject>();
- for(DocumentObject column : sourceArray) {
- Element columnElement = (Element)column;
+ for (DocumentObject column : sourceArray) {
+ Element columnElement = (Element) column;
Attribute indexAttr = columnElement.getAttribute(attrName);
- if(indexAttr == null) {
+ if (indexAttr == null) {
columnsList.add(column);
}
}
List<Element> tempList = new LinkedList<Element>();
- for(DocumentObject column : sourceArray) {
- Element columnElement = (Element)column;
+ for (DocumentObject column : sourceArray) {
+ Element columnElement = (Element) column;
Attribute indexAttr = columnElement.getAttribute(attrName);
- if(indexAttr != null) {
+ if (indexAttr != null) {
tempList.add(columnElement);
}
}
- if(comparator == null) {
+ if (comparator == null) {
comparator = new AttrComparator(attrName);
}
Collections.sort(tempList, comparator);
- for(Element columnElement : tempList) {
+ for (Element columnElement : tempList) {
Attribute indexAttr = columnElement.getAttribute(attrName);
try {
int index = Integer.parseInt(indexAttr.getContent());
@@ -78,7 +78,7 @@ public class DocumentObjectSorter {
Attribute attr2 = e2.getAttribute(attrName);
String compare1 = attr1.getContent();
String compare2 = attr2.getContent();
- if(compare1 == null || compare2 == null) {
+ if (compare1 == null || compare2 == null) {
return 0;
}
try {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/LoggerManager.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/LoggerManager.java
index 9f70cc9512f..1ecbfbbed14 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/LoggerManager.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/LoggerManager.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ import java.util.logging.Logger;
/**
* Logger Manager.
- *
+ *
* @author jliu
*/
public class LoggerManager {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/NamespaceHelper.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/NamespaceHelper.java
index 553340a1eb7..e64a71306d1 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/NamespaceHelper.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/NamespaceHelper.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -17,24 +17,24 @@ public class NamespaceHelper {
static public Class<?> loadCLRClass(ILoadingContext loadingContext, String name, String namespace) throws ClassNotFoundException {
// xmlns:custom="clr-namespace:SDKSample;assembly=SDKSampleLibrary"
- if(namespace.startsWith(IConstants.XAML_CLR_NAMESPACE_PROTO)) {
+ if (namespace.startsWith(IConstants.XAML_CLR_NAMESPACE_PROTO)) {
String contentSegment = namespace.substring(IConstants.XAML_CLR_NAMESPACE_PROTO.length());
String packageName = contentSegment;
String assembly = null;
int index = contentSegment.indexOf(";");
- if(index != -1) {
+ if (index != -1) {
packageName = contentSegment.substring(0, index);
contentSegment = contentSegment.substring(index + 1);
- if(contentSegment.startsWith(IConstants.XAML_CLR_ASSEMBLY)) {
+ if (contentSegment.startsWith(IConstants.XAML_CLR_ASSEMBLY)) {
assembly = contentSegment.substring(IConstants.XAML_CLR_ASSEMBLY.length());
} else {
throw new IllegalStateException(IConstants.XAML_CLR_ASSEMBLY);
}
}
- if(assembly != null) {
+ if (assembly != null) {
// TODO Load jar using URLClassLoader
}
- if(packageName != null && packageName.length() > 0) {
+ if (packageName != null && packageName.length() > 0) {
name = packageName + "." + name;
}
return ClassLoaderUtil.loadClass(loadingContext, name);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObjectUtil.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObjectUtil.java
index 227a54ae30d..2e3449788bf 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObjectUtil.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObjectUtil.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -22,7 +22,7 @@ import org.eclipse.papyrus.xwt.XWT;
/**
* Object Tools.
- *
+ *
* @author yyang (yves.yang@soyatec.com)
* @version 1.0
*/
@@ -34,23 +34,23 @@ public class ObjectUtil {
}
public static Class<?> normalizedType(Class<?> type) {
- if(type == int.class) {
+ if (type == int.class) {
return Integer.class;
}
- if(type == double.class) {
+ if (type == double.class) {
return Double.class;
}
- if(type == float.class) {
+ if (type == float.class) {
return Float.class;
}
- if(type == boolean.class) {
+ if (type == boolean.class) {
return Boolean.class;
}
return type;
}
public static boolean isAssignableFrom(Class<?> source, Class<?> target) {
- if(normalizedType(source) == normalizedType(target)) {
+ if (normalizedType(source) == normalizedType(target)) {
return true;
}
return source.isAssignableFrom(target);
@@ -58,9 +58,9 @@ public class ObjectUtil {
/**
* Find the compatible class. This includes superclasses, interfaces and so on.
- *
+ *
* @param clazz
- * the specified class.
+ * the specified class.
* @return Returns the class array includes its superclasses, interfaces and itself.
*/
public static final Class<?>[] findCompatibleClasses(Class<?> clazz) {
@@ -70,37 +70,37 @@ public class ObjectUtil {
classes.add(clazz);
// Add primitive compatible type
- if(clazz == Boolean.class) {
+ if (clazz == Boolean.class) {
classes.add(boolean.class);
- } else if(clazz == Byte.class) {
+ } else if (clazz == Byte.class) {
classes.add(byte.class);
- } else if(clazz == Short.class) {
+ } else if (clazz == Short.class) {
classes.add(short.class);
- } else if(clazz == Integer.class) {
+ } else if (clazz == Integer.class) {
classes.add(int.class);
- } else if(clazz == Long.class) {
+ } else if (clazz == Long.class) {
classes.add(long.class);
- } else if(clazz == Float.class) {
+ } else if (clazz == Float.class) {
classes.add(float.class);
- } else if(clazz == Double.class) {
+ } else if (clazz == Double.class) {
classes.add(double.class);
- } else if(clazz == Character.class) {
+ } else if (clazz == Character.class) {
classes.add(char.class);
- } else if(clazz == boolean.class) {
+ } else if (clazz == boolean.class) {
classes.add(Boolean.class);
- } else if(clazz == byte.class) {
+ } else if (clazz == byte.class) {
classes.add(Byte.class);
- } else if(clazz == short.class) {
+ } else if (clazz == short.class) {
classes.add(Short.class);
- } else if(clazz == int.class) {
+ } else if (clazz == int.class) {
classes.add(Integer.class);
- } else if(clazz == long.class) {
+ } else if (clazz == long.class) {
classes.add(Long.class);
- } else if(clazz == float.class) {
+ } else if (clazz == float.class) {
classes.add(Float.class);
- } else if(clazz == double.class) {
+ } else if (clazz == double.class) {
classes.add(Double.class);
- } else if(clazz == char.class) {
+ } else if (clazz == char.class) {
classes.add(Character.class);
}
@@ -122,7 +122,7 @@ public class ObjectUtil {
public static Object resolveValue(Object value, Class<?> sourceType, Class<?> targetType, Object defaultValue) {
IConverter converter = XWT.findConvertor(sourceType, targetType);
- if(converter != null) {
+ if (converter != null) {
return converter.convert(value);
}
return defaultValue;
@@ -130,31 +130,31 @@ public class ObjectUtil {
/**
* Find compatible constructor for specified class.
- *
+ *
* @param clazz
- * the specified class.
+ * the specified class.
* @param argumentTypes
- * constructor argument types.
+ * constructor argument types.
* @return Returns constructor instance. If snot find, returns null.
*/
public static final Constructor<?> findConstructor(Class<?> clazz, Class<?>... argumentTypes) {
Class<?>[][] classesArray = new Class[argumentTypes.length][];
- for(int i = 0, len = argumentTypes.length; i < len; i++) {
+ for (int i = 0, len = argumentTypes.length; i < len; i++) {
Class<?>[] classes = findCompatibleClasses(argumentTypes[i]);
classesArray[i] = classes;
}
int totalPossibles = 1;
- for(int i = 0; i < classesArray.length; i++) {
+ for (int i = 0; i < classesArray.length; i++) {
totalPossibles *= classesArray[i].length;
}
List<Class<?>[]> classList = new ArrayList<Class<?>[]>(totalPossibles);
computeArguments(classList, classesArray, new Class[classesArray.length], 0);
- for(Class<?>[] arguments : classList) {
+ for (Class<?>[] arguments : classList) {
try {
return clazz.getConstructor(arguments);
} catch (NoSuchMethodException e) {
@@ -167,35 +167,35 @@ public class ObjectUtil {
/**
* Find compatible public method for specified class.
- *
+ *
* @param clazz
- * the specified class.
+ * the specified class.
* @param name
- * method name.
+ * method name.
* @param argumentTypes
- * method argument types. If it is a null value, system will find method without argument types.
+ * method argument types. If it is a null value, system will find method without argument types.
* @return Returns method instance. If not find, returns null.
*/
public static final Method findMethod(Class<?> clazz, String name, Class<?>... argumentTypes) {
- if(argumentTypes != null && argumentTypes.length > 0) {
+ if (argumentTypes != null && argumentTypes.length > 0) {
Class<?>[][] classesArray = new Class[argumentTypes.length][];
- for(int i = 0, len = argumentTypes.length; i < len; i++) {
+ for (int i = 0, len = argumentTypes.length; i < len; i++) {
Class<?>[] classes = findCompatibleClasses(argumentTypes[i]);
classesArray[i] = classes;
}
int totalPossibles = 1;
- for(int i = 0; i < classesArray.length; i++) {
+ for (int i = 0; i < classesArray.length; i++) {
totalPossibles *= classesArray[i].length;
}
List<Class<?>[]> classList = new ArrayList<Class<?>[]>(totalPossibles);
computeArguments(classList, classesArray, new Class[classesArray.length], 0);
- for(Class<?>[] arguments : classList) {
+ for (Class<?>[] arguments : classList) {
try {
return clazz.getDeclaredMethod(name, arguments);
} catch (NoSuchMethodException e) {
@@ -207,8 +207,8 @@ public class ObjectUtil {
// find method without argument types;
Method[] methods = clazz.getMethods();
- for(Method method : methods) {
- if(method.getName().equals(name)) {
+ for (Method method : methods) {
+ if (method.getName().equals(name)) {
return method;
}
}
@@ -219,35 +219,35 @@ public class ObjectUtil {
/**
* Find compatible method for specified class.
- *
+ *
* @param clazz
- * the specified class.
+ * the specified class.
* @param name
- * method name.
+ * method name.
* @param argumentTypes
- * method argument types. If it is a null value, system will find method without argument types.
+ * method argument types. If it is a null value, system will find method without argument types.
* @return Returns method instance. If not find, returns null.
*/
public static final Method findDeclaredMethod(Class<?> clazz, String name, Class<?>... argumentTypes) {
- if(argumentTypes != null && argumentTypes.length > 0) {
+ if (argumentTypes != null && argumentTypes.length > 0) {
Class<?>[][] classesArray = new Class[argumentTypes.length][];
- for(int i = 0, len = argumentTypes.length; i < len; i++) {
+ for (int i = 0, len = argumentTypes.length; i < len; i++) {
Class<?>[] classes = findCompatibleClasses(argumentTypes[i]);
classesArray[i] = classes;
}
int totalPossibles = 1;
- for(int i = 0; i < classesArray.length; i++) {
+ for (int i = 0; i < classesArray.length; i++) {
totalPossibles *= classesArray[i].length;
}
List<Class<?>[]> classList = new ArrayList<Class<?>[]>(totalPossibles);
computeArguments(classList, classesArray, new Class[classesArray.length], 0);
- for(Class<?>[] arguments : classList) {
+ for (Class<?>[] arguments : classList) {
try {
return clazz.getDeclaredMethod(name, arguments);
} catch (NoSuchMethodException e) {
@@ -258,14 +258,14 @@ public class ObjectUtil {
// find method without argument types;
Method[] methods = clazz.getDeclaredMethods();
- for(Method method : methods) {
- if(method.getName().equals(name) && method.getParameterTypes().length == 0) {
+ for (Method method : methods) {
+ if (method.getName().equals(name) && method.getParameterTypes().length == 0) {
return method;
}
}
}
Class<?> superclass = clazz.getSuperclass();
- if(superclass != null) {
+ if (superclass != null) {
return findDeclaredMethod(superclass, name, argumentTypes);
}
@@ -274,17 +274,17 @@ public class ObjectUtil {
/**
* Find property getter method for specified class.
- *
+ *
* @param clazz
- * the specified class.
+ * the specified class.
* @param name
- * property name
+ * property name
* @param type
- * property type. If it is a null value, system will find the suitable method.
+ * property type. If it is a null value, system will find the suitable method.
* @return Returns method instance. If not find, returns null.
*/
public static final Method findGetter(Class<?> clazz, String name, Class<?> type) {
- if(name == null || name.length() == 0) {
+ if (name == null || name.length() == 0) {
throw new IllegalArgumentException("Invalid getter method name, null value found");
}
@@ -292,7 +292,7 @@ public class ObjectUtil {
Method method;
try {
- if(clazz.isEnum()) {
+ if (clazz.isEnum()) {
method = clazz.getClass().getMethod(getterName, EMPTY);
} else {
method = clazz.getMethod(getterName, EMPTY);
@@ -303,7 +303,7 @@ public class ObjectUtil {
getterName = "is" + name.substring(0, 1).toUpperCase() + name.substring(1);
try {
method = clazz.getMethod(getterName, EMPTY);
- if(method.getReturnType() != Boolean.class && method.getReturnType() != boolean.class) {
+ if (method.getReturnType() != Boolean.class && method.getReturnType() != boolean.class) {
return null;
}
} catch (NoSuchMethodException e2) {
@@ -312,14 +312,14 @@ public class ObjectUtil {
// :~
}
- if(type == null) {
+ if (type == null) {
return method;
} else {
- if(method != null) {
+ if (method != null) {
Class<?> returnType = method.getReturnType();
Class<?>[] types = findCompatibleClasses(type);
- for(Class<?> t : types) {
- if(t == returnType) {
+ for (Class<?> t : types) {
+ if (t == returnType) {
return method;
}
}
@@ -333,14 +333,14 @@ public class ObjectUtil {
String getterName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
String isName = "is" + name.substring(0, 1).toUpperCase() + name.substring(1);
- for(Method element : clazz.getMethods()) {
- if(element.getParameterTypes().length != 0) {
+ for (Method element : clazz.getMethods()) {
+ if (element.getParameterTypes().length != 0) {
continue;
}
- if(element.getName().equalsIgnoreCase(getterName)) {
+ if (element.getName().equalsIgnoreCase(getterName)) {
return element;
}
- if(element.getName().equalsIgnoreCase(isName) && element.getReturnType() != Boolean.class && element.getReturnType() != boolean.class) {
+ if (element.getName().equalsIgnoreCase(isName) && element.getReturnType() != Boolean.class && element.getReturnType() != boolean.class) {
return element;
}
}
@@ -351,10 +351,10 @@ public class ObjectUtil {
* Find superclasses and add them to list.
*/
private static void findSuperClasses(Set<Class<?>> list, Class<?> clazz) {
- if(clazz != null) {
+ if (clazz != null) {
Class<?> superClass = clazz.getSuperclass();
- if(superClass != Object.class) {
+ if (superClass != Object.class) {
list.add(superClass);
findInterfaces(list, superClass);
@@ -368,10 +368,10 @@ public class ObjectUtil {
* Find interfaces and add them to list.
*/
private static void findInterfaces(Set<Class<?>> list, Class<?> clazz) {
- if(clazz != null) {
+ if (clazz != null) {
Class<?>[] interfaces = clazz.getInterfaces();
- for(Class<?> interfac1 : interfaces) {
+ for (Class<?> interfac1 : interfaces) {
list.add(interfac1);
findInterfaces(list, interfac1);
}
@@ -382,16 +382,16 @@ public class ObjectUtil {
* Combine arithmetic.
*/
private static void computeArguments(List<Class<?>[]> list, Class<?>[][] arguments, Class<?>[] buffer, int start) {
- if(start >= arguments.length) {
+ if (start >= arguments.length) {
Class<?>[] classes = new Class<?>[arguments.length];
- for(int i = 0; i < arguments.length; ++i) {
+ for (int i = 0; i < arguments.length; ++i) {
classes[i] = buffer[i];
}
list.add(classes);
return;
}
- for(int i = 0; i < arguments[start].length; ++i) {
+ for (int i = 0; i < arguments[start].length; ++i) {
buffer[start] = arguments[start][i];
computeArguments(list, arguments, buffer, start + 1);
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObservableValueManager.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObservableValueManager.java
index 26e8b359e0b..56fc585feb0 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObservableValueManager.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/ObservableValueManager.java
@@ -37,12 +37,12 @@ public class ObservableValueManager implements IObservableValueListener {
}
public void changeValueHandle(Object object, Event event) {
- // TODO the cast is not clean.
- EventProperty property = (EventProperty)object;
+ // TODO the cast is not clean.
+ EventProperty property = (EventProperty) object;
IObservableValue value = map.get(property.getName());
- if(value != null) {
- Boolean oldValue = (Boolean)value.getValue();
- if(oldValue == null) {
+ if (value != null) {
+ Boolean oldValue = (Boolean) value.getValue();
+ if (oldValue == null) {
oldValue = false;
}
value.setValue(!oldValue);
@@ -53,31 +53,31 @@ public class ObservableValueManager implements IObservableValueListener {
// TODO this conversion should be simplied
String eventName = ModelUtils.normalizePropertyName(property.getEvent().getName());
IEventGroup eventGroup = metaclass.getEventGroup(eventName);
- if(eventGroup != null) {
+ if (eventGroup != null) {
eventGroup.fireEvent(this, property);
}
}
public void registerValue(IProperty property, IObservableValue observableValue) {
- if(map == null) {
+ if (map == null) {
map = new HashMap<String, IObservableValue>();
}
map.put(property.getName(), observableValue);
IMetaclass metaclass = XWT.getMetaclass(host);
- // TODO it is not clean.
- EventProperty eventProperty = (EventProperty)property;
+ // TODO it is not clean.
+ EventProperty eventProperty = (EventProperty) property;
// TODO this conversion should be simplied
String eventName = ModelUtils.normalizePropertyName(eventProperty.getEvent().getName());
IEventGroup eventGroup = metaclass.getEventGroup(eventName);
- if(eventGroup != null) {
+ if (eventGroup != null) {
eventGroup.registerEvent(this, property);
}
}
public IObservableValue getValue(IProperty property) {
- if(map == null) {
+ if (map == null) {
return null;
}
return map.get(property.getName());
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/TableEditorHelper.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/TableEditorHelper.java
index 10c974074a2..721a3ac0840 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/TableEditorHelper.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/TableEditorHelper.java
@@ -4,8 +4,8 @@
* are made available under the terms of the Eclipse Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.eclipse.org/legal/epl-v10.html *
- * *
- * Contributors: *
+ * *
+ * Contributors: *
* Soyatec - initial API and implementation *
*******************************************************************************/
package org.eclipse.papyrus.xwt.internal.utils;
@@ -23,8 +23,8 @@ import org.eclipse.swt.widgets.Text;
public class TableEditorHelper {
public static void initEditor(final TableItem tableItem, Control editor, final int column) {
- if(editor instanceof Text) {
- final Text text = (Text)editor;
+ if (editor instanceof Text) {
+ final Text text = (Text) editor;
text.setText(tableItem.getText(column));
text.addModifyListener(new ModifyListener() {
@@ -32,8 +32,8 @@ public class TableEditorHelper {
tableItem.setText(column, text.getText());
}
});
- } else if(editor instanceof CCombo) {
- final CCombo combo = (CCombo)editor;
+ } else if (editor instanceof CCombo) {
+ final CCombo combo = (CCombo) editor;
combo.setText(tableItem.getText(column));
combo.addSelectionListener(new SelectionListener() {
@@ -45,8 +45,8 @@ public class TableEditorHelper {
tableItem.setText(column, combo.getItem(combo.getSelectionIndex()));
}
});
- } else if(editor instanceof Combo) {
- final Combo combo = (Combo)editor;
+ } else if (editor instanceof Combo) {
+ final Combo combo = (Combo) editor;
combo.setText(tableItem.getText(column));
combo.addSelectionListener(new SelectionListener() {
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/UserData.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/UserData.java
index 1c7c7e05275..17c38a32cbc 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/UserData.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/utils/UserData.java
@@ -67,47 +67,47 @@ public class UserData {
}
public void setData(Object key, Object value) {
- if(dictionary == null) {
+ if (dictionary == null) {
dictionary = new HashMap<Object, Object>();
}
dictionary.put(key, value);
- if(observableValueManager != null && (key instanceof IProperty)) {
- IObservableValue observableValue = observableValueManager.getValue((IProperty)key);
+ if (observableValueManager != null && (key instanceof IProperty)) {
+ IObservableValue observableValue = observableValueManager.getValue((IProperty) key);
observableValue.setValue(value);
}
}
public Object getData(Object key) {
- if(dictionary == null) {
+ if (dictionary == null) {
return null;
}
return dictionary.get(key);
}
public Object removeData(Object key) {
- if(dictionary == null) {
+ if (dictionary == null) {
return null;
}
return dictionary.remove(key);
}
public boolean containsKey(Object key) {
- if(dictionary == null) {
+ if (dictionary == null) {
return false;
}
return dictionary.containsKey(key);
}
public Collection<Object> keySet() {
- if(dictionary == null) {
+ if (dictionary == null) {
return Collections.emptyList();
}
return dictionary.keySet();
}
public static boolean isUIElementType(Object element) {
- if(element instanceof Class<?>) {
- Class<?> elementType = (Class<?>)element;
+ if (element instanceof Class<?>) {
+ Class<?> elementType = (Class<?>) element;
return Widget.class.isAssignableFrom(elementType) || Viewer.class.isAssignableFrom(elementType) || ControlEditor.class.isAssignableFrom(elementType);
}
return false;
@@ -115,11 +115,11 @@ public class UserData {
public static void bindNameContext(Object element, ScopeKeeper nameContext) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return;
}
UserData dataDictionary = updateDataDictionary(widget);
- if(dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY) != null) {
+ if (dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY) != null) {
throw new IllegalStateException("Name context is already set");
}
dataDictionary.setData(IUserDataConstants.XWT_NAMECONTEXT_KEY, nameContext);
@@ -127,11 +127,11 @@ public class UserData {
protected static UserData updateDataDictionary(Object target) {
Widget widget = getWidget(target);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary == null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary == null) {
dataDictionary = new UserData();
widget.setData(IUserDataConstants.XWT_USER_DATA_KEY, dataDictionary);
}
@@ -140,14 +140,14 @@ public class UserData {
public static Shell findShell(Object element) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- if(widget instanceof Shell) {
- return (Shell)widget;
+ if (widget instanceof Shell) {
+ return (Shell) widget;
}
- Control parent = (Control)findParent(widget, Control.class);
- if(parent != null) {
+ Control parent = (Control) findParent(widget, Control.class);
+ if (parent != null) {
return parent.getShell();
}
return null;
@@ -156,16 +156,16 @@ public class UserData {
/**
* Find the root widget used by XWT. In fact, it tries to find the root
* ScopeKeeper
- *
+ *
* @param element
* @return
*/
public static Widget findRootWidget(Object element) {
Widget root = null;
Widget current = getWidget(element);
- while(current != null) {
+ while (current != null) {
ScopeKeeper scopeKeeper = findScopeKeeper(current);
- if(scopeKeeper != null) {
+ if (scopeKeeper != null) {
root = current;
}
current = getTreeParent(current);
@@ -176,19 +176,19 @@ public class UserData {
public static Composite findCompositeParent(Object element) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return null;
}
Control control = getParent(widget);
- while(control != null && !(control instanceof Composite)) {
+ while (control != null && !(control instanceof Composite)) {
control = getParent(control);
}
- return (Composite)control;
+ return (Composite) control;
}
public static Object findParent(Widget element, Class<?> type) {
Widget widget = getTreeParent(element);
- while(widget != null && !(type.isInstance(widget))) {
+ while (widget != null && !(type.isInstance(widget))) {
widget = getTreeParent(widget);
}
return widget;
@@ -196,11 +196,11 @@ public class UserData {
public static ScopeKeeper findScopeKeeper(Object element) {
ScopeKeeper scopeKeeper = getLocalScopeKeeper(element);
- if(scopeKeeper != null) {
+ if (scopeKeeper != null) {
return scopeKeeper;
}
Widget parent = getTreeParent(element);
- if(parent != null && !parent.isDisposed()) {
+ if (parent != null && !parent.isDisposed()) {
return findScopeKeeper(parent);
}
return null;
@@ -208,16 +208,16 @@ public class UserData {
public static Widget findScopeRoot(Object element) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return null;
}
Widget current = widget;
- while(current != null) {
- UserData dataDictionary = (UserData)current.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
+ while (current != null) {
+ UserData dataDictionary = (UserData) current.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
Object data = dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
- if(data != null) {
+ if (data != null) {
return current;
}
}
@@ -230,14 +230,14 @@ public class UserData {
public static ScopeKeeper getLocalScopeKeeper(Object element) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
Object data = dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
- if(data != null) {
- return (ScopeKeeper)data;
+ if (data != null) {
+ return (ScopeKeeper) data;
}
}
return null;
@@ -245,21 +245,21 @@ public class UserData {
public static Object findElementByName(Object context, String name) {
Widget widget = getWidget(context);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
- ScopeKeeper nameContext = (ScopeKeeper)dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
- if(nameContext != null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
+ ScopeKeeper nameContext = (ScopeKeeper) dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
+ if (nameContext != null) {
Object element = nameContext.getNamedObject(name);
- if(element != null) {
+ if (element != null) {
return element;
}
}
}
Widget parent = getTreeParent(widget);
- if(parent != null) {
+ if (parent != null) {
return findElementByName(parent, name);
}
return null;
@@ -267,21 +267,21 @@ public class UserData {
public static String getElementName(Object object) {
Widget widget = getWidget(object);
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
- return (String)dataDictionary.getData(IUserDataConstants.XWT_NAME_KEY);
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
+ return (String) dataDictionary.getData(IUserDataConstants.XWT_NAME_KEY);
}
return null;
}
public static void setElementName(Object object, String name, boolean updateScope) {
Widget widget = getWidget(object);
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
dataDictionary.setData(IUserDataConstants.XWT_NAME_KEY, name);
- if(updateScope) {
+ if (updateScope) {
ScopeKeeper keeper = findScopeKeeper(object);
- if(keeper != null) {
+ if (keeper != null) {
keeper.addNamedObject(name, object);
}
}
@@ -294,18 +294,18 @@ public class UserData {
public static Object getCLR(Object element) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
Object data = dataDictionary.getData(IUserDataConstants.XWT_CLR_KEY);
- if(data != null) {
+ if (data != null) {
return data;
}
}
Widget parent = getParent(widget);
- if(parent != null) {
+ if (parent != null) {
return getCLR(parent);
}
return null;
@@ -313,13 +313,13 @@ public class UserData {
public static Widget getTreeParent(Object element) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
- widget = (Widget)dataDictionary.getData(IUserDataConstants.XWT_PARENT_KEY);
- if(widget != null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
+ widget = (Widget) dataDictionary.getData(IUserDataConstants.XWT_PARENT_KEY);
+ if (widget != null) {
return widget;
}
}
@@ -328,64 +328,64 @@ public class UserData {
public static Control getParent(Object element) {
Widget widget = getWidget(element);
- if(widget instanceof Control) {
- Control control = (Control)widget;
+ if (widget instanceof Control) {
+ Control control = (Control) widget;
return control.getParent();
- } else if(widget instanceof Menu) {
- Menu item = (Menu)widget;
+ } else if (widget instanceof Menu) {
+ Menu item = (Menu) widget;
return item.getParent();
- } else if(widget instanceof MenuItem) {
- MenuItem item = (MenuItem)widget;
+ } else if (widget instanceof MenuItem) {
+ MenuItem item = (MenuItem) widget;
Menu menu = item.getParent();
- if(menu == null) {
+ if (menu == null) {
return null;
}
return menu.getParent();
- } else if(widget instanceof ScrollBar) {
- ScrollBar item = (ScrollBar)widget;
+ } else if (widget instanceof ScrollBar) {
+ ScrollBar item = (ScrollBar) widget;
return item.getParent();
- } else if(widget instanceof ToolTip) {
- ToolTip item = (ToolTip)widget;
+ } else if (widget instanceof ToolTip) {
+ ToolTip item = (ToolTip) widget;
return item.getParent();
- } else if(widget instanceof CoolItem) {
- CoolItem item = (CoolItem)widget;
+ } else if (widget instanceof CoolItem) {
+ CoolItem item = (CoolItem) widget;
return item.getParent();
- } else if(widget instanceof CTabItem) {
- CTabItem item = (CTabItem)widget;
+ } else if (widget instanceof CTabItem) {
+ CTabItem item = (CTabItem) widget;
return item.getParent();
- } else if(widget instanceof ExpandItem) {
- ExpandItem item = (ExpandItem)widget;
+ } else if (widget instanceof ExpandItem) {
+ ExpandItem item = (ExpandItem) widget;
return item.getParent();
- } else if(widget instanceof TabItem) {
- TabItem item = (TabItem)widget;
+ } else if (widget instanceof TabItem) {
+ TabItem item = (TabItem) widget;
return item.getParent();
- } else if(widget instanceof TableColumn) {
- TableColumn item = (TableColumn)widget;
+ } else if (widget instanceof TableColumn) {
+ TableColumn item = (TableColumn) widget;
return item.getParent();
- } else if(widget instanceof TableItem) {
- TableItem item = (TableItem)widget;
+ } else if (widget instanceof TableItem) {
+ TableItem item = (TableItem) widget;
return item.getParent();
- } else if(widget instanceof TableTreeItem) {
- TableTreeItem item = (TableTreeItem)widget;
+ } else if (widget instanceof TableTreeItem) {
+ TableTreeItem item = (TableTreeItem) widget;
return item.getParent();
- } else if(widget instanceof ToolItem) {
- ToolItem item = (ToolItem)widget;
+ } else if (widget instanceof ToolItem) {
+ ToolItem item = (ToolItem) widget;
return item.getParent();
- } else if(widget instanceof TreeColumn) {
- TreeColumn item = (TreeColumn)widget;
+ } else if (widget instanceof TreeColumn) {
+ TreeColumn item = (TreeColumn) widget;
return item.getParent();
- } else if(widget instanceof TreeItem) {
- TreeItem item = (TreeItem)widget;
+ } else if (widget instanceof TreeItem) {
+ TreeItem item = (TreeItem) widget;
return item.getParent();
- } else if(widget instanceof Caret) {
- Caret item = (Caret)widget;
+ } else if (widget instanceof Caret) {
+ Caret item = (Caret) widget;
return item.getParent();
}
return null;
}
public static IEventController findEventController(Object widget) {
- return (IEventController)findData(widget, IUserDataConstants.XWT_CONTROLLER_KEY);
+ return (IEventController) findData(widget, IUserDataConstants.XWT_CONTROLLER_KEY);
}
public static Object getDataContext(Object widget) {
@@ -393,18 +393,18 @@ public class UserData {
}
public static IBindingContext getBindingContext(Object widget) {
- return (IBindingContext)findData(widget, IUserDataConstants.XWT_BINDING_CONTEXT_KEY);
+ return (IBindingContext) findData(widget, IUserDataConstants.XWT_BINDING_CONTEXT_KEY);
}
public static TriggerBase[] getTriggers(Object element) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return TriggerBase.EMPTY_ARRAY;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
- TriggerBase[] triggers = (TriggerBase[])dataDictionary.getData(IUserDataConstants.XWT_TRIGGERS_KEY);
- if(triggers != null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
+ TriggerBase[] triggers = (TriggerBase[]) dataDictionary.getData(IUserDataConstants.XWT_TRIGGERS_KEY);
+ if (triggers != null) {
return triggers;
}
}
@@ -417,26 +417,26 @@ public class UserData {
public static Widget getDataContextHost(Object element) {
Widget widget = getWidget(element);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
Object host = null;
- if(dataDictionary != null) {
+ if (dataDictionary != null) {
host = dataDictionary.getData(IUserDataConstants.XWT_DATACONTEXT_KEY);
- if(host != null) {
+ if (host != null) {
return widget;
}
}
Widget parent = widget;
- while(parent != null) {
- dataDictionary = (UserData)parent.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
+ while (parent != null) {
+ dataDictionary = (UserData) parent.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
host = dataDictionary.getData(IUserDataConstants.XWT_DATACONTEXT_KEY);
- if(host != null) {
+ if (host != null) {
return parent;
}
- parent = (Widget)dataDictionary.getData(IUserDataConstants.XWT_PARENT_KEY);
+ parent = (Widget) dataDictionary.getData(IUserDataConstants.XWT_PARENT_KEY);
} else {
parent = getParent(parent);
}
@@ -453,20 +453,20 @@ public class UserData {
}
public static Widget getWidget(Object target) {
- if(JFacesHelper.isViewer(target)) {
+ if (JFacesHelper.isViewer(target)) {
return JFacesHelper.getControl(target);
- } else if(target instanceof Widget) {
- return (Widget)target;
- } else if(target instanceof TableViewerColumn) {
- return ((TableViewerColumn)target).getColumn();
- } else if(target instanceof ControlEditor) {
- return ((ControlEditor)target).getEditor();
+ } else if (target instanceof Widget) {
+ return (Widget) target;
+ } else if (target instanceof TableViewerColumn) {
+ return ((TableViewerColumn) target).getColumn();
+ } else if (target instanceof ControlEditor) {
+ return ((ControlEditor) target).getEditor();
}
return null;
}
public static Viewer getLocalViewer(Object object) {
- return (Viewer)getLocalData(object, IUserDataConstants.XWT_VIEWER_KEY);
+ return (Viewer) getLocalData(object, IUserDataConstants.XWT_VIEWER_KEY);
}
public static Object getLocalDataContext(Object object) {
@@ -479,11 +479,11 @@ public class UserData {
public static Object getLocalData(Object object, IProperty property) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary == null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary == null) {
return null;
}
return dataDictionary.getData(property);
@@ -491,11 +491,11 @@ public class UserData {
public static Object getLocalData(Object object, String key) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary == null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary == null) {
return null;
}
return dataDictionary.getData(key);
@@ -503,11 +503,11 @@ public class UserData {
public static boolean hasLocalData(Object object, String propertyName) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
return false;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary == null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary == null) {
return false;
}
return dataDictionary.containsKey(propertyName);
@@ -515,11 +515,11 @@ public class UserData {
public static boolean hasLocalData(Object object, IProperty property) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
return false;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary == null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary == null) {
return false;
}
return dataDictionary.containsKey(property);
@@ -527,11 +527,11 @@ public class UserData {
public static void removeLocalData(Object object, IProperty property) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
return;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary == null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary == null) {
return;
}
dataDictionary.removeData(property);
@@ -539,28 +539,28 @@ public class UserData {
public static void removeLocalData(Object object, String key) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
return;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary == null) {
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary == null) {
return;
}
dataDictionary.removeData(key);
}
public static Map<String, Object> getLocalResources(Object object) {
- return (Map<String, Object>)getLocalData(object, IUserDataConstants.XWT_RESOURCES_KEY);
+ return (Map<String, Object>) getLocalData(object, IUserDataConstants.XWT_RESOURCES_KEY);
}
public static Object findResource(Object object, String key) {
- Map<String, Object> map = (Map<String, Object>)getLocalData(object, IUserDataConstants.XWT_RESOURCES_KEY);
- if(map.containsKey(key)) {
+ Map<String, Object> map = (Map<String, Object>) getLocalData(object, IUserDataConstants.XWT_RESOURCES_KEY);
+ if (map.containsKey(key)) {
return map.get(key);
}
Object parent = getTreeParent(object);
- if(parent != null) {
+ if (parent != null) {
return findResource(parent, key);
}
return null;
@@ -584,8 +584,8 @@ public class UserData {
public static IEventController updateEventController(Object object) {
UserData dataDictionary = updateDataDictionary(object);
- IEventController controller = (IEventController)dataDictionary.getData(IUserDataConstants.XWT_CONTROLLER_KEY);
- if(controller == null) {
+ IEventController controller = (IEventController) dataDictionary.getData(IUserDataConstants.XWT_CONTROLLER_KEY);
+ if (controller == null) {
controller = new Controller();
dataDictionary.setData(IUserDataConstants.XWT_CONTROLLER_KEY, controller);
}
@@ -604,12 +604,12 @@ public class UserData {
public static IObservableValueListener getObservableValueManager(Object object) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
return null;
}
- UserData userData = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(userData != null) {
+ UserData userData = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (userData != null) {
return userData.getObservableValueManager();
}
return null;
@@ -617,7 +617,7 @@ public class UserData {
public static void setObservableValueManager(Object object, IObservableValueListener eventManager) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
throw new IllegalStateException("Not SWT Widget");
}
UserData userData = updateDataDictionary(object);
@@ -626,27 +626,27 @@ public class UserData {
public static Object findData(Object object, String key) {
Widget widget = getWidget(object);
- if(widget == null) {
+ if (widget == null) {
return Collections.EMPTY_MAP;
}
- UserData dataDictionary = (UserData)widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ UserData dataDictionary = (UserData) widget.getData(IUserDataConstants.XWT_USER_DATA_KEY);
Object resources = null;
- if(dataDictionary != null) {
+ if (dataDictionary != null) {
resources = dataDictionary.getData(key);
- if(resources != null) {
+ if (resources != null) {
return resources;
}
}
Widget parent = widget;
- while(parent != null) {
- dataDictionary = (UserData)parent.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
+ while (parent != null) {
+ dataDictionary = (UserData) parent.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
resources = dataDictionary.getData(key);
- if(resources != null) {
+ if (resources != null) {
return resources;
}
- parent = (Widget)dataDictionary.getData(IUserDataConstants.XWT_PARENT_KEY);
+ parent = (Widget) dataDictionary.getData(IUserDataConstants.XWT_PARENT_KEY);
} else {
parent = getParent(parent);
}
@@ -655,21 +655,21 @@ public class UserData {
}
public static Map<?, ?> getResources(Object object) {
- return (Map<?, ?>)findData(object, IUserDataConstants.XWT_RESOURCES_KEY);
+ return (Map<?, ?>) findData(object, IUserDataConstants.XWT_RESOURCES_KEY);
}
public static void setObjectName(Object object, String name) {
Widget widget = getWidget(object);
ScopeKeeper nameScoped;
- if(UserData.findElementByName(widget, name) != null) {
+ if (UserData.findElementByName(widget, name) != null) {
// throw an exception or log a message?
return;
}
Widget parent = UserData.getTreeParent(widget);
- UserData dataDictionary = (UserData)parent.getData(IUserDataConstants.XWT_USER_DATA_KEY);
- if(dataDictionary != null) {
- if(dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY) != null) {
- nameScoped = (ScopeKeeper)dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
+ UserData dataDictionary = (UserData) parent.getData(IUserDataConstants.XWT_USER_DATA_KEY);
+ if (dataDictionary != null) {
+ if (dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY) != null) {
+ nameScoped = (ScopeKeeper) dataDictionary.getData(IUserDataConstants.XWT_NAMECONTEXT_KEY);
} else {
ScopeKeeper parentNameScope = findScopeKeeper(parent);
nameScoped = new ScopeKeeper(parentNameScope, widget);
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/Attribute.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/Attribute.java
index 6cd357207f4..6adfd9cc6b3 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/Attribute.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/Attribute.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -40,7 +40,7 @@ public class Attribute extends Element {
@Override
public Object clone() throws CloneNotSupportedException {
- Attribute attribute = (Attribute)super.clone();
+ Attribute attribute = (Attribute) super.clone();
attribute.setId(getId());
return attribute;
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DefaultElementCache.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DefaultElementCache.java
index b7c3e1e98cb..074bd324835 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DefaultElementCache.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DefaultElementCache.java
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014 CEA and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@ import java.util.Map;
*/
public class DefaultElementCache implements IElementCache {
- /** The default cache size (currently {@value}). */
+ /** The default cache size (currently {@value} ). */
static int DEFAULT_CACHE_SIZE = 128;
private final int cacheSize;
@@ -31,6 +31,7 @@ public class DefaultElementCache implements IElementCache {
private static final long serialVersionUID = 1L;
+ @Override
protected boolean removeEldestEntry(Map.Entry<String, Element> eldest) {
return size() > cacheSize;
}
@@ -46,17 +47,17 @@ public class DefaultElementCache implements IElementCache {
/**
* Initializes me with a specific size of cache.
- *
+ *
* @param cacheSize
- * the maximal number of cached XML elements to keep
- *
+ * the maximal number of cached XML elements to keep
+ *
* @throws IllegalArgumentException
- * if the {@code cacheSize} is not positive
+ * if the {@code cacheSize} is not positive
*/
public DefaultElementCache(int cacheSize) {
super();
- if(cacheSize <= 0) {
+ if (cacheSize <= 0) {
throw new IllegalArgumentException("non-positive cacheSize"); //$NON-NLS-1$
}
diff --git a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DocumentObject.java b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DocumentObject.java
index 38ac56fe253..aadf5c8109b 100644
--- a/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DocumentObject.java
+++ b/plugins/xwt/org.eclipse.papyrus.xwt/src/org/eclipse/papyrus/xwt/internal/xml/DocumentObject.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Soyatec - initial API and implementation
*******************************************************************************/
@@ -59,9 +59,9 @@ public class DocumentObject extends Observable implements Cloneable {
public void addChild(DocumentObject child) {
assert child != null;
- if(children.add(child)) {
+ if (children.add(child)) {
DocumentObject oParent = (child).getParent();
- if(oParent != null) {
+ if (oParent != null) {
oParent.delChild(child);
}
// Assign the new parent.
@@ -143,7 +143,7 @@ public class DocumentObject extends Observable implements Cloneable {
*/
public void include(ElementManager elementManager, String path) throws IOException {
InputStream input = elementManager.getDocumentRoot().openStream(path);
- if(input != null) {
+ if (input != null) {
include(elementManager, input);
}
input.close();
@@ -160,14 +160,14 @@ public class DocumentObject extends Observable implements Cloneable {
@Override
public Object clone() throws CloneNotSupportedException {
- DocumentObject docobj = (DocumentObject)super.clone();
+ DocumentObject docobj = (DocumentObject) super.clone();
// Clear object id.
docobj.id = null;
// Clone children.
- for(DocumentObject child : getChildren()) {
- DocumentObject nChild = (DocumentObject)child.clone();
+ for (DocumentObject child : getChildren()) {
+ DocumentObject nChild = (DocumentObject) child.clone();
docobj.addChild(nChild);
}
@@ -176,10 +176,10 @@ public class DocumentObject extends Observable implements Cloneable {
/**