This commit was manufactured by cvs2svn to create tag 'v20090204-1930'.
Sprout from master 2009-02-04 22:59:52 UTC Boris Bokowski <bbokowski> 'Had to fix problems after merge with Paul's changes - Bug 263710 Get rid of weird IHasInput interface'
Cherrypick from master 2009-02-02 21:36:05 UTC Boris Bokowski <bbokowski> 'Getting rid of photo demo specific application class. See bug 263057':
bundles/org.eclipse.e4.ui.workbench/Application.xmi
bundles/org.eclipse.e4.ui.workbench/META-INF/EWorkbench.xmi
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/behaviors/IHasInput.java
Delete:
bundles/org.eclipse.e4.ui.css.core/.classpath
bundles/org.eclipse.e4.ui.css.core/.project
bundles/org.eclipse.e4.ui.css.core/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF
bundles/org.eclipse.e4.ui.css.core/about.html
bundles/org.eclipse.e4.ui.css.core/apache_about_files/LICENSE-2.0.txt
bundles/org.eclipse.e4.ui.css.core/apache_about_files/NOTICE
bundles/org.eclipse.e4.ui.css.core/build.properties
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/SACConstants.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2FontHelper.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2FontPropertiesHelpers.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2PrimitiveValueImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2RGBColorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSSBorderPropertiesHelpers.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSExtendedProperties.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSProperty.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSPropertyList.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSStylableElement.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ElementAdapter.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedCSSRule.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/IElementProvider.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/CSSParser.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/CSSParserFactory.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/ICSSParserFactory.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/AbstractCSSPropertyCompositeHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/CSSBorderProperties.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/Gradient.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyCompositeHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler2.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler2Delegate.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandlerProvider.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/AbstractCSSValueConverter.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/CSSValueBooleanConverterImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/CSSValueConverterConfigColorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverter.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverterColorConfig.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverterConfig.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBackgroundCompositeHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBackgroundHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBorderCompositeHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBorderHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyClassificationHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyDimensionHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyFontCompositeHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyFontHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyTextHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/CSS2FontProperties.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/CSS2FontPropertiesImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyBackgroundHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyBorderHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyClassificationHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyDimensionHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyFontHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyTextHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/AbstractCSSPropertyHandlerProvider.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerSimpleProviderImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/selectors/IDynamicPseudoClassesHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSElementContext.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSEngine.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSErrorHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/DOMExceptionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/ExceptionResource.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/UnsupportedClassCSSPropertyException.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/UnsupportedPropertyException.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/AbstractCSSNode.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSS2PropertiesImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSComputedStyleImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSExtendedPropertiesImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSFontFaceRuleImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSImportRuleImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSMediaRuleImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPageRuleImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPropertyImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPropertyListImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSRuleImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSRuleListImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleDeclarationImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleRuleImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleSheetImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSUnknownRuleImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueFactory.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueListImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CounterImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/Measure.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/RGBColorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/RectImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleSheetListImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/AbstractCSSParser.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/CSSParserFactoryImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/CSSParserImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/properties/CSSBorderPropertiesImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSElementContextImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSEngineImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSErrorHandlerImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractAttributeCondition.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractCombinatorCondition.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractDescendantSelector.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractElementSelector.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractSiblingSelector.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSAndConditionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSAttributeConditionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSBeginHyphenAttributeConditionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSChildSelectorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSClassConditionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSConditionFactoryImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSConditionalSelectorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDescendantSelectorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDirectAdjacentSelectorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDocumentHandlerImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSElementSelectorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSIdConditionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSLangConditionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSOneOfAttributeConditionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSPseudoClassConditionImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSPseudoElementSelectorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSSelectorFactoryImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/DocumentHandlerFactoryImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/ExtendedCondition.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/ExtendedSelector.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/SACParserFactoryImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/AbstractResourcesRegistry.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/CSSResourcesHelpers.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/IResourcesRegistry.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/DocumentHandlerFactory.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ExtendedDocumentHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/IDocumentHandlerFactory.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ISACParserFactory.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ParserNotFoundException.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/SACParserFactory.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSHTMLSerializerConfiguration.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializerConfiguration.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/FileResourcesLocatorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/HttpResourcesLocatorImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/ResourcesLocatorManager.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IResourceLocator.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IResourcesLocatorManager.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IURIResolver.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/ClassUtils.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/NumberUtils.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/Platform.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/StringUtils.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/engine/CSSXMLEngineImpl.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyBackgroundXMLHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyFontXMLHandler.java
bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyTextXMLHandler.java
bundles/org.eclipse.e4.ui.css.swt/.classpath
bundles/org.eclipse.e4.ui.css.swt/.project
bundles/org.eclipse.e4.ui.css.swt/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.e4.ui.css.swt/META-INF/MANIFEST.MF
bundles/org.eclipse.e4.ui.css.swt/about.html
bundles/org.eclipse.e4.ui.css.swt/build.properties
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/CSSSWTConstants.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/SWTElement.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/SWTElementProvider.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/html/SWTHTMLElement.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/html/SWTHTMLElementProvider.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/AbstractCSSSWTEngineImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTApplyStylesListener.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTEngineImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTLazyHandlerEngineImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/html/CSSSWTHTMLEngineImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTCursorHelper.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTFontHelper.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTHelpers.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTImageHelper.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTElementHelpers.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTStyleHelpers.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/AbstractCSSPropertySWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/AbstractConvertedCSSPropertySWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/GradientBackgroundListener.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTColorConverterImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTCursorConverterImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTFontConverterImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTFontDataConverterImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTGradientConverterImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTImageConverterImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTRGBConverterImpl.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyBackgroundSWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyBorderSWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyClassificationSWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyFontSWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyTextSWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundColorHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundImageHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/AbstractCSSPropertyBorderSWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderColorHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderSWTHandler2.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderStyleHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderWidthHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/classification/CSSPropertyCursorHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/AbstractCSSPropertyFontSWTHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontFamilyHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontSWTHandler2.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontSizeHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontStyleHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontWeightHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/text/CSSPropertyColorHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/resources/SWTResourcesRegistry.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/AbstractDynamicPseudoClassesControlHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/DynamicPseudoClassesSWTFocusHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/DynamicPseudoClassesSWTHoverHandler.java
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/serializers/CSSSWTSerializerConfiguration.java
examples/org.eclipse.e4.ui.examples.css.rcp/.classpath
examples/org.eclipse.e4.ui.examples.css.rcp/.project
examples/org.eclipse.e4.ui.examples.css.rcp/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.e4.ui.examples.css.rcp/META-INF/MANIFEST.MF
examples/org.eclipse.e4.ui.examples.css.rcp/build.properties
examples/org.eclipse.e4.ui.examples.css.rcp/icons/mail.ico
examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample.gif
examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample.icns
examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample2.gif
examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample3.gif
examples/org.eclipse.e4.ui.examples.css.rcp/plugin.xml
examples/org.eclipse.e4.ui.examples.css.rcp/product_lg.gif
examples/org.eclipse.e4.ui.examples.css.rcp/splash.bmp
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Activator.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Application.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationActionBarAdvisor.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationWorkbenchAdvisor.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationWorkbenchWindowAdvisor.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ICommandIds.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/MarkAsReadAction.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/NavigationView.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/OpenViewAction.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Perspective.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/View.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/presentation/CSSPresentationFactory.java
examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/presentation/CSSTabFolder.java
examples/org.eclipse.e4.ui.examples.css.rcp/styles/stylesheet.css
examples/org.eclipse.e4.ui.examples.css/.classpath
examples/org.eclipse.e4.ui.examples.css/.project
examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.e4.ui.examples.css/META-INF/MANIFEST.MF
examples/org.eclipse.e4.ui.examples.css/build.properties
examples/org.eclipse.e4.ui.examples.css/images/bluefade-banner.gif
examples/org.eclipse.e4.ui.examples.css/images/bluefade-full.gif
examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/Activator.java
examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSEditor.java
examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSSWTEditor.java
examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/CSSEditorSWTWidgets.java
examples/org.eclipse.e4.ui.examples.css/styles/html/Osx.css
examples/org.eclipse.e4.ui.examples.css/styles/html/Vista.css
examples/org.eclipse.e4.ui.examples.css/styles/swt/Example.css
examples/org.eclipse.e4.ui.examples.css/styles/swt/Osx.css
examples/org.eclipse.e4.ui.examples.css/styles/swt/Vista.css
tests/org.eclipse.e4.ui.compatibility.tests/.classpath
tests/org.eclipse.e4.ui.compatibility.tests/.project
tests/org.eclipse.e4.ui.compatibility.tests/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.e4.ui.compatibility.tests/META-INF/MANIFEST.MF
tests/org.eclipse.e4.ui.compatibility.tests/build.properties
tests/org.eclipse.e4.ui.compatibility.tests/contexts.xml
tests/org.eclipse.e4.ui.compatibility.tests/icons/sample.gif
tests/org.eclipse.e4.ui.compatibility.tests/plugin.xml
tests/org.eclipse.e4.ui.compatibility.tests/src/TestViews/CompatView.java
tests/org.eclipse.e4.ui.compatibility.tests/src/org/eclipse/e4/ui/compatibility/tests/Activator.java
tests/org.eclipse.e4.ui.compatibility.tests/src/org/eclipse/e4/ui/compatibility/tests/views/SampleView.java
tests/org.eclipse.e4.ui.tests.css.core/.classpath
tests/org.eclipse.e4.ui.tests.css.core/.project
tests/org.eclipse.e4.ui.tests.css.core/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.e4.ui.tests.css.core/CSS Core Test Suite.launch
tests/org.eclipse.e4.ui.tests.css.core/META-INF/MANIFEST.MF
tests/org.eclipse.e4.ui.tests.css.core/build.properties
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/Activator.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CssCoreTestSuite.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/CascadeTest.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/FontFaceRulesTest.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/MediaRulesTest.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/RGBColorImplTest.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/StyleRuleTest.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/ViewCSSTest.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/util/ParserTestUtil.java
tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/util/TestElement.java
tests/org.eclipse.e4.ui.tests.css.core/test.xml
tests/org.eclipse.e4.ui.tests.css.swt/.classpath
tests/org.eclipse.e4.ui.tests.css.swt/.project
tests/org.eclipse.e4.ui.tests.css.swt/.settings/org.eclipse.jdt.core.prefs
tests/org.eclipse.e4.ui.tests.css.swt/CSS SWT Test Suite.launch
tests/org.eclipse.e4.ui.tests.css.swt/META-INF/MANIFEST.MF
tests/org.eclipse.e4.ui.tests.css.swt/build.properties
tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/Activator.java
tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CSSTestCase.java
tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CTabFolderTest.java
tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CssSwtTestSuite.java
tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/IdClassLabelColorTest.java
tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/LabelTest.java
tests/org.eclipse.e4.ui.tests.css.swt/test.xml
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/dom/parsers/CSSParserTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/examples/csseditors/AbstractCSSEditor.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/CSSCoreResources.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/html/font-html.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/html/simple-html.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/style-class.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/MockDocumentHandler.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/AbstractParseStyleSheet.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/batik/ParseStyleSheet.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/flute/ParseStyleSheet.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/xml/engine/CSSXMLEngineImplTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/xml/engine/test.xhtml
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/html/Osx.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/html/Vista.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/swt/Osx.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/swt/Vista.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/core/examples/csseditors/AbstractCSSEditor.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/CSSSWTEngineSimpleTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/CSSSWTEngineTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/className/CSSSWTEngineCLassNameTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/html/CSSSWTHTMLEngineTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/lazy/CSSSWTLazyEngineTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/lazy/CSSSWTLazyHandlerEngineTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/pseudoClasses/CSSSWTEnginePseudoClassesTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/style/CSSSWTEngineStyleTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/styleDeclaration/CSSSWTEngineStyleDeclarationTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/styleDeclaration/CSSSWTEngineStyleDeclarationTest2.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/CSSSWTTableViewerEngineTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/CSSSWTTableViewerEngineTest2.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/viewers/MyCSSLabelProvider.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/viewers/MyCSSTableLabelProvider.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/AbstractChatExample.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithMatrixStyle.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithOsxStyle.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithStylesAppliedAtRuntime.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithVistaStyle.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/csseditors/AbstractCSSSWTEditor.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/csseditors/CSSEditorSWTWidgets.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/CSSSWTResources.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/Osx.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/Vista.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/pseudo-class.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/swt.css
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest1.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest2.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest3.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest4.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest5.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest6.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest7.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/type/SWTTypeSelectorTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/SWTUniversalSelectorTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest1.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest2.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest3.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/serializers/CSSSerializerSWTTest.java
tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/uiforms/engine/html/CSSFormTextTest.java
diff --git a/bundles/org.eclipse.e4.ui.css.core/.classpath b/bundles/org.eclipse.e4.ui.css.core/.classpath
deleted file mode 100644
index 64c5e31..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.e4.ui.css.core/.project b/bundles/org.eclipse.e4.ui.css.core/.project
deleted file mode 100644
index bc83f6b..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.e4.ui.css.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.e4.ui.css.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.ui.css.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4079f12..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Tue Nov 18 20:32:19 EST 2008
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
diff --git a/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 4988995..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,34 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Core
-Bundle-SymbolicName: org.eclipse.e4.ui.css.core
-Bundle-Version: 0.9.0.qualifier
-Export-Package: org.eclipse.e4.ui.css.core,
- org.eclipse.e4.ui.css.core.css2,
- org.eclipse.e4.ui.css.core.dom,
- org.eclipse.e4.ui.css.core.dom.parsers,
- org.eclipse.e4.ui.css.core.dom.properties,
- org.eclipse.e4.ui.css.core.dom.properties.converters,
- org.eclipse.e4.ui.css.core.dom.properties.css2,
- org.eclipse.e4.ui.css.core.dom.properties.providers,
- org.eclipse.e4.ui.css.core.dom.selectors,
- org.eclipse.e4.ui.css.core.engine,
- org.eclipse.e4.ui.css.core.exceptions,
- org.eclipse.e4.ui.css.core.impl.dom,
- org.eclipse.e4.ui.css.core.impl.dom.parsers,
- org.eclipse.e4.ui.css.core.impl.dom.properties,
- org.eclipse.e4.ui.css.core.impl.engine,
- org.eclipse.e4.ui.css.core.impl.sac,
- org.eclipse.e4.ui.css.core.resources,
- org.eclipse.e4.ui.css.core.sac,
- org.eclipse.e4.ui.css.core.serializers,
- org.eclipse.e4.ui.css.core.util.impl.resources,
- org.eclipse.e4.ui.css.core.util.resources,
- org.eclipse.e4.ui.css.core.utils,
- org.eclipse.e4.ui.css.xml.engine,
- org.eclipse.e4.ui.css.xml.properties.css2
-Require-Bundle: org.apache.commons.logging;bundle-version="1.0.4",
- org.apache.xerces;bundle-version="2.8.0",
- org.w3c.css.sac;bundle-version="1.3.0",
- org.apache.batik.css;bundle-version="1.6.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/bundles/org.eclipse.e4.ui.css.core/about.html b/bundles/org.eclipse.e4.ui.css.core/about.html
deleted file mode 100644
index 3ce4e7e..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>November 20, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.core/apache_about_files/LICENSE-2.0.txt b/bundles/org.eclipse.e4.ui.css.core/apache_about_files/LICENSE-2.0.txt
deleted file mode 100644
index 3e4e3d0..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/apache_about_files/LICENSE-2.0.txt
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.core/apache_about_files/NOTICE b/bundles/org.eclipse.e4.ui.css.core/apache_about_files/NOTICE
deleted file mode 100644
index 6feaada..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/apache_about_files/NOTICE
+++ /dev/null
@@ -1,8 +0,0 @@
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This software contains code from the World Wide Web Consortium (W3C) for the
-Document Object Model API (DOM API) and SVG Document Type Definition (DTD).
-
-This software contains code from the International Organisation for Standardization
-for the definition of character entities used in the software's documentation.
diff --git a/bundles/org.eclipse.e4.ui.css.core/build.properties b/bundles/org.eclipse.e4.ui.css.core/build.properties
deleted file mode 100644
index b107977..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-source.. = src/
-bin.includes = META-INF/,\
- .
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/SACConstants.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/SACConstants.java
deleted file mode 100644
index 5e29b1a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/SACConstants.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core;
-
-/**
- * SAC Constants Parsers.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class SACConstants {
-
- /**
- * org.w3c.flute.parser.Parser SAC Parser.
- */
- public static final String SACPARSER_FLUTE = "org.w3c.flute.parser.Parser";
-
- /**
- * org.w3c.flute.parser.Parser SAC Parser.
- */
- public static final String SACPARSER_FLUTE_CSS3 = "org.w3c.flute.parser.CSS3Parser";
-
- /**
- * com.steadystate.css.parser.SACParser SAC Parser
- */
- public static final String SACPARSER_STEADYSTATE = "com.steadystate.css.parser.SACParser";
-
- /**
- * org.apache.batik.css.parser.Parser SAC Parser.
- */
- public static final String SACPARSER_BATIK = "org.apache.batik.css.parser.Parser";
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java
deleted file mode 100644
index 6a6a0d0..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.css2;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterColorConfig;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.RGBColor;
-
-/**
- * CSS2 Color Helper.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSS2ColorHelper {
-
- /**
- * Map with key=color name and value=hexadecimal color.
- */
- private static Map colorNamesMap = new HashMap();;
-
- /**
- * Map with key=hexadecimal color and value=color name.
- */
- private static Map colorHexasMap = new HashMap();;
-
- /**
- * Return w3c {@link RGBColor} from string value. Format String value is
- * hexadecimal like #FFFFFF or color name like white.
- *
- * @param value
- * @return
- */
- public static RGBColor getRGBColor(String value) {
- if (value.startsWith("#") && value.length() == 7) {
- // Color is like #FFFFFF
- try {
- int redValue = Integer.decode("0x" + value.substring(1, 3))
- .intValue();
- int greenValue = Integer.decode("0x" + value.substring(3, 5))
- .intValue();
- int blueValue = Integer.decode("0x" + value.substring(5))
- .intValue();
- return new CSS2RGBColorImpl(redValue, greenValue, blueValue);
- } catch (Exception e) {
- return null;
- }
- }
- // Search if it's color name
- value = value.toLowerCase();
- value = (String) colorNamesMap.get(value);
- if (value != null)
- return getRGBColor(value);
- return null;
- }
-
- /**
- * Return color string form w3c <code>rgbColor</code> instance. The format
- * (Hexa, color name or rgb format) of the color string is managed with
- * <code>config</code> {@link ICSSValueConverterConfig}.
- *
- * @param rgbColor
- * @param config
- * @return
- */
- public static String getColorStringValue(RGBColor rgbColor,
- ICSSValueConverterConfig config) {
- if (config instanceof ICSSValueConverterColorConfig) {
- ICSSValueConverterColorConfig colorConfig = (ICSSValueConverterColorConfig) config;
- switch (colorConfig.getFormat()) {
- case ICSSValueConverterColorConfig.COLOR_HEXA_FORMAT:
- return getHexaColorStringValue(rgbColor);
- case ICSSValueConverterColorConfig.COLOR_RGB_FORMAT:
- return getRGBColorStringValue(rgbColor);
- case ICSSValueConverterColorConfig.COLOR_NAME_FORMAT:
- // Get the Hexa color string value
- String hexaColor = getHexaColorStringValue(rgbColor);
- if (hexaColor != null) {
- // Search into hexa map the color name
- String colorName = getColorNameFromHexaColor(hexaColor);
- if (colorName != null)
- return colorName;
- // Color name is not found, return the Hexa value
- return hexaColor;
-
- }
- return getRGBColorStringValue(rgbColor);
- }
-
- }
- return getHexaColorStringValue(rgbColor);
- }
-
- /**
- * Return rgb (ex : rgb(0,0,0)) color string value from w3c
- * <code>rgbColor</code> instance.
- *
- * @param rgbColor
- * @return
- */
- public static String getRGBColorStringValue(RGBColor rgbColor) {
- String result = "rgb(";
- int red = (int) rgbColor.getRed().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER);
- result += red;
- result += ",";
- int green = (int) rgbColor.getGreen().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER);
- result += green;
- result += ",";
- int blue = (int) rgbColor.getBlue().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER);
- result += blue;
- result += ")";
- return result;
- }
-
- /**
- * Return hexadecimal (ex : #FFFFFF) color string value from w3c
- * <code>rgbColor</code> instance.
- *
- * @param rgbColor
- * @return
- */
- public static String getHexaColorStringValue(RGBColor rgbColor) {
- String result = "#";
- int red = (int) rgbColor.getRed().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER);
- if (red < 16)
- result += "0";
- result += Integer.toHexString(red);
- int green = (int) rgbColor.getGreen().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER);
- if (green < 16)
- result += "0";
- result += Integer.toHexString(green);
- int blue = (int) rgbColor.getBlue().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER);
- if (blue < 16)
- result += "0";
- result += Integer.toHexString(blue);
- return result;
- }
-
- /**
- * Return the Hexa color (ex : #FFFFFF) from color name (ex : white).
- *
- * @param colorName
- * @return
- */
- public static String getHexaColorFromColorName(String colorName) {
- return (String) colorNamesMap.get(colorName);
- }
-
- /**
- * Return true if <code>value</code> is color name (ex : white) and false
- * otherwise.
- *
- * @param value
- * @return
- */
- public static boolean isColorName(String value) {
- return (colorNamesMap.get(value) != null);
- }
-
- /**
- * Return the color name (ex : white) from Hexa color (ex : #FFFFFF).
- *
- * @param hexaColor
- * @return
- */
- public static String getColorNameFromHexaColor(String hexaColor) {
- hexaColor = hexaColor.toUpperCase();
- return (String) colorHexasMap.get(hexaColor);
- }
-
- static {
- colorNamesMap.put("aliceBlue", "#F0F8FF");
- colorNamesMap.put("aqua", "#00FFFF");
- colorNamesMap.put("aquamarine", "#7FFFD4");
- colorNamesMap.put("azure", "#F0FFFF");
- colorNamesMap.put("beige", "#F5F5DC");
- colorNamesMap.put("bisque", "#FFE4C4");
- colorNamesMap.put("black", "#000000");
- colorNamesMap.put("blanchedalmond", "#FFEBCD");
- colorNamesMap.put("blue", "#0000FF");
- colorNamesMap.put("blueviolet", "#8A2BE2");
- colorNamesMap.put("brown", "#A52A2A");
- colorNamesMap.put("burlywood", "#DEB887");
- colorNamesMap.put("cadetblue", "#5F9EA0");
- colorNamesMap.put("chartreuse", "#7FFF00");
- colorNamesMap.put("chocolate", "#D2691E");
- colorNamesMap.put("coral", "#FF7F50");
- colorNamesMap.put("cornflowerblue", "#6495ED");
- colorNamesMap.put("cornsilk", "#FFF8DC");
- colorNamesMap.put("crimson", "#DC143C");
- colorNamesMap.put("cyan", "#00FFFF");
- colorNamesMap.put("darkblue", "#00008B");
- colorNamesMap.put("darkcyan", "#008B8B");
- colorNamesMap.put("darkgoldenrod", "#B8860B");
- colorNamesMap.put("darkgray", "#A9A9A9");
- colorNamesMap.put("darkgrey", "#A9A9A9");
- colorNamesMap.put("darkgreen", "#006400");
- colorNamesMap.put("darkkhaki", "#BDB76B");
- colorNamesMap.put("darkmagenta", "#8B008B");
- colorNamesMap.put("darkolivegreen", "#556B2F");
- colorNamesMap.put("darkorange", "#FF8C00");
- colorNamesMap.put("darkorchid", "#9932CC");
- colorNamesMap.put("darkred", "#8B0000");
- colorNamesMap.put("darksalmon", "#E9967A");
- colorNamesMap.put("darkseagreen", "#8FBC8F");
- colorNamesMap.put("darkslateblue", "#483D8B");
- colorNamesMap.put("darkslategray", "#2F4F4F");
- colorNamesMap.put("darkslategrey", "#2F4F4F");
- colorNamesMap.put("darkturquoise", "#00CED1");
- colorNamesMap.put("darkviolet", "#9400D3");
- colorNamesMap.put("deeppink", "#FF1493");
- colorNamesMap.put("deepskyblue", "#00BFFF");
- colorNamesMap.put("dimgray", "#696969");
- colorNamesMap.put("dimgrey", "#696969");
- colorNamesMap.put("dodgerblue", "#1E90FF");
- colorNamesMap.put("firebrick", "#B22222");
- colorNamesMap.put("floralwhite", "#FFFAF0");
- colorNamesMap.put("forestgreen", "#228B22");
- colorNamesMap.put("fuchsia", "#FF00FF");
- colorNamesMap.put("gainsboro", "#DCDCDC");
- colorNamesMap.put("ghostwhite", "#F8F8FF");
- colorNamesMap.put("gold", "#FFD700");
- colorNamesMap.put("goldenrod", "#DAA520");
- colorNamesMap.put("gray", "#808080");
- colorNamesMap.put("grey", "#808080");
- colorNamesMap.put("green", "#008000");
- colorNamesMap.put("greenyellow", "#ADFF2F");
- colorNamesMap.put("honeydew", "#F0FFF0");
- colorNamesMap.put("hotpink", "#FF69B4");
- colorNamesMap.put("indianred", "#CD5C5C");
- colorNamesMap.put("indigo", "#4B0082");
- colorNamesMap.put("ivory", "#FFFFF0");
- colorNamesMap.put("khaki", "#F0E68C");
- colorNamesMap.put("lavender", "#E6E6FA");
- colorNamesMap.put("lavenderblush", "#FFF0F5");
- colorNamesMap.put("lawngreen", "#7CFC00");
- colorNamesMap.put("lemonchiffon", "#FFFACD");
- colorNamesMap.put("lightblue", "#ADD8E6");
- colorNamesMap.put("lightcoral", "#F08080");
- colorNamesMap.put("lightcyan", "#E0FFFF");
- colorNamesMap.put("lightgoldenrodyellow", "#FAFAD2");
- colorNamesMap.put("lightgray", "#D3D3D3");
- colorNamesMap.put("lightgrey", "#D3D3D3");
- colorNamesMap.put("lightgreen", "#90EE90");
- colorNamesMap.put("lightpink", "#FFB6C1");
- colorNamesMap.put("lightsalmon", "#FFA07A");
- colorNamesMap.put("lightseagreen", "#20B2AA");
- colorNamesMap.put("lightskyblue", "#87CEFA");
- colorNamesMap.put("lightslategray", "#778899");
- colorNamesMap.put("lightslategrey", "#778899");
- colorNamesMap.put("lightsteelblue", "#B0C4DE");
- colorNamesMap.put("lightyellow", "#FFFFE0");
- colorNamesMap.put("lime", "#00FF00");
- colorNamesMap.put("limegreen", "#32CD32");
- colorNamesMap.put("linen", "#FAF0E6");
- colorNamesMap.put("magenta", "#FF00FF");
- colorNamesMap.put("maroon", "#800000");
- colorNamesMap.put("mediumaquamarine", "#66CDAA");
- colorNamesMap.put("mediumblue", "#0000CD");
- colorNamesMap.put("mediumorchid", "#BA55D3");
- colorNamesMap.put("mediumpurple", "#9370D8");
- colorNamesMap.put("mediumseagreen", "#3CB371");
- colorNamesMap.put("mediumslateblue", "#7B68EE");
- colorNamesMap.put("mediumspringgreen", "#00FA9A");
- colorNamesMap.put("mediumturquoise", "#48D1CC");
- colorNamesMap.put("mediumvioletred", "#C71585");
- colorNamesMap.put("midnightblue", "#191970");
- colorNamesMap.put("mintcream", "#F5FFFA");
- colorNamesMap.put("mistyrose", "#FFE4E1");
- colorNamesMap.put("moccasin", "#FFE4B5");
- colorNamesMap.put("navajowhite", "#FFDEAD");
- colorNamesMap.put("navy", "#000080");
- colorNamesMap.put("oldlace", "#FDF5E6");
- colorNamesMap.put("olive", "#808000");
- colorNamesMap.put("olivedrab", "#6B8E23");
- colorNamesMap.put("orange", "#FFA500");
- colorNamesMap.put("orangered", "#FF4500");
- colorNamesMap.put("orchid", "#DA70D6");
- colorNamesMap.put("palegoldenrod", "#EEE8AA");
- colorNamesMap.put("palegreen", "#98FB98");
- colorNamesMap.put("paleturquoise", "#AFEEEE");
- colorNamesMap.put("palevioletred", "#D87093");
- colorNamesMap.put("papayawhip", "#FFEFD5");
- colorNamesMap.put("peachpuff", "#FFDAB9");
- colorNamesMap.put("peru", "#CD853F");
- colorNamesMap.put("pink", "#FFC0CB");
- colorNamesMap.put("plum", "#DDA0DD");
- colorNamesMap.put("powderblue", "#B0E0E6");
- colorNamesMap.put("purple", "#800080");
- colorNamesMap.put("red", "#FF0000");
- colorNamesMap.put("rosybrown", "#BC8F8F");
- colorNamesMap.put("royalblue", "#4169E1");
- colorNamesMap.put("saddlebrown", "#8B4513");
- colorNamesMap.put("salmon", "#FA8072");
- colorNamesMap.put("sandybrown", "#F4A460");
- colorNamesMap.put("seagreen", "#2E8B57");
- colorNamesMap.put("seashell", "#FFF5EE");
- colorNamesMap.put("sienna", "#A0522D");
- colorNamesMap.put("silver", "#C0C0C0");
- colorNamesMap.put("skyblue", "#87CEEB");
- colorNamesMap.put("slateblue", "#6A5ACD");
- colorNamesMap.put("slategray", "#708090");
- colorNamesMap.put("slategrey", "#708090");
- colorNamesMap.put("snow", "#FFFAFA");
- colorNamesMap.put("springgreen", "#00FF7F");
- colorNamesMap.put("steelblue", "#4682B4");
- colorNamesMap.put("tan", "#D2B48C");
- colorNamesMap.put("teal", "#008080");
- colorNamesMap.put("thistle", "#D8BFD8");
- colorNamesMap.put("tomato", "#FF6347");
- colorNamesMap.put("turquoise", "#40E0D0");
- colorNamesMap.put("violet", "#EE82EE");
- colorNamesMap.put("wheat", "#F5DEB3");
- colorNamesMap.put("white", "#FFFFFF");
- colorNamesMap.put("whitesmoke", "#F5F5F5");
- colorNamesMap.put("yellow", "#FFFF00");
- colorNamesMap.put("yellowgreen", "#9ACD32");
-
- // Build Map with key=hexadecimal color and value=color name
- for (Iterator iterator = colorNamesMap.entrySet().iterator(); iterator
- .hasNext();) {
- Map.Entry entry = (Map.Entry) iterator.next();
- colorHexasMap.put(entry.getValue(), entry.getKey());
- }
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2FontHelper.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2FontHelper.java
deleted file mode 100644
index db11203..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2FontHelper.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.css2;
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- * CSS2 Font Helper.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSS2FontHelper {
-
- /**
- * Return CSS2 font-family. Escape font <code>family</code> with " if
- * need.
- *
- * @param family
- * @return
- */
- public static String getFontFamily(String family) {
- if (family == null)
- return null;
- if (family.indexOf(" ") != -1 || family.startsWith("@"))
- family = "\"" + family + "\"";
- return family;
- }
-
- /**
- * Return CSS2 font-size of int <code>size</code>.
- *
- * @param size
- * @return
- */
- public static String getFontSize(int size) {
- return size + "";
- }
-
- /**
- * Return CSS2 font-style.
- *
- * @param isItalic
- * @return
- */
- public static String getFontStyle(boolean isItalic) {
- if (isItalic)
- return "italic";
- return "normal";
- }
-
- /**
- * Return CSS2 font-weight.
- *
- * @param isBold
- * @return
- */
- public static String getFontWeight(boolean isBold) {
- if (isBold)
- return "bold";
- return "normal";
- }
-
- /**
- * Return the CSS Font Property name (font-style, font-weight, font-size,
- * font-family) switch the {@link CSSPrimitiveValue} <code>value</code>.
- *
- * @param value
- * @return
- */
- public static String getCSSFontPropertyName(CSSPrimitiveValue value) {
- short type = value.getPrimitiveType();
- switch (type) {
- case CSSPrimitiveValue.CSS_STRING:
- case CSSPrimitiveValue.CSS_IDENT:
- String s = value.getStringValue();
- if (/* "normal".equals(s) || */"italic".equals(s)
- || "oblique".equals(s)) {
- return "font-style";
- }
- if ("normal".equals(s) || "bold".equals(s) || "bolder".equals(s)) {
- return "font-weight";
- }
- return "font-family";
- case CSSPrimitiveValue.CSS_PT:
- case CSSPrimitiveValue.CSS_NUMBER:
- case CSSPrimitiveValue.CSS_PX:
- return "font-size";
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2FontPropertiesHelpers.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2FontPropertiesHelpers.java
deleted file mode 100644
index 4d5c630..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2FontPropertiesHelpers.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontPropertiesImpl;
-import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.CSSValueList;
-
-/**
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSS2FontPropertiesHelpers {
-
- /**
- * Constant used to store {@link CSS2FontProperties} instance into
- * {@link CSSElementContext} context.
- */
- public static final String CSS2FONT_KEY = "org.eclipse.e4.ui.css.core.css2.CSS2FONT_KEY";
-
- /**
- * Get {@link CSS2FontProperties} from {@link CSSElementContext} context.
- *
- * @param control
- * @return
- */
- public static CSS2FontProperties getCSS2FontProperties(
- CSSElementContext context) {
- // Search into Data of context if CSS2FontProperties exist.
- return (CSS2FontProperties) context.getData(CSS2FONT_KEY);
- }
-
- /**
- * Set {@link CSS2FontProperties} <code>fontProperties</code> into
- * {@link CSSElementContext} context.
- *
- * @param fontProperties
- * @param context
- */
- public static void setCSS2FontProperties(CSS2FontProperties fontProperties,
- CSSElementContext context) {
- if (fontProperties == null)
- return;
- context.setData(CSS2FONT_KEY, fontProperties);
- }
-
- /**
- * Create and return {@link CSS2FontProperties} instance from
- * <code>value</code>.
- *
- * @param value
- * @param property
- * @return
- */
- public static CSS2FontProperties createCSS2FontProperties(CSSValue value,
- String property) {
- CSS2FontProperties fontProperties = new CSS2FontPropertiesImpl();
- updateCSSPropertyFont(fontProperties, property, value);
- return fontProperties;
- }
-
- /**
- * Update the <code>property of</code> <code>fontProperties</code>
- * instance with the <code>value</code>.
- *
- * @param fontProperties
- * @param property
- * @param value
- */
- public static void updateCSSPropertyFont(CSS2FontProperties fontProperties,
- String property, CSSValue value) {
- if ("font-family".equals(property))
- updateCSSPropertyFontFamily(fontProperties, value);
- else if ("font-size".equals(property))
- updateCSSPropertyFontSize(fontProperties, value);
- else if ("font-style".equals(property))
- updateCSSPropertyFontStyle(fontProperties, value);
- else if ("font-weight".equals(property))
- updateCSSPropertyFontWeight(fontProperties, value);
- else if ("font".equals(property))
- updateCSSPropertyFontComposite(fontProperties, value);
- }
-
- /**
- * Update <code>fontProperties</code> instance with the {@link CSSValue}
- * <code>value</code>. value can be {@link CSSPrimitiveValue} or
- * {@link CSSValueList}.
- *
- * @param font
- * @param value
- */
- public static void updateCSSPropertyFontComposite(CSS2FontProperties font,
- CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
- CSSValueList valueList = (CSSValueList) value;
- int length = valueList.getLength();
- for (int i = 0; i < length; i++) {
- CSSValue value2 = valueList.item(i);
- updateCSSPropertyFontComposite(font, value2);
- }
- } else {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- String property = CSS2FontHelper
- .getCSSFontPropertyName((CSSPrimitiveValue) value);
- updateCSSPropertyFont(font, property, value);
- }
- }
- }
-
- /**
- * Update CSS2FontProperties instance with font-family.
- *
- * @param font
- * @param value
- * @throws Exception
- */
- public static void updateCSSPropertyFontFamily(CSS2FontProperties font,
- CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- font.setFamily((CSSPrimitiveValue) value);
- }
- }
-
- /**
- * Update CSS2FontProperties instance with font-size.
- *
- * @param font
- * @param value
- * @throws Exception
- */
- public static void updateCSSPropertyFontSize(CSS2FontProperties font,
- CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- font.setSize((CSSPrimitiveValue) value);
- }
- }
-
- /**
- * Update CSS2FontProperties instance with font-style.
- *
- * @param font
- * @param value
- * @throws Exception
- */
- public static void updateCSSPropertyFontStyle(CSS2FontProperties font,
- CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- font.setStyle((CSSPrimitiveValue) value);
- }
- }
-
- /**
- * Update CSS2FontProperties instance with font-weight.
- *
- * @param font
- * @param value
- * @throws Exception
- */
- public static void updateCSSPropertyFontWeight(CSS2FontProperties font,
- CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- font.setWeight((CSSPrimitiveValue) value);
- }
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2PrimitiveValueImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2PrimitiveValueImpl.java
deleted file mode 100644
index 9b63380..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2PrimitiveValueImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.css2;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.Counter;
-import org.w3c.dom.css.RGBColor;
-import org.w3c.dom.css.Rect;
-
-/**
- * Simple {@link CSSPrimitiveValue} implementation.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSS2PrimitiveValueImpl implements CSSPrimitiveValue {
-
- private String s = null;
-
- private float v = -9999;
-
- private int i = -9999;
-
- private short primitiveType;
-
- public CSS2PrimitiveValueImpl(String s) {
- this.s = s;
- this.primitiveType = CSSPrimitiveValue.CSS_IDENT;
- }
-
- public CSS2PrimitiveValueImpl(float v) {
- this.v = v;
- this.primitiveType = CSSPrimitiveValue.CSS_NUMBER;
- }
-
- public CSS2PrimitiveValueImpl(int i) {
- this.i = i;
- this.primitiveType = CSSPrimitiveValue.CSS_NUMBER;
- }
-
- public Counter getCounterValue() throws DOMException {
- return null;
- }
-
- public float getFloatValue(short word0) throws DOMException {
- if (v != -9999)
- return v;
- return i;
- }
-
- public short getPrimitiveType() {
- return primitiveType;
- }
-
- public Rect getRectValue() throws DOMException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public RGBColor getRGBColorValue() throws DOMException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getStringValue() throws DOMException {
- return s;
- }
-
- public void setFloatValue(short word0, float f) throws DOMException {
- // TODO Auto-generated method stub
-
- }
-
- public void setStringValue(short word0, String s) throws DOMException {
- // TODO Auto-generated method stub
-
- }
-
- public String getCssText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public short getCssValueType() {
- return CSSValue.CSS_PRIMITIVE_VALUE;
- }
-
- public void setCssText(String s) throws DOMException {
- // TODO Auto-generated method stub
-
- }
-
- public String toString() {
- if (s != null)
- return s;
- if (v != -9999)
- return v + "";
- if (i != -9999)
- return i + "";
- return super.toString();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2RGBColorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2RGBColorImpl.java
deleted file mode 100644
index e6cadeb..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2RGBColorImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.css2;
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.RGBColor;
-
-/**
- * Simple {@link RGBColor} implementation.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSS2RGBColorImpl implements RGBColor {
-
- private CSSPrimitiveValue red;
- private CSSPrimitiveValue green;
- private CSSPrimitiveValue blue;
-
- public CSS2RGBColorImpl(int r, int g, int b) {
- red = new CSS2PrimitiveValueImpl(r);
- green = new CSS2PrimitiveValueImpl(g);
- blue = new CSS2PrimitiveValueImpl(b);
- }
-
- public CSSPrimitiveValue getBlue() {
- return blue;
- }
-
- public CSSPrimitiveValue getGreen() {
- return green;
- }
-
- public CSSPrimitiveValue getRed() {
- return red;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSSBorderPropertiesHelpers.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSSBorderPropertiesHelpers.java
deleted file mode 100644
index d321cec..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSSBorderPropertiesHelpers.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.CSSBorderProperties;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS2 Border Helper.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSBorderPropertiesHelpers {
-
- /**
- * Update the <code>property of</code> <code>borderProperties</code>
- * instance with the <code>value</code>.
- *
- * @param border
- * @param property
- * @param value
- */
- public static void updateCSSProperty(CSSBorderProperties borderProperties,
- String property, CSSValue value) {
- if ("border-style".equals(property))
- updateCSSPropertyBorderStyle(borderProperties, value);
- else if ("border-color".equals(property))
- updateCSSPropertyBorderColor(borderProperties, value);
- else if ("border-width".equals(property))
- updateCSSPropertyBorderWidth(borderProperties, value);
- }
-
- /**
- * Update <code>borderProperties</code> instance with border-style
- * <code>value</code>.
- *
- * @param borderProperties
- * @param value
- */
- public static void updateCSSPropertyBorderStyle(
- CSSBorderProperties borderProperties, CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- borderProperties.setStyle(((CSSPrimitiveValue) value)
- .getStringValue());
- }
- }
-
- /**
- * Update <code>borderProperties</code> instance with border-color
- * <code>value</code>.
- *
- * @param borderProperties
- * @param value
- */
- public static void updateCSSPropertyBorderColor(
- CSSBorderProperties borderProperties, CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- borderProperties.setColor((CSSPrimitiveValue) value);
- }
- }
-
- /**
- * Update <code>borderProperties</code> instance with border-width
- * <code>value</code>.
- *
- * @param borderProperties
- * @param value
- */
- public static void updateCSSPropertyBorderWidth(
- CSSBorderProperties borderProperties, CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- borderProperties.setWidth((int) ((CSSPrimitiveValue) value)
- .getFloatValue(CSSPrimitiveValue.CSS_PT));
- }
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSExtendedProperties.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSExtendedProperties.java
deleted file mode 100644
index 15286d6..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSExtendedProperties.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom;
-
-import org.w3c.dom.css.CSS2Properties;
-
-//TODO KM: removed the reference to CSS3Properties for expediency in getting things to compile
-//TODO KM: either we should settle on CCS2 and delete this interface, or figure out how to ref CSS3
-
-public interface CSSExtendedProperties extends CSS2Properties {
-
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSProperty.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSProperty.java
deleted file mode 100644
index b09eadc..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSProperty.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom;
-
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS property interface.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface CSSProperty {
-
- /**
- * Return name of CSS property.
- *
- * @return
- */
- public String getName();
-
- /**
- * Return {@link CSSValue} value of CSS property.
- *
- * @return
- */
- public CSSValue getValue();
-
- /**
- * Set the {@link CSSValue} value of CSS property.
- *
- * @param value
- */
- public void setValue(CSSValue value);
-
- /**
- * Return true if CSS property is important and false otherwise.
- *
- * @return
- */
- public boolean isImportant();
-
- public void setImportant(boolean important);
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSPropertyList.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSPropertyList.java
deleted file mode 100644
index 595724e..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSPropertyList.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom;
-
-/**
- * CSS property list interface.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface CSSPropertyList {
-
- /**
- * Return length of CSS property list.
- *
- * @return
- */
- public abstract int getLength();
-
- /**
- * Return the CSS property {@link CSSProperty} at item <code>i</code>.
- *
- * @param i
- * @return
- */
- public abstract CSSProperty item(int i);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSStylableElement.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSStylableElement.java
deleted file mode 100644
index 8ce7f63..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/CSSStylableElement.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * CSS stylable element interface to wrap native widget.
- */
-public interface CSSStylableElement extends Element {
-
- /**
- * Return the native widget wrapped (SWT widget, Swing Component...)
- *
- * @return
- */
- public Object getNativeWidget();
-
- /**
- * Return the id of the native widget. This method is used to manage CSS
- * style like this input#MyId{....}.
- *
- * @return
- */
- public String getCSSId();
-
- /**
- * Return the class of the native widget. This method is used to manage CSS
- * style like this .blueClass {...}.
- *
- * @return
- */
- public String getCSSClass();
-
- /**
- * Return the inline style of the native widget.
- *
- * @return
- */
- public String getCSSStyle();
-
- /**
- * Return the default {@link CSSStyleDeclaration} of the native widget.
- *
- * @return
- */
- public CSSStyleDeclaration getDefaultStyleDeclaration(String pseudoE);
-
- /**
- * Copy all default style declarations defined into
- * <code>stylableElement</code>.
- *
- * @param stylableElement
- */
- public void copyDefaultStyleDeclarations(CSSStylableElement stylableElement);
-
- /**
- * Set the default {@link CSSStyleDeclaration} of the native widget.
- *
- * @param defaultStyleDeclaration
- */
- public void setDefaultStyleDeclaration(String pseudoE,
- CSSStyleDeclaration defaultStyleDeclaration);
-
- /**
- * Return true if <code>s</code> is pseudo instance (ex :focus) and false
- * otherwise.
- *
- * @param s
- * @return
- */
- public abstract boolean isPseudoInstanceOf(String s);
-
- /**
- * Return all static pseudo instances. Static pseudo instance is used for
- * widget which define method which can update property (Color,
- * BackgroundColor) for a special state (without manage listener like
- * focus). For instance SWT CTabFolder#setSelectionBackground (Color color)
- * is method which set background Color when a CTabItem is selected.
- *
- * @return
- */
- public String[] getStaticPseudoInstances();
-
- /**
- * Return true if <code>s</code> is static pseudo instance (ex
- * :CTabFolder:selected) and false otherwise. Static pseudo instance is used
- * for widget which define method which can update property (Color,
- * BackgroundColor) for a special state (without manage listener like
- * focus). For instance SWT CTabFolder#setSelectionBackground (Color color)
- * is method which set background color when a CTabItem is selected.
- *
- * @param s
- * @return
- */
- public boolean isStaticPseudoInstance(String s);
-
- /**
- * Call-back method called when styles are applied to the all children nodes
- * of the native widget
- *
- * @param nodes
- */
- public void onStylesApplied(NodeList nodes);
-
- /**
- * Return the {@link CSSExtendedProperties} of the native widget.
- *
- * @return
- */
- public CSSExtendedProperties getStyle();
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ElementAdapter.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ElementAdapter.java
deleted file mode 100644
index 3790420..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ElementAdapter.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSExtendedPropertiesImpl;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * {@link Element} implementation.
- */
-public abstract class ElementAdapter implements Element, CSSStylableElement {
-
- private static final String[] EMPTY_STRING = new String[0];
-
- private Object nativeWidget;
-
- protected CSSEngine engine;
-
- private Map /* <String, CSSStyleDeclaration> */defaultStyleDeclarationMap = new HashMap();
-
- private CSSExtendedProperties style = null;
-
- private List staticPseudoInstances;
-
- public ElementAdapter(Object nativeWidget, CSSEngine engine) {
- this.nativeWidget = nativeWidget;
- this.engine = engine;
- }
-
- /**
- * Add static pseudo instance
- *
- * @param instance
- */
- public void addStaticPseudoInstance(String pseudoE) {
- if (staticPseudoInstances == null)
- staticPseudoInstances = new ArrayList();
- staticPseudoInstances.add(pseudoE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.CSSStylableElement#isStaticPseudoInstance(java.lang.String)
- */
- public boolean isStaticPseudoInstance(String s) {
- if (staticPseudoInstances == null)
- return false;
- return staticPseudoInstances.contains(s);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.CSSStylableElement#copyDefaultStyleDeclarations(org.eclipse.e4.ui.css.core.dom.CSSStylableElement)
- */
- public void copyDefaultStyleDeclarations(CSSStylableElement stylableElement) {
- // Copy default style decalaration
- this.setDefaultStyleDeclaration(null, stylableElement
- .getDefaultStyleDeclaration(null));
- // Copy all static pseudo instances
- String[] staticPseudoInstances = stylableElement
- .getStaticPseudoInstances();
- if (staticPseudoInstances != null) {
- for (int i = 0; i < staticPseudoInstances.length; i++) {
- String pseudoE = staticPseudoInstances[i];
- CSSStyleDeclaration declaration = stylableElement
- .getDefaultStyleDeclaration(pseudoE);
- this.setDefaultStyleDeclaration(pseudoE, declaration);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.Node#getLocalName()
- */
- public abstract String getLocalName();
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.Element#getAttribute(java.lang.String)
- */
- public abstract String getAttribute(String arg0);
-
- public String getAttributeNS(String namespace, String attr)
- throws DOMException {
- return getAttribute(attr);
- };
-
- public Attr getAttributeNode(String arg0) {
- return null;
- }
-
- public Attr getAttributeNodeNS(String arg0, String arg1)
- throws DOMException {
- return null;
- }
-
- public NodeList getElementsByTagName(String arg0) {
- return null;
- }
-
- public NodeList getElementsByTagNameNS(String arg0, String arg1)
- throws DOMException {
- return null;
- }
-
- public boolean hasAttribute(String arg0) {
- return false;
- }
-
- public boolean hasAttributeNS(String namespace, String attr)
- throws DOMException {
- return hasAttribute(attr);
- }
-
- public void removeAttribute(String arg0) throws DOMException {
- }
-
- public void removeAttributeNS(String arg0, String arg1) throws DOMException {
- }
-
- public Attr removeAttributeNode(Attr arg0) throws DOMException {
- return null;
- }
-
- public void setAttribute(String arg0, String arg1) throws DOMException {
- }
-
- public void setAttributeNS(String arg0, String arg1, String arg2)
- throws DOMException {
- }
-
- public Attr setAttributeNode(Attr arg0) throws DOMException {
- return null;
- }
-
- public Attr setAttributeNodeNS(Attr arg0) throws DOMException {
- return null;
- }
-
- public Node appendChild(Node newChild) throws DOMException {
- return insertBefore(newChild, null);
- }
-
- public Node cloneNode(boolean arg0) {
- return null;
- }
-
- public NamedNodeMap getAttributes() {
- return null;
- }
-
- public Node getFirstChild() {
- return null;
- }
-
- public Node getLastChild() {
- return null;
- }
-
- public String getTagName() {
- return getLocalName();
- }
-
- public Node getNextSibling() {
- return null;
- }
-
- public String getNodeName() {
- // By default Node name is the same thing like localName
- return getLocalName();
- }
-
- public short getNodeType() {
- return ELEMENT_NODE;
- }
-
- public String getNodeValue() throws DOMException {
- return null;
- }
-
- public Document getOwnerDocument() {
- return null;
- }
-
- public String getPrefix() {
- return null;
- }
-
- public Node getPreviousSibling() {
- return null;
- }
-
- public boolean hasAttributes() {
- return false;
- }
-
- public boolean hasChildNodes() {
- return false;
- }
-
- public Node insertBefore(Node newChild, Node refChild) throws DOMException {
-
- return null;
- }
-
- public boolean isSupported(String arg0, String arg1) {
- return false;
- }
-
- public void normalize() {
- }
-
- public Node removeChild(Node arg0) throws DOMException {
- return null;
- }
-
- public Node replaceChild(Node arg0, Node arg1) throws DOMException {
- return null;
- }
-
- public void setNodeValue(String arg0) throws DOMException {
- }
-
- public void setPrefix(String arg0) throws DOMException {
- }
-
- public void setIdAttribute(String name, boolean isId) throws DOMException {
- }
-
- public void setIdAttributeNS(String namespaceURI, String localName,
- boolean isId) throws DOMException {
- }
-
- public void setIdAttributeNode(Attr idAttr, boolean isId)
- throws DOMException {
- }
-
- public short compareDocumentPosition(Node other) throws DOMException {
- return 0;
- }
-
- public String getBaseURI() {
- return null;
- }
-
- public Object getFeature(String feature, String version) {
- return null;
- }
-
- public String getTextContent() throws DOMException {
- return null;
- }
-
- public Object getUserData(String key) {
- return null;
- }
-
- public boolean isDefaultNamespace(String namespaceURI) {
- return false;
- }
-
- public boolean isEqualNode(Node arg) {
- return false;
- }
-
- public boolean isSameNode(Node other) {
- return false;
- }
-
- public String lookupNamespaceURI(String prefix) {
- return null;
- }
-
- public String lookupPrefix(String namespaceURI) {
- return null;
- }
-
- public void setTextContent(String textContent) throws DOMException {
-
- }
-
- public Object getNativeWidget() {
- return nativeWidget;
- }
-
- public Object setUserData(String key, Object data, UserDataHandler handler) {
- return null;
- }
-
- public TypeInfo getSchemaTypeInfo() {
- return null;
- }
-
- public CSSStyleDeclaration getDefaultStyleDeclaration(String pseudoE) {
- return (CSSStyleDeclaration) defaultStyleDeclarationMap.get(pseudoE);
- }
-
- public void setDefaultStyleDeclaration(String pseudoE,
- CSSStyleDeclaration declaration) {
- this.defaultStyleDeclarationMap.put(pseudoE, declaration);
- }
-
- public void onStylesApplied(NodeList nodes) {
- // Do Nothing
-
- }
-
- protected Element getElement(Object widget) {
- return engine.getElement(widget);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.CSSStylableElement#getStyle()
- */
- public CSSExtendedProperties getStyle() {
- if (style == null)
- style = new CSSExtendedPropertiesImpl(nativeWidget, engine);
- return style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.CSSStylableElement#getStaticPseudoInstances()
- */
- public String[] getStaticPseudoInstances() {
- if (staticPseudoInstances == null)
- return EMPTY_STRING;
- return (String[]) staticPseudoInstances.toArray(EMPTY_STRING);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.CSSStylableElement#isPseudoInstanceOf(java.lang.String)
- */
- public boolean isPseudoInstanceOf(String s) {
- if (staticPseudoInstances == null)
- return false;
- return staticPseudoInstances.contains(s);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedCSSRule.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedCSSRule.java
deleted file mode 100644
index ccf1761..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedCSSRule.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom;
-
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SelectorList;
-import org.w3c.dom.css.CSSRule;
-
-/**
- * Extend {@link CSSRule} to get selector and property list.
- */
-public interface ExtendedCSSRule extends CSSRule {
-
- /**
- * Return the list of {@link CSSProperty} of this {@link CSSRule}.
- *
- * @return
- */
- public CSSPropertyList getCSSPropertyList();
-
- /**
- * Return the list of {@link Selector} of this {@link CSSRule}.
- *
- * @return
- */
- public SelectorList getSelectorList();
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java
deleted file mode 100644
index 5777981..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom;
-
-import java.util.List;
-
-import org.w3c.css.sac.Condition;
-import org.w3c.css.sac.Selector;
-import org.w3c.dom.css.DocumentCSS;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- * Extend {@link DocumentCSS} to add methods like add/remove style sheet.
- */
-public interface ExtendedDocumentCSS extends DocumentCSS {
-
- public static final Integer SAC_ID_CONDITION = new Integer(
- Condition.SAC_ID_CONDITION);
- public static final Integer SAC_CLASS_CONDITION = new Integer(
- Condition.SAC_CLASS_CONDITION);
- public static final Integer SAC_PSEUDO_CLASS_CONDITION = new Integer(
- Condition.SAC_PSEUDO_CLASS_CONDITION);
- public static final Integer OTHER_SAC_CONDITIONAL_SELECTOR = new Integer(
- Selector.SAC_CONDITIONAL_SELECTOR);
-
- public static final Integer OTHER_SAC_SELECTOR = new Integer(999);
-
- public void addStyleSheet(StyleSheet styleSheet);
-
- public void removeAllStyleSheets();
-
- public List queryConditionSelector(int conditionType);
-
- public List querySelector(int selectorType, int conditionType);
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/IElementProvider.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/IElementProvider.java
deleted file mode 100644
index f9aef5e..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/IElementProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.Element;
-
-/**
- * Element provider to retrieve w3c {@link Element} which wrap the native widget
- * (SWT Control, Swing JComponent...).
- */
-public interface IElementProvider {
-
- /**
- * Return the w3c Element which wrap the native widget <code>element</code>
- * (SWT Control, Swing JComponent). The <code>element</code> can be the
- * w3c Element.
- *
- * @param element
- * @param engine
- *
- * @return
- */
- public Element getElement(Object element, CSSEngine engine);
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/CSSParser.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/CSSParser.java
deleted file mode 100644
index 44ca727..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/CSSParser.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.parsers;
-
-import java.io.IOException;
-
-import org.eclipse.e4.ui.css.core.sac.DocumentHandlerFactory;
-import org.eclipse.e4.ui.css.core.sac.ExtendedDocumentHandler;
-import org.w3c.css.sac.ConditionFactory;
-import org.w3c.css.sac.InputSource;
-import org.w3c.css.sac.Parser;
-import org.w3c.css.sac.SelectorFactory;
-import org.w3c.css.sac.SelectorList;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS Parser interface to parse with SAC {@link Parser} :
- * <ul>
- * <li>CSS Style sheet and return {@link CSSStyleSheet}.</li>
- * <li>CSS Style declaration and return {@link CSSStyleDeclaration}.</li>
- * <li>CSS value and return {@link CSSValue}.</li>
- * <li>CSS rule and return {@link CSSRule}.</li>
- * </ul>
- */
-public interface CSSParser {
-
- /**
- * Parse CSS <code>source</code> style sheet with SAC {@link Parser} and
- * return {@link CSSStyleSheet} instance.
- *
- * @param source
- * style sheet.
- * @return
- * @throws IOException
- */
- public CSSStyleSheet parseStyleSheet(InputSource source) throws IOException;
-
- /**
- * Set the parent {@link CSSStyleSheet}.
- *
- * @param parentStyleSheet
- */
- public void setParentStyleSheet(CSSStyleSheet parentStyleSheet);
-
- /**
- * Parse CSS <code>source</code> style declaration with SAC {@link Parser}
- * and return {@link CSSStyleDeclaration} instance.
- *
- * @param source
- * style declaration.
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseStyleDeclaration(InputSource source)
- throws IOException;
-
- /**
- * Parse CSS <code>source</code> style declaration with SAC {@link Parser}
- * and update the <code>styleDecelaration</code>.
- *
- * @param styleDeclaration
- * @param source
- * @throws IOException
- */
- public void parseStyleDeclaration(CSSStyleDeclaration styleDeclaration,
- InputSource source) throws IOException;
-
- /**
- * Parse CSS <code>source</code> value with SAC {@link Parser} and return
- * {@link CSSValue} instance.
- *
- * @param source
- * CSS value.
- * @return
- * @throws IOException
- */
- public CSSValue parsePropertyValue(InputSource source) throws IOException;
-
- /**
- * Parse CSS <code>source</code> rule value with SAC {@link Parser} and
- * return {@link CSSRule} instance.
- *
- * @param source
- * CSS rule.
- * @return
- * @throws IOException
- */
- public CSSRule parseRule(InputSource source) throws IOException;
-
- /**
- * Parse CSS <code>source</code> selectors value with SAC {@link Parser}
- * and return {@link SelectorList} instance.
- *
- * @param source
- * @return
- * @throws IOException
- */
- public SelectorList parseSelectors(InputSource source) throws IOException;
-
- /*------- SAC parser configuration methods ------- */
-
- /**
- * Set the SAC {@link DocumentHandlerFactory} factory to get SAC
- * {@link ExtendedDocumentHandler} handler used by SAC {@link Parser}.
- *
- * @param documentHandlerFactory
- */
- public void setDocumentHandlerFactory(
- DocumentHandlerFactory documentHandlerFactory);
-
- /**
- * Get the SAC {@link ConditionFactory} used by SAC {@link Parser}.
- *
- * @return
- */
- public ConditionFactory getConditionFactory();
-
- /**
- * Set the SAC {@link ConditionFactory} used by SAC {@link Parser}.
- *
- * @param conditionFactory
- */
- public void setConditionFactory(ConditionFactory conditionFactory);
-
- /**
- * Get the SAC {@link SelectorFactory} used by SAC {@link Parser}.
- *
- * @return
- */
- public SelectorFactory getSelectorFactory();
-
- /**
- * Set the SAC {@link SelectorFactory} used by SAC {@link Parser}.
- *
- * @param selectorFactory
- */
- public void setSelectorFactory(SelectorFactory selectorFactory);
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/CSSParserFactory.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/CSSParserFactory.java
deleted file mode 100644
index 7c48a88..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/CSSParserFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.parsers;
-
-import org.eclipse.e4.ui.css.core.impl.dom.parsers.CSSParserFactoryImpl;
-
-/**
- * CSS Parser factory to manage instance of {@link ICSSParserFactory}.
- */
-public abstract class CSSParserFactory implements ICSSParserFactory {
-
- /**
- * Obtain a new instance of a {@link ICSSParserFactory}.
- *
- * @return
- */
- public static ICSSParserFactory newInstance() {
- return new CSSParserFactoryImpl();
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/ICSSParserFactory.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/ICSSParserFactory.java
deleted file mode 100644
index a6dc86e..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/parsers/ICSSParserFactory.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.parsers;
-
-/**
- * CSS Parser factory to manage instance of {@link CSSParser}.
- */
-public interface ICSSParserFactory {
-
- /**
- * Return instance of {@link CSSParser}.
- *
- * @return
- */
- public CSSParser makeCSSParser();
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/AbstractCSSPropertyCompositeHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/AbstractCSSPropertyCompositeHandler.java
deleted file mode 100644
index 1af46d7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/AbstractCSSPropertyCompositeHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.CSSValueList;
-
-/**
- * Abstract class which manage CSS Property composite like border:solid black
- * 1px; It dispatch
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSPropertyCompositeHandler implements
- ICSSPropertyCompositeHandler {
-
- /**
- * Apply CSS Property composite and dispatch CSS Property if CSSValue is
- * CSSValueList by calling applyCSSProperty for each item of CSSValue.
- *
- * @param element
- * @param property
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyComposite(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
- CSSValueList valueList = (CSSValueList) value;
- int length = valueList.getLength();
- for (int i = 0; i < length; i++) {
- CSSValue value2 = valueList.item(i);
- applyCSSProperty(element, value2, pseudo, engine);
- }
- } else {
- applyCSSProperty(element, value, pseudo, engine);
- }
- }
-
- /**
- * Apply CSS Property.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public abstract void applyCSSProperty(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/CSSBorderProperties.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/CSSBorderProperties.java
deleted file mode 100644
index 40fdba2..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/CSSBorderProperties.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties;
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- * CSS Border properties interface.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface CSSBorderProperties {
-
- /**
- * Return border-color value.
- *
- * @return
- */
- public CSSPrimitiveValue getColor();
-
- /**
- * Set border-color value.
- *
- * @return
- */
- public void setColor(CSSPrimitiveValue color);
-
- /**
- * Return border-width value.
- *
- * @return
- */
- public int getWidth();
-
- /**
- * Set border-width value.
- *
- * @return
- */
- public void setWidth(int width);
-
- /**
- * Return border-style value.
- *
- * @return
- */
- public String getStyle();
-
- /**
- * Set border-style value.
- *
- * @return
- */
- public void setStyle(String style);
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/Gradient.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/Gradient.java
deleted file mode 100644
index 959fa06..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/Gradient.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Generic class to store informations to manage Gradiant color.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class Gradient {
-
- private List rgbs = new ArrayList();
- private List percents = new ArrayList();
-
- public void addRGB(Object rgb) {
- rgbs.add(rgb);
- }
-
- public void addPercent(Integer percent) {
- percents.add(percent);
- }
-
- public List getRGBs() {
- return rgbs;
- }
-
- public List getPercents() {
- return percents;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyCompositeHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyCompositeHandler.java
deleted file mode 100644
index 4f3d044..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyCompositeHandler.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties;
-
-/**
- * CSS Property Handler interface to manage composite CSS Property (ex:
- * background is CSS Property composed with background-color,
- * background-image..).
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface ICSSPropertyCompositeHandler extends ICSSPropertyHandler {
-
- /**
- * Return true if <code>property</code> is CSS Property composite and
- * false otherwise.
- *
- * @param property
- * @return
- */
- public boolean isCSSPropertyComposite(String property);
-
- /**
- * Return the CSS Properties names if the CSS Property <code>property</code>
- * is composite and null otherwise.
- *
- * @param property
- * @return
- */
- public String[] getCSSPropertiesNames(String property);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler.java
deleted file mode 100644
index 1ce8988..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS Property Handler interface used to
- * <ul>
- * <li>apply CSS Property value to an element like Swing Component, SWT Widget.</li>
- * <li>retrieve default CSS Property value from element like Swing Component,
- * SWT Widget.</li>
- * </ul>
- */
-public interface ICSSPropertyHandler {
-
- /**
- * Apply CSS Property <code>property</code> (ex : background-color) with
- * CSSValue <code>value</code> (ex : red) into the <code>element</code>
- * (ex : Swing Component, SWT Widget).
- *
- * @param element
- * Swing Component, SWT Widget...
- * @param property
- * CSS Property
- * @param value
- * CSS value
- * @param pseudo
- * @param engine
- * CSS Engine
- * @return
- * @throws Exception
- */
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Retrieve CSS value (ex : red) of CSS Property <code>property</code> (ex :
- * background-color) from the <code>element</code> (ex : Swing Component,
- * SWT Widget).
- *
- * @param element
- * @param property
- * CSS Property
- * @param engine
- * CSS Engine
- * @return
- * @throws Exception
- */
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception;
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler2.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler2.java
deleted file mode 100644
index f8342dd..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-
-/**
- * CSS Property Handler to intercept when all CSS Properties are applied.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface ICSSPropertyHandler2 {
-
- /**
- * Callback method called when all CSS properties are applied.
- *
- * @param element
- * @param engine
- * @throws Exception
- */
- public void onAllCSSPropertiesApplyed(Object element, CSSEngine engine)
- throws Exception;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler2Delegate.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler2Delegate.java
deleted file mode 100644
index dc1b950..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandler2Delegate.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties;
-
-/**
- *
- * {@link ICSSPropertyHandler2} delegate.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface ICSSPropertyHandler2Delegate {
-
- /**
- * Return {@link ICSSPropertyHandler2} to call when all CSS Properties are
- * applied .
- *
- * @return
- */
- public ICSSPropertyHandler2 getCSSPropertyHandler2();
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandlerProvider.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandlerProvider.java
deleted file mode 100644
index 6f2a405..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/ICSSPropertyHandlerProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties;
-
-import java.util.Collection;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * Interface CSS Property Handler provider to manage
- * <ul>
- * <li>the strategy to provide list of {@link ICSSPropertyHandler} linked to a
- * CSS Property.</li>
- * <li>the strategy to get the CSS default style declaration of an element</li>
- * </ul>
- */
-public interface ICSSPropertyHandlerProvider {
-
- /**
- * Return list of {@link ICSSPropertyHandler} linked to the CSS Property
- * <code>property</code>.
- *
- * @param property
- * @return
- * @throws Exception
- */
- public Collection getCSSPropertyHandlers(String property) throws Exception;
-
- /**
- * Return the default CSS style declaration of the <code>element</code>
- * before apply the <code>newStyle</code> {@link CSSStyleDeclaration}.
- *
- * @param engine
- * @param element
- * @param newStyle
- * @param pseudoE
- * @return
- * @throws Exception
- */
- public CSSStyleDeclaration getDefaultCSSStyleDeclaration(CSSEngine engine,
- Object element, CSSStyleDeclaration newStyle, String pseudoE)
- throws Exception;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/AbstractCSSValueConverter.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/AbstractCSSValueConverter.java
deleted file mode 100644
index 7cde55b..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/AbstractCSSValueConverter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.converters;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-
-/**
- * Abstract base class for converters.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSValueConverter implements ICSSValueConverter {
-
- private Object toType;
-
- public AbstractCSSValueConverter(Object toType) {
- this.toType = toType;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter#getToType()
- */
- public Object getToType() {
- return toType;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter#convert(java.lang.Object,
- * org.eclipse.e4.ui.css.core.engine.CSSEngine, java.lang.Object)
- */
- public String convert(Object value, CSSEngine engine, Object context)
- throws Exception {
- return convert(value, engine, context, null);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/CSSValueBooleanConverterImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/CSSValueBooleanConverterImpl.java
deleted file mode 100644
index 50529c1..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/CSSValueBooleanConverterImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.converters;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS Value converter to convert :
- * <ul>
- * <li>CSS Value to {@link Boolean}</li>.
- * <li>{@link Boolean} to String CSS Value</li>
- * </ul>
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSValueBooleanConverterImpl extends AbstractCSSValueConverter {
-
- public static final ICSSValueConverter INSTANCE = new CSSValueBooleanConverterImpl();
-
- public CSSValueBooleanConverterImpl() {
- super(Boolean.class);
- }
-
- public Object convert(CSSValue value, CSSEngine engine, Object context)
- throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- if ("true".equals(primitiveValue.getStringValue()))
- return Boolean.TRUE;
- }
- return Boolean.FALSE;
- }
-
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception {
- if (value instanceof Boolean) {
- Boolean b = (Boolean) value;
- if (b.booleanValue())
- return "true";
- }
- return "false";
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/CSSValueConverterConfigColorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/CSSValueConverterConfigColorImpl.java
deleted file mode 100644
index a9d5a4c..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/CSSValueConverterConfigColorImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.converters;
-
-/**
- * CSS Value converter color config to format the CSSValue string color.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSValueConverterConfigColorImpl implements
- ICSSValueConverterColorConfig {
-
- public static final ICSSValueConverterConfig COLOR_HEXA_FORMAT_CONFIG = new CSSValueConverterConfigColorImpl(
- COLOR_HEXA_FORMAT);
-
- public static final ICSSValueConverterConfig COLOR_NAME_FORMAT_CONFIG = new CSSValueConverterConfigColorImpl(
- COLOR_NAME_FORMAT);
-
- public static final ICSSValueConverterConfig COLOR_RGB_FORMAT_CONFIG = new CSSValueConverterConfigColorImpl(
- COLOR_RGB_FORMAT);
-
- private int format;
-
- public CSSValueConverterConfigColorImpl(int format) {
- this.format = format;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterColorConfig#getFormat()
- */
- public int getFormat() {
- return format;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverter.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverter.java
deleted file mode 100644
index f208a67..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.converters;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * A one-way converter.
- *
- * This interface is not intended to be implemented by clients; clients should
- * subclass {@link AbstractCSSValueConverter}.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface ICSSValueConverter {
-
- /**
- * Returns the type to which this converter can convert. The return type is
- * Object rather than Class to optionally support richer type systems than
- * the one provided by Java reflection.
- *
- * @return the type to which this converter can convert, or null if this
- * converter is untyped
- */
- public Object getToType();
-
- /**
- * Returns the result of the conversion of the given CSSValue
- * <code>value</code>.
- *
- * @param value
- * the CSSValue to convert, of type {@link #getFromType()}
- * @param engine
- * @param context
- *
- * @return the converted object, of type {@link #getToType()}
- */
- public Object convert(CSSValue value, CSSEngine engine, Object context)
- throws Exception;
-
- /**
- * Returns String {@link CSSValue} of the result of the conversion of the
- * given Object <code>value</code>.
- *
- * @param value
- *
- * @param engine
- * @param context
- *
- * @return
- */
- public String convert(Object value, CSSEngine engine, Object context)
- throws Exception;
-
- /**
- * Returns String {@link CSSValue} of the result of the conversion of the
- * given Object <code>value</code>. <code>config</code> can be used to
- * manage format of the CSSValue String to return.
- *
- * @param value
- * @param engine
- * @param context
- * @param config
- * @return
- * @throws Exception
- */
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverterColorConfig.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverterColorConfig.java
deleted file mode 100644
index ab2d495..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverterColorConfig.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.converters;
-
-import org.w3c.dom.css.RGBColor;
-
-/**
- * {@link ICSSValueConverterConfig} to manage format String of the
- * {@link RGBColor}.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface ICSSValueConverterColorConfig extends ICSSValueConverterConfig {
-
- /*
- * Format CSSValue string color into Hexadecimal.
- */
- public static final int COLOR_HEXA_FORMAT = 0;
-
- /*
- * Format CSSValue string color into Color Name.
- */
- public static final int COLOR_NAME_FORMAT = 1;
-
- /*
- * Format CSSValue string color into RGB.
- */
- public static final int COLOR_RGB_FORMAT = 2;
-
- /**
- * Return format (Hexadecimal color, Color name, RGB color).
- *
- * @return
- */
- public int getFormat();
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverterConfig.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverterConfig.java
deleted file mode 100644
index 569a153..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/converters/ICSSValueConverterConfig.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.converters;
-
-/**
- * CSS Value converter config.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface ICSSValueConverterConfig {
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBackgroundCompositeHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBackgroundCompositeHandler.java
deleted file mode 100644
index 7c53f7c..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBackgroundCompositeHandler.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.AbstractCSSPropertyCompositeHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract CSS property composite background which is enable to dispatch to well
- * CSS Property background-color, background-image...
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSPropertyBackgroundCompositeHandler extends
- AbstractCSSPropertyCompositeHandler {
-
- private static final String[] BACKROUND_CSSPROPERTIES = {
- "background-attachment", "background-color", "background-image",
- "background-position", "background-repeat" };
-
- public void applyCSSProperty(Object element, CSSValue value, String pseudo,
- CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- short type = primitiveValue.getPrimitiveType();
- switch (type) {
- case CSSPrimitiveValue.CSS_IDENT:
- case CSSPrimitiveValue.CSS_RGBCOLOR:
- engine.applyCSSProperty(element, "background-color", value,
- pseudo);
- break;
- case CSSPrimitiveValue.CSS_URI:
- engine.applyCSSProperty(element, "background-image", value,
- pseudo);
- break;
- }
- }
- }
-
- public boolean isCSSPropertyComposite(String property) {
- return "background".equals(property);
- }
-
- public String[] getCSSPropertiesNames(String property) {
- if ("background".equals(property))
- return BACKROUND_CSSPROPERTIES;
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBackgroundHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBackgroundHandler.java
deleted file mode 100644
index 6cb1864..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBackgroundHandler.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.exceptions.UnsupportedPropertyException;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract CSS property background which is enable to manage
- * apply CSS Property background, background-color, background-image...
- */
-public abstract class AbstractCSSPropertyBackgroundHandler extends
- AbstractCSSPropertyBackgroundCompositeHandler implements
- ICSSPropertyBackgroundHandler {
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if ("background".equals(property)) {
- applyCSSPropertyBackground(element, value, pseudo, engine);
- }
- if ("background-attachment".equals(property)) {
- applyCSSPropertyBackgroundAttachment(element, value, pseudo, engine);
- }
- if ("background-color".equals(property)) {
- applyCSSPropertyBackgroundColor(element, value, pseudo, engine);
- }
- if ("background-image".equals(property)) {
- applyCSSPropertyBackgroundImage(element, value, pseudo, engine);
- }
- if ("background-position".equals(property)) {
- applyCSSPropertyBackgroundPosition(element, value, pseudo, engine);
- }
- if ("background-repeat".equals(property)) {
- applyCSSPropertyBackgroundRepeat(element, value, pseudo, engine);
- }
- return false;
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- if ("background-attachment".equals(property)) {
- return retrieveCSSPropertyBackgroundAttachment(element, pseudo,
- engine);
- }
- if ("background-color".equals(property)) {
- return retrieveCSSPropertyBackgroundColor(element, pseudo, engine);
- }
- if ("background-image".equals(property)) {
- return retrieveCSSPropertyBackgroundImage(element, pseudo, engine);
- }
- if ("background-position".equals(property)) {
- return retrieveCSSPropertyBackgroundPosition(element, pseudo,
- engine);
- }
- if ("background-repeat".equals(property)) {
- return retrieveCSSPropertyBackgroundRepeat(element, pseudo, engine);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler#applyCSSPropertyBackground(java.lang.Object,
- * org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.css.core.engine.CSSEngine)
- */
- public void applyCSSPropertyBackground(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- super.applyCSSPropertyComposite(element, "background", value, pseudo,
- engine);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler#applyCSSPropertyBackgroundAttachment(java.lang.Object,
- * org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.css.core.engine.CSSEngine)
- */
- public void applyCSSPropertyBackgroundAttachment(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("background-attachment");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler#applyCSSPropertyBackgroundColor(java.lang.Object,
- * org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.css.core.engine.CSSEngine)
- */
- public void applyCSSPropertyBackgroundColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("background-color");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler#applyCSSPropertyBackgroundImage(java.lang.Object,
- * org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.css.core.engine.CSSEngine)
- */
- public void applyCSSPropertyBackgroundImage(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("background-image");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler#applyCSSPropertyBackgroundPosition(java.lang.Object,
- * org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.css.core.engine.CSSEngine)
- */
- public void applyCSSPropertyBackgroundPosition(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("background-position");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler#applyCSSPropertyBackgroundRepeat(java.lang.Object,
- * org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.css.core.engine.CSSEngine)
- */
- public void applyCSSPropertyBackgroundRepeat(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("background-repeat");
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBorderCompositeHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBorderCompositeHandler.java
deleted file mode 100644
index a747e77..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBorderCompositeHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper;
-import org.eclipse.e4.ui.css.core.dom.properties.AbstractCSSPropertyCompositeHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract class which dispatch border CSS Property defined to call the
- * applyCSSProperty methods CSS Properties border-color, border-style,
- * border-width.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSPropertyBorderCompositeHandler extends
- AbstractCSSPropertyCompositeHandler {
-
- private static final String[] BORDER_CSSPROPERTIES = { "border-width",
- "border-style", "border-color" };
-
- public void applyCSSProperty(Object element, CSSValue value, String pseudo,
- CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- short type = primitiveValue.getPrimitiveType();
- switch (type) {
- case CSSPrimitiveValue.CSS_IDENT:
- if (CSS2ColorHelper
- .isColorName(primitiveValue.getStringValue())) {
- engine.applyCSSProperty(element, "border-color", value,
- pseudo);
- } else {
- engine.applyCSSProperty(element, "border-style", value,
- pseudo);
- }
- break;
- case CSSPrimitiveValue.CSS_RGBCOLOR:
- engine.applyCSSProperty(element, "border-color", value, pseudo);
- break;
- case CSSPrimitiveValue.CSS_PT:
- case CSSPrimitiveValue.CSS_NUMBER:
- case CSSPrimitiveValue.CSS_PX:
- engine.applyCSSProperty(element, "border-width", value, pseudo);
- break;
- }
- }
- }
-
- public boolean isCSSPropertyComposite(String property) {
- return "border".equals(property);
- }
-
- public String[] getCSSPropertiesNames(String property) {
- if ("border".equals(property))
- return BORDER_CSSPROPERTIES;
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBorderHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBorderHandler.java
deleted file mode 100644
index 2ee8286..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyBorderHandler.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.CSSBorderProperties;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.exceptions.UnsupportedPropertyException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract CSS property background which is enable to manage
- * apply CSS Property border, border-color, border-style...
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSPropertyBorderHandler extends
- AbstractCSSPropertyBorderCompositeHandler implements
- ICSSPropertyBorderHandler {
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- // Border
- if ("border".equals(property))
- applyCSSPropertyBorder(element, value, pseudo, engine);
- // Border bottom
- else if ("border-bottom".equals(property))
- applyCSSPropertyBorderBottom(element, value, pseudo, engine);
- else if ("border-bottom-color".equals(property))
- applyCSSPropertyBorderBottomColor(element, value, pseudo, engine);
- else if ("border-bottom-style".equals(property))
- applyCSSPropertyBorderBottomStyle(element, value, pseudo, engine);
- else if ("border-bottom-width".equals(property))
- applyCSSPropertyBorderBottomWidth(element, value, pseudo, engine);
- // Border color
- else if ("border-color".equals(property))
- applyCSSPropertyBorderColor(element, value, pseudo, engine);
- // Border left
- else if ("border-left".equals(property))
- applyCSSPropertyBorderLeft(element, value, pseudo, engine);
- else if ("border-left-color".equals(property))
- applyCSSPropertyBorderLeftColor(element, value, pseudo, engine);
- else if ("border-left-style".equals(property))
- applyCSSPropertyBorderLeftStyle(element, value, pseudo, engine);
- else if ("border-left-width".equals(property))
- applyCSSPropertyBorderLeftWidth(element, value, pseudo, engine);
- // Border right
- else if ("border-right".equals(property))
- applyCSSPropertyBorderRight(element, value, pseudo, engine);
- else if ("border-right-color".equals(property))
- applyCSSPropertyBorderRightColor(element, value, pseudo, engine);
- else if ("border-right-style".equals(property))
- applyCSSPropertyBorderRightStyle(element, value, pseudo, engine);
- else if ("border-right-width".equals(property))
- applyCSSPropertyBorderRightWidth(element, value, pseudo, engine);
- // Border style
- else if ("border-style".equals(property))
- applyCSSPropertyBorderStyle(element, value, pseudo, engine);
- // Border top
- else if ("border-top".equals(property))
- applyCSSPropertyBorderTop(element, value, pseudo, engine);
- else if ("border-top-color".equals(property))
- applyCSSPropertyBorderTopColor(element, value, pseudo, engine);
- else if ("border-top-style".equals(property))
- applyCSSPropertyBorderTopStyle(element, value, pseudo, engine);
- else if ("border-top-width".equals(property))
- applyCSSPropertyBorderTopWidth(element, value, pseudo, engine);
- // Border width
- else if ("border-width".equals(property))
- applyCSSPropertyBorderWidth(element, value, pseudo, engine);
- return false;
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- // Border
- if ("border".equals(property))
- return retrieveCSSPropertyBorder(element, pseudo, engine);
- // Border bottom
- if ("border-bottom".equals(property))
- return retrieveCSSPropertyBorderBottom(element, pseudo, engine);
- if ("border-bottom-color".equals(property))
- return retrieveCSSPropertyBorderBottomColor(element, pseudo, engine);
- if ("border-bottom-style".equals(property))
- return retrieveCSSPropertyBorderBottomStyle(element, pseudo, engine);
- if ("border-bottom-width".equals(property))
- return retrieveCSSPropertyBorderBottomWidth(element, pseudo, engine);
- // Border color
- if ("border-color".equals(property))
- return retrieveCSSPropertyBorderColor(element, pseudo, engine);
- // Border left
- if ("border-left".equals(property))
- return retrieveCSSPropertyBorderLeft(element, pseudo, engine);
- if ("border-left-color".equals(property))
- return retrieveCSSPropertyBorderLeftColor(element, pseudo, engine);
- if ("border-left-style".equals(property))
- return retrieveCSSPropertyBorderLeftStyle(element, pseudo, engine);
- if ("border-left-width".equals(property))
- return retrieveCSSPropertyBorderLeftWidth(element, pseudo, engine);
- // Border right
- if ("border-right".equals(property))
- return retrieveCSSPropertyBorderRight(element, pseudo, engine);
- if ("border-right-color".equals(property))
- return retrieveCSSPropertyBorderRightColor(element, pseudo, engine);
- if ("border-right-style".equals(property))
- return retrieveCSSPropertyBorderRightStyle(element, pseudo, engine);
- if ("border-right-width".equals(property))
- return retrieveCSSPropertyBorderRightWidth(element, pseudo, engine);
- // Border style
- if ("border-style".equals(property))
- return retrieveCSSPropertyBorderStyle(element, pseudo, engine);
- // Border top
- if ("border-top".equals(property))
- return retrieveCSSPropertyBorderTop(element, pseudo, engine);
- if ("border-top-color".equals(property))
- return retrieveCSSPropertyBorderTopColor(element, pseudo, engine);
- if ("border-top-style".equals(property))
- return retrieveCSSPropertyBorderTopStyle(element, pseudo, engine);
- if ("border-top-width".equals(property))
- return retrieveCSSPropertyBorderTopWidth(element, pseudo, engine);
- // Border width
- if ("border-width".equals(property))
- return retrieveCSSPropertyBorderWidth(element, pseudo, engine);
- return null;
- }
-
- public void applyCSSPropertyBorder(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- super.applyCSSPropertyComposite(element, "border", value, pseudo,
- engine);
- }
-
- public void applyCSSPropertyBorderBottom(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-bottom");
- }
-
- public void applyCSSPropertyBorderBottomColor(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-bottom-color");
- }
-
- public void applyCSSPropertyBorderBottomStyle(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-bottom-style");
- }
-
- public void applyCSSPropertyBorderBottomWidth(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-bottom-width");
- }
-
- public void applyCSSPropertyBorderColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (element instanceof CSSBorderProperties) {
- applyCSSPropertyBorderColor((CSSBorderProperties) element, value,
- pseudo, engine);
- return;
- }
- throw new UnsupportedPropertyException("border-color");
- }
-
- public void applyCSSPropertyBorderColor(CSSBorderProperties border,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- border.setColor((CSSPrimitiveValue) value);
- }
- }
-
- public void applyCSSPropertyBorderLeft(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-left");
- }
-
- public void applyCSSPropertyBorderLeftColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-left-color");
- }
-
- public void applyCSSPropertyBorderLeftStyle(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-left-style");
- }
-
- public void applyCSSPropertyBorderLeftWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-left-width");
- }
-
- public void applyCSSPropertyBorderRight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-right");
- }
-
- public void applyCSSPropertyBorderRightColor(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-right-color");
- }
-
- public void applyCSSPropertyBorderRightStyle(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-right-style");
- }
-
- public void applyCSSPropertyBorderRightWidth(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-right-width");
- }
-
- public void applyCSSPropertyBorderStyle(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (element instanceof CSSBorderProperties) {
- applyCSSPropertyBorderStyle((CSSBorderProperties) element, value,
- pseudo, engine);
- return;
- }
- throw new UnsupportedPropertyException("border-style");
- }
-
- public void applyCSSPropertyBorderStyle(CSSBorderProperties border,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- border.setStyle(((CSSPrimitiveValue) value).getStringValue());
- }
- }
-
- public void applyCSSPropertyBorderTop(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-top");
-
- }
-
- public void applyCSSPropertyBorderTopColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-top-color");
- }
-
- public void applyCSSPropertyBorderTopStyle(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-top-style");
-
- }
-
- public void applyCSSPropertyBorderTopWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("border-top-width");
- }
-
- public void applyCSSPropertyBorderWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (element instanceof CSSBorderProperties) {
- applyCSSPropertyBorderWidth((CSSBorderProperties) element, value,
- pseudo, engine);
- return;
- }
- throw new UnsupportedPropertyException("border-width");
- }
-
- public void applyCSSPropertyBorderWidth(CSSBorderProperties border,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- border.setWidth((int) ((CSSPrimitiveValue) value)
- .getFloatValue(CSSPrimitiveValue.CSS_PT));
- }
- }
-
- public String retrieveCSSPropertyBorder(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderBottom(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderBottomColor(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderBottomStyle(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderBottomWidth(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderColor(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderLeft(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderLeftColor(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderLeftStyle(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderLeftWidth(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderRight(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderRightColor(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderRightStyle(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderRightWidth(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderStyle(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderTop(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderTopColor(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderTopStyle(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderTopWidth(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBorderWidth(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return "0";
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyClassificationHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyClassificationHandler.java
deleted file mode 100644
index b463961..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyClassificationHandler.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.exceptions.UnsupportedPropertyException;
-import org.w3c.dom.css.CSSValue;
-
-public abstract class AbstractCSSPropertyClassificationHandler implements
- ICSSPropertyClassificationHandler {
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if ("clear".equals(property)) {
- applyCSSPropertyClear(element, value, pseudo, engine);
- }
- if ("cursor".equals(property)) {
- applyCSSPropertyCursor(element, value, pseudo, engine);
- }
- if ("display".equals(property)) {
- applyCSSPropertyDisplay(element, value, pseudo, engine);
- }
- if ("float".equals(property)) {
- applyCSSPropertyFloat(element, value, pseudo, engine);
- }
- if ("position".equals(property)) {
- applyCSSPropertyPosition(element, value, pseudo, engine);
- }
- if ("visibility".equals(property)) {
- applyCSSPropertyVisibility(element, value, pseudo, engine);
- }
- return false;
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- if ("clear".equals(property)) {
- return retrieveCSSPropertyClear(element, pseudo, engine);
- }
- if ("cursor".equals(property)) {
- return retrieveCSSPropertyCursor(element, pseudo, engine);
- }
- if ("display".equals(property)) {
- return retrieveCSSPropertyDisplay(element, pseudo, engine);
- }
- if ("float".equals(property)) {
- return retrieveCSSPropertyFloat(element, pseudo, engine);
- }
- if ("position".equals(property)) {
- return retrieveCSSPropertyPosition(element, pseudo, engine);
- }
- if ("visibility".equals(property)) {
- return retrieveCSSPropertyVisibility(element, pseudo, engine);
- }
- return null;
- }
-
- public void applyCSSPropertyClear(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("clear");
- }
-
- public void applyCSSPropertyCursor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("cursor");
- }
-
- public void applyCSSPropertyDisplay(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("display");
- }
-
- public void applyCSSPropertyFloat(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("float");
- }
-
- public void applyCSSPropertyPosition(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("position");
- }
-
- public void applyCSSPropertyVisibility(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("visibility");
- }
-
- public String retrieveCSSPropertyClear(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyCursor(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyDisplay(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyFloat(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyPosition(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyVisibility(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyDimensionHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyDimensionHandler.java
deleted file mode 100644
index 5721ce7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyDimensionHandler.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-public abstract class AbstractCSSPropertyDimensionHandler implements ICSSPropertyDimensionHandler {
-
- public void applyCSSPropertyHeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
-
- }
-
- public void applyCSSPropertyLineHeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void applyCSSPropertyMaxHeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void applyCSSPropertyMaxWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void applyCSSPropertyMinHeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void applyCSSPropertyMinWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void applyCSSPropertyWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public String retrieveCSSPropertyHeight(Object widget, String property,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyMaxHeight(Object widget, String property,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyMinHeight(Object widget, String property,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyMinWidth(Object widget, String property,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean applyCSSProperty(Object widget, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return false;
- }
-
- public String retrieveCSSProperty(Object widget, String property,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyFontCompositeHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyFontCompositeHandler.java
deleted file mode 100644
index 8246735..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyFontCompositeHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2FontHelper;
-import org.eclipse.e4.ui.css.core.dom.properties.AbstractCSSPropertyCompositeHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract class which dispatch font CSS Property defined to call the
- * applyCSSProperty methods CSS Properties font-style, font-family, font-weight,
- * font-size.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSPropertyFontCompositeHandler extends
- AbstractCSSPropertyCompositeHandler {
-
- private static final String[] FONT_CSSPROPERTIES = { "font-style",
- "font-variant", "font-weight", "font-size", "font-family" };
-
- public void applyCSSProperty(Object element, CSSValue value, String pseudo,
- CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- String property = CSS2FontHelper
- .getCSSFontPropertyName((CSSPrimitiveValue) value);
- if (property != null) {
- engine.applyCSSProperty(element, property, value, pseudo);
- }
- }
- }
-
- public boolean isCSSPropertyComposite(String property) {
- return "font".equals(property);
- }
-
- public String[] getCSSPropertiesNames(String property) {
- if ("font".equals(property))
- return FONT_CSSPROPERTIES;
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyFontHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyFontHandler.java
deleted file mode 100644
index 124d264..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyFontHandler.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.exceptions.UnsupportedPropertyException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public abstract class AbstractCSSPropertyFontHandler extends
- AbstractCSSPropertyFontCompositeHandler implements
- ICSSPropertyFontHandler {
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if ("font".equals(property))
- applyCSSPropertyFont(element, value, pseudo, engine);
- else if ("font-family".equals(property))
- applyCSSPropertyFontFamily(element, value, pseudo, engine);
- else if ("font-size".equals(property))
- applyCSSPropertyFontSize(element, value, pseudo, engine);
- else if ("font-adjust".equals(property))
- applyCSSPropertyFontSizeAdjust(element, value, pseudo, engine);
- else if ("font-stretch".equals(property))
- applyCSSPropertyFontStretch(element, value, pseudo, engine);
- else if ("font-style".equals(property))
- applyCSSPropertyFontStyle(element, value, pseudo, engine);
- else if ("font-variant".equals(property))
- applyCSSPropertyFontVariant(element, value, pseudo, engine);
- else if ("font-weight".equals(property))
- applyCSSPropertyFontWeight(element, value, pseudo, engine);
- return false;
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- if ("font-family".equals(property)) {
- return retrieveCSSPropertyFontFamily(element, pseudo, engine);
- }
- if ("font-size".equals(property)) {
- return retrieveCSSPropertyFontSize(element, pseudo, engine);
- }
- if ("font-adjust".equals(property)) {
- return retrieveCSSPropertyFontAdjust(element, pseudo, engine);
- }
- if ("font-stretch".equals(property)) {
- return retrieveCSSPropertyFontStretch(element, pseudo, engine);
- }
- if ("font-style".equals(property)) {
- return retrieveCSSPropertyFontStyle(element, pseudo, engine);
- }
- if ("font-variant".equals(property)) {
- return retrieveCSSPropertyFontVariant(element, pseudo, engine);
- }
- if ("font-weight".equals(property)) {
- return retrieveCSSPropertyFontWeight(element, pseudo, engine);
- }
- return null;
- }
-
- public void applyCSSPropertyFont(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- super.applyCSSPropertyComposite(element, "font", value, pseudo, engine);
- }
-
- public void applyCSSPropertyFontFamily(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (element instanceof CSS2FontProperties) {
- applyCSSPropertyFontFamily((CSS2FontProperties) element, value,
- pseudo, engine);
- return;
- }
- throw new UnsupportedPropertyException("font-family");
- }
-
- protected void applyCSSPropertyFontFamily(CSS2FontProperties font,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- font.setFamily((CSSPrimitiveValue) value);
- }
- }
-
- public void applyCSSPropertyFontSize(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (element instanceof CSS2FontProperties) {
- applyCSSPropertyFontSize((CSS2FontProperties) element, value,
- pseudo, engine);
- return;
- }
- throw new UnsupportedPropertyException("font-size");
- }
-
- protected void applyCSSPropertyFontSize(CSS2FontProperties font,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- font.setSize((CSSPrimitiveValue) value);
- }
- }
-
- public void applyCSSPropertyFontSizeAdjust(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("font-adjust");
- }
-
- public void applyCSSPropertyFontStretch(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("font-stretch");
- }
-
- public void applyCSSPropertyFontStyle(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (element instanceof CSS2FontProperties) {
- applyCSSPropertyFontStyle((CSS2FontProperties) element, value,
- pseudo, engine);
- return;
- }
- throw new UnsupportedPropertyException("font-style");
- }
-
- protected void applyCSSPropertyFontStyle(CSS2FontProperties font,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- font.setStyle((CSSPrimitiveValue) value);
- }
- }
-
- public void applyCSSPropertyFontVariant(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("font-variant");
- }
-
- public void applyCSSPropertyFontWeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (element instanceof CSS2FontProperties) {
- applyCSSPropertyFontWeight((CSS2FontProperties) element, value,
- pseudo, engine);
- return;
- }
- throw new UnsupportedPropertyException("font-weight");
- }
-
- protected void applyCSSPropertyFontWeight(CSS2FontProperties font,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- font.setWeight((CSSPrimitiveValue) value);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyTextHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyTextHandler.java
deleted file mode 100644
index ea1d1ee..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/AbstractCSSPropertyTextHandler.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.exceptions.UnsupportedPropertyException;
-import org.eclipse.e4.ui.css.core.utils.StringUtils;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public abstract class AbstractCSSPropertyTextHandler implements
- ICSSPropertyTextHandler {
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if ("color".equals(property)) {
- applyCSSPropertyColor(element, value, pseudo, engine);
- }
- if ("text-transform".equals(property)) {
- applyCSSPropertyTextTransform(element, value, pseudo, engine);
- }
- return false;
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- if ("color".equals(property)) {
- return retrieveCSSPropertyColor(element, pseudo, engine);
- }
- if ("text-transform".equals(property)) {
- return retrieveCSSPropertyTextTransform(element, pseudo, engine);
- }
- return null;
- }
-
- public void applyCSSPropertyColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("color");
- }
-
- public void applyCSSPropertyTextTransform(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- throw new UnsupportedPropertyException("text-transform");
- }
-
- public String retrieveCSSPropertyColor(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyTextTransform(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- protected String getTextTransform(String text, CSSValue value,
- String defaultText) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- String textTransform = primitiveValue.getStringValue();
- if ("capitalize".equals(textTransform)) {
- return StringUtils.capitalize(text);
- }
- if ("uppercase".equals(textTransform)) {
- if (text != null)
- return text.toUpperCase();
- }
- if ("lowercase".equals(textTransform)) {
- if (text != null)
- return text.toLowerCase();
- }
- if ("inherit".equals(textTransform)) {
- return text;
- }
- // TODO : manage inherit
- }
- if (defaultText != null)
- return defaultText;
- return text;
- }
-
- protected String getTextTransform(String textToInsert, String oldText,
- CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- String textTransform = primitiveValue.getStringValue();
- if ("capitalize".equals(textTransform)) {
- String newText = StringUtils.capitalize(oldText + textToInsert);
- if (newText.length() > 0) {
- return newText.substring(newText.length() - 1);
- }
- }
- if ("uppercase".equals(textTransform)) {
- if (textToInsert != null)
- return textToInsert.toUpperCase();
- }
- if ("lowercase".equals(textTransform)) {
- if (textToInsert != null)
- return textToInsert.toLowerCase();
- }
- if ("inherit".equals(textTransform)) {
- return textToInsert;
- }
- // TODO : manage inherit
- }
- return textToInsert;
- }
-
- protected boolean hasTextTransform(CSSValue value) {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- String textTransform = primitiveValue.getStringValue();
- if ("capitalize".equals(textTransform))
- return true;
- if ("uppercase".equals(textTransform))
- return true;
- if ("lowercase".equals(textTransform))
- return true;
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/CSS2FontProperties.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/CSS2FontProperties.java
deleted file mode 100644
index 818c598..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/CSS2FontProperties.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public interface CSS2FontProperties extends CSSValue {
-
- public CSSPrimitiveValue getFamily();
-
- public void setFamily(CSSPrimitiveValue family);
-
- public CSSPrimitiveValue getSize();
-
- public void setSize(CSSPrimitiveValue size);
-
- public CSSPrimitiveValue getSizeAdjust();
-
- public void setSizeAdjust(CSSPrimitiveValue sizeAdjust);
-
- public CSSPrimitiveValue getWeight();
-
- public void setWeight(CSSPrimitiveValue weight);
-
- public CSSPrimitiveValue getStyle();
-
- public void setStyle(CSSPrimitiveValue style);
-
- public CSSPrimitiveValue getVariant();
-
- public void setVariant(CSSPrimitiveValue variant);
-
- public CSSPrimitiveValue getStretch();
-
- public void setStretch(CSSPrimitiveValue stretch);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/CSS2FontPropertiesImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/CSS2FontPropertiesImpl.java
deleted file mode 100644
index 6545394..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/CSS2FontPropertiesImpl.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public class CSS2FontPropertiesImpl implements CSS2FontProperties {
-
- private CSSPrimitiveValue family;
-
- private CSSPrimitiveValue size;
-
- private CSSPrimitiveValue sizeAdjust;
-
- private CSSPrimitiveValue weight;
-
- private CSSPrimitiveValue style;
-
- private CSSPrimitiveValue variant;
-
- private CSSPrimitiveValue stretch;
-
- public CSSPrimitiveValue getFamily() {
- return family;
- }
-
- public void setFamily(CSSPrimitiveValue family) {
- this.family = family;
- }
-
- public CSSPrimitiveValue getSize() {
- return size;
- }
-
- public void setSize(CSSPrimitiveValue size) {
- this.size = size;
- }
-
- public CSSPrimitiveValue getSizeAdjust() {
- return sizeAdjust;
- }
-
- public void setSizeAdjust(CSSPrimitiveValue sizeAdjust) {
- this.sizeAdjust = sizeAdjust;
- }
-
- public CSSPrimitiveValue getWeight() {
- return weight;
- }
-
- public void setWeight(CSSPrimitiveValue weight) {
- this.weight = weight;
- }
-
- public CSSPrimitiveValue getStyle() {
- return style;
- }
-
- public void setStyle(CSSPrimitiveValue style) {
- this.style = style;
- }
-
- public CSSPrimitiveValue getVariant() {
- return variant;
- }
-
- public void setVariant(CSSPrimitiveValue variant) {
- this.variant = variant;
- }
-
- public CSSPrimitiveValue getStretch() {
- return stretch;
- }
-
- public void setStretch(CSSPrimitiveValue stretch) {
- this.stretch = stretch;
- }
-
- public String getCssText() {
- return null;
- }
-
- public short getCssValueType() {
- return CSSValue.CSS_CUSTOM;
- }
-
- public void setCssText(String arg0) throws DOMException {
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyBackgroundHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyBackgroundHandler.java
deleted file mode 100644
index 7492f01..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyBackgroundHandler.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS2 Background Property Handler.
- *
- * @see http://www.w3schools.com/css/css_reference.asp#background
- */
-public interface ICSSPropertyBackgroundHandler extends ICSSPropertyHandler {
-
- /**
- * A shorthand property for setting all background properties in one
- * declaration Available values = background-color background-image
- * background-repeat background-attachment background-position
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBackground(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets whether a background image is fixed or scrolls with the rest of the
- * page. Available values are=scroll,fixed
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyBackgroundAttachment(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the background color of an element. Available values are= color-rgb,
- * color-hex, color-name, transparent
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyBackgroundColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets an image as the background. Available values=url(URL), none
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyBackgroundImage(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the starting position of a background image. Available values=top
- * left,top center,top right,center left,center center,center right,bottom
- * left,bottom center,bottom right,x% y%,xpos ypos
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyBackgroundPosition(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets if/how a background image will be repeated. Available
- * values=repeat,repeat-x,repeat-y,no-repeat
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyBackgroundRepeat(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBackgroundAttachment(Object element,
- String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBackgroundColor(Object element,
- String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBackgroundImage(Object element,
- String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBackgroundPosition(Object element,
- String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBackgroundRepeat(Object element,
- String pseudo,
- CSSEngine engine) throws Exception;
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyBorderHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyBorderHandler.java
deleted file mode 100644
index 854e79a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyBorderHandler.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS2 Border Property Handler.
- *
- * @see http://www.w3schools.com/css/css_reference.asp#border
- */
-public interface ICSSPropertyBorderHandler extends ICSSPropertyHandler {
-
- /**
- * A shorthand property for setting all of the properties for the four
- * borders in one declaration. Available values are= border-width
- * border-style border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorder(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * A shorthand property for setting all of the properties for the bottom
- * border in one declaration. Available values are=border-bottom-width
- * border-style border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderBottom(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the color of the bottom border. Available values are=border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderBottomColor(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the style of the bottom border. Available values are=border-style
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderBottomStyle(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the width of the bottom border. Available values are= thin medium
- * thick length
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderBottomWidth(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the color of the four borders, can have from one to four colors.
- * Available values are=color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * A shorthand property for setting all of the properties for the left
- * border in one declaration. Available values are=border-left-width
- * border-style border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderLeft(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the color of the left border. Available values are=border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderLeftColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the style of the left border. Available values are=border-style
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderLeftStyle(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the width of the left border. Available values are=thin medium thick
- * length
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderLeftWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * A shorthand property for setting all of the properties for the right
- * border in one declaration. Available values are=border-right-width
- * border-style border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderRight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the color of the right border. Available values are=border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderRightColor(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the style of the right border. Available values are=border-style
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderRightStyle(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the width of the right border.Available values are= thin medium
- * thick length
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderRightWidth(Object element,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the style of the four borders, can have from one to four styles.
- * Available values are=none hidden dotted dashed solid double groove ridge
- * inset outset
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderStyle(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * A shorthand property for setting all of the properties for the top border
- * in one declaration. Available values are=border-top-width border-style
- * border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderTop(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the color of the top border. Available values are=border-color
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderTopColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the style of the top border. Available values are=border-style
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderTopStyle(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the width of the top border. Available values are=thin medium thick
- * length
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderTopWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * A shorthand property for setting the width of the four borders in one
- * declaration, can have from one to four values. Available values are=thin
- * medium thick length
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyBorderWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorder(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderBottom(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderBottomColor(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderBottomStyle(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderBottomWidth(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderColor(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderLeft(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderLeftColor(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderLeftStyle(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderLeftWidth(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderRight(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderRightColor(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderRightStyle(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderRightWidth(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderStyle(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderTop(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderTopColor(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderTopStyle(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderTopWidth(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyBorderWidth(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyClassificationHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyClassificationHandler.java
deleted file mode 100644
index 591c883..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyClassificationHandler.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS2 Classification Property Handler.
- *
- * @see http://www.w3schools.com/css/css_reference.asp#classification
- */
-public interface ICSSPropertyClassificationHandler extends ICSSPropertyHandler {
-
- /**
- * Sets the sides of an element where other floating elements are not
- * allowed. Available values are=left,right,both,none
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyClear(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Specifies the type of cursor to be displayed. Available values are=url
- * auto crosshair default pointer move e-resize ne-resize nw-resize n-resize
- * se-resize sw-resize s-resize w-resize text wait help
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyCursor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets how/if an element is displayed. Available values are=none inline
- * block list-item run-in compact marker table inline-table table-row-group
- * table-header-group table-footer-group table-row table-column-group
- * table-column table-cell table-caption
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyDisplay(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets where an image or a text will appear in another element. Available
- * values are=left right none
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyFloat(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Places an element in a static, relative, absolute or fixed position.
- * Available values are=static relative absolute fixed
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyPosition(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets if an element should be visible or invisible. Available values
- * are=visible hidden collapse
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyVisibility(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyClear(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyCursor(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyDisplay(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyFloat(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyPosition(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyVisibility(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyDimensionHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyDimensionHandler.java
deleted file mode 100644
index 549aba0..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyDimensionHandler.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS2 Dimension Property Handler.
- *
- * @see http://www.w3schools.com/css/css_reference.asp#dimension
- */
-public interface ICSSPropertyDimensionHandler extends ICSSPropertyHandler {
-
- /**
- * Sets the height of an element. Available values are=auto length %
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyHeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the distance between lines. Available values are=normal number
- * length %
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyLineHeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the maximum height of an element. Available values are= none length %
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyMaxHeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the maximum width of an element. Available values are=none length %
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyMaxWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the minimum height of an element. Available values are=length %
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyMinHeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the minimum width of an element. Available values are=length %
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyMinWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the width of an element. Available values are=auto % length
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyWidth(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyHeight(Object widget, String property,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyMaxHeight(Object widget, String property,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyMinHeight(Object widget, String property,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyMinWidth(Object widget, String property,
- String pseudo, CSSEngine engine) throws Exception;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyFontHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyFontHandler.java
deleted file mode 100644
index 06ac27d..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyFontHandler.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS2 Font Property Handler.
- *
- * @see http://www.w3schools.com/css/css_reference.asp#font
- */
-public interface ICSSPropertyFontHandler extends ICSSPropertyHandler {
-
- /**
- * A shorthand property for setting all of the properties for a font in one
- * declaration. Available values are=font-style font-variant font-weight
- * font-size/line-height font-family caption icon menu message-box
- * small-caption status-bar
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyFont(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * A prioritized list of font family names and/or generic family names for
- * an element.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyFontFamily(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the size of a font.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyFontSize(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Specifies an aspect value for an element that will preserve the x-height
- * of the first-choice font.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyFontSizeAdjust(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Condenses or expands the current font-family.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyFontStretch(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the style of the font.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyFontStyle(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Displays text in a small-caps font or a normal font.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyFontVariant(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Sets the weight of a font.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @return
- * @throws Exception
- */
- public void applyCSSPropertyFontWeight(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyFontFamily(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyFontSize(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyFontAdjust(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyFontStretch(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyFontStyle(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyFontVariant(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyFontWeight(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyTextHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyTextHandler.java
deleted file mode 100644
index 17a1581..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/css2/ICSSPropertyTextHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS2 Text Property Handler.
- *
- * @see http://www.w3schools.com/css/css_reference.asp#text
- */
-public interface ICSSPropertyTextHandler extends ICSSPropertyHandler {
-
- /**
- * Sets the color of a text.
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Controls the letters in an element. Available values are : none
- * capitalize uppercase lowercase
- *
- * @param element
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- public void applyCSSPropertyTextTransform(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyColor(Object element, String pseudo,
- CSSEngine engine) throws Exception;
-
- public String retrieveCSSPropertyTextTransform(Object element,
- String pseudo, CSSEngine engine) throws Exception;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/AbstractCSSPropertyHandlerProvider.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/AbstractCSSPropertyHandlerProvider.java
deleted file mode 100644
index 22aab7b..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/AbstractCSSPropertyHandlerProvider.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.providers;
-
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandlerProvider;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * Abstract CSS Property handler.
- */
-public abstract class AbstractCSSPropertyHandlerProvider implements
- ICSSPropertyHandlerProvider {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandlerProvider#getDefaultCSSStyleDeclaration(org.eclipse.e4.ui.css.core.engine.CSSEngine,
- * java.lang.Object, org.w3c.dom.css.CSSStyleDeclaration)
- */
- public CSSStyleDeclaration getDefaultCSSStyleDeclaration(CSSEngine engine,
- Object widget, CSSStyleDeclaration newStyle, String pseudoE)
- throws Exception {
- Element elt = engine.getElement(widget);
- if (elt != null) {
- if (elt instanceof CSSStylableElement) {
- CSSStylableElement stylableElement = (CSSStylableElement) elt;
- return getDefaultCSSStyleDeclaration(engine, stylableElement,
- newStyle, pseudoE);
- }
- }
- return null;
- }
-
- /**
- * Return the CSS property from the CSS <code>propertyName</code> of the
- * <code>stylableElement</code>.
- *
- * @param engine
- * @param stylableElement
- * @param propertyName
- * @return
- */
- protected String getCSSPropertyStyle(CSSEngine engine,
- CSSStylableElement stylableElement, String propertyName,
- String pseudo) {
- String propertyValue = engine.retrieveCSSProperty(stylableElement,
- propertyName, pseudo);
- StringBuffer style = null;
- // if (propertyValue != null) {
- if (style == null)
- style = new StringBuffer();
- style.append(propertyName);
- style.append(":");
- style.append(propertyValue);
- style.append(";");
- // }
- return (style == null ? null : style.toString());
- }
-
- /**
- * Return the default CSS style declaration of the
- * {@link CSSStylableElement} <code>stylableElement</code> before apply
- * the <code>newStyle</code> {@link CSSStyleDeclaration}.
- *
- * @param engine
- * @param stylableElement
- * @param newStyle
- * @return
- * @throws Exception
- */
- protected abstract CSSStyleDeclaration getDefaultCSSStyleDeclaration(
- CSSEngine engine, CSSStylableElement stylableElement,
- CSSStyleDeclaration newStyle, String pseudoE) throws Exception;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java
deleted file mode 100644
index 8307d2d..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.providers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.exceptions.UnsupportedClassCSSPropertyException;
-import org.eclipse.e4.ui.css.core.utils.StringUtils;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * CSS property handler with lazy strategy. {@link ICSSPropertyHandler} are
- * retrieved with name into packages registered with registerPackage method.
- */
-public class CSSPropertyHandlerLazyProviderImpl extends
- AbstractCSSPropertyHandlerProvider {
-
- private static Log logger = LogFactory
- .getLog(CSSPropertyHandlerLazyProviderImpl.class);
-
- // List of package names containing handlers class for properties
- private List packageNames = new ArrayList();
-
- // Map used as a cache for properties handlers found
- private Map propertyToHandlersMap = new HashMap();
-
- /**
- * Return the list of PropertiesHandler corresponding to the property name
- * given as argument
- */
- public Collection getCSSPropertyHandlers(String property) throws Exception {
- // Test if ICSSPropertyHandler List was stored into cache
- // with key property
- Map propertyHandlers = getPropertyToHandlersMap();
- Object h = propertyHandlers.get(property);
- if (h != null) {
- // Test if there
- if (h instanceof List)
- return (List) h;
- return null;
- }
-
- List handlers = null;
- try {
- String handlerClassName = getHandlerClassName(property);
- for (Iterator iterator = packageNames.iterator(); iterator
- .hasNext();) {
- String packageName = (String) iterator.next();
-
- ICSSPropertyHandler handler = getCSSPropertyHandler(
- packageName, handlerClassName);
- if (handler != null) {
- if (logger.isDebugEnabled())
- logger.debug("Handle CSS Property=" + property
- + ", with class=" + packageName + "."
- + handlerClassName);
- if (handlers == null)
- handlers = new ArrayList();
- handlers.add(handler);
- }
- }
- if (logger.isDebugEnabled()) {
- if (handlers == null)
- logger.debug("Cannot find Handle Class CSS Property="
- + property + ", for class=" + handlerClassName);
- }
- } finally {
- if (handlers != null)
- propertyHandlers.put(property, handlers);
- else
- propertyHandlers.put(property, "__HANDLER_NOT_FOUND__");
- }
- return handlers;
- }
-
- /**
- * Register a package path "name.name1." where to search for PropertyHandler
- * class
- *
- * @param packageName
- */
- public void registerPackage(String packageName) {
- packageNames.add(packageName);
- propertyToHandlersMap = null;
- }
-
- protected Map getPropertyToHandlersMap() {
- if (propertyToHandlersMap == null)
- propertyToHandlersMap = new HashMap();
- return propertyToHandlersMap;
- }
-
- /**
- * Reflexive method that return a property handler class
- *
- * @param packageName
- * @param handlerClassName
- * @return
- * @throws Exception
- */
- protected ICSSPropertyHandler getCSSPropertyHandler(String packageName,
- String handlerClassName) throws Exception {
- String handlerClass = packageName + "." + handlerClassName;
- try {
- Class clazz = this.getClass().getClassLoader().loadClass(
- handlerClass);
- Object instance = clazz.newInstance();
- if (!(instance instanceof ICSSPropertyHandler)) {
- throw new UnsupportedClassCSSPropertyException(clazz);
- }
- return (ICSSPropertyHandler) clazz.newInstance();
- } catch (ClassNotFoundException e) {
-
- }
- return null;
- }
-
- /**
- * Return the handler class name corresponding to the property label given
- * as argument A Property Handler Class Name is CSSPropertyXXXHandler (like
- * CSSPropertyBorderTopColorHandler)
- *
- * @param property
- * @return
- */
- protected String getHandlerClassName(String property) {
- String handlerClassName = "CSSProperty";
- String[] s = StringUtils.split(property, "-");
- for (int i = 0; i < s.length; i++) {
- String p = s[i];
- p = p.substring(0, 1).toUpperCase() + p.substring(1, p.length());
- handlerClassName += p;
- }
- handlerClassName += "Handler";
- return handlerClassName;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.e4.ui.css.core.dom.properties.providers.AbstractCSSPropertyHandlerProvider#getDefaultCSSStyleDeclaration(org.eclipse.e4.ui.css.core.engine.CSSEngine,
- * org.eclipse.e4.ui.css.core.dom.CSSStylableElement,
- * org.w3c.dom.css.CSSStyleDeclaration)
- */
- protected CSSStyleDeclaration getDefaultCSSStyleDeclaration(
- CSSEngine engine, CSSStylableElement stylableElement,
- CSSStyleDeclaration newStyle, String pseudoE) throws Exception {
- if (stylableElement.getDefaultStyleDeclaration(pseudoE) != null)
- return stylableElement.getDefaultStyleDeclaration(pseudoE);
- if (newStyle != null) {
- StringBuffer style = null;
- int length = newStyle.getLength();
- for (int i = 0; i < length; i++) {
- String propertyName = newStyle.item(i);
- String[] compositePropertiesNames = engine
- .getCSSCompositePropertiesNames(propertyName);
- if (compositePropertiesNames != null) {
- for (int j = 0; j < compositePropertiesNames.length; j++) {
- propertyName = compositePropertiesNames[j];
- String s = getCSSPropertyStyle(engine, stylableElement,
- propertyName, pseudoE);
- if (s != null) {
- if (style == null)
- style = new StringBuffer();
- style.append(s);
- }
- }
- } else {
- String s = getCSSPropertyStyle(engine, stylableElement,
- propertyName, pseudoE);
- if (s != null) {
- if (style == null)
- style = new StringBuffer();
- style.append(s);
- }
- }
- }
- if (style != null) {
- CSSStyleDeclaration defaultStyleDeclaration = engine
- .parseStyleDeclaration(style.toString());
- stylableElement.setDefaultStyleDeclaration(pseudoE,
- defaultStyleDeclaration);
- return defaultStyleDeclaration;
- }
- }
- return stylableElement.getDefaultStyleDeclaration(pseudoE);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerSimpleProviderImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerSimpleProviderImpl.java
deleted file mode 100644
index 0ceb3b3..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerSimpleProviderImpl.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.properties.providers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyBorderHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyClassificationHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyDimensionHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyFontHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyTextHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * CSS property handler with static strategy. {@link ICSSPropertyHandler} are
- * retrieved afetre the CSS Engine register the handler with
- * registerCSSPropertyHandler method.
- */
-public class CSSPropertyHandlerSimpleProviderImpl extends
- AbstractCSSPropertyHandlerProvider {
-
- /**
- * Default <code>Map</code> of <code>ICSSPropertyHandler</code> stored
- * under a CSS property <code>name</code> key.
- */
- private static Map defaultCSSProperties = new HashMap();
-
- private Map propertiesHandler = new HashMap();
-
- /**
- * Custom <code>Map</code> of <code>ICSSPropertyHandler</code> stored
- * under a CSS property <code>name</code> key.
- */
- private Map customCSSProperties = new HashMap();
-
- /**
- * True if custom CSS properties is merged with default CSS Properties.
- */
- private boolean isCSSPropertiesInitialized;
-
- static {
- // http://www.w3schools.com/css/css_reference.asp
- // Register CSS2 properties
-
- // Register CSS2 Background Properties
- registerDefaultCSSProperty("background",
- ICSSPropertyBackgroundHandler.class);
- registerDefaultCSSProperty("background-attachment",
- ICSSPropertyBackgroundHandler.class);
- registerDefaultCSSProperty("background-color",
- ICSSPropertyBackgroundHandler.class);
- registerDefaultCSSProperty("background-image",
- ICSSPropertyBackgroundHandler.class);
- registerDefaultCSSProperty("background-position",
- ICSSPropertyBackgroundHandler.class);
- registerDefaultCSSProperty("background-repeat",
- ICSSPropertyBackgroundHandler.class);
-
- // Register CSS2 Border Properties
- registerDefaultCSSProperty("border", ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-bottom",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-bottom-color",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-bottom-style",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-bottom-width",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-color",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-left",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-left-color",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-left-style",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-left-width",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-right",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-right-color",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-right-style",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-right-width",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-style",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-top",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-top-color",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-top-style",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-top-width",
- ICSSPropertyBorderHandler.class);
- registerDefaultCSSProperty("border-width",
- ICSSPropertyBorderHandler.class);
-
- // Register CSS2 Classification Properties
- registerDefaultCSSProperty("clear",
- ICSSPropertyClassificationHandler.class);
- registerDefaultCSSProperty("cursor",
- ICSSPropertyClassificationHandler.class);
- registerDefaultCSSProperty("display",
- ICSSPropertyClassificationHandler.class);
- registerDefaultCSSProperty("float",
- ICSSPropertyClassificationHandler.class);
- registerDefaultCSSProperty("position",
- ICSSPropertyClassificationHandler.class);
- registerDefaultCSSProperty("visibility",
- ICSSPropertyClassificationHandler.class);
-
- // Register CSS2 Dimension Properties
- registerDefaultCSSProperty("height", ICSSPropertyDimensionHandler.class);
- registerDefaultCSSProperty("line-height",
- ICSSPropertyDimensionHandler.class);
- registerDefaultCSSProperty("max-height",
- ICSSPropertyDimensionHandler.class);
- registerDefaultCSSProperty("max-width",
- ICSSPropertyDimensionHandler.class);
- registerDefaultCSSProperty("min-height",
- ICSSPropertyDimensionHandler.class);
- registerDefaultCSSProperty("min-width",
- ICSSPropertyDimensionHandler.class);
- registerDefaultCSSProperty("width", ICSSPropertyDimensionHandler.class);
-
- // Register CSS2 Font Properties
- registerDefaultCSSProperty("font", ICSSPropertyFontHandler.class);
- registerDefaultCSSProperty("font-family", ICSSPropertyFontHandler.class);
- registerDefaultCSSProperty("font-size", ICSSPropertyFontHandler.class);
- registerDefaultCSSProperty("font-size-adjust",
- ICSSPropertyFontHandler.class);
- registerDefaultCSSProperty("font-stretch",
- ICSSPropertyFontHandler.class);
- registerDefaultCSSProperty("font-style", ICSSPropertyFontHandler.class);
- registerDefaultCSSProperty("font-variant",
- ICSSPropertyFontHandler.class);
- registerDefaultCSSProperty("font-weight", ICSSPropertyFontHandler.class);
-
- // Register CSS2 Text Properties
- registerDefaultCSSProperty("color", ICSSPropertyTextHandler.class);
- registerDefaultCSSProperty("text-transform",
- ICSSPropertyTextHandler.class);
- }
-
- public Collection getCSSPropertyHandlers(String property) throws Exception {
- Class cl = getCSSPropertyHandlerClass(property);
- return (Collection) propertiesHandler.get(cl);
- }
-
- /*--------------- CSS Property Handler -----------------*/
-
- public void registerCSSPropertyHandler(Class cl, ICSSPropertyHandler handler) {
- Object h = propertiesHandler.get(cl);
- if (h != null) {
- if (h instanceof List) {
- List handlers = (List) h;
- handlers.add(handler);
- }
- } else {
- List handlers = new ArrayList();
- handlers.add(handler);
- propertiesHandler.put(cl, handlers);
- }
- }
-
- protected Class getCSSPropertyHandlerClass(String property) {
- initializeCSSPropertiesIfNeed();
- return (Class) customCSSProperties.get(property);
-
- }
-
- public void registerCSSProperty(String propertyName,
- Class propertyHandlerClass) {
- customCSSProperties.put(propertyName, propertyHandlerClass);
- }
-
- public static void registerDefaultCSSProperty(String propertyName,
- Class propertyHandlerClass) {
- defaultCSSProperties.put(propertyName, propertyHandlerClass);
- }
-
- /**
- * Merge custom CSS Properties with default CSS properties.
- */
- private void initializeCSSPropertiesIfNeed() {
- if (isCSSPropertiesInitialized)
- return;
- customCSSProperties.putAll(defaultCSSProperties);
- isCSSPropertiesInitialized = true;
- }
-
- public Collection getAllCSSPropertyNames() {
- initializeCSSPropertiesIfNeed();
- return customCSSProperties.keySet();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.properties.providers.AbstractCSSPropertyHandlerProvider#getDefaultCSSStyleDeclaration(org.eclipse.e4.ui.css.core.engine.CSSEngine,
- * org.eclipse.e4.ui.css.core.dom.CSSStylableElement,
- * org.w3c.dom.css.CSSStyleDeclaration, java.lang.String)
- */
- public CSSStyleDeclaration getDefaultCSSStyleDeclaration(CSSEngine engine,
- CSSStylableElement stylableElement, CSSStyleDeclaration newStyle,
- String pseudoE) throws Exception {
- CSSStyleDeclaration defaultStyleDeclaration = stylableElement
- .getDefaultStyleDeclaration(pseudoE);
- if (defaultStyleDeclaration != null)
- // default style is already computed for the stylable element ,
- // return it.
- return defaultStyleDeclaration;
-
- // Default style must be computed.
- StringBuffer style = null;
- Collection propertyNames = getAllCSSPropertyNames();
- for (Iterator iterator = propertyNames.iterator(); iterator.hasNext();) {
- String propertyName = (String) iterator.next();
- String s = getCSSPropertyStyle(engine, stylableElement,
- propertyName, pseudoE);
- if (s != null) {
- if (style == null)
- style = new StringBuffer();
- style.append(s);
- }
- }
- if (style != null) {
- defaultStyleDeclaration = engine.parseStyleDeclaration(style
- .toString());
- stylableElement.setDefaultStyleDeclaration(pseudoE,
- defaultStyleDeclaration);
- return defaultStyleDeclaration;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/selectors/IDynamicPseudoClassesHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/selectors/IDynamicPseudoClassesHandler.java
deleted file mode 100644
index 6b43112..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/selectors/IDynamicPseudoClassesHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.dom.selectors;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-
-/**
- * Interface to manage dynamic pseudo classes handler like (...:focus,
- * ...:hover).
- */
-public interface IDynamicPseudoClassesHandler {
-
- /**
- * Initialize the <code>element</code>. In this method you can add
- * Listener to the element if it is Swing container, SWT Widget.
- *
- * @param element
- * @param engine
- */
- public void intialize(Object element, CSSEngine engine);
-
- /**
- * Dispose the <code>element</code>. In this method you can remove
- * Listener to the element if it is Swing container, SWT Widget.
- *
- * @param element
- * @param engine
- */
- public void dispose(Object element, CSSEngine engine);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSElementContext.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSElementContext.java
deleted file mode 100644
index 5fd33c7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSElementContext.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.engine;
-
-import org.eclipse.e4.ui.css.core.dom.IElementProvider;
-import org.w3c.dom.Element;
-
-/**
- * Context of the {@link Element} which wrap the native widget (SWT widget,
- * Swing Component...).
- *
- * This context can be used to store any data.
- */
-public interface CSSElementContext {
-
- /**
- * Return the {@link Element} which wrap the native widget.
- *
- * @return
- */
- public Element getElement();
-
- /**
- * Set the {@link Element} which wrap the native widget.
- *
- * @param newElement
- */
- public void setElement(Element newElement);
-
- /**
- * Set data <code>value</code> into the context with <code>key</code>.
- *
- * @param key
- * @param value
- */
- public void setData(Object key, Object value);
-
- /**
- * Get data with <code>key</code>.
- *
- * @param key
- * @return
- */
- public Object getData(Object key);
-
- /**
- * Return true if element provider has changed and false otherwise.
- *
- * @param elementProvider
- * @return
- */
- public boolean elementMustBeRefreshed(IElementProvider elementProvider);
-
- /**
- * Set {@link IElementProvider} used to get the Element wich wrap the native
- * widget.
- *
- * @param elementProvider
- */
- public void setElementProvider(IElementProvider elementProvider);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSEngine.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSEngine.java
deleted file mode 100644
index 669129d..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSEngine.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.engine;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.e4.ui.css.core.dom.IElementProvider;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.resources.IResourcesRegistry;
-import org.eclipse.e4.ui.css.core.util.resources.IResourcesLocatorManager;
-import org.w3c.css.sac.InputSource;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.DocumentCSS;
-import org.w3c.dom.css.ViewCSS;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- * CSS Engine interface used to parse style sheet and apply styles to something
- * (UI SWT, UI Swing...).
- *
- */
-public interface CSSEngine {
-
- /*--------------- Parse style sheet -----------------*/
-
- /**
- * Parse style sheet from Reader reader.
- *
- * @param reader
- * @return
- * @throws IOException
- */
- public StyleSheet parseStyleSheet(Reader reader) throws IOException;
-
- /**
- * Parse style sheet from InputStream stream.
- *
- * @param stream
- * @return
- * @throws IOException
- */
- public StyleSheet parseStyleSheet(InputStream stream) throws IOException;
-
- /**
- * Parse style sheet from InputSource source.
- *
- * @param source
- * @return
- * @throws IOException
- */
- public StyleSheet parseStyleSheet(InputSource source) throws IOException;
-
- /*--------------- Parse style declaration -----------------*/
-
- /**
- * Parse style declaration from String style.
- *
- * @param style
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseStyleDeclaration(String style)
- throws IOException;
-
- /**
- * Parse style declaration from Reader reader.
- *
- * @param reader
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseStyleDeclaration(Reader reader)
- throws IOException;
-
- /**
- * Parse style declaration from InputStream stream.
- *
- * @param stream
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseStyleDeclaration(InputStream stream)
- throws IOException;
-
- /**
- * Parse style declaration from InputSource source.
- *
- * @param source
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseStyleDeclaration(InputSource source)
- throws IOException;
-
- /*--------------- Parse CSS Property Value-----------------*/
-
- /**
- * Parse CSSValue from String value.
- *
- * @param value
- * @return
- * @throws IOException
- */
- public CSSValue parsePropertyValue(String value) throws IOException;
-
- /**
- * Parse CSSValue from InputStream stream.
- *
- * @param reader
- * @return
- * @throws IOException
- */
- public CSSValue parsePropertyValue(InputStream stream) throws IOException;
-
- /**
- * Parse CSSValue from Reader reader.
- *
- * @param reader
- * @return
- * @throws IOException
- */
- public CSSValue parsePropertyValue(Reader reader) throws IOException;
-
- /**
- * Parse CSSValue from InputSource source.
- *
- * @param source
- * @return
- * @throws IOException
- */
- public CSSValue parsePropertyValue(InputSource source) throws IOException;
-
- /*--------------- Apply styles -----------------*/
-
- /**
- * Apply styles to the Object node (SWT Text,...). If
- * <code>applyStylesToChildNodes</code> is true, apply styles to the child
- * nodes (ex : if node is SWT Composite, styles are applied to the child
- * controls too).
- *
- * @param node
- * @param applyStylesToChildNodes
- */
- public void applyStyles(Object node, boolean applyStylesToChildNodes);
-
- /**
- * Apply styles to the Object node (SWT Text,...). If
- * <code>applyStylesToChildNodes</code> is true, apply styles to the child
- * nodes (ex : if node is SWT Composite, styles are applied to the child
- * controls too). If <code>computeDefaultStyle</code> is true, default
- * style is computed before apply styles.
- *
- * @param node
- * @param applyStylesToChildNodes
- * @param computeDefaultStyle
- */
- public void applyStyles(Object node, boolean applyStylesToChildNodes,
- boolean computeDefaultStyle);
-
- /*--------------- Apply style declaration -----------------*/
-
- /**
- * Apply style declaration to the object node.
- *
- * @param node
- * @param style
- * @param pseudo
- */
- public void applyStyleDeclaration(Object node, CSSStyleDeclaration style,
- String pseudo);
-
- /**
- * Parse and apply style declaration from Reader reader.
- *
- * @param node
- * @param reader
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node,
- Reader reader) throws IOException;
-
- /**
- * Parse and apply style declaration from InputStream stream.
- *
- * @param node
- * @param stream
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node,
- InputStream stream) throws IOException;
-
- /**
- * Parse and apply style declaration from InputSource source.
- *
- * @param node
- * @param source
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node,
- InputSource sourcee) throws IOException;
-
- /**
- * Parse and apply style declaration from String style.
- *
- * @param node
- * @param style
- * @return
- * @throws IOException
- */
- public CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node,
- String style) throws IOException;
-
- /*--------------- Apply inline style -----------------*/
-
- /**
- * Apply inline style of the object node. If
- * <code>applyStylesToChildNodes</code> is true, apply style inline to the
- * child nodes (ex : if node is SWT Composite, styles are applied to the
- * child controls too).
- *
- * @param node
- * @param applyStylesToChildNodes
- * @throws IOException
- */
- public void applyInlineStyle(Object node, boolean applyStylesToChildNodes)
- throws IOException;
-
- /**
- * Return {@link CSSErrorHandler} used to handles exception error.
- *
- * @return
- */
- public CSSErrorHandler getErrorHandler();
-
- /**
- * Register the {@link CSSErrorHandler} used to handles exception error.
- *
- * @param errorHandler
- */
- public void setErrorHandler(CSSErrorHandler errorHandler);
-
- /*--------------- Resources -----------------*/
-
- /**
- * Set the {@link IResourcesLocatorManager} to use manage resources.
- *
- * @param resourcesLocatorManager
- */
- public void setResourcesLocatorManager(
- IResourcesLocatorManager resourcesLocatorManager);
-
- /**
- * Get the {@link IResourcesLocatorManager} to use manage resources.
- *
- * @return
- */
- public IResourcesLocatorManager getResourcesLocatorManager();
-
- /*--------------- Document/View CSS -----------------*/
-
- /**
- * Return the {@link DocumentCSS} used to store {@link CSSStyleSheet}.
- *
- * @return
- */
- public DocumentCSS getDocumentCSS();
-
- /**
- * Return the {@link ViewCSS} used to compute {@link CSSStyleDeclaration}.
- *
- * @return
- */
- public ViewCSS getViewCSS();
-
- /*--------------- w3c Element -----------------*/
-
- /**
- * Get {@link IElementProvider} registered used to retrieve w3c
- * {@link Element} which wrap native widget.
- *
- * @return
- */
- public IElementProvider getElementProvider();
-
- /**
- * Set {@link IElementProvider} registered used to retrieve w3c
- * {@link Element} which wrap native widget.
- *
- * @param elementProvider
- */
- public void setElementProvider(IElementProvider elementProvider);
-
- /*--------------- CSS Property Handler -----------------*/
-
- /**
- * Apply CSS property <code>property</code> to the <code>node</code>
- * with <code>value</code>.
- *
- * @param node
- * @param property
- * @param value
- * @param pseudo
- * @return
- * @throws Exception
- */
- public ICSSPropertyHandler applyCSSProperty(Object node, String property,
- CSSValue value, String pseudo) throws Exception;
-
- /**
- * Retrieve String of {@link CSSValue} of the CSS <code>property</code> of
- * the <code>node</code>.
- *
- * @param widget
- * @param property
- * @param pseudo
- * @return
- */
- public String retrieveCSSProperty(Object node, String property, String pseudo);
-
-
- /*--------------- Default Style -----------------*/
-
- /**
- * Apply initial style of the object node. If
- * <code>applyStylesToChildNodes</code> is true, apply style inline to the
- * child nodes (ex : if node is SWT Composite, styles are applied to the
- * child controls too).
- *
- * @param node
- * @param applyStylesToChildNodes
- * @throws IOException
- */
- public void applyDefaultStyleDeclaration(Object node,
- boolean applyStylesToChildNodes);
-
- /**
- * Get default {@link CSSStyleDeclaration} of the <code>node</code> for
- * pseudo element <code>pseudoE</code> which can be null.
- *
- * @param element
- * @return
- */
- public CSSStyleDeclaration getDefaultStyleDeclaration(Object node,
- String pseudoE);
-
- /*--------------- Dispose/Reset -----------------*/
-
- /**
- * Call reset and dispose all resources
- */
- public void dispose();
-
- /**
- * Reset all style sheet registered into CSS Engine. This method must be
- * called if you want parse and apply new StyleSheet and remove the old
- * StyleSheet parsed.
- */
- public void reset();
-
- /*--------------- Resources Registry -----------------*/
-
- /**
- * Get the {@link IResourcesRegistry} registered used to cache/dispose
- * resources.
- *
- * @return
- */
- public IResourcesRegistry getResourcesRegistry();
-
- /**
- * Register {@link IResourcesRegistry} used to cache/dispose resources.
- *
- * @param resourcesRegistry
- */
- public void setResourcesRegistry(IResourcesRegistry resourcesRegistry);
-
- /*--------------- CSS Value Converter -----------------*/
-
- /**
- * Register CSSValue converter {@link ICSSValueConverter}.
- *
- * @param converter
- */
- public void registerCSSValueConverter(ICSSValueConverter converter);
-
- /**
- * Unregister CSSValue converter {@link ICSSValueConverter}.
- *
- * @param converter
- */
- public void unregisterCSSValueConverter(ICSSValueConverter converter);
-
- /**
- * Get CSSValue converter {@link ICSSValueConverter} which is enable to
- * convert <code>toType</code> Object.
- *
- * @param toType
- * @return
- */
- public ICSSValueConverter getCSSValueConverter(Object toType);
-
- /**
- * Convert CSSValue into Object type of <code>toType</code>. (ex :
- * convert CSSValue color:red into java.awt.Color). If
- * {@link IResourcesRegistry} is registered into {@link CSSEngine} this
- * method search before into cache of {@link IResourcesRegistry} if the
- * Object was already converted.
- *
- * @param value
- * @param toType
- * @param context
- * can be null. For SWT context is
- * org.eclipse.swt.widgets.Display.
- * @return
- * @throws Exception
- */
- public Object convert(CSSValue value, Object toType, Object context)
- throws Exception;
-
- /**
- * Convert Object type of <code>toType</code> into CSSValue String.
- *
- * @param value
- * @param toType
- * @param context
- * @return
- * @throws Exception
- */
- public String convert(Object value, Object toType, Object context)
- throws Exception;
-
- /**
- * Get the w3c {@link Element} which wrap Oqbject <code>node</code>.
- *
- * @param node
- * @return
- */
- public Element getElement(Object node);
-
- /**
- * Get the {@link CSSElementContext} context of the object <code>node</code>.
- *
- * @param node
- * @return
- */
- public CSSElementContext getCSSElementContext(Object node);
-
- /**
- * Return array of CSS property name of the CSS <code>property</code>.
- *
- * @param property
- * @return
- */
- public String[] getCSSCompositePropertiesNames(String property);
-
- /**
- * Handle exceptions.
- *
- * @param e
- */
- public void handleExceptions(Exception e);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSErrorHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSErrorHandler.java
deleted file mode 100644
index 7340c0a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/engine/CSSErrorHandler.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.engine;
-
-/**
- * Basic interface for CSS Engine error handlers.
- */
-public interface CSSErrorHandler {
-
- /**
- * Callback method called when CSS engien catch errors.
- *
- * @param e
- */
- public void error(Exception e);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/DOMExceptionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/DOMExceptionImpl.java
deleted file mode 100644
index 90bede1..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/DOMExceptionImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation\
- * IBM Corporation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.exceptions;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.w3c.dom.DOMException;
-
-/**
- * DOM exception implementation.
- */
-public class DOMExceptionImpl extends DOMException {
-
- public static final int SYNTAX_ERROR = 0;
- public static final int ARRAY_OUT_OF_BOUNDS = 1;
- public static final int READ_ONLY_STYLE_SHEET = 2;
- public static final int EXPECTING_UNKNOWN_RULE = 3;
- public static final int EXPECTING_STYLE_RULE = 4;
- public static final int EXPECTING_CHARSET_RULE = 5;
- public static final int EXPECTING_IMPORT_RULE = 6;
- public static final int EXPECTING_MEDIA_RULE = 7;
- public static final int EXPECTING_FONT_FACE_RULE = 8;
- public static final int EXPECTING_PAGE_RULE = 9;
- public static final int FLOAT_ERROR = 10;
- public static final int STRING_ERROR = 11;
- public static final int COUNTER_ERROR = 12;
- public static final int RECT_ERROR = 13;
- public static final int RGBCOLOR_ERROR = 14;
- public static final int CHARSET_NOT_FIRST = 15;
- public static final int CHARSET_NOT_UNIQUE = 16;
- public static final int IMPORT_NOT_FIRST = 17;
- public static final int NOT_FOUND = 18;
- public static final int NOT_IMPLEMENTED = 19;
- public static final int NO_MODIFICATION_ALLOWED_ERROR = 20;
-
- private static ResourceBundle exceptionResource = ResourceBundle.getBundle(
- ExceptionResource.class.getName(), Locale.getDefault());
-
- public DOMExceptionImpl(short code, int messageKey) {
- super(code, exceptionResource.getString(keyString(messageKey)));
- }
-
- public DOMExceptionImpl(int code, int messageKey) {
- super((short) code, exceptionResource.getString(keyString(messageKey)));
- }
-
- public DOMExceptionImpl(short code, int messageKey, String info) {
- super(code, exceptionResource.getString(keyString(messageKey)));
- }
-
- private static String keyString(int key) {
- return "s" + String.valueOf(key);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/ExceptionResource.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/ExceptionResource.java
deleted file mode 100644
index aade90d..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/ExceptionResource.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.exceptions;
-
-import java.util.ListResourceBundle;
-
-/**
- * DOM Exception resource.
- */
-public class ExceptionResource extends ListResourceBundle {
-
- public Object[][] getContents() {
- return contents;
- }
-
- static final Object[][] contents = {
- {"s0", "Syntax error"},
- {"s1", "Array out of bounds error"},
- {"s2", "This style sheet is read only"},
- {"s3", "The text does not represent an unknown rule"},
- {"s4", "The text does not represent a style rule"},
- {"s5", "The text does not represent a charset rule"},
- {"s6", "The text does not represent an import rule"},
- {"s7", "The text does not represent a media rule"},
- {"s8", "The text does not represent a font face rule"},
- {"s9", "The text does not represent a page rule"},
- {"s10", "This isn't a Float type"},
- {"s11", "This isn't a String type"},
- {"s12", "This isn't a Counter type"},
- {"s13", "This isn't a Rect type"},
- {"s14", "This isn't an RGBColor type"},
- {"s15", "A charset rule must be the first rule"},
- {"s16", "A charset rule already exists"},
- {"s17", "An import rule must preceed all other rules"},
- {"s18", "The specified type was not found"},
- {"s19", "Not implemented"},
- {"s20", "Attempt to change a readonly object"}
- };
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/UnsupportedClassCSSPropertyException.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/UnsupportedClassCSSPropertyException.java
deleted file mode 100644
index 5147c81..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/UnsupportedClassCSSPropertyException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.exceptions;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.providers.CSSPropertyHandlerLazyProviderImpl;
-
-/**
- * Exception used when java Class CSS property is not retrieved.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- * @see CSSPropertyHandlerLazyProviderImpl
- */
-public class UnsupportedClassCSSPropertyException extends Exception {
- private static final long serialVersionUID = 1L;
- private Class clazz;
-
- public UnsupportedClassCSSPropertyException(Class clazz) {
- this.clazz = clazz;
- }
-
- public String getMessage() {
- return clazz + " must implement " + ICSSPropertyHandler.class.getName();
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/UnsupportedPropertyException.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/UnsupportedPropertyException.java
deleted file mode 100644
index f8819c3..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/exceptions/UnsupportedPropertyException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.exceptions;
-
-/**
- * Exception used when CSS property handler is not retrieved.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class UnsupportedPropertyException extends Exception {
- private static final long serialVersionUID = 1L;
- private String property;
-
- public UnsupportedPropertyException(String property) {
- if (property == null)
- throw new IllegalArgumentException();
- this.property = property;
- }
-
- public String getMessage() {
- return "CSS Property " + property + " is not supported.";
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/AbstractCSSNode.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/AbstractCSSNode.java
deleted file mode 100644
index 1d44520..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/AbstractCSSNode.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import org.eclipse.e4.ui.css.core.dom.parsers.CSSParser;
-
-/**
- * Abstract CSS Node.
- */
-public class AbstractCSSNode {
-
- public AbstractCSSNode() {
- super();
- }
-
- public CSSParser getCSSParser() {
- //TODO not sure why this always returns null
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSS2PropertiesImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSS2PropertiesImpl.java
deleted file mode 100644
index 65ceb44..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSS2PropertiesImpl.java
+++ /dev/null
@@ -1,2263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSS2Properties;
-
-/**
- * w3c {@link CSS2Properties} implementation.
- */
-public class CSS2PropertiesImpl implements CSS2Properties {
-
- protected Object widget;
-
- protected CSSEngine engine;
-
- public CSS2PropertiesImpl(Object widget, CSSEngine engine) {
- this.widget = widget;
- this.engine = engine;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getAzimuth()
- */
- public String getAzimuth() {
- return engine.retrieveCSSProperty(widget, "azimut", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBackground()
- */
- public String getBackground() {
- return engine.retrieveCSSProperty(widget, "background", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBackgroundAttachment()
- */
- public String getBackgroundAttachment() {
- return engine
- .retrieveCSSProperty(widget, "background-attachment", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBackgroundColor()
- */
- public String getBackgroundColor() {
- return engine.retrieveCSSProperty(widget, "background-color", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBackgroundImage()
- */
- public String getBackgroundImage() {
- return engine.retrieveCSSProperty(widget, "background-image", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBackgroundPosition()
- */
- public String getBackgroundPosition() {
- return engine.retrieveCSSProperty(widget, "background-position", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBackgroundRepeat()
- */
- public String getBackgroundRepeat() {
- return engine.retrieveCSSProperty(widget, "background-repeat", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorder()
- */
- public String getBorder() {
- return engine.retrieveCSSProperty(widget, "border", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderBottom()
- */
- public String getBorderBottom() {
- return engine.retrieveCSSProperty(widget, "border-bottom", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderBottomColor()
- */
- public String getBorderBottomColor() {
- return engine.retrieveCSSProperty(widget, "border-bottom-color", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderBottomStyle()
- */
- public String getBorderBottomStyle() {
- return engine.retrieveCSSProperty(widget, "border-bottom-style", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderBottomWidth()
- */
- public String getBorderBottomWidth() {
- return engine.retrieveCSSProperty(widget, "border-bottom-width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderCollapse()
- */
- public String getBorderCollapse() {
- return engine.retrieveCSSProperty(widget, "border-collapse", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderColor()
- */
- public String getBorderColor() {
- return engine.retrieveCSSProperty(widget, "border-color", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderLeft()
- */
- public String getBorderLeft() {
- return engine.retrieveCSSProperty(widget, "border-left", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderLeftColor()
- */
- public String getBorderLeftColor() {
- return engine.retrieveCSSProperty(widget, "border-left-color", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderLeftStyle()
- */
- public String getBorderLeftStyle() {
- return engine.retrieveCSSProperty(widget, "border-left-style", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderLeftWidth()
- */
- public String getBorderLeftWidth() {
- return engine.retrieveCSSProperty(widget, "border-left-width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderRight()
- */
- public String getBorderRight() {
- return engine.retrieveCSSProperty(widget, "border-right", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderRightColor()
- */
- public String getBorderRightColor() {
- return engine.retrieveCSSProperty(widget, "border-right-color", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderRightStyle()
- */
- public String getBorderRightStyle() {
- return engine.retrieveCSSProperty(widget, "border-right-style", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderRightWidth()
- */
- public String getBorderRightWidth() {
- return engine.retrieveCSSProperty(widget, "border-right-width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderSpacing()
- */
- public String getBorderSpacing() {
- return engine.retrieveCSSProperty(widget, "border-spacing", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderStyle()
- */
- public String getBorderStyle() {
- return engine.retrieveCSSProperty(widget, "border-style", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderTop()
- */
- public String getBorderTop() {
- return engine.retrieveCSSProperty(widget, "border-top", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderTopColor()
- */
- public String getBorderTopColor() {
- return engine.retrieveCSSProperty(widget, "border-top-color", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderTopStyle()
- */
- public String getBorderTopStyle() {
- return engine.retrieveCSSProperty(widget, "border-top-style", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderTopWidth()
- */
- public String getBorderTopWidth() {
- return engine.retrieveCSSProperty(widget, "border-top-width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBorderWidth()
- */
- public String getBorderWidth() {
- return engine.retrieveCSSProperty(widget, "border-width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getBottom()
- */
- public String getBottom() {
- return engine.retrieveCSSProperty(widget, "border-bottom", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getCaptionSide()
- */
- public String getCaptionSide() {
- return engine.retrieveCSSProperty(widget, "caption-side", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getClear()
- */
- public String getClear() {
- return engine.retrieveCSSProperty(widget, "clear", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getClip()
- */
- public String getClip() {
- return engine.retrieveCSSProperty(widget, "clip", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getColor()
- */
- public String getColor() {
- return engine.retrieveCSSProperty(widget, "color", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getContent()
- */
- public String getContent() {
- return engine.retrieveCSSProperty(widget, "content", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getCounterIncrement()
- */
- public String getCounterIncrement() {
- return engine.retrieveCSSProperty(widget, "counter-increment", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getCounterReset()
- */
- public String getCounterReset() {
- return engine.retrieveCSSProperty(widget, "counter-reset", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getCssFloat()
- */
- public String getCssFloat() {
- return engine.retrieveCSSProperty(widget, "float", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getCue()
- */
- public String getCue() {
- return engine.retrieveCSSProperty(widget, "cue", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getCueAfter()
- */
- public String getCueAfter() {
- return engine.retrieveCSSProperty(widget, "cue-after", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getCueBefore()
- */
- public String getCueBefore() {
- return engine.retrieveCSSProperty(widget, "cue-before", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getCursor()
- */
- public String getCursor() {
- return engine.retrieveCSSProperty(widget, "cursor", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getDirection()
- */
- public String getDirection() {
- return engine.retrieveCSSProperty(widget, "direction", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getDisplay()
- */
- public String getDisplay() {
- return engine.retrieveCSSProperty(widget, "display", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getElevation()
- */
- public String getElevation() {
- return engine.retrieveCSSProperty(widget, "elevation", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getEmptyCells()
- */
- public String getEmptyCells() {
- return engine.retrieveCSSProperty(widget, "empty-cells", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getFont()
- */
- public String getFont() {
- return engine.retrieveCSSProperty(widget, "font", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getFontFamily()
- */
- public String getFontFamily() {
- return engine.retrieveCSSProperty(widget, "font-family", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getFontSize()
- */
- public String getFontSize() {
- return engine.retrieveCSSProperty(widget, "font-size", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getFontSizeAdjust()
- */
- public String getFontSizeAdjust() {
- return engine.retrieveCSSProperty(widget, "font_size-adjust", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getFontStretch()
- */
- public String getFontStretch() {
- return engine.retrieveCSSProperty(widget, "font-stretch", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getFontStyle()
- */
- public String getFontStyle() {
- return engine.retrieveCSSProperty(widget, "font-style", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getFontVariant()
- */
- public String getFontVariant() {
- return engine.retrieveCSSProperty(widget, "font-variant", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getFontWeight()
- */
- public String getFontWeight() {
- return engine.retrieveCSSProperty(widget, "font-weight", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getHeight()
- */
- public String getHeight() {
- return engine.retrieveCSSProperty(widget, "height", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getLeft()
- */
- public String getLeft() {
- return engine.retrieveCSSProperty(widget, "left", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getLetterSpacing()
- */
- public String getLetterSpacing() {
- return engine.retrieveCSSProperty(widget, "letter-spacing", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getLineHeight()
- */
- public String getLineHeight() {
- return engine.retrieveCSSProperty(widget, "line-height", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getListStyle()
- */
- public String getListStyle() {
- return engine.retrieveCSSProperty(widget, "list-style", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getListStyleImage()
- */
- public String getListStyleImage() {
- return engine.retrieveCSSProperty(widget, "list-style-image", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getListStylePosition()
- */
- public String getListStylePosition() {
- return engine.retrieveCSSProperty(widget, "list-style-position", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getListStyleType()
- */
- public String getListStyleType() {
- return engine.retrieveCSSProperty(widget, "list-style-type", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMargin()
- */
- public String getMargin() {
- return engine.retrieveCSSProperty(widget, "margin", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMarginBottom()
- */
- public String getMarginBottom() {
- return engine.retrieveCSSProperty(widget, "margin-bottom", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMarginLeft()
- */
- public String getMarginLeft() {
- return engine.retrieveCSSProperty(widget, "margin-left", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMarginRight()
- */
- public String getMarginRight() {
- return engine.retrieveCSSProperty(widget, "margin-right", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMarginTop()
- */
- public String getMarginTop() {
- return engine.retrieveCSSProperty(widget, "margin-top", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMarkerOffset()
- */
- public String getMarkerOffset() {
- return engine.retrieveCSSProperty(widget, "marker-offset", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMarks()
- */
- public String getMarks() {
- return engine.retrieveCSSProperty(widget, "marks", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMaxHeight()
- */
- public String getMaxHeight() {
- return engine.retrieveCSSProperty(widget, "max-height", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMaxWidth()
- */
- public String getMaxWidth() {
- return engine.retrieveCSSProperty(widget, "max-width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMinHeight()
- */
- public String getMinHeight() {
- return engine.retrieveCSSProperty(widget, "min-height", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getMinWidth()
- */
- public String getMinWidth() {
- return engine.retrieveCSSProperty(widget, "min-width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getOrphans()
- */
- public String getOrphans() {
- return engine.retrieveCSSProperty(widget, "orphans", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getOutline()
- */
- public String getOutline() {
- return engine.retrieveCSSProperty(widget, "outline", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getOutlineColor()
- */
- public String getOutlineColor() {
- return engine.retrieveCSSProperty(widget, "outline-color", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getOutlineStyle()
- */
- public String getOutlineStyle() {
- return engine.retrieveCSSProperty(widget, "outline-style", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getOutlineWidth()
- */
- public String getOutlineWidth() {
- return engine.retrieveCSSProperty(widget, "outline-width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getOverflow()
- */
- public String getOverflow() {
- return engine.retrieveCSSProperty(widget, "overflow", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPadding()
- */
- public String getPadding() {
- return engine.retrieveCSSProperty(widget, "padding", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPaddingBottom()
- */
- public String getPaddingBottom() {
- return engine.retrieveCSSProperty(widget, "padding-bottom", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPaddingLeft()
- */
- public String getPaddingLeft() {
- return engine.retrieveCSSProperty(widget, "padding-left", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPaddingRight()
- */
- public String getPaddingRight() {
- return engine.retrieveCSSProperty(widget, "padding-right", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPaddingTop()
- */
- public String getPaddingTop() {
- return engine.retrieveCSSProperty(widget, "padding-top", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPage()
- */
- public String getPage() {
- return engine.retrieveCSSProperty(widget, "page", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPageBreakAfter()
- */
- public String getPageBreakAfter() {
- return engine.retrieveCSSProperty(widget, "page-break-after", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPageBreakBefore()
- */
- public String getPageBreakBefore() {
- return engine.retrieveCSSProperty(widget, "page-break-before", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPageBreakInside()
- */
- public String getPageBreakInside() {
- return engine.retrieveCSSProperty(widget, "page-break-inside", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPause()
- */
- public String getPause() {
- return engine.retrieveCSSProperty(widget, "pause", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPauseAfter()
- */
- public String getPauseAfter() {
- return engine.retrieveCSSProperty(widget, "pause-after", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPauseBefore()
- */
- public String getPauseBefore() {
- return engine.retrieveCSSProperty(widget, "pause-before", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPitch()
- */
- public String getPitch() {
- return engine.retrieveCSSProperty(widget, "pitch", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPitchRange()
- */
- public String getPitchRange() {
- return engine.retrieveCSSProperty(widget, "pitch-range", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPlayDuring()
- */
- public String getPlayDuring() {
- return engine.retrieveCSSProperty(widget, "play-during", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getPosition()
- */
- public String getPosition() {
- return engine.retrieveCSSProperty(widget, "position", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getQuotes()
- */
- public String getQuotes() {
- return engine.retrieveCSSProperty(widget, "quotes", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getRichness()
- */
- public String getRichness() {
- return engine.retrieveCSSProperty(widget, "richness", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getRight()
- */
- public String getRight() {
- return engine.retrieveCSSProperty(widget, "right", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getSize()
- */
- public String getSize() {
- return engine.retrieveCSSProperty(widget, "size", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getSpeak()
- */
- public String getSpeak() {
- return engine.retrieveCSSProperty(widget, "speak", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getSpeakHeader()
- */
- public String getSpeakHeader() {
- return engine.retrieveCSSProperty(widget, "speak-header", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getSpeakNumeral()
- */
- public String getSpeakNumeral() {
- return engine.retrieveCSSProperty(widget, "speak-numeral", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getSpeakPunctuation()
- */
- public String getSpeakPunctuation() {
- return engine.retrieveCSSProperty(widget, "speak-punctuation", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getSpeechRate()
- */
- public String getSpeechRate() {
- return engine.retrieveCSSProperty(widget, "speech-rate", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getStress()
- */
- public String getStress() {
- return engine.retrieveCSSProperty(widget, "stress", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getTableLayout()
- */
- public String getTableLayout() {
- return engine.retrieveCSSProperty(widget, "table-layout", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getTextAlign()
- */
- public String getTextAlign() {
- return engine.retrieveCSSProperty(widget, "text-align", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getTextDecoration()
- */
- public String getTextDecoration() {
- return engine.retrieveCSSProperty(widget, "text-decoration", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getTextIndent()
- */
- public String getTextIndent() {
- return engine.retrieveCSSProperty(widget, "text-indent", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getTextShadow()
- */
- public String getTextShadow() {
- return engine.retrieveCSSProperty(widget, "text-shadow", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getTextTransform()
- */
- public String getTextTransform() {
- return engine.retrieveCSSProperty(widget, "text-transform", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getTop()
- */
- public String getTop() {
- return engine.retrieveCSSProperty(widget, "top", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getUnicodeBidi()
- */
- public String getUnicodeBidi() {
- return engine.retrieveCSSProperty(widget, "unicode-bidi", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getVerticalAlign()
- */
- public String getVerticalAlign() {
- return engine.retrieveCSSProperty(widget, "vertical-align", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getVisibility()
- */
- public String getVisibility() {
- return engine.retrieveCSSProperty(widget, "visibility", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getVoiceFamily()
- */
- public String getVoiceFamily() {
- return engine.retrieveCSSProperty(widget, "voice-family", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getVolume()
- */
- public String getVolume() {
- return engine.retrieveCSSProperty(widget, "volume", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getWhiteSpace()
- */
- public String getWhiteSpace() {
- return engine.retrieveCSSProperty(widget, "white-space", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getWidows()
- */
- public String getWidows() {
- return engine.retrieveCSSProperty(widget, "widows", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getWidth()
- */
- public String getWidth() {
- return engine.retrieveCSSProperty(widget, "width", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getWordSpacing()
- */
- public String getWordSpacing() {
- return engine.retrieveCSSProperty(widget, "word-spacing", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#getZIndex()
- */
- public String getZIndex() {
- return engine.retrieveCSSProperty(widget, "z-index", null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setAzimuth(java.lang.String)
- */
- public void setAzimuth(String azimuth) throws DOMException {
- parseAndApplyStyle("azimuth", azimuth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBackground(java.lang.String)
- */
- public void setBackground(String background) throws DOMException {
- parseAndApplyStyle("background", background);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBackgroundAttachment(java.lang.String)
- */
- public void setBackgroundAttachment(String backgroundAttachment)
- throws DOMException {
- parseAndApplyStyle("background-attachment", backgroundAttachment);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBackgroundColor(java.lang.String)
- */
- public void setBackgroundColor(String backgroundColor) throws DOMException {
- parseAndApplyStyle("background-color", backgroundColor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBackgroundImage(java.lang.String)
- */
- public void setBackgroundImage(String backgroundImage) throws DOMException {
- parseAndApplyStyle("background-image", backgroundImage);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBackgroundPosition(java.lang.String)
- */
- public void setBackgroundPosition(String backgroundPosition)
- throws DOMException {
- parseAndApplyStyle("background-position", backgroundPosition);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBackgroundRepeat(java.lang.String)
- */
- public void setBackgroundRepeat(String backgroundRepeat)
- throws DOMException {
- parseAndApplyStyle("background-repeat", backgroundRepeat);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorder(java.lang.String)
- */
- public void setBorder(String border) throws DOMException {
- parseAndApplyStyle("border", border);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderBottom(java.lang.String)
- */
- public void setBorderBottom(String borderBottom) throws DOMException {
- parseAndApplyStyle("border-bottom", borderBottom);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderBottomColor(java.lang.String)
- */
- public void setBorderBottomColor(String borderColor) throws DOMException {
- parseAndApplyStyle("border-color", borderColor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderBottomStyle(java.lang.String)
- */
- public void setBorderBottomStyle(String borderBottomStyle)
- throws DOMException {
- parseAndApplyStyle("border-bottom-style", borderBottomStyle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderBottomWidth(java.lang.String)
- */
- public void setBorderBottomWidth(String borderBottomWidth)
- throws DOMException {
- parseAndApplyStyle("border-bottom-width", borderBottomWidth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderCollapse(java.lang.String)
- */
- public void setBorderCollapse(String borderCollapse) throws DOMException {
- parseAndApplyStyle("border-collapse", borderCollapse);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderColor(java.lang.String)
- */
- public void setBorderColor(String borderColor) throws DOMException {
- parseAndApplyStyle("border-color", borderColor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderLeft(java.lang.String)
- */
- public void setBorderLeft(String borderLeft) throws DOMException {
- parseAndApplyStyle("border-left", borderLeft);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderLeftColor(java.lang.String)
- */
- public void setBorderLeftColor(String borderLeftColor) throws DOMException {
- parseAndApplyStyle("border-left-color", borderLeftColor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderLeftStyle(java.lang.String)
- */
- public void setBorderLeftStyle(String borderLeftStyle) throws DOMException {
- parseAndApplyStyle("border-left-style", borderLeftStyle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderLeftWidth(java.lang.String)
- */
- public void setBorderLeftWidth(String borderLeftWidth) throws DOMException {
- parseAndApplyStyle("border-left-width", borderLeftWidth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderRight(java.lang.String)
- */
- public void setBorderRight(String borderRight) throws DOMException {
- parseAndApplyStyle("border-right", borderRight);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderRightColor(java.lang.String)
- */
- public void setBorderRightColor(String borderRightColor)
- throws DOMException {
- parseAndApplyStyle("border-right-color", borderRightColor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderRightStyle(java.lang.String)
- */
- public void setBorderRightStyle(String borderRightStyle)
- throws DOMException {
- parseAndApplyStyle("border-right-style", borderRightStyle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderRightWidth(java.lang.String)
- */
- public void setBorderRightWidth(String borderRightWidth)
- throws DOMException {
- parseAndApplyStyle("border-right-width", borderRightWidth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderSpacing(java.lang.String)
- */
- public void setBorderSpacing(String borderSpacing) throws DOMException {
- parseAndApplyStyle("border-spacing", borderSpacing);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderStyle(java.lang.String)
- */
- public void setBorderStyle(String borderStyle) throws DOMException {
- parseAndApplyStyle("border-style", borderStyle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderTop(java.lang.String)
- */
- public void setBorderTop(String borderTop) throws DOMException {
- parseAndApplyStyle("border-top", borderTop);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderTopColor(java.lang.String)
- */
- public void setBorderTopColor(String borderTopColor) throws DOMException {
- parseAndApplyStyle("border-top-color", borderTopColor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderTopStyle(java.lang.String)
- */
- public void setBorderTopStyle(String borderTopStyle) throws DOMException {
- parseAndApplyStyle("border-top-style", borderTopStyle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderTopWidth(java.lang.String)
- */
- public void setBorderTopWidth(String borderTopWidth) throws DOMException {
- parseAndApplyStyle("border-top-width", borderTopWidth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBorderWidth(java.lang.String)
- */
- public void setBorderWidth(String borderWidth) throws DOMException {
- parseAndApplyStyle("border-width", borderWidth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setBottom(java.lang.String)
- */
- public void setBottom(String bottom) throws DOMException {
- parseAndApplyStyle("bottom", bottom);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setCaptionSide(java.lang.String)
- */
- public void setCaptionSide(String captionSide) throws DOMException {
- parseAndApplyStyle("caption-side", captionSide);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setClear(java.lang.String)
- */
- public void setClear(String clear) throws DOMException {
- parseAndApplyStyle("clear", clear);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setClip(java.lang.String)
- */
- public void setClip(String clip) throws DOMException {
- parseAndApplyStyle("clip", clip);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setColor(java.lang.String)
- */
- public void setColor(String color) throws DOMException {
- parseAndApplyStyle("color", color);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setContent(java.lang.String)
- */
- public void setContent(String content) throws DOMException {
- parseAndApplyStyle("content", content);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setCounterIncrement(java.lang.String)
- */
- public void setCounterIncrement(String counterIncrement)
- throws DOMException {
- parseAndApplyStyle("counter-increment", counterIncrement);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setCounterReset(java.lang.String)
- */
- public void setCounterReset(String counterReset) throws DOMException {
- parseAndApplyStyle("counter-reset", counterReset);
- }
-
- public void setCssFloat(String cssFloat) throws DOMException {
- parseAndApplyStyle("float", cssFloat);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setCue(java.lang.String)
- */
- public void setCue(String cue) throws DOMException {
- parseAndApplyStyle("cue", cue);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setCueAfter(java.lang.String)
- */
- public void setCueAfter(String cueAfter) throws DOMException {
- parseAndApplyStyle("cue-after", cueAfter);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setCueBefore(java.lang.String)
- */
- public void setCueBefore(String cueBefore) throws DOMException {
- parseAndApplyStyle("cue-before", cueBefore);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setCursor(java.lang.String)
- */
- public void setCursor(String cursor) throws DOMException {
- parseAndApplyStyle("cursor", cursor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setDirection(java.lang.String)
- */
- public void setDirection(String direction) throws DOMException {
- parseAndApplyStyle("direction", direction);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setDisplay(java.lang.String)
- */
- public void setDisplay(String display) throws DOMException {
- parseAndApplyStyle("display", display);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setElevation(java.lang.String)
- */
- public void setElevation(String elevation) throws DOMException {
- parseAndApplyStyle("elevation", elevation);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setEmptyCells(java.lang.String)
- */
- public void setEmptyCells(String emptyCells) throws DOMException {
- parseAndApplyStyle("empty-cells", emptyCells);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setFont(java.lang.String)
- */
- public void setFont(String font) throws DOMException {
- parseAndApplyStyle("font", font);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setFontFamily(java.lang.String)
- */
- public void setFontFamily(String fontFamily) throws DOMException {
- parseAndApplyStyle("font-family", fontFamily);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setFontSize(java.lang.String)
- */
- public void setFontSize(String fontSize) throws DOMException {
- parseAndApplyStyle("font-size", fontSize);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setFontSizeAdjust(java.lang.String)
- */
- public void setFontSizeAdjust(String fontSizeAdjust) throws DOMException {
- parseAndApplyStyle("font-size-adjust", fontSizeAdjust);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setFontStretch(java.lang.String)
- */
- public void setFontStretch(String fontStretch) throws DOMException {
- parseAndApplyStyle("font-stretch", fontStretch);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setFontStyle(java.lang.String)
- */
- public void setFontStyle(String fontStyle) throws DOMException {
- parseAndApplyStyle("font-style", fontStyle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setFontVariant(java.lang.String)
- */
- public void setFontVariant(String fontVariant) throws DOMException {
- parseAndApplyStyle("font-variant", fontVariant);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setFontWeight(java.lang.String)
- */
- public void setFontWeight(String fontWeight) throws DOMException {
- parseAndApplyStyle("font-weight", fontWeight);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setHeight(java.lang.String)
- */
- public void setHeight(String height) throws DOMException {
- parseAndApplyStyle("height", height);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setLeft(java.lang.String)
- */
- public void setLeft(String left) throws DOMException {
- parseAndApplyStyle("left", left);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setLetterSpacing(java.lang.String)
- */
- public void setLetterSpacing(String letterSpacing) throws DOMException {
- parseAndApplyStyle("letter-spacing", letterSpacing);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setLineHeight(java.lang.String)
- */
- public void setLineHeight(String lineHeight) throws DOMException {
- parseAndApplyStyle("line-height", lineHeight);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setListStyle(java.lang.String)
- */
- public void setListStyle(String listStyle) throws DOMException {
- parseAndApplyStyle("list-style", listStyle);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setListStyleImage(java.lang.String)
- */
- public void setListStyleImage(String listStyleImage) throws DOMException {
- parseAndApplyStyle("list-style-image", listStyleImage);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setListStylePosition(java.lang.String)
- */
- public void setListStylePosition(String listStylePosition)
- throws DOMException {
- parseAndApplyStyle("list-style-position", listStylePosition);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setListStyleType(java.lang.String)
- */
- public void setListStyleType(String listStyleType) throws DOMException {
- parseAndApplyStyle("list-style-type", listStyleType);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMargin(java.lang.String)
- */
- public void setMargin(String margin) throws DOMException {
- parseAndApplyStyle("margin", margin);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMarginBottom(java.lang.String)
- */
- public void setMarginBottom(String marginBottom) throws DOMException {
- parseAndApplyStyle("margin-bottom", marginBottom);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMarginLeft(java.lang.String)
- */
- public void setMarginLeft(String marginLeft) throws DOMException {
- parseAndApplyStyle("margin-left", marginLeft);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMarginRight(java.lang.String)
- */
- public void setMarginRight(String marginRight) throws DOMException {
- parseAndApplyStyle("margin-right", marginRight);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMarginTop(java.lang.String)
- */
- public void setMarginTop(String marginTop) throws DOMException {
- parseAndApplyStyle("margin-top", marginTop);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMarkerOffset(java.lang.String)
- */
- public void setMarkerOffset(String markerOffset) throws DOMException {
- parseAndApplyStyle("marker-offset", markerOffset);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMarks(java.lang.String)
- */
- public void setMarks(String marks) throws DOMException {
- parseAndApplyStyle("marks", marks);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMaxHeight(java.lang.String)
- */
- public void setMaxHeight(String maxHeight) throws DOMException {
- parseAndApplyStyle("max-height", maxHeight);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMaxWidth(java.lang.String)
- */
- public void setMaxWidth(String maxWidth) throws DOMException {
- parseAndApplyStyle("max-width", maxWidth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMinHeight(java.lang.String)
- */
- public void setMinHeight(String minHeight) throws DOMException {
- parseAndApplyStyle("min-height", minHeight);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setMinWidth(java.lang.String)
- */
- public void setMinWidth(String minWidth) throws DOMException {
- parseAndApplyStyle("min-width", minWidth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setOrphans(java.lang.String)
- */
- public void setOrphans(String orphans) throws DOMException {
- parseAndApplyStyle("orphans", orphans);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setOutline(java.lang.String)
- */
- public void setOutline(String outline) throws DOMException {
- parseAndApplyStyle("outline", outline);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setOutlineColor(java.lang.String)
- */
- public void setOutlineColor(String outlineColor) throws DOMException {
- parseAndApplyStyle("outline-color", outlineColor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setOutlineStyle(java.lang.String)
- */
- public void setOutlineStyle(String outlineStyle) throws DOMException {
- parseAndApplyStyle("outline-style", outlineStyle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setOutlineWidth(java.lang.String)
- */
- public void setOutlineWidth(String outlineWidth) throws DOMException {
- parseAndApplyStyle("outline-width", outlineWidth);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setOverflow(java.lang.String)
- */
- public void setOverflow(String overflow) throws DOMException {
- parseAndApplyStyle("overflow", overflow);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPadding(java.lang.String)
- */
- public void setPadding(String padding) throws DOMException {
- parseAndApplyStyle("padding", padding);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPaddingBottom(java.lang.String)
- */
- public void setPaddingBottom(String paddingBottom) throws DOMException {
- parseAndApplyStyle("padding-bottom", paddingBottom);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPaddingLeft(java.lang.String)
- */
- public void setPaddingLeft(String paddingLeft) throws DOMException {
- parseAndApplyStyle("padding-left", paddingLeft);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPaddingRight(java.lang.String)
- */
- public void setPaddingRight(String paddingRight) throws DOMException {
- parseAndApplyStyle("padding-right", paddingRight);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPaddingTop(java.lang.String)
- */
- public void setPaddingTop(String paddingTop) throws DOMException {
- parseAndApplyStyle("padding-top", paddingTop);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPage(java.lang.String)
- */
- public void setPage(String page) throws DOMException {
- parseAndApplyStyle("page", page);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPageBreakAfter(java.lang.String)
- */
- public void setPageBreakAfter(String pageBreakAfter) throws DOMException {
- parseAndApplyStyle("page-break-after", pageBreakAfter);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPageBreakBefore(java.lang.String)
- */
- public void setPageBreakBefore(String pageBreakBefore) throws DOMException {
- parseAndApplyStyle("page-break-before", pageBreakBefore);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPageBreakInside(java.lang.String)
- */
- public void setPageBreakInside(String pageBreakInside) throws DOMException {
- parseAndApplyStyle("page-break-inside", pageBreakInside);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPause(java.lang.String)
- */
- public void setPause(String pause) throws DOMException {
- parseAndApplyStyle("pause", pause);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPauseAfter(java.lang.String)
- */
- public void setPauseAfter(String pauseAfter) throws DOMException {
- parseAndApplyStyle("pause-after", pauseAfter);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPauseBefore(java.lang.String)
- */
- public void setPauseBefore(String pauseBefore) throws DOMException {
- parseAndApplyStyle("pause-before", pauseBefore);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPitch(java.lang.String)
- */
- public void setPitch(String pitch) throws DOMException {
- parseAndApplyStyle("pitch", pitch);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPitchRange(java.lang.String)
- */
- public void setPitchRange(String pitchRange) throws DOMException {
- parseAndApplyStyle("pitch-range", pitchRange);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPlayDuring(java.lang.String)
- */
- public void setPlayDuring(String playDuring) throws DOMException {
- parseAndApplyStyle("playDuring", playDuring);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setPosition(java.lang.String)
- */
- public void setPosition(String position) throws DOMException {
- parseAndApplyStyle("position", position);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setQuotes(java.lang.String)
- */
- public void setQuotes(String quotes) throws DOMException {
- parseAndApplyStyle("quotes", quotes);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setRichness(java.lang.String)
- */
- public void setRichness(String richness) throws DOMException {
- parseAndApplyStyle("richness", richness);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setRight(java.lang.String)
- */
- public void setRight(String right) throws DOMException {
- parseAndApplyStyle("right", right);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setSize(java.lang.String)
- */
- public void setSize(String size) throws DOMException {
- parseAndApplyStyle("size", size);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setSpeak(java.lang.String)
- */
- public void setSpeak(String speak) throws DOMException {
- parseAndApplyStyle("speak", speak);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setSpeakHeader(java.lang.String)
- */
- public void setSpeakHeader(String speakHeader) throws DOMException {
- parseAndApplyStyle("speak-header", speakHeader);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setSpeakNumeral(java.lang.String)
- */
- public void setSpeakNumeral(String speakNumeral) throws DOMException {
- parseAndApplyStyle("speak-numeral", speakNumeral);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setSpeakPunctuation(java.lang.String)
- */
- public void setSpeakPunctuation(String speakPunctuation)
- throws DOMException {
- parseAndApplyStyle("speak-punctuation", speakPunctuation);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setSpeechRate(java.lang.String)
- */
- public void setSpeechRate(String speechRate) throws DOMException {
- parseAndApplyStyle("speech-rate", speechRate);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setStress(java.lang.String)
- */
- public void setStress(String stress) throws DOMException {
- parseAndApplyStyle("stress", stress);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setTableLayout(java.lang.String)
- */
- public void setTableLayout(String tableLayout) throws DOMException {
- parseAndApplyStyle("table-layout", tableLayout);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setTextAlign(java.lang.String)
- */
- public void setTextAlign(String textAlign) throws DOMException {
- parseAndApplyStyle("text-align", textAlign);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setTextDecoration(java.lang.String)
- */
- public void setTextDecoration(String textDecoration) throws DOMException {
- parseAndApplyStyle("text-decoration", textDecoration);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setTextIndent(java.lang.String)
- */
- public void setTextIndent(String textIndent) throws DOMException {
- parseAndApplyStyle("text-indent", textIndent);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setTextShadow(java.lang.String)
- */
- public void setTextShadow(String textShadow) throws DOMException {
- parseAndApplyStyle("text-shadow", textShadow);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setTextTransform(java.lang.String)
- */
- public void setTextTransform(String textTransform) throws DOMException {
- parseAndApplyStyle("text-transform", textTransform);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setTop(java.lang.String)
- */
- public void setTop(String top) throws DOMException {
- parseAndApplyStyle("top", top);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setUnicodeBidi(java.lang.String)
- */
- public void setUnicodeBidi(String unicodeBidi) throws DOMException {
- parseAndApplyStyle("unicode-bidi", unicodeBidi);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setVerticalAlign(java.lang.String)
- */
- public void setVerticalAlign(String verticalAlign) throws DOMException {
- parseAndApplyStyle("vertical-align", verticalAlign);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setVisibility(java.lang.String)
- */
- public void setVisibility(String visibility) throws DOMException {
- parseAndApplyStyle("visibility", visibility);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setVoiceFamily(java.lang.String)
- */
- public void setVoiceFamily(String voiceFamily) throws DOMException {
- parseAndApplyStyle("voice-family", voiceFamily);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setVolume(java.lang.String)
- */
- public void setVolume(String volume) throws DOMException {
- parseAndApplyStyle("volume", volume);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setWhiteSpace(java.lang.String)
- */
- public void setWhiteSpace(String whiteSpace) throws DOMException {
- parseAndApplyStyle("white-space", whiteSpace);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setWidows(java.lang.String)
- */
- public void setWidows(String widows) throws DOMException {
- parseAndApplyStyle("widows", widows);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setWidth(java.lang.String)
- */
- public void setWidth(String width) throws DOMException {
- parseAndApplyStyle("width", width);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setWordSpacing(java.lang.String)
- */
- public void setWordSpacing(String wordSpacing) throws DOMException {
- parseAndApplyStyle("word-spacing", wordSpacing);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.css.CSS2Properties#setZIndex(java.lang.String)
- */
- public void setZIndex(String zIndex) throws DOMException {
- parseAndApplyStyle("z-index", zIndex);
- }
-
- /**
- * Parse and apply CSS property name <code>propertyName</code> with value
- * <code>propertyValue</code> to the widget.
- *
- * @param propertyName
- * @param propertyValue
- */
- protected void parseAndApplyStyle(String propertyName, String propertyValue) {
- try {
- String property = propertyName + ":" + propertyValue;
- engine.parseAndApplyStyleDeclaration(widget, property);
- } catch (Exception e) {
- throw new DOMException(DOMException.SYNTAX_ERR, e.getMessage());
- }
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSComputedStyleImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSComputedStyleImpl.java
deleted file mode 100644
index b3b7c4a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSComputedStyleImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * EclipseSource - revision
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.e4.ui.css.core.dom.CSSProperty;
-import org.eclipse.e4.ui.css.core.dom.CSSPropertyList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- * CSS computed style which concatenate list of CSSComputedStyleImpl to manage
- * styles coming from Condition Selector (ex : Label#MyId) and other selectors
- * (ex : Label).
- */
-public class CSSComputedStyleImpl extends CSSStyleDeclarationImpl implements
- CSSStyleDeclaration {
-
- private List<StyleWrapper> styleRules;
-
- public CSSComputedStyleImpl(List<StyleWrapper> styleRules) {
- super(null);
- this.styleRules = styleRules;
- // TODO [rst] Optimize: A list of StyleWrapper instances could be sorted
- // only once after reading the stylesheet(s).
- Collections.sort( this.styleRules, StyleWrapper.COMPARATOR );
- Iterator iterator = this.styleRules.iterator();
- while (iterator.hasNext()) {
- StyleWrapper styleWrapper = (StyleWrapper) iterator.next();
- addCSSPropertyList(((CSSStyleDeclarationImpl) styleWrapper.style).getCSSPropertyList());
- }
- }
-
- private void addCSSPropertyList(CSSPropertyList properties) {
- int length = properties.getLength();
- for (int i = 0; i < length; i++) {
- CSSProperty property = properties.item(i);
- super.removeProperty(property.getName());
- super.addProperty(property);
- }
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSExtendedPropertiesImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSExtendedPropertiesImpl.java
deleted file mode 100644
index 7a5e499..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSExtendedPropertiesImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import org.eclipse.e4.ui.css.core.dom.CSSExtendedProperties;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-
-/**
- * {@link CSSExtendedProperties} implementation.
- */
-public class CSSExtendedPropertiesImpl extends CSS2PropertiesImpl implements
- CSSExtendedProperties {
-
- public CSSExtendedPropertiesImpl(Object widget, CSSEngine engine) {
- super(widget, engine);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSFontFaceRuleImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSFontFaceRuleImpl.java
deleted file mode 100644
index f29f4c9..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSFontFaceRuleImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-
-public class CSSFontFaceRuleImpl extends CSSRuleImpl implements CSSFontFaceRule, Serializable {
-
- public CSSFontFaceRuleImpl(CSSStyleSheet parentStyleSheet, CSSRule parentRule) {
- super(parentStyleSheet, parentRule);
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /**
- * @see org.w3c.dom.css.CSSRule.getType()
- */
- public short getType() {
- return CSSRule.FONT_FACE_RULE;
- }
-
- // W3C CSSFontFaceRule API methods
-
- /**
- * @see org.w3c.dom.css.CSSFontFaceRule.getStyle()
- */
- public CSSStyleDeclaration getStyle() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- // Additional methods
-
- public void setStyle(CSSStyleDeclarationImpl decl) {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSImportRuleImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSImportRuleImpl.java
deleted file mode 100644
index af21f47..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSImportRuleImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.MediaList;
-
-public class CSSImportRuleImpl extends CSSRuleImpl implements CSSImportRule, Serializable {
-
- public CSSImportRuleImpl(CSSStyleSheet parentStyleSheet, CSSRule parentRule,
- String uri, MediaListImpl mediaListImpl) {
- super(parentStyleSheet, parentRule);
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#getType()
- */
- public short getType() {
- return CSSRule.IMPORT_RULE;
- }
-
- // W3C CSSImportRule API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSImportRule#getHref()
- */
- public String getHref() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSImportRule#getMedia()
- */
- public MediaList getMedia() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSImportRule#getStyleSheet()
- */
- public CSSStyleSheet getStyleSheet() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSMediaRuleImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSMediaRuleImpl.java
deleted file mode 100644
index 214fb77..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSMediaRuleImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSMediaRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.MediaList;
-
-public class CSSMediaRuleImpl extends CSSRuleImpl implements CSSMediaRule, Serializable {
-
- public CSSMediaRuleImpl(CSSStyleSheet parentStyleSheet, CSSRule parentRule,
- MediaListImpl mediaListImpl) {
- super(parentStyleSheet, parentRule);
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#getType()
- */
- public short getType() {
- return CSSRule.MEDIA_RULE;
- }
-
- // W3C CSSMediaRule API methods
-
- public void deleteRule(int index) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public CSSRuleList getCssRules() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public MediaList getMedia() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public int insertRule(String rule, int index) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-
- // Additional methods
-
- public void setRuleList(CSSRuleListImpl rules) {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
-
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPageRuleImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPageRuleImpl.java
deleted file mode 100644
index 8a6e0ca..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPageRuleImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPageRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-
-public class CSSPageRuleImpl extends CSSRuleImpl implements CSSPageRule, Serializable {
-
- public CSSPageRuleImpl(CSSStyleSheet parentStyleSheet, CSSRule parentRule,
- String name, String pseudo_page) {
- super(parentStyleSheet, parentRule);
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#getType()
- */
- public short getType() {
- return CSSRule.PAGE_RULE;
- }
-
- // W3C CSSPageRule API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPageRule#getSelectorText()
- */
- public String getSelectorText() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPageRule#getStyle()
- */
- public CSSStyleDeclaration getStyle() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPageRule#setSelectorText(String)
- */
- public void setSelectorText(String arg0) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- // Additional methods
-
- public void setStyle(CSSStyleDeclarationImpl decl) {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPropertyImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPropertyImpl.java
deleted file mode 100644
index 5ac0de9..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPropertyImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.eclipse.e4.ui.css.core.dom.CSSProperty;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyImpl implements CSSProperty, Serializable {
-
- /*
- * The string used to signify a property's priority as "important"
- * e.g. @see org.w3c.dom.css.CSSStyleDeclaration#getPropertyPriority(String)
- */
- protected static String IMPORTANT_IDENTIFIER = "important";
-
- private String name;
- private CSSValue value;
- private boolean important;
-
- public static boolean sameName(CSSProperty property, String testName) {
- return property.getName().equalsIgnoreCase(testName);
- }
-
- /** Creates new Property */
- public CSSPropertyImpl(String name, CSSValue value, boolean important) {
- this.name = name;
- this.value = value;
- this.important = important;
- }
-
- public String getName() {
- return name;
- }
-
- public CSSValue getValue() {
- return value;
- }
-
- public boolean isImportant() {
- return important;
- }
-
- public void setImportant(boolean important) {
- this.important = important;
- }
-
- public void setValue(CSSValue value) {
- this.value = value;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPropertyListImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPropertyListImpl.java
deleted file mode 100644
index 0269734..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSPropertyListImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.e4.ui.css.core.dom.CSSProperty;
-import org.eclipse.e4.ui.css.core.dom.CSSPropertyList;
-
-/**
- * w3c {@link CSSPropertyList} implementation.
- */
-public class CSSPropertyListImpl implements CSSPropertyList {
-
- private List properties = null;
-
- public CSSPropertyListImpl() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.e4.css.core.dom.CSSPropertyList#getLength()
- */
- public int getLength() {
- return (properties != null) ? properties.size() : 0;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.e4.css.core.dom.CSSPropertyList#item(int)
- */
- public CSSProperty item(int index) {
- return (properties != null) ? (CSSProperty) properties.get(index)
- : null;
- }
-
- /**
- * Add {@link CSSProperty}.
- */
- public void add(CSSProperty property) {
- if (properties == null) {
- properties = new ArrayList();
- }
- properties.add(property);
- }
-
- /**
- * Insert {@link CSSProperty} at <code>index</code>.
- * @param property
- * @param index
- */
- public void insert(CSSProperty property, int index) {
- if (properties == null) {
- properties = new ArrayList();
- }
- properties.add(index, property);
- }
-
- /**
- * Delete {@link CSSProperty} at <code>index</code>.
- * @param index
- */
- public void delete(int index) {
- if (properties == null) {
- properties = new ArrayList();
- }
- properties.remove(index);
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < getLength(); i++) {
- sb.append(item(i).toString()).append("\r\n");
- }
- return sb.toString();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSRuleImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSRuleImpl.java
deleted file mode 100644
index 8022265..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSRuleImpl.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import org.eclipse.e4.ui.css.core.exceptions.DOMExceptionImpl;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleSheet;
-
-public abstract class CSSRuleImpl extends AbstractCSSNode implements CSSRule {
-
- private CSSStyleSheet parentStyleSheet = null; // null allowed
- private CSSRule parentRule = null; // null allowed
- private boolean readOnly;
-
- //TODO who sets readOnly? Seems should be ViewCSSImpl.getComputedStyle(Element,String)
-
- public CSSRuleImpl(CSSStyleSheet parentStyleSheet, CSSRule parentRule) {
- super();
- this.parentStyleSheet = parentStyleSheet;
- this.parentRule = parentRule;
- }
-
- // W3C CSSRule API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#getCssText()
- */
- public String getCssText() {
- // TODO Auto-generated constructor stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#getParentStyleSheet()
- */
- public CSSStyleSheet getParentStyleSheet() {
- return parentStyleSheet;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#getParentRule()
- */
- public CSSRule getParentRule() {
- return parentRule;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#getType()
- */
- abstract public short getType();
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#setCssText(java.lang.String)
- */
- public void setCssText(String cssText) throws DOMException {
- if(readOnly)
- throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMExceptionImpl.NO_MODIFICATION_ALLOWED_ERROR);
- // TODO Auto-generated method stub
- // TODO throws SYNTAX_ERR if cssText is unparsable
- // TODO throws INVALID_MODIFICATION_ERR: Raised if the specified CSS string value represents a different type of rule than the current one.
- // TODO throws HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at this point in the style sheet.
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSRuleListImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSRuleListImpl.java
deleted file mode 100644
index 854ed22..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSRuleListImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-
-public class CSSRuleListImpl implements CSSRuleList, Serializable {
-
- private List<CSSRule> ruleList;
-
- public CSSRuleListImpl() {
- super();
- this.ruleList = new ArrayList<CSSRule>();
- }
-
- // W3C CSSRuleList API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRuleList#getLength()
- */
- public int getLength() {
- return ruleList.size();
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRuleList#item(int)
- */
- public CSSRule item(int position) {
- return ruleList.get(position);
- }
-
- //Additional
-
- /**
- * @throws IndexOutOfBoundsException
- */
- public void add(CSSRule rule) {
- ruleList.add(rule);
- }
-
- /**
- * @throws IndexOutOfBoundsException
- */
- public void remove(int position) {
- ruleList.remove(position);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleDeclarationImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleDeclarationImpl.java
deleted file mode 100644
index 5c96575..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleDeclarationImpl.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.e4.ui.css.core.dom.CSSProperty;
-import org.eclipse.e4.ui.css.core.dom.CSSPropertyList;
-import org.eclipse.e4.ui.css.core.dom.ExtendedCSSRule;
-import org.eclipse.e4.ui.css.core.exceptions.DOMExceptionImpl;
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SelectorList;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSStyleDeclarationImpl extends AbstractCSSNode implements CSSStyleDeclaration, Serializable {
-
- private boolean readOnly;
- private CSSRule parentRule;
- private List<CSSProperty> properties = new ArrayList<CSSProperty>();
-
- public CSSStyleDeclarationImpl(CSSRule parentRule) {
- this.parentRule = parentRule;
- }
-
- // W3C CSSStyleDeclaration API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#getCSSText()
- */
- public String getCssText() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#getLength()
- */
- public int getLength() {
- return properties.size();
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#getParentRule()
- */
- public CSSRule getParentRule() {
- return parentRule;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#getPropertyCSSValue(String)
- */
- public CSSValue getPropertyCSSValue(String propertyName) {
- CSSProperty property = findCSSProperty(propertyName);
- return (property == null)
- ? null
- : property.getValue();
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#getPropertyPriority(String)
- */
- public String getPropertyPriority(String propertyName) {
- CSSProperty property = findCSSProperty(propertyName);
- return (property != null && property.isImportant())
- ? CSSPropertyImpl.IMPORTANT_IDENTIFIER
- : "";
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#getPropertyValue(String)
- */
- public String getPropertyValue(String propertyName) {
- CSSProperty property = findCSSProperty(propertyName);
- return (property == null)
- ? ""
- : property.getValue().toString();
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#item(int)
- */
- public String item(int index) {
- return properties.get(index).getName();
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#removeProperty(String)
- */
- public String removeProperty(String propertyName) throws DOMException {
- if(readOnly)
- throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMExceptionImpl.NO_MODIFICATION_ALLOWED_ERROR);
- for (int i = 0; i < properties.size(); i++) {
- CSSProperty property = properties.get(i);
- if(CSSPropertyImpl.sameName(property, propertyName)) {
- properties.remove(i);
- return property.getValue().toString();
- }
- }
- return "";
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration#setCssText(String)
- */
- public void setCssText(String cssText) throws DOMException {
- if(readOnly)
- throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMExceptionImpl.NO_MODIFICATION_ALLOWED_ERROR);
- // TODO Auto-generated method stub
- // TODO throws SYNTAX_ERR if cssText is unparsable
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleDeclaration.setProperty(String, String, String)
- */
- public void setProperty(String propertyName, String value, String priority) throws DOMException {
- if(readOnly)
- throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMExceptionImpl.NO_MODIFICATION_ALLOWED_ERROR);
- // TODO Auto-generated method stub
- // TODO throws SYNTAX_ERR if value is unparsable
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-
- // Additional
-
- public void addProperty(CSSProperty property) {
- properties.add(property);
- }
-
- public CSSPropertyList getCSSPropertyList() {
- CSSPropertyListImpl propertyList = new CSSPropertyListImpl();
- for (CSSProperty property: properties) {
- propertyList.add(property);
- }
- return propertyList;
- }
-
- protected void setReadOnly(boolean readOnly) {
- //TODO ViewCSS.getComputedStyle() should provide a read only access to the computed values
- this.readOnly = readOnly;
- }
-
- private CSSProperty findCSSProperty(String propertyName) {
- for (CSSProperty property : properties) {
- if(CSSPropertyImpl.sameName(property, propertyName))
- return property;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleRuleImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleRuleImpl.java
deleted file mode 100644
index 5c2d555..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleRuleImpl.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.eclipse.e4.ui.css.core.dom.CSSPropertyList;
-import org.eclipse.e4.ui.css.core.dom.ExtendedCSSRule;
-import org.w3c.css.sac.SelectorList;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleRule;
-import org.w3c.dom.css.CSSStyleSheet;
-
-public class CSSStyleRuleImpl extends CSSRuleImpl implements CSSStyleRule, ExtendedCSSRule, Serializable {
-
- private SelectorList selectors;
- private CSSStyleDeclarationImpl styleDeclaration;
-
- public CSSStyleRuleImpl(CSSStyleSheet parentStyleSheet, CSSRule parentRule,
- SelectorList selectors) {
- super(parentStyleSheet, parentRule);
- this.selectors = selectors;
- }
-
- //----------------------------------------
- // W3C CSSRule API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule.getType()
- */
- public short getType() {
- return CSSRule.STYLE_RULE;
- }
-
-
- //----------------------------------------
- // W3C CSSStyleRule API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleRule#getSelectorText()
- */
- public String getSelectorText() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleRule#getStyle()
- */
- public CSSStyleDeclaration getStyle() {
- return styleDeclaration;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleRule#setSelectorText(String)
- */
- public void setSelectorText(String selectorText) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-
- //----------------------------------------
- // Additional methods
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.e4.ui.css.core.dom#ExtendedCSSRule#getSelectorList()
- */
- public SelectorList getSelectorList() {
- return selectors;
- }
-
-
- public CSSPropertyList getCSSPropertyList() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public void setStyle(CSSStyleDeclarationImpl styleDeclaration) {
- this.styleDeclaration = styleDeclaration;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleSheetImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleSheetImpl.java
deleted file mode 100644
index 0382833..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSStyleSheetImpl.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.eclipse.e4.ui.css.core.exceptions.DOMExceptionImpl;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.MediaList;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-public class CSSStyleSheetImpl extends AbstractCSSNode implements CSSStyleSheet, Serializable {
-
- private CSSRuleList rules = null;
-
- public CSSStyleSheetImpl() {
- super();
- }
-
- // W3C CSSStyleSheet API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleSheet#deleteRule(int)
- */
- public void deleteRule(int position) throws DOMException {
- try {
- ((CSSRuleListImpl) rules).remove(position);
- } catch (IndexOutOfBoundsException ex) {
- throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR, DOMExceptionImpl.ARRAY_OUT_OF_BOUNDS, ex.getMessage());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleSheet#getCssRules()
- */
- public CSSRuleList getCssRules() {
- return rules;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleSheet#getOwnerRule()
- */
- public CSSRule getOwnerRule() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSStyleSheet#insertRule(String, int)
- */
- public int insertRule(String arg0, int arg1) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-
- // org.w3c.dom.stylesheet.StyleSheet API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheet.StyleSheet#getDisabled()
- */
- public boolean getDisabled() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheet.StyleSheet#getHref()
- */
- public String getHref() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheet.StyleSheet#getMedia()
- */
- public MediaList getMedia() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheet.StyleSheet#getOwnerNode()
- */
- public Node getOwnerNode() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheet.StyleSheet#getParentStyleSheet()
- */
- public StyleSheet getParentStyleSheet() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheet.StyleSheet#getTitle()
- */
- public String getTitle() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheet.StyleSheet#getType()
- */
- public String getType() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheet.StyleSheet#setDisabled(boolean)
- */
- public void setDisabled(boolean disabled) {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- // Additional
-
- public void setRuleList(CSSRuleList rules) {
- this.rules = rules;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSUnknownRuleImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSUnknownRuleImpl.java
deleted file mode 100644
index 0bd0027..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSUnknownRuleImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.CSSUnknownRule;
-
-public class CSSUnknownRuleImpl extends CSSRuleImpl implements CSSUnknownRule, Serializable {
-
- public CSSUnknownRuleImpl(CSSStyleSheet parentStyleSheet, CSSRule parentRule,
- String atRule) {
- super(parentStyleSheet, parentRule);
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSRule#getType()
- */
- public short getType() {
- return CSSRule.UNKNOWN_RULE;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueFactory.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueFactory.java
deleted file mode 100644
index afa1e72..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import org.w3c.css.sac.LexicalUnit;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSValueFactory {
-
- public static CSSValue newValue(LexicalUnit value) {
- //if there are more lexical units then it's a list
- if(value.getNextLexicalUnit() != null)
- return new CSSValueListImpl(value);
-
- return newPrimitiveValue(value);
- }
-
- public static CSSPrimitiveValue newPrimitiveValue(LexicalUnit value) {
- if (value.getLexicalUnitType() == LexicalUnit.SAC_RGBCOLOR) {
- // RGBColor
- return new RGBColorImpl(value);
- }
- //TODO add cases for Rect, Counter
-
- return new Measure(value);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueImpl.java
deleted file mode 100644
index 9c65293..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.eclipse.e4.ui.css.core.exceptions.DOMExceptionImpl;
-import org.w3c.css.sac.LexicalUnit;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.Counter;
-import org.w3c.dom.css.RGBColor;
-import org.w3c.dom.css.Rect;
-
-public abstract class CSSValueImpl extends AbstractCSSNode implements CSSPrimitiveValue, CSSValue, Serializable {
-
- // W3C CSSValue API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#getCssText()
- */
- public String getCssText() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#getCssValueType()
- */
- public short getCssValueType() {
- return CSS_PRIMITIVE_VALUE;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#setCssText(java.lang.String)
- */
- public void setCssText(String cssText) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- // W3C CSSPrimitiveValue API methods
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#getPrimitiveType()
- */
- public short getPrimitiveType() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#getCounterValue()
- */
- public Counter getCounterValue() throws DOMException {
- throw new DOMExceptionImpl(DOMException.INVALID_ACCESS_ERR, DOMExceptionImpl.COUNTER_ERROR);
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()
- */
- public RGBColor getRGBColorValue() throws DOMException {
- throw new DOMExceptionImpl(DOMException.INVALID_ACCESS_ERR, DOMExceptionImpl.RGBCOLOR_ERROR);
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#getRectValue()
- */
- public Rect getRectValue() throws DOMException {
- throw new DOMExceptionImpl(DOMException.INVALID_ACCESS_ERR, DOMExceptionImpl.RECT_ERROR);
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#getStringValue()
- */
- public String getStringValue() throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short, float)
- */
- public void setFloatValue(short arg0, float arg1) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#setStringValue(short, java.lang.String)
- */
- public void setStringValue(short arg0, String arg1) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- // Additional methods
-
- public float getFloatValue(short valueType) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueListImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueListImpl.java
deleted file mode 100644
index 101cecd..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CSSValueListImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.css.sac.LexicalUnit;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.CSSValueList;
-
-public class CSSValueListImpl extends AbstractCSSNode implements CSSValueList {
-
- List<CSSValue> values;
-
- public CSSValueListImpl(LexicalUnit parsePropertyValue) {
- values = new ArrayList<CSSValue>();
-
- LexicalUnit unit = parsePropertyValue;
- while(unit != null) {
- values.add(CSSValueFactory.newPrimitiveValue(unit));
- unit = unit.getNextLexicalUnit();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValueList#getLength()
- */
- public int getLength() {
- return values.size();
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValueList#item(int)
- */
- public CSSValue item(int index) {
- return values.get(index);
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#getCssText()
- */
- public String getCssText() {
- StringBuffer buffer = new StringBuffer();
- for (CSSValue value : values) {
- buffer.append(value.toString());
- buffer.append(" ");
- }
- return buffer.toString();
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#getCssValueType()
- */
- public short getCssValueType() {
- return CSS_VALUE_LIST;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#setCssText(java.lang.String)
- */
- public void setCssText(String arg0) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CounterImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CounterImpl.java
deleted file mode 100644
index cd840e7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CounterImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.dom.css.Counter;
-
-public class CounterImpl implements Counter, Serializable {
-
- public String getIdentifier() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public String getListStyle() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public String getSeparator() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java
deleted file mode 100644
index df48216..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.dom.ExtendedCSSRule;
-import org.eclipse.e4.ui.css.core.dom.ExtendedDocumentCSS;
-import org.w3c.css.sac.ConditionalSelector;
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SelectorList;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.DocumentCSS;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * w3c {@link DocumentCSS} implementation.
- */
-public class DocumentCSSImpl implements ExtendedDocumentCSS {
-
- private StyleSheetListImpl styleSheetList = new StyleSheetListImpl();
-
- /**
- * key=selector type, value = CSSStyleDeclaration
- */
- private Map styleDeclarationMap = null;
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.stylesheets.DocumentStyle#getStyleSheets()
- */
- public StyleSheetList getStyleSheets() {
- return styleSheetList;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.DocumentCSS#getOverrideStyle(org.w3c.dom.Element, java.lang.String)
- */
- public CSSStyleDeclaration getOverrideStyle(Element element, String s) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.e4.css.core.dom.ExtendedDocumentCSS#addStyleSheet(org.w3c.dom.stylesheets.StyleSheet)
- */
- public void addStyleSheet(StyleSheet styleSheet) {
- styleSheetList.addStyleSheet(styleSheet);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.e4.css.core.dom.ExtendedDocumentCSS#removeAllStyleSheets()
- */
- public void removeAllStyleSheets() {
- styleSheetList.removeAllStyleSheets();
- this.styleDeclarationMap = null;
- }
-
- public List queryConditionSelector(int conditionType) {
- return querySelector(Selector.SAC_CONDITIONAL_SELECTOR, conditionType);
- }
-
- public List querySelector(int selectorType, int conditionType) {
- List list = getCSSStyleDeclarationList(selectorType, conditionType);
- if (list != null)
- return list;
- int l = styleSheetList.getLength();
- for (int i = 0; i < l; i++) {
- CSSStyleSheet styleSheet = (CSSStyleSheet) styleSheetList.item(i);
- CSSRuleList ruleList = styleSheet.getCssRules();
- list = querySelector(ruleList, selectorType, conditionType);
- setCSSStyleDeclarationList(list, selectorType, conditionType);
- }
- return list;
- }
-
- protected List querySelector(CSSRuleList ruleList, int selectorType,
- int selectorConditionType) {
- List list = new ArrayList();
- int length = ruleList.getLength();
- for (int i = 0; i < length; i++) {
- CSSRule rule = ruleList.item(i);
- switch (rule.getType()) {
- case CSSRule.STYLE_RULE: {
- if (rule instanceof ExtendedCSSRule) {
- ExtendedCSSRule r = (ExtendedCSSRule) rule;
- SelectorList selectorList = r.getSelectorList();
- // Loop for SelectorList
- int l = selectorList.getLength();
- for (int j = 0; j < l; j++) {
- Selector selector = (Selector) selectorList.item(j);
- if (selector.getSelectorType() == selectorType) {
- switch (selectorType) {
- case Selector.SAC_CONDITIONAL_SELECTOR:
- // It's conditional selector
- ConditionalSelector conditionalSelector = (ConditionalSelector) selector;
- short conditionType = conditionalSelector
- .getCondition().getConditionType();
- if (selectorConditionType == conditionType) {
- // current selector match the current CSS
- // Rule
- // CSSStyleRule styleRule = (CSSStyleRule)
- // rule;
- list.add(selector);
- }
- }
- }
-
- }
- }
- }
- }
- }
- return list;
- }
-
- protected List getCSSStyleDeclarationList(int selectorType,
- int conditionType) {
- Integer key = getKey(selectorType, conditionType);
- return (List) getStyleDeclarationMap().get(key);
- }
-
- protected void setCSSStyleDeclarationList(List list, int selectorType,
- int conditionType) {
- Integer key = getKey(selectorType, conditionType);
- getStyleDeclarationMap().put(key, list);
- }
-
- protected Integer getKey(int selectorType, int conditionType) {
- if (selectorType == Selector.SAC_CONDITIONAL_SELECTOR) {
- if (conditionType == SAC_CLASS_CONDITION.intValue())
- return SAC_CLASS_CONDITION;
- if (conditionType == SAC_ID_CONDITION.intValue())
- return SAC_ID_CONDITION;
- if (conditionType == SAC_PSEUDO_CLASS_CONDITION.intValue())
- return SAC_PSEUDO_CLASS_CONDITION;
- return OTHER_SAC_CONDITIONAL_SELECTOR;
- }
-
- return OTHER_SAC_SELECTOR;
- }
-
- protected Map getStyleDeclarationMap() {
- if (styleDeclarationMap == null)
- styleDeclarationMap = new HashMap();
- return styleDeclarationMap;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/Measure.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/Measure.java
deleted file mode 100644
index 76f5ea3..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/Measure.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import org.w3c.css.sac.LexicalUnit;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSValue;
-
-public class Measure extends CSSValueImpl {
-
- LexicalUnit value;
-
- public Measure(LexicalUnit value) {
- super();
- this.value = value;
- }
-
- /**
- * Return a float representation of the receiver's value.
- * @param valueType a short representing the value type, see {@link CSSValue#getCssValueType()}
- */
- public float getFloatValue(short valueType) throws DOMException {
- //If it's actually a SAC_INTEGER return the integer value, callers tend to expect and cast
- //There is no getIntegerFloat(short)
- //TODO Not sure the purpose of arg valyeType, its not referenced in this method
- if(value.getLexicalUnitType() == LexicalUnit.SAC_INTEGER)
- return value.getIntegerValue();
- //TODO not sure what to do if it's not one of the lexical unit types that are specified in LexicalUnit#getFloatValue()
- //ie. SAC_DEGREE, SAC_GRADIAN, SAC_RADIAN, SAC_MILLISECOND, SAC_SECOND, SAC_HERTZ or SAC_KILOHERTZ
- return value.getFloatValue();
- }
-
- /**
- * Return an int representation of the receiver's value.
- * @param valueType a short representing the value type, see {@link CSSValue#getCssValueType()}
- */
- public int getIntegerValue(short valueType) throws DOMException {
- return value.getIntegerValue();
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#getStringValue()
- */
- public String getStringValue() throws DOMException {
- if((value.getLexicalUnitType() == LexicalUnit.SAC_IDENT)
- || (value.getLexicalUnitType() == LexicalUnit.SAC_STRING_VALUE)
- || (value.getLexicalUnitType() == LexicalUnit.SAC_URI))
- return value.getStringValue();
- // TODO There are more cases to catch of getLexicalUnitType()
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSPrimitiveValue#getPrimitiveType()
- */
- public short getPrimitiveType() {
- switch (value.getLexicalUnitType()) {
- case LexicalUnit.SAC_IDENT:
- return CSS_IDENT;
- case LexicalUnit.SAC_PIXEL:
- return CSS_PX;
- case LexicalUnit.SAC_INTEGER:
- case LexicalUnit.SAC_REAL:
- return CSS_NUMBER;
- case LexicalUnit.SAC_URI:
- return CSS_URI;
- }
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#getCssText()
- */
- public String getCssText() {
- if(getPrimitiveType() == CSS_NUMBER)
- return String.valueOf(value.getIntegerValue());
- return value.getStringValue();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java
deleted file mode 100644
index c604cb1..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation]
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.css.sac.SACMediaList;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.stylesheets.MediaList;
-
-public class MediaListImpl implements MediaList, Serializable {
-
- public MediaListImpl(SACMediaList media) {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public void appendMedium(String arg0) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public void deleteMedium(String arg0) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public int getLength() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public String getMediaText() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public String item(int arg0) {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public void setMediaText(String arg0) throws DOMException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/RGBColorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/RGBColorImpl.java
deleted file mode 100644
index bbd14eb..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/RGBColorImpl.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.css.sac.LexicalUnit;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.RGBColor;
-
-public class RGBColorImpl extends CSSValueImpl implements RGBColor, Serializable {
-
- private CSSPrimitiveValue red;
- private CSSPrimitiveValue green;
- private CSSPrimitiveValue blue;
-
- public RGBColorImpl(LexicalUnit lexicalUnit) {
- LexicalUnit nextUnit = lexicalUnit.getParameters();
- red = new Measure(nextUnit);
- nextUnit = nextUnit.getNextLexicalUnit().getNextLexicalUnit();
- green = new Measure(nextUnit);
- nextUnit = nextUnit.getNextLexicalUnit().getNextLexicalUnit();
- blue = new Measure(nextUnit);
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.RGBColor#getRed()
- */
- public CSSPrimitiveValue getRed() {
- return red;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.RGBColor#getGreen()
- */
- public CSSPrimitiveValue getGreen() {
- return green;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.RGBColor#getBlue()
- */
- public CSSPrimitiveValue getBlue() {
- return blue;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#getRGBColorValue()
- */
- public RGBColor getRGBColorValue() throws DOMException {
- return this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#getPrimitiveType()
- */
- public short getPrimitiveType() {
- return CSS_RGBCOLOR;
- }
-
- /*
- * (non-Javadoc)
- * @see org.w3c.dom.css.CSSValue#getCssText()
- */
- public String getCssText() {
- return "rgb(" + red.getCssText() + ", " + green.getCssText() + ", "
- + blue.getCssText() + ")";
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/RectImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/RectImpl.java
deleted file mode 100644
index 216fcd4..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/RectImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.io.Serializable;
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.Rect;
-
-public class RectImpl implements Rect, Serializable {
-
- public CSSPrimitiveValue getBottom() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public CSSPrimitiveValue getLeft() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public CSSPrimitiveValue getRight() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
- public CSSPrimitiveValue getTop() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("NOT YET IMPLEMENTED");
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleSheetListImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleSheetListImpl.java
deleted file mode 100644
index 6522d55..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleSheetListImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * {@link StyleSheetList} implementation. It provides the abstraction of an
- * ordered collection of style sheets.
- */
-public class StyleSheetListImpl implements StyleSheetList {
-
- private List styleSheets = null;
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.stylesheets.StyleSheetList#getLength()
- */
- public int getLength() {
- return (styleSheets != null) ? styleSheets.size() : 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.w3c.dom.stylesheets.StyleSheetList#item(int)
- */
- public StyleSheet item(int index) {
- return (styleSheets != null) ? (StyleSheet) styleSheets.get(index)
- : null;
- }
-
- /**
- * Add {@link StyleSheet} to the collection of style sheets
- *
- * @param styleSheet
- */
- public void addStyleSheet(StyleSheet styleSheet) {
- if (styleSheets == null)
- styleSheets = new ArrayList();
- styleSheets.add(styleSheet);
- }
-
- /**
- * Remove all style sheet.
- */
- public void removeAllStyleSheets() {
- styleSheets = null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java
deleted file mode 100644
index 0e98b4c..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.util.Comparator;
-
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * A wrapper that holds a reference to the styles defined in a CSS rule block,
- * together with all the information needed to calculate a matching selector's
- * precedence.
- */
-final class StyleWrapper {
-
- private static class StyleWrapperComparator implements Comparator {
-
- public int compare(final Object object1, final Object object2) {
- int result = 0;
- StyleWrapper wrapper1 = (StyleWrapper) object1;
- StyleWrapper wrapper2 = (StyleWrapper) object2;
- if (wrapper1.specificity > wrapper2.specificity) {
- result = 1;
- } else if (wrapper1.specificity < wrapper2.specificity) {
- result = -1;
- } else if (wrapper1.position > wrapper2.position) {
- result = 1;
- } else if (wrapper1.position < wrapper2.position) {
- result = -1;
- }
- return result;
- }
- }
-
- /**
- * A comparator for {@link StyleWrapper}s.
- */
- public static final StyleWrapperComparator COMPARATOR = new StyleWrapperComparator();
-
- public final CSSStyleDeclaration style;
- public final int specificity;
- public final int position;
-
- public StyleWrapper(CSSStyleDeclaration style, int specificity,
- int position) {
- this.style = style;
- this.specificity = specificity;
- this.position = position;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java
deleted file mode 100644
index 3facc67..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.e4.ui.css.core.dom.ExtendedCSSRule;
-import org.eclipse.e4.ui.css.core.impl.sac.ExtendedSelector;
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SelectorList;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleRule;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.DocumentCSS;
-import org.w3c.dom.css.ViewCSS;
-import org.w3c.dom.stylesheets.StyleSheetList;
-import org.w3c.dom.views.DocumentView;
-
-
-/**
- * {@link ViewCSS} implementation used to compute {@link CSSStyleDeclaration}.
- */
-public class ViewCSSImpl implements ViewCSS {
-
- protected DocumentCSS documentCSS;
-
- /**
- * Creates a new ViewCSS.
- */
- public ViewCSSImpl(DocumentCSS documentCSS) {
- this.documentCSS = documentCSS;
- }
-
- /**
- * <b>DOM</b>: Implements {@link
- * org.w3c.dom.views.AbstractView#getDocument()}.
- */
- public DocumentView getDocument() {
- return null;
- }
-
- /**
- * <b>DOM</b>: Implements {@link
- * org.w3c.dom.css.ViewCSS#getComputedStyle(Element,String)}.
- */
- public CSSStyleDeclaration getComputedStyle(Element elt, String pseudoElt) {
- // Loop for CSS StyleSheet list parsed
- StyleSheetList styleSheetList = documentCSS.getStyleSheets();
- int l = styleSheetList.getLength();
- for (int i = 0; i < l; i++) {
- CSSStyleSheet styleSheet = (CSSStyleSheet) styleSheetList.item(i);
- CSSStyleDeclaration styleDeclaration = getComputedStyle(styleSheet,
- elt, pseudoElt);
- if (styleDeclaration != null)
- return styleDeclaration;
- }
- return null;
- }
-
- public CSSStyleDeclaration getComputedStyle(CSSStyleSheet styleSheet,
- Element elt, String pseudoElt) {
- List styleDeclarations = null;
- StyleWrapper firstStyleDeclaration = null;
- CSSRuleList ruleList = styleSheet.getCssRules();
- int length = ruleList.getLength();
- int position = 0;
- for (int i = 0; i < length; i++) {
- CSSRule rule = ruleList.item(i);
- switch (rule.getType()) {
- case CSSRule.STYLE_RULE: {
- CSSStyleRule styleRule = (CSSStyleRule) rule;
- if (rule instanceof ExtendedCSSRule) {
- ExtendedCSSRule r = (ExtendedCSSRule) rule;
- SelectorList selectorList = r.getSelectorList();
- // Loop for SelectorList
- int l = selectorList.getLength();
- for (int j = 0; j < l; j++) {
- Selector selector = (Selector) selectorList.item(j);
- if (selector instanceof ExtendedSelector) {
- ExtendedSelector extendedSelector = (ExtendedSelector) selector;
- if (extendedSelector.match(elt, pseudoElt)) {
- CSSStyleDeclaration style = styleRule
- .getStyle();
- int specificity = extendedSelector
- .getSpecificity();
- StyleWrapper wrapper = new StyleWrapper(style,
- specificity, position++);
- if (firstStyleDeclaration == null) {
- firstStyleDeclaration = wrapper;
- } else {
- // There is several Style Declarations which
- // match the current element
- if (styleDeclarations == null) {
- styleDeclarations = new ArrayList();
- styleDeclarations
- .add(firstStyleDeclaration);
- }
- styleDeclarations.add(wrapper);
- }
- }
- } else {
- // TODO : selector is not batik ExtendedSelector,
- // Manage this case...
- }
- }
- } else {
- // TODO : CSS rule is not ExtendedCSSRule,
- // Manage this case...
- }
- }
- }
- }
- if (styleDeclarations != null) {
- // There is several Style Declarations wich match
- // the element, merge the CSS Property value.
- return new CSSComputedStyleImpl(styleDeclarations);
- }
- if (firstStyleDeclaration != null) {
- return firstStyleDeclaration.style;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/AbstractCSSParser.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/AbstractCSSParser.java
deleted file mode 100644
index 6d9bd7d..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/AbstractCSSParser.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.dom.parsers;
-
-import java.io.IOException;
-import java.util.Stack;
-
-import org.eclipse.e4.ui.css.core.dom.parsers.CSSParser;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSStyleDeclarationImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSValueFactory;
-import org.eclipse.e4.ui.css.core.sac.DocumentHandlerFactory;
-import org.eclipse.e4.ui.css.core.sac.ExtendedDocumentHandler;
-import org.eclipse.e4.ui.css.core.sac.ISACParserFactory;
-import org.eclipse.e4.ui.css.core.sac.ParserNotFoundException;
-import org.eclipse.e4.ui.css.core.sac.SACParserFactory;
-import org.w3c.css.sac.ConditionFactory;
-import org.w3c.css.sac.InputSource;
-import org.w3c.css.sac.Parser;
-import org.w3c.css.sac.SelectorFactory;
-import org.w3c.css.sac.SelectorList;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract {@link CSSParser} implementation.
- */
-public class AbstractCSSParser implements CSSParser {
-
- private static DocumentHandlerFactory defaultDocumentHandlerFactory;
- private static ISACParserFactory defaultParserFactory;
- static {
- defaultDocumentHandlerFactory = DocumentHandlerFactory.newInstance();
- defaultParserFactory = SACParserFactory.newInstance();
- }
-
- // SAC
- private Parser parser = null;
- private DocumentHandlerFactory documentHandlerFactory;
- private ISACParserFactory parserFactory;
-
- private ConditionFactory conditionFactory = null;
- private SelectorFactory selectorFactory = null;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#parseStyleSheet(org.w3c.css.sac.InputSource)
- */
- public CSSStyleSheet parseStyleSheet(InputSource source) throws IOException {
- ExtendedDocumentHandler documentHandler = getDocumentHandlerFactory()
- .makeDocumentHandler();
- Parser parser = getParser();
- parser.setDocumentHandler(documentHandler);
- parser.parseStyleSheet(source);
- return (CSSStyleSheet) documentHandler.getNodeRoot();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#parseStyleDeclaration(org.w3c.css.sac.InputSource)
- */
- public CSSStyleDeclaration parseStyleDeclaration(InputSource source)
- throws IOException {
- CSSStyleDeclarationImpl styleDeclaration = new CSSStyleDeclarationImpl(
- null);
- parseStyleDeclaration(((CSSStyleDeclaration) (styleDeclaration)),
- source);
- return styleDeclaration;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#parseStyleDeclaration(org.w3c.dom.css.CSSStyleDeclaration,
- * org.w3c.css.sac.InputSource)
- */
- public void parseStyleDeclaration(CSSStyleDeclaration styleDeclaration,
- InputSource source) throws IOException {
- Stack stack = new Stack();
- stack.push(styleDeclaration);
- ExtendedDocumentHandler documentHandler = getDocumentHandlerFactory()
- .makeDocumentHandler();
- documentHandler.setNodeStack(stack);
- Parser parser = getParser();
- parser.setDocumentHandler(documentHandler);
- parser.parseStyleDeclaration(source);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#parsePropertyValue(org.w3c.css.sac.InputSource)
- */
- public CSSValue parsePropertyValue(InputSource source) throws IOException {
- Parser parser = getParser();
- ExtendedDocumentHandler documentHandler = getDocumentHandlerFactory()
- .makeDocumentHandler();
- parser.setDocumentHandler(documentHandler);
- return CSSValueFactory.newValue(parser.parsePropertyValue(source));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#parseRule(org.w3c.css.sac.InputSource)
- */
- public CSSRule parseRule(InputSource source) throws IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#parseSelectors(org.w3c.css.sac.InputSource)
- */
- public SelectorList parseSelectors(InputSource source) throws IOException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#setParentStyleSheet(org.w3c.dom.css.CSSStyleSheet)
- */
- public void setParentStyleSheet(CSSStyleSheet parentStyleSheet) {
-
- }
-
- /**
- * Return instance of {@link DocumentHandlerFactory}.
- *
- * @return
- */
- public DocumentHandlerFactory getDocumentHandlerFactory() {
- if (documentHandlerFactory == null)
- return defaultDocumentHandlerFactory;
- return documentHandlerFactory;
- }
-
- /**
- * Set instance of {@link DocumentHandlerFactory}.
- *
- * @param documentHandlerFactory
- */
- public void setDocumentHandlerFactory(
- DocumentHandlerFactory documentHandlerFactory) {
- this.documentHandlerFactory = documentHandlerFactory;
- }
-
- /**
- * Return SAC {@link Parser} to use.
- *
- * @return
- */
- public Parser getParser() {
- if (parser == null)
- try {
- parser = getSACParserFactory().makeParser();
- if (conditionFactory != null)
- parser.setConditionFactory(conditionFactory);
- if (selectorFactory != null)
- parser.setSelectorFactory(selectorFactory);
- } catch (Exception e) {
- // TODO : manage error.
- // e.printStackTrace();
- throw new ParserNotFoundException(e);
- }
- return parser;
- }
-
- /**
- * Set SAC {@link Parser} to use.
- *
- * @param parser
- */
- public void setParser(Parser parser) {
- this.parser = parser;
- }
-
- /**
- * Return factory {@link ISACParserFactory} to use.
- *
- * @return
- */
- public ISACParserFactory getSACParserFactory() {
- if (parserFactory == null)
- return defaultParserFactory;
- return parserFactory;
- }
-
- /**
- * Set factory {@link ISACParserFactory} to use.
- *
- * @param parserFactory
- */
- public void setSACParserFactory(ISACParserFactory parserFactory) {
- this.parserFactory = parserFactory;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#getConditionFactory()
- */
- public ConditionFactory getConditionFactory() {
- return conditionFactory;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#setConditionFactory(org.w3c.css.sac.ConditionFactory)
- */
- public void setConditionFactory(ConditionFactory conditionFactory) {
- this.conditionFactory = conditionFactory;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#getSelectorFactory()
- */
- public SelectorFactory getSelectorFactory() {
- return selectorFactory;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.CSSParser#setSelectorFactory(org.w3c.css.sac.SelectorFactory)
- */
- public void setSelectorFactory(SelectorFactory selectorFactory) {
- this.selectorFactory = selectorFactory;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/CSSParserFactoryImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/CSSParserFactoryImpl.java
deleted file mode 100644
index bc39a41..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/CSSParserFactoryImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.dom.parsers;
-
-import org.eclipse.e4.ui.css.core.dom.parsers.CSSParser;
-import org.eclipse.e4.ui.css.core.dom.parsers.CSSParserFactory;
-
-/**
- * {@link CSSParserFactory} implementation.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSParserFactoryImpl extends CSSParserFactory {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.parsers.ICSSParserFactory#makeCSSParser()
- */
- public CSSParser makeCSSParser() {
- return new CSSParserImpl();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/CSSParserImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/CSSParserImpl.java
deleted file mode 100644
index 4423b07..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/parsers/CSSParserImpl.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.dom.parsers;
-
-import org.eclipse.e4.ui.css.core.dom.parsers.CSSParser;
-
-/**
- * {@link CSSParser} implementation.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSParserImpl extends AbstractCSSParser {
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/properties/CSSBorderPropertiesImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/properties/CSSBorderPropertiesImpl.java
deleted file mode 100644
index 0f88209..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/properties/CSSBorderPropertiesImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.dom.properties;
-
-import org.eclipse.e4.ui.css.core.dom.properties.CSSBorderProperties;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- * {@link CSSBorderProperties} implementation.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSBorderPropertiesImpl implements CSSBorderProperties {
-
- private CSSPrimitiveValue color;
-
- private int width = 0;
-
- private String style;
-
- public CSSPrimitiveValue getColor() {
- return color;
- }
-
- public void setColor(CSSPrimitiveValue color) {
- this.color = color;
- }
-
- public int getWidth() {
- return width;
- }
-
- public void setWidth(int width) {
- this.width = width;
- }
-
- public String getStyle() {
- return style;
- }
-
- public void setStyle(String style) {
- this.style = style;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java
deleted file mode 100644
index c9ec39f..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java
+++ /dev/null
@@ -1,988 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.engine;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.util.impl.resources.ResourcesLocatorManager;
-import org.eclipse.e4.ui.css.core.util.resources.IResourcesLocatorManager;
-import org.eclipse.e4.ui.css.core.utils.StringUtils;
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.eclipse.e4.ui.css.core.dom.ExtendedDocumentCSS;
-import org.eclipse.e4.ui.css.core.dom.IElementProvider;
-import org.eclipse.e4.ui.css.core.dom.parsers.CSSParser;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyCompositeHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2Delegate;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandlerProvider;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.selectors.IDynamicPseudoClassesHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler;
-import org.eclipse.e4.ui.css.core.exceptions.UnsupportedPropertyException;
-import org.eclipse.e4.ui.css.core.impl.dom.DocumentCSSImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.ViewCSSImpl;
-import org.eclipse.e4.ui.css.core.impl.sac.ExtendedSelector;
-import org.eclipse.e4.ui.css.core.resources.CSSResourcesHelpers;
-import org.eclipse.e4.ui.css.core.resources.IResourcesRegistry;
-import org.w3c.css.sac.AttributeCondition;
-import org.w3c.css.sac.Condition;
-import org.w3c.css.sac.ConditionalSelector;
-import org.w3c.css.sac.InputSource;
-import org.w3c.css.sac.Selector;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.DocumentCSS;
-import org.w3c.dom.css.ViewCSS;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- * Abstract CSS Engine manage style sheet parsing and store the
- * {@link CSSStyleSheet} into {@link DocumentCSS}.
- *
- * To apply styles, call the {@link #applyStyles(Object, boolean, boolean)}
- * method. This method check if {@link ICSSPropertyHandler} is registered for
- * apply the CSS property.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSEngine implements CSSEngine {
-
- /**
- * Default {@link IResourcesLocatorManager} used to get InputStream, Reader
- * resource like Image.
- */
- private final static IResourcesLocatorManager defaultResourcesLocatorManager = ResourcesLocatorManager.INSTANCE;
-
- /**
- * w3c {@link DocumentCSS}.
- */
- private ExtendedDocumentCSS documentCSS;
-
- /**
- * w3c {@link ViewCSS}.
- */
- private ViewCSS viewCSS;
-
- /**
- * {@link IElementProvider} used to retrieve w3c Element linked to the
- * widget.
- */
- private IElementProvider elementProvider;
-
- protected boolean computeDefaultStyle = false;
-
- private Map elementsWithDynamicPseudoClasses = null;
-
- private Map elementsContext = null;
-
- /**
- * CSS Error Handler to intercept error while parsing, applying styles.
- */
- private CSSErrorHandler errorHandler;
-
- private IResourcesLocatorManager resourcesLocatorManager;
-
- private Map dynamicPseudoClassesHandler = new HashMap();
-
- private IResourcesRegistry resourcesRegistry;
-
- /**
- * ICSSPropertyHandlerProvider
- */
- private List propertyHandlerProviders = new ArrayList();
-
- private Map currentCSSPropertiesApplyed = new HashMap();
-
- private boolean throwError;
-
- private Map valueConverters = null;
-
- public AbstractCSSEngine() {
- this(new DocumentCSSImpl());
- }
-
- public AbstractCSSEngine(ExtendedDocumentCSS documentCSS) {
- this.documentCSS = documentCSS;
- this.viewCSS = new ViewCSSImpl(documentCSS);
- }
-
- /*--------------- Parse style sheet -----------------*/
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseStyleSheet(java.io.Reader)
- */
- public StyleSheet parseStyleSheet(Reader reader) throws IOException {
- InputSource source = new InputSource();
- source.setCharacterStream(reader);
- return parseStyleSheet(source);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseStyleSheet(java.io.InputStream)
- */
- public StyleSheet parseStyleSheet(InputStream stream) throws IOException {
- InputSource source = new InputSource();
- source.setByteStream(stream);
- return parseStyleSheet(source);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseStyleSheet(org.w3c.css.sac.InputSource)
- */
- public StyleSheet parseStyleSheet(InputSource source) throws IOException {
- // Check that CharacterStream or ByteStream is not null
- checkInputSource(source);
- CSSParser parser = makeCSSParser();
- CSSStyleSheet styleSheet = parser.parseStyleSheet(source);
- if (documentCSS instanceof ExtendedDocumentCSS) {
- ((ExtendedDocumentCSS) documentCSS).addStyleSheet(styleSheet);
- }
- return styleSheet;
- }
-
- /**
- * Return true if <code>source</code> is valid and false otherwise.
- *
- * @param source
- * @throws IOException
- */
- private void checkInputSource(InputSource source) throws IOException {
- Reader reader = source.getCharacterStream();
- InputStream stream = source.getByteStream();
- if (reader == null && stream == null)
- throw new IOException(
- "CharacterStream or ByteStream cannot be null for the InputSource.");
- }
-
- /*--------------- Parse style declaration -----------------*/
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseStyleDeclaration(java.lang.String)
- */
- public CSSStyleDeclaration parseStyleDeclaration(String style)
- throws IOException {
- Reader reader = new StringReader(style);
- return parseStyleDeclaration(reader);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseStyleDeclaration(java.io.Reader)
- */
- public CSSStyleDeclaration parseStyleDeclaration(Reader reader)
- throws IOException {
- InputSource source = new InputSource();
- source.setCharacterStream(reader);
- return parseStyleDeclaration(source);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseStyleDeclaration(java.io.InputStream)
- */
- public CSSStyleDeclaration parseStyleDeclaration(InputStream stream)
- throws IOException {
- InputSource source = new InputSource();
- source.setByteStream(stream);
- return parseStyleDeclaration(source);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseStyleDeclaration(org.w3c.css.sac.InputSource)
- */
- public CSSStyleDeclaration parseStyleDeclaration(InputSource source)
- throws IOException {
- checkInputSource(source);
- CSSParser parser = makeCSSParser();
- CSSStyleDeclaration styleDeclaration = parser
- .parseStyleDeclaration(source);
- return styleDeclaration;
- }
-
- /*--------------- Parse CSS Property Value-----------------*/
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parsePropertyValue(java.io.Reader)
- */
- public CSSValue parsePropertyValue(Reader reader) throws IOException {
- InputSource source = new InputSource();
- source.setCharacterStream(reader);
- return parsePropertyValue(source);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parsePropertyValue(java.io.InputStream)
- */
- public CSSValue parsePropertyValue(InputStream stream) throws IOException {
- InputSource source = new InputSource();
- source.setByteStream(stream);
- return parsePropertyValue(source);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parsePropertyValue(java.lang.String)
- */
- public CSSValue parsePropertyValue(String value) throws IOException {
- Reader reader = new StringReader(value);
- return parsePropertyValue(reader);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parsePropertyValue(org.w3c.css.sac.InputSource)
- */
- public CSSValue parsePropertyValue(InputSource source) throws IOException {
- checkInputSource(source);
- CSSParser parser = makeCSSParser();
- return parser.parsePropertyValue(source);
- }
-
- /*--------------- Apply styles -----------------*/
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.engine.CSSEngine#applyStyles(java.lang.Object,
- * boolean)
- */
- public void applyStyles(Object element, boolean applyStylesToChildNodes) {
- applyStyles(element, applyStylesToChildNodes, computeDefaultStyle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.engine.CSSEngine#applyStyles(java.lang.Object,
- * boolean, boolean)
- */
- public void applyStyles(Object element, boolean applyStylesToChildNodes,
- boolean computeDefaultStyle) {
- Element elt = getElement(element);
- if (elt != null) {
- /*
- * Compute new Style to apply.
- */
- CSSStyleDeclaration style = viewCSS.getComputedStyle(elt, null);
- if (computeDefaultStyle) {
- if (applyStylesToChildNodes)
- this.computeDefaultStyle = computeDefaultStyle;
- /*
- * Apply default style.
- */
- applyDefaultStyleDeclaration(element, false, style, null);
- }
- /*
- * Initialize dynamic pseudo classes if needed
- */
- initializeDynamicPseudoClassesIfNeeded(element);
-
- /*
- * Manage static pseudo instances
- */
- String[] pseudoInstances = getStaticPseudoInstances(elt);
- if (pseudoInstances != null) {
- // there are static pseudo instances definied, loop for it and
- // apply styles for each pseudo instance.
- for (int i = 0; i < pseudoInstances.length; i++) {
- String pseudoInstance = pseudoInstances[i];
- CSSStyleDeclaration styleWithPseudoInstance = viewCSS
- .getComputedStyle(elt, pseudoInstance);
- if (computeDefaultStyle) {
- /*
- * Apply default style for the current pseudo instance.
- */
- applyDefaultStyleDeclaration(element, false,
- styleWithPseudoInstance, pseudoInstance);
- }
- if (styleWithPseudoInstance != null) {
- applyStyleDeclaration(element, styleWithPseudoInstance,
- pseudoInstance);
- }
- }
- }
-
- if (style != null) {
- applyStyleDeclaration(element, style, null);
- }
- try {
- // Apply inline style
- applyInlineStyle(elt, false);
- } catch (Exception e) {
- handleExceptions(e);
- }
-
- if (applyStylesToChildNodes) {
- /*
- * Style all children recursive.
- */
- NodeList nodes = elt.getChildNodes();
- if (nodes != null) {
- for (int k = 0; k < nodes.getLength(); k++) {
- applyStyles(nodes.item(k), applyStylesToChildNodes);
- }
- onStylesAppliedToChildNodes(elt, nodes);
- }
- }
- }
-
- }
-
- protected String[] getStaticPseudoInstances(Element element) {
- if (element instanceof CSSStylableElement) {
- CSSStylableElement stylableElement = (CSSStylableElement) element;
- return stylableElement.getStaticPseudoInstances();
- }
- return null;
- }
-
- /**
- * Callback method called when styles applied of <code>nodes</code>
- * children of the <code>element</code>.
- *
- * @param element
- * @param nodes
- */
- protected void onStylesAppliedToChildNodes(Element element, NodeList nodes) {
- if (element instanceof CSSStylableElement)
- ((CSSStylableElement) element).onStylesApplied(nodes);
- }
-
- /*--------------- Apply style declaration -----------------*/
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#applyStyleDeclaration(java.lang.Object,
- * org.w3c.dom.css.CSSStyleDeclaration, java.lang.String)
- */
-
- public void applyStyleDeclaration(Object element,
- CSSStyleDeclaration style, String pseudo) {
- // Apply style
- currentCSSPropertiesApplyed.clear();
- List handlers2 = null;
- for (int i = 0; i < style.getLength(); i++) {
- String property = style.item(i);
- CSSValue value = style.getPropertyCSSValue(property);
- try {
- ICSSPropertyHandler handler = this.applyCSSProperty(element,
- property, value, pseudo);
- ICSSPropertyHandler2 propertyHandler2 = null;
- if (handler instanceof ICSSPropertyHandler2) {
- propertyHandler2 = (ICSSPropertyHandler2) handler;
- } else {
- if (handler instanceof ICSSPropertyHandler2Delegate) {
- propertyHandler2 = ((ICSSPropertyHandler2Delegate) handler)
- .getCSSPropertyHandler2();
- }
- }
- if (propertyHandler2 != null) {
- if (handlers2 == null)
- handlers2 = new ArrayList();
- if (!handlers2.contains(propertyHandler2))
- handlers2.add(propertyHandler2);
- }
- } catch (Exception e) {
- if (throwError
- || (!throwError && !(e instanceof UnsupportedPropertyException)))
- handleExceptions(e);
- }
- }
- if (handlers2 != null) {
- for (Iterator iterator = handlers2.iterator(); iterator.hasNext();) {
- ICSSPropertyHandler2 handler2 = (ICSSPropertyHandler2) iterator
- .next();
- try {
- handler2.onAllCSSPropertiesApplyed(element, this);
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseAndApplyStyleDeclaration(java.io.Reader,
- * java.lang.Object)
- */
- public CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node,
- Reader reader) throws IOException {
- CSSStyleDeclaration style = parseStyleDeclaration(reader);
- this.applyStyleDeclaration(node, style, null);
- return style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseAndApplyStyleDeclaration(java.io.InputStream,
- * java.lang.Object)
- */
- public CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node,
- InputStream stream) throws IOException {
- CSSStyleDeclaration style = parseStyleDeclaration(stream);
- this.applyStyleDeclaration(node, style, null);
- return style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseAndApplyStyleDeclaration(org.w3c.css.sac.InputSource,
- * java.lang.Object)
- */
- public CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node,
- InputSource source) throws IOException {
- CSSStyleDeclaration style = parseStyleDeclaration(source);
- this.applyStyleDeclaration(node, style, null);
- return style;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#parseAndApplyStyleDeclaration(java.lang.Object,
- * java.lang.String)
- */
- public CSSStyleDeclaration parseAndApplyStyleDeclaration(Object node,
- String style) throws IOException {
- CSSStyleDeclaration styleDeclaration = parseStyleDeclaration(style);
- this.applyStyleDeclaration(node, styleDeclaration, null);
- return styleDeclaration;
- }
-
- /*--------------- Apply inline style -----------------*/
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.engine.CSSEngine#applyInlineStyle(java.lang.Object,
- * boolean)
- */
- public void applyInlineStyle(Object node, boolean applyStylesToChildNodes)
- throws IOException {
- Element elt = getElement(node);
- if (elt != null) {
- if (elt instanceof CSSStylableElement) {
- CSSStylableElement stylableElement = (CSSStylableElement) elt;
- String style = stylableElement.getCSSStyle();
- if (style != null && style.length() > 0) {
- parseAndApplyStyleDeclaration(stylableElement
- .getNativeWidget(), style);
- }
- }
- if (applyStylesToChildNodes) {
- /*
- * Style all children recursive.
- */
- NodeList nodes = elt.getChildNodes();
- if (nodes != null) {
- for (int k = 0; k < nodes.getLength(); k++) {
- applyInlineStyle(nodes.item(k), applyStylesToChildNodes);
- }
- }
- }
- }
- }
-
- /*--------------- Initial Style -----------------*/
-
- public CSSStyleDeclaration getDefaultStyleDeclaration(Object element,
- String pseudoE) {
- return getDefaultStyleDeclaration(element, null, pseudoE);
- }
-
- public CSSStyleDeclaration getDefaultStyleDeclaration(Object widget,
- CSSStyleDeclaration newStyle, String pseudoE) {
- CSSStyleDeclaration style = null;
- for (Iterator iterator = propertyHandlerProviders.iterator(); iterator
- .hasNext();) {
- ICSSPropertyHandlerProvider provider = (ICSSPropertyHandlerProvider) iterator
- .next();
- try {
- style = provider.getDefaultCSSStyleDeclaration(this, widget,
- newStyle, pseudoE);
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
- return style;
- }
-
- public void applyDefaultStyleDeclaration(Object element,
- boolean applyStylesToChildNodes) {
- applyDefaultStyleDeclaration(element, applyStylesToChildNodes, null,
- null);
- }
-
- public void applyDefaultStyleDeclaration(Object element,
- boolean applyStylesToChildNodes, CSSStyleDeclaration newStyle,
- String pseudoE) {
- // Initial styles must be computed or applied
- Element elt = getElement(element);
- if (elt != null) {
- if (elt instanceof CSSStylableElement) {
- CSSStylableElement stylableElement = (CSSStylableElement) elt;
- CSSStyleDeclaration oldDefaultStyleDeclaration = stylableElement
- .getDefaultStyleDeclaration(pseudoE);
- // CSSStyleDeclaration defaultStyleDeclaration =
- // computeDefaultStyleDeclaration(
- // stylableElement, newStyle);
- CSSStyleDeclaration defaultStyleDeclaration = getDefaultStyleDeclaration(
- element, newStyle, pseudoE);
- if (oldDefaultStyleDeclaration != null) {
- // Second apply styles, apply the initial style
- // before apply the new style
- try {
- throwError = false;
- applyStyleDeclaration(element, defaultStyleDeclaration,
- pseudoE);
- } finally {
- throwError = true;
- }
- }
- }
- if (applyStylesToChildNodes) {
- /*
- * Style all children recursive.
- */
- NodeList nodes = elt.getChildNodes();
- if (nodes != null) {
- for (int k = 0; k < nodes.getLength(); k++) {
- applyDefaultStyleDeclaration(nodes.item(k),
- applyStylesToChildNodes);
- }
- onStylesAppliedToChildNodes(elt, nodes);
- }
- }
- }
- }
-
- /**
- * Delegates the handle method.
- *
- * @param control
- * @param property
- * @param value
- */
- public ICSSPropertyHandler applyCSSProperty(Object widget, String property,
- CSSValue value, String pseudo) throws Exception {
- if (currentCSSPropertiesApplyed.containsKey(property))
- // CSS Property was already applied, ignore it.
- return null;
- Collection handlers = getCSSPropertyHandlers(property);
- if (handlers == null) {
- if (throwError)
- throw new UnsupportedPropertyException(property);
- return null;
- }
- try {
- for (Iterator iterator = handlers.iterator(); iterator.hasNext();) {
- ICSSPropertyHandler handler = (ICSSPropertyHandler) iterator
- .next();
- boolean result = handler.applyCSSProperty(widget, property,
- value, pseudo, this);
- if (result) {
- // Add CSS Property to flag that this CSS Property was
- // applied.
- currentCSSPropertiesApplyed.put(property, property);
- return handler;
- }
- }
-
- } catch (Exception e) {
- if (throwError
- || (!throwError && !(e instanceof UnsupportedPropertyException)))
- handleExceptions(e);
- }
- return null;
- }
-
- public String retrieveCSSProperty(Object widget, String property,
- String pseudo) {
- try {
- Collection handlers = getCSSPropertyHandlers(property);
- if (handlers == null) {
- return null;
- }
- for (Iterator iterator = handlers.iterator(); iterator.hasNext();) {
- ICSSPropertyHandler handler = (ICSSPropertyHandler) iterator
- .next();
- String value = handler.retrieveCSSProperty(widget, property,
- pseudo, this);
- if (!StringUtils.isEmpty(value))
- return value;
- }
- } catch (Exception e) {
- handleExceptions(e);
- }
- return null;
- }
-
- public String[] getCSSCompositePropertiesNames(String property) {
- try {
- Collection handlers = getCSSPropertyHandlers(property);
- if (handlers == null) {
- return null;
- }
- for (Iterator iterator = handlers.iterator(); iterator.hasNext();) {
- ICSSPropertyHandler handler = (ICSSPropertyHandler) iterator
- .next();
- if (handler instanceof ICSSPropertyCompositeHandler) {
- ICSSPropertyCompositeHandler compositeHandler = (ICSSPropertyCompositeHandler) handler;
- if (compositeHandler.isCSSPropertyComposite(property))
- return compositeHandler.getCSSPropertiesNames(property);
- }
- }
- } catch (Exception e) {
- handleExceptions(e);
- }
- return null;
- }
-
- protected Collection getCSSPropertyHandlers(String property)
- throws Exception {
- Collection handlers = null;
- for (Iterator iterator = propertyHandlerProviders.iterator(); iterator
- .hasNext();) {
- ICSSPropertyHandlerProvider provider = (ICSSPropertyHandlerProvider) iterator
- .next();
- Collection h = provider.getCSSPropertyHandlers(property);
- if (handlers == null) {
- handlers = h;
- } else {
- handlers = new ArrayList(handlers);
- handlers.addAll(h);
- }
- }
- return handlers;
- }
-
- /*--------------- Dynamic pseudo classes -----------------*/
-
- public void registerDynamicPseudoClassHandler(String pseudo,
- IDynamicPseudoClassesHandler dynamicPseudoClassHandler) {
- dynamicPseudoClassesHandler.put(pseudo, dynamicPseudoClassHandler);
- }
-
- protected void initializeDynamicPseudoClassesIfNeeded(Object node) {
- if (dynamicPseudoClassesHandler == null
- || dynamicPseudoClassesHandler.values().size() < 1)
- return;
- Element element = getElement(node);
- if (element == null)
- return;
- if (isElementsWithDynamicPseudoClassesInitialized(element))
- return;
- // Create
- // Loop for pseudo class condition
- List list = documentCSS
- .queryConditionSelector(Condition.SAC_PSEUDO_CLASS_CONDITION);
- if (list == null)
- return;
- for (Iterator iterator = list.iterator(); iterator.hasNext();) {
- Selector selector = (Selector) iterator.next();
- ConditionalSelector conditionalSelector = (ConditionalSelector) selector;
- String value = ((AttributeCondition) conditionalSelector
- .getCondition()).getValue();
-
- if (((ExtendedSelector) conditionalSelector.getSimpleSelector())
- .match(element, value)) {
- IDynamicPseudoClassesHandler handler = (IDynamicPseudoClassesHandler) dynamicPseudoClassesHandler
- .get(value);
- if (handler != null) {
- handler.intialize(element, this);
- addElementsWithDynamicPseudoClasses(element);
- }
- }
-
- }
- }
-
- protected void addElementsWithDynamicPseudoClasses(Element element) {
- if (elementsWithDynamicPseudoClasses == null)
- elementsWithDynamicPseudoClasses = new HashMap();
- elementsWithDynamicPseudoClasses.put(element, element);
- }
-
- protected boolean isElementsWithDynamicPseudoClassesInitialized(
- Element element) {
- if (elementsWithDynamicPseudoClasses == null)
- return false;
- return (elementsWithDynamicPseudoClasses.get(element) != null);
- }
-
- /*--------------- w3c Element -----------------*/
-
- public IElementProvider getElementProvider() {
- return elementProvider;
- }
-
- public void setElementProvider(IElementProvider elementProvider) {
- this.elementProvider = elementProvider;
- // this.elementsContext = null;
- }
-
- /**
- * Return the w3c Element linked to the Object element.
- *
- * @param element
- * @return
- */
- public Element getElement(Object element) {
- Element elt = null;
- CSSElementContext elementContext = getCSSElementContext(element);
- if (elementContext != null) {
- if (!elementContext.elementMustBeRefreshed(elementProvider)) {
- return elementContext.getElement();
- }
- }
- if (element instanceof Element)
- elt = (Element) element;
- else if (elementProvider != null) {
- elt = elementProvider.getElement(element, this);
- }
- if (elt != null) {
- if (elementContext == null) {
- elementContext = new CSSElementContextImpl();
- getElementsContext().put(getNativeWidget(element),
- elementContext);
- }
- elementContext.setElementProvider(elementProvider);
- elementContext.setElement(elt);
- }
- return elt;
- }
-
- public Object getDocument() {
- return null;
- }
-
- public CSSElementContext getCSSElementContext(Object element) {
- Object o = getNativeWidget(element);
- return (CSSElementContext) getElementsContext().get(o);
- }
-
- public Object getNativeWidget(Object element) {
- Object o = element;
- if (element instanceof CSSStylableElement) {
- o = ((CSSStylableElement) o).getNativeWidget();
- }
- return o;
- }
-
- protected Map getElementsContext() {
- if (elementsContext == null)
- elementsContext = new HashMap();
- return elementsContext;
- }
-
- /*--------------- Error Handler -----------------*/
-
- /**
- * Handle exceptions thrown while parsing, applying styles. By default this
- * method call CSS Error Handler if it is initialized.
- *
- */
- public void handleExceptions(Exception e) {
- if (errorHandler != null)
- errorHandler.error(e);
- }
-
- public CSSErrorHandler getErrorHandler() {
- return errorHandler;
- }
-
- /**
- * Set the CSS Error Handler to manage exception.
- */
- public void setErrorHandler(CSSErrorHandler errorHandler) {
- this.errorHandler = errorHandler;
- }
-
- /*--------------- Resources Locator Manager -----------------*/
-
- public IResourcesLocatorManager getResourcesLocatorManager() {
- if (resourcesLocatorManager == null)
- return defaultResourcesLocatorManager;
- return resourcesLocatorManager;
- }
-
- public void setResourcesLocatorManager(
- IResourcesLocatorManager resourcesLocatorManager) {
- this.resourcesLocatorManager = resourcesLocatorManager;
- }
-
- /*--------------- Document/View CSS -----------------*/
-
- public DocumentCSS getDocumentCSS() {
- return documentCSS;
- }
-
- public ViewCSS getViewCSS() {
- return viewCSS;
- }
-
- public void dispose() {
- reset();
- elementsContext = null;
- if (resourcesRegistry != null)
- resourcesRegistry.dispose();
- }
-
- public void reset() {
- // Remove All Style Sheets
- ((ExtendedDocumentCSS) documentCSS).removeAllStyleSheets();
- if (elementsWithDynamicPseudoClasses != null) {
- Collection elements = elementsWithDynamicPseudoClasses.values();
- for (Iterator iterator = elements.iterator(); iterator.hasNext();) {
- Element element = (Element) iterator.next();
- Collection handlers = dynamicPseudoClassesHandler.values();
- for (Iterator iterator2 = handlers.iterator(); iterator2
- .hasNext();) {
- IDynamicPseudoClassesHandler handler = (IDynamicPseudoClassesHandler) iterator2
- .next();
- handler.dispose(element, this);
- }
- }
- elementsWithDynamicPseudoClasses = null;
- }
- }
-
- /*--------------- Resources Registry -----------------*/
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.engine.CSSEngine#getResourcesRegistry()
- */
- public IResourcesRegistry getResourcesRegistry() {
- return resourcesRegistry;
- }
-
- public void setResourcesRegistry(IResourcesRegistry resourcesRegistry) {
- this.resourcesRegistry = resourcesRegistry;
- }
-
- public void registerCSSPropertyHandlerProvider(
- ICSSPropertyHandlerProvider handlerProvider) {
- propertyHandlerProviders.add(handlerProvider);
- }
-
- public void unregisterCSSPropertyHandlerProvider(
- ICSSPropertyHandlerProvider handlerProvider) {
- propertyHandlerProviders.remove(handlerProvider);
- }
-
- /*--------------- CSS Value Converter -----------------*/
-
- public void registerCSSValueConverter(ICSSValueConverter converter) {
- if (valueConverters == null)
- valueConverters = new HashMap();
- valueConverters.put(converter.getToType(), converter);
- }
-
- public void unregisterCSSValueConverter(ICSSValueConverter converter) {
- if (valueConverters == null)
- return;
- valueConverters.remove(converter);
- }
-
- public ICSSValueConverter getCSSValueConverter(Object toType) {
- if (valueConverters != null) {
- return (ICSSValueConverter) valueConverters.get(toType);
- }
- return null;
- }
-
- public Object convert(CSSValue value, Object toType, Object context)
- throws Exception {
- Object newValue = null;
- String key = CSSResourcesHelpers.getCSSValueKey(value);
- IResourcesRegistry resourcesRegistry = getResourcesRegistry();
- if (resourcesRegistry != null) {
- if (key != null)
- newValue = resourcesRegistry.getResource(toType, key);
- }
- if (newValue == null) {
- ICSSValueConverter converter = getCSSValueConverter(toType);
- if (converter != null) {
- newValue = converter.convert(value, this, context);
- if (newValue != null) {
- // cache it
- if (resourcesRegistry != null) {
- if (key != null)
- resourcesRegistry.registerResource(toType, key,
- newValue);
- }
- }
- }
- }
- return newValue;
- }
-
- public String convert(Object value, Object toType, Object context)
- throws Exception {
- if (value == null)
- return null;
- ICSSValueConverter converter = getCSSValueConverter(toType);
- if (converter != null) {
- return converter.convert(value, this, context);
- }
- return null;
- }
-
- /*--------------- Abstract methods -----------------*/
-
- /**
- * Return instance of CSS Parser.
- */
- public abstract CSSParser makeCSSParser();
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSElementContextImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSElementContextImpl.java
deleted file mode 100644
index 96ab4a0..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSElementContextImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.engine;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.eclipse.e4.ui.css.core.dom.IElementProvider;
-import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
-import org.w3c.dom.Element;
-
-public class CSSElementContextImpl implements CSSElementContext {
-
- private Element element;
-
- private Map datas = null;
-
- private IElementProvider elementProvider;
-
- public CSSElementContextImpl() {
-
- }
-
- public void setData(Object key, Object value) {
- if (datas == null)
- datas = new HashMap();
- datas.put(key, value);
- }
-
- public Object getData(Object key) {
- if (datas == null)
- return null;
- return datas.get(key);
- }
-
- public Element getElement() {
- return element;
- }
-
- public void setElement(Element newElement) {
- if (element != null && element instanceof CSSStylableElement
- && newElement instanceof CSSStylableElement) {
- ((CSSStylableElement) newElement)
- .copyDefaultStyleDeclarations(((CSSStylableElement) element));
- }
- this.element = newElement;
- }
-
- public boolean elementMustBeRefreshed(IElementProvider elementProvider) {
- if (this.elementProvider == null)
- return (elementProvider != null);
- return !this.elementProvider.equals(elementProvider);
- }
-
- public void setElementProvider(IElementProvider elementProvider) {
- this.elementProvider = elementProvider;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSEngineImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSEngineImpl.java
deleted file mode 100644
index 3608a12..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSEngineImpl.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.engine;
-
-import org.eclipse.e4.ui.css.core.dom.ExtendedDocumentCSS;
-import org.eclipse.e4.ui.css.core.dom.parsers.CSSParser;
-import org.eclipse.e4.ui.css.core.dom.parsers.CSSParserFactory;
-import org.eclipse.e4.ui.css.core.dom.parsers.ICSSParserFactory;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.CSSValueBooleanConverterImpl;
-import org.eclipse.e4.ui.css.core.dom.properties.providers.CSSPropertyHandlerLazyProviderImpl;
-import org.eclipse.e4.ui.css.core.dom.properties.providers.CSSPropertyHandlerSimpleProviderImpl;
-import org.eclipse.e4.ui.css.core.impl.sac.CSSConditionFactoryImpl;
-import org.eclipse.e4.ui.css.core.impl.sac.CSSSelectorFactoryImpl;
-import org.w3c.css.sac.ConditionFactory;
-
-public class CSSEngineImpl extends AbstractCSSEngine {
-
- public static final ConditionFactory CONDITIONFACTORY_INSTANCE = new CSSConditionFactoryImpl(
- null, "class", null, "id");
-
- private CSSPropertyHandlerSimpleProviderImpl handlerProvider = null;
-
- private CSSPropertyHandlerLazyProviderImpl lazyHandlerProvider = null;
-
- public CSSEngineImpl() {
- super();
- // Register SWT Boolean CSSValue Converter
- super.registerCSSValueConverter(CSSValueBooleanConverterImpl.INSTANCE);
- }
-
- public CSSEngineImpl(ExtendedDocumentCSS documentCSS) {
- super(documentCSS);
- // Register SWT Boolean CSSValue Converter
- super.registerCSSValueConverter(CSSValueBooleanConverterImpl.INSTANCE);
- }
-
- public CSSParser makeCSSParser() {
- // Create CSS Parser
- ICSSParserFactory factory = CSSParserFactory.newInstance();
- CSSParser parser = factory.makeCSSParser();
-
- // Register Batik CSS Selector factory.
- parser.setSelectorFactory(CSSSelectorFactoryImpl.INSTANCE);
-
- // Register Custom CSS Condition factory.
- parser.setConditionFactory(CONDITIONFACTORY_INSTANCE);
-
- return parser;
- }
-
- public void registerCSSPropertyHandler(Class cl, ICSSPropertyHandler handler) {
- initHandlerProviderIfNeed();
- handlerProvider.registerCSSPropertyHandler(cl, handler);
- }
-
- private void initHandlerProviderIfNeed() {
- if (handlerProvider == null) {
- handlerProvider = new CSSPropertyHandlerSimpleProviderImpl();
- super.registerCSSPropertyHandlerProvider(handlerProvider);
- }
- }
-
- public void registerCSSProperty(String propertyName,
- Class propertyHandlerClass) {
- initHandlerProviderIfNeed();
- handlerProvider.registerCSSProperty(propertyName, propertyHandlerClass);
- }
-
- private void initLazyHandlerProviderIfNeed() {
- if (lazyHandlerProvider == null) {
- lazyHandlerProvider = new CSSPropertyHandlerLazyProviderImpl();
- super.registerCSSPropertyHandlerProvider(lazyHandlerProvider);
- }
- }
-
- public void registerPackage(String packageName) {
- initLazyHandlerProviderIfNeed();
- lazyHandlerProvider.registerPackage(packageName);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSErrorHandlerImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSErrorHandlerImpl.java
deleted file mode 100644
index 4525cce..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSErrorHandlerImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.engine;
-
-import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler;
-
-/**
- * Basic implementation for CSS Engine error handlers which print stack trace of
- * the exception throwed.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSErrorHandlerImpl implements CSSErrorHandler {
-
- public static final CSSErrorHandler INSTANCE = new CSSErrorHandlerImpl();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.e4.ui.css.core.engine.CSSErrorHandler#error(java.lang.Exception)
- */
- public void error(Exception e) {
- e.printStackTrace();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractAttributeCondition.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractAttributeCondition.java
deleted file mode 100644
index 723ca97..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractAttributeCondition.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.css.sac.AttributeCondition;
-
-/**
- * This class provides an abstract implementation of the {@link
- * org.w3c.css.sac.AttributeCondition} interface.
- */
-public abstract class AbstractAttributeCondition implements AttributeCondition,
- ExtendedCondition {
-
- /**
- * The attribute value.
- */
- protected String value;
-
- /**
- * Creates a new AbstractAttributeCondition object.
- */
- protected AbstractAttributeCondition(String value) {
- this.value = value;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- *
- * @param obj
- * the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (obj == null || (obj.getClass() != getClass())) {
- return false;
- }
- AbstractAttributeCondition c = (AbstractAttributeCondition) obj;
- return c.value.equals(value);
- }
-
- /**
- * equal objects should have equal hashCodes.
- *
- * @return hashCode of this AbstractAttributeCondition
- */
- public int hashCode() {
- return value == null ? -1 : value.hashCode();
- }
-
- /**
- * Returns the specificity of this condition.
- */
- public int getSpecificity() {
- return 1 << 8;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getValue()}.
- */
- public String getValue() {
- return value;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractCombinatorCondition.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractCombinatorCondition.java
deleted file mode 100644
index 63bcd65..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractCombinatorCondition.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.css.sac.CombinatorCondition;
-import org.w3c.css.sac.Condition;
-
-/**
- * This class provides an abstract implementation of the {@link
- * org.w3c.css.sac.CombinatorCondition} interface.
- */
-public abstract class AbstractCombinatorCondition implements
- CombinatorCondition, ExtendedCondition {
-
- /**
- * The first condition.
- */
- protected Condition firstCondition;
-
- /**
- * The second condition.
- */
- protected Condition secondCondition;
-
- /**
- * Creates a new CombinatorCondition object.
- */
- protected AbstractCombinatorCondition(Condition c1, Condition c2) {
- firstCondition = c1;
- secondCondition = c2;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- *
- * @param obj
- * the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (obj == null || (obj.getClass() != getClass())) {
- return false;
- }
- AbstractCombinatorCondition c = (AbstractCombinatorCondition) obj;
- return (c.firstCondition.equals(firstCondition) && c.secondCondition
- .equals(secondCondition));
- }
-
- /**
- * Returns the specificity of this condition.
- */
- public int getSpecificity() {
- return ((ExtendedCondition) getFirstCondition()).getSpecificity()
- + ((ExtendedCondition) getSecondCondition()).getSpecificity();
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.CombinatorCondition#getFirstCondition()}.
- */
- public Condition getFirstCondition() {
- return firstCondition;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.CombinatorCondition#getSecondCondition()}.
- */
- public Condition getSecondCondition() {
- return secondCondition;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractDescendantSelector.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractDescendantSelector.java
deleted file mode 100644
index 0ab48ef..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractDescendantSelector.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.css.sac.DescendantSelector;
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SimpleSelector;
-
-/**
- * This class provides an abstract implementation of the {@link
- * org.w3c.css.sac.DescendantSelector} interface.
- */
-public abstract class AbstractDescendantSelector
- implements DescendantSelector,
- ExtendedSelector {
-
- /**
- * The ancestor selector.
- */
- protected Selector ancestorSelector;
-
- /**
- * The simple selector.
- */
- protected SimpleSelector simpleSelector;
-
- /**
- * Creates a new DescendantSelector object.
- */
- protected AbstractDescendantSelector(Selector ancestor,
- SimpleSelector simple) {
- ancestorSelector = ancestor;
- simpleSelector = simple;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- * @param obj the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (obj == null || (obj.getClass() != getClass())) {
- return false;
- }
- AbstractDescendantSelector s = (AbstractDescendantSelector)obj;
- return s.simpleSelector.equals(simpleSelector);
- }
-
- /**
- * Returns the specificity of this selector.
- */
- public int getSpecificity() {
- return ((ExtendedSelector)ancestorSelector).getSpecificity() +
- ((ExtendedSelector)simpleSelector).getSpecificity();
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.DescendantSelector#getAncestorSelector()}.
- */
- public Selector getAncestorSelector() {
- return ancestorSelector;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.DescendantSelector#getSimpleSelector()}.
- */
- public SimpleSelector getSimpleSelector() {
- return simpleSelector;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractElementSelector.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractElementSelector.java
deleted file mode 100644
index c8b9b12..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractElementSelector.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.ElementSelector;
-
-/**
- * This class provides an abstract implementation of the ElementSelector
- * interface.
- */
-public abstract class AbstractElementSelector
- implements ElementSelector,
- ExtendedSelector {
-
- /**
- * The namespace URI.
- */
- protected String namespaceURI;
-
- /**
- * The local name.
- */
- protected String localName;
-
- /**
- * Creates a new ElementSelector object.
- */
- protected AbstractElementSelector(String uri, String name) {
- namespaceURI = uri;
- localName = name;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- * @param obj the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (obj == null || (obj.getClass() != getClass())) {
- return false;
- }
- AbstractElementSelector s = (AbstractElementSelector)obj;
- return (s.namespaceURI.equals(namespaceURI) &&
- s.localName.equals(localName));
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ElementSelector#getNamespaceURI()}.
- */
- public String getNamespaceURI() {
- return namespaceURI;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ElementSelector#getLocalName()}.
- */
- public String getLocalName() {
- return localName;
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractSiblingSelector.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractSiblingSelector.java
deleted file mode 100644
index 066dc3a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/AbstractSiblingSelector.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SiblingSelector;
-import org.w3c.css.sac.SimpleSelector;
-
-/**
- * This class provides an abstract implementation of the {@link
- * org.w3c.css.sac.SiblingSelector} interface.
- */
-public abstract class AbstractSiblingSelector implements SiblingSelector,
- ExtendedSelector {
-
- /**
- * The node type.
- */
- protected short nodeType;
-
- /**
- * The selector.
- */
- protected Selector selector;
-
- /**
- * The simple selector.
- */
- protected SimpleSelector simpleSelector;
-
- /**
- * Creates a new SiblingSelector object.
- */
- protected AbstractSiblingSelector(short type, Selector sel,
- SimpleSelector simple) {
- nodeType = type;
- selector = sel;
- simpleSelector = simple;
- }
-
- /**
- * Returns the node type.
- */
- public short getNodeType() {
- return nodeType;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- *
- * @param obj
- * the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (obj == null || (obj.getClass() != getClass())) {
- return false;
- }
- AbstractSiblingSelector s = (AbstractSiblingSelector) obj;
- return s.simpleSelector.equals(simpleSelector);
- }
-
- /**
- * Returns the specificity of this selector.
- */
- public int getSpecificity() {
- return ((ExtendedSelector) selector).getSpecificity()
- + ((ExtendedSelector) simpleSelector).getSpecificity();
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SiblingSelector#getSelector()}.
- */
- public Selector getSelector() {
- return selector;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SiblingSelector#getSiblingSelector()}.
- */
- public SimpleSelector getSiblingSelector() {
- return simpleSelector;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSAndConditionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSAndConditionImpl.java
deleted file mode 100644
index a307f21..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSAndConditionImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.Condition;
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.CombinatorCondition} interface.
- */
-public class CSSAndConditionImpl extends AbstractCombinatorCondition {
- /**
- * Creates a new CombinatorCondition object.
- */
- public CSSAndConditionImpl(Condition c1, Condition c2) {
- super(c1, c2);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Condition#getConditionType()}.
- */
- public short getConditionType() {
- return SAC_AND_CONDITION;
- }
-
- /**
- * Tests whether this condition matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- return ((ExtendedCondition)getFirstCondition()).match(e, pseudoE) &&
- ((ExtendedCondition)getSecondCondition()).match(e, pseudoE);
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- ((ExtendedCondition)getFirstCondition()).fillAttributeSet(attrSet);
- ((ExtendedCondition)getSecondCondition()).fillAttributeSet(attrSet);
- }
-
- /**
- * Returns a text representation of this object.
- */
- public String toString() {
- return String.valueOf( getFirstCondition() ) + getSecondCondition();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSAttributeConditionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSAttributeConditionImpl.java
deleted file mode 100644
index 891e7cb..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSAttributeConditionImpl.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.AttributeCondition} interface.
- */
-public class CSSAttributeConditionImpl extends AbstractAttributeCondition {
- /**
- * The attribute's local name.
- */
- protected String localName;
-
- /**
- * The attribute's namespace URI.
- */
- protected String namespaceURI;
-
- /**
- * Whether this condition applies to specified attributes.
- */
- protected boolean specified;
-
- /**
- * Creates a new CSSAttributeCondition object.
- */
- public CSSAttributeConditionImpl(String localName, String namespaceURI,
- boolean specified, String value) {
- super(value);
- this.localName = localName;
- this.namespaceURI = namespaceURI;
- this.specified = specified;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- *
- * @param obj
- * the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (!super.equals(obj)) {
- return false;
- }
- CSSAttributeConditionImpl c = (CSSAttributeConditionImpl) obj;
- return (c.namespaceURI.equals(namespaceURI)
- && c.localName.equals(localName) && c.specified == specified);
- }
-
- /**
- * equal objects should have equal hashCodes.
- *
- * @return hashCode of this CSSAttributeCondition
- */
- public int hashCode() {
- return namespaceURI.hashCode() ^ localName.hashCode()
- ^ (specified ? -1 : 0);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Condition#getConditionType()}.
- */
- public short getConditionType() {
- return SAC_ATTRIBUTE_CONDITION;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getNamespaceURI()}.
- */
- public String getNamespaceURI() {
- return namespaceURI;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getLocalName()}.
- */
- public String getLocalName() {
- return localName;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getSpecified()}.
- */
- public boolean getSpecified() {
- return specified;
- }
-
- /**
- * Tests whether this condition matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- String val = getValue();
- if (val == null) {
- return !e.getAttribute(getLocalName()).equals("");
- }
- return e.getAttribute(getLocalName()).equals(val);
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- attrSet.add(localName);
- }
-
- /**
- * Returns a text representation of this object.
- */
- public String toString() {
- if (value == null) {
- return '[' + localName + ']';
- }
- return '[' + localName + "=\"" + value + "\"]";
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSBeginHyphenAttributeConditionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSBeginHyphenAttributeConditionImpl.java
deleted file mode 100644
index 7010fbd..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSBeginHyphenAttributeConditionImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.AttributeCondition} interface.
- */
-public class CSSBeginHyphenAttributeConditionImpl extends
- CSSAttributeConditionImpl {
-
- /**
- * Creates a new CSSAttributeCondition object.
- */
- public CSSBeginHyphenAttributeConditionImpl(String localName,
- String namespaceURI, boolean specified, String value) {
- super(localName, namespaceURI, specified, value);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Condition#getConditionType()}.
- */
- public short getConditionType() {
- return SAC_BEGIN_HYPHEN_ATTRIBUTE_CONDITION;
- }
-
- /**
- * Tests whether this condition matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- return e.getAttribute(getLocalName()).startsWith(getValue());
- }
-
- /**
- * Returns a text representation of this object.
- */
- public String toString() {
- return '[' + getLocalName() + "|=\"" + getValue() + "\"]";
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSChildSelectorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSChildSelectorImpl.java
deleted file mode 100644
index 4d9290a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSChildSelectorImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SimpleSelector;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.DescendantSelector} interface.
- */
-public class CSSChildSelectorImpl extends AbstractDescendantSelector {
-
- /**
- * Creates a new CSSChildSelector object.
- */
- public CSSChildSelectorImpl(Selector ancestor, SimpleSelector simple) {
- super(ancestor, simple);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Selector#getSelectorType()}.
- */
- public short getSelectorType() {
- return SAC_CHILD_SELECTOR;
- }
-
- /**
- * Tests whether this selector matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- Node n = e.getParentNode();
- if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
- return ((ExtendedSelector)getAncestorSelector()).match((Element)n,
- null) &&
- ((ExtendedSelector)getSimpleSelector()).match(e, pseudoE);
- }
- return false;
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- ((ExtendedSelector)getAncestorSelector()).fillAttributeSet(attrSet);
- ((ExtendedSelector)getSimpleSelector()).fillAttributeSet(attrSet);
- }
-
- /**
- * Returns a representation of the selector.
- */
- public String toString() {
- SimpleSelector s = getSimpleSelector();
- if (s.getSelectorType() == SAC_PSEUDO_ELEMENT_SELECTOR) {
- return String.valueOf( getAncestorSelector() ) + s;
- }
- return getAncestorSelector() + " > " + s;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSClassConditionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSClassConditionImpl.java
deleted file mode 100644
index d712745..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSClassConditionImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.AttributeCondition} interface.
- */
-public class CSSClassConditionImpl extends CSSAttributeConditionImpl {
-
- /**
- * Creates a new CSSAttributeCondition object.
- */
- public CSSClassConditionImpl(String localName, String namespaceURI,
- String value) {
- super(localName, namespaceURI, true, value);
- }
-
- public boolean match(Element e, String pseudoE) {
- String attr = null;
- if ((e instanceof CSSStylableElement))
- attr = ((CSSStylableElement) e).getCSSClass();
- else
- attr = e.getAttribute("class");
- if (attr == null || attr.length() < 1)
- return false;
- String val = getValue();
- int attrLen = attr.length();
- int valLen = val.length();
- for (int i = attr.indexOf(val); i != -1; i = attr.indexOf(val, i
- + valLen))
- if ((i == 0 || Character.isSpaceChar(attr.charAt(i - 1)))
- && (i + valLen == attrLen || Character.isSpaceChar(attr
- .charAt(i + valLen))))
- return true;
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSConditionFactoryImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSConditionFactoryImpl.java
deleted file mode 100644
index 9551f8f..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSConditionFactoryImpl.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.css.sac.AttributeCondition;
-import org.w3c.css.sac.CSSException;
-import org.w3c.css.sac.CombinatorCondition;
-import org.w3c.css.sac.Condition;
-import org.w3c.css.sac.ConditionFactory;
-import org.w3c.css.sac.ContentCondition;
-import org.w3c.css.sac.LangCondition;
-import org.w3c.css.sac.NegativeCondition;
-import org.w3c.css.sac.PositionalCondition;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.ConditionFactory} interface.
- */
-public class CSSConditionFactoryImpl implements ConditionFactory {
-
- /**
- * The class attribute namespace URI.
- */
- protected String classNamespaceURI;
-
- /**
- * The class attribute local name.
- */
- protected String classLocalName;
-
- /**
- * The id attribute namespace URI.
- */
- protected String idNamespaceURI;
-
- /**
- * The id attribute local name.
- */
- protected String idLocalName;
-
- /**
- * Creates a new condition factory.
- */
- public CSSConditionFactoryImpl(String cns, String cln, String idns,
- String idln) {
- classNamespaceURI = cns;
- classLocalName = cln;
- idNamespaceURI = idns;
- idLocalName = idln;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * ConditionFactory#createAndCondition(Condition,Condition)}.
- */
- public CombinatorCondition createAndCondition(Condition first,
- Condition second) throws CSSException {
- return new CSSAndConditionImpl(first, second);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * ConditionFactory#createOrCondition(Condition,Condition)}.
- */
- public CombinatorCondition createOrCondition(Condition first,
- Condition second) throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionFactory#createNegativeCondition(Condition)}.
- */
- public NegativeCondition createNegativeCondition(Condition condition)
- throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * ConditionFactory#createPositionalCondition(int,boolean,boolean)}.
- */
- public PositionalCondition createPositionalCondition(int position,
- boolean typeNode, boolean type) throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * ConditionFactory#createAttributeCondition(String,String,boolean,String)}.
- */
- public AttributeCondition createAttributeCondition(String localName,
- String namespaceURI, boolean specified, String value)
- throws CSSException {
- return new CSSAttributeConditionImpl(localName, namespaceURI, specified,
- value);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionFactory#createIdCondition(String)}.
- */
- public AttributeCondition createIdCondition(String value)
- throws CSSException {
- return new CSSIdConditionImpl(idNamespaceURI, idLocalName, value);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionFactory#createLangCondition(String)}.
- */
- public LangCondition createLangCondition(String lang) throws CSSException {
- return new CSSLangConditionImpl(lang);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * ConditionFactory#createOneOfAttributeCondition(String,String,boolean,String)}.
- */
- public AttributeCondition createOneOfAttributeCondition(String localName,
- String nsURI, boolean specified, String value) throws CSSException {
- return new CSSOneOfAttributeConditionImpl(localName, nsURI, specified,
- value);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * ConditionFactory#createBeginHyphenAttributeCondition(String,String,boolean,String)}.
- */
- public AttributeCondition createBeginHyphenAttributeCondition(
- String localName, String namespaceURI, boolean specified,
- String value) throws CSSException {
- return new CSSBeginHyphenAttributeConditionImpl(localName,
- namespaceURI, specified, value);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionFactory#createClassCondition(String,String)}.
- */
- public AttributeCondition createClassCondition(String namespaceURI,
- String value) throws CSSException {
- return new CSSClassConditionImpl(classLocalName, classNamespaceURI, value);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * ConditionFactory#createPseudoClassCondition(String,String)}.
- */
- public AttributeCondition createPseudoClassCondition(String namespaceURI,
- String value) throws CSSException {
- return new CSSPseudoClassConditionImpl(namespaceURI, value);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionFactory#createOnlyChildCondition()}.
- */
- public Condition createOnlyChildCondition() throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionFactory#createOnlyTypeCondition()}.
- */
- public Condition createOnlyTypeCondition() throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionFactory#createContentCondition(String)}.
- */
- public ContentCondition createContentCondition(String data)
- throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSConditionalSelectorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSConditionalSelectorImpl.java
deleted file mode 100644
index 266346b..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSConditionalSelectorImpl.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.Condition;
-import org.w3c.css.sac.ConditionalSelector;
-import org.w3c.css.sac.SimpleSelector;
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.ConditionalSelector} interface.
- */
-public class CSSConditionalSelectorImpl
- implements ConditionalSelector,
- ExtendedSelector {
-
- /**
- * The simple selector.
- */
- protected SimpleSelector simpleSelector;
-
- /**
- * The condition.
- */
- protected Condition condition;
-
- /**
- * Creates a new ConditionalSelector object.
- */
- public CSSConditionalSelectorImpl(SimpleSelector s, Condition c) {
- simpleSelector = s;
- condition = c;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- * @param obj the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (obj == null || (obj.getClass() != getClass())) {
- return false;
- }
- CSSConditionalSelectorImpl s = (CSSConditionalSelectorImpl)obj;
- return (s.simpleSelector.equals(simpleSelector) &&
- s.condition.equals(condition));
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Selector#getSelectorType()}.
- */
- public short getSelectorType() {
- return SAC_CONDITIONAL_SELECTOR;
- }
-
- /**
- * Tests whether this selector matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- return ((ExtendedSelector)getSimpleSelector()).match(e, pseudoE) &&
- ((ExtendedCondition)getCondition()).match(e, pseudoE);
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- ((ExtendedSelector)getSimpleSelector()).fillAttributeSet(attrSet);
- ((ExtendedCondition)getCondition()).fillAttributeSet(attrSet);
- }
-
- /**
- * Returns the specificity of this selector.
- */
- public int getSpecificity() {
- return ((ExtendedSelector)getSimpleSelector()).getSpecificity() +
- ((ExtendedCondition)getCondition()).getSpecificity();
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionalSelector#getSimpleSelector()}.
- */
- public SimpleSelector getSimpleSelector() {
- return simpleSelector;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.ConditionalSelector#getCondition()}.
- */
- public Condition getCondition() {
- return condition;
- }
-
- /**
- * Returns a representation of the selector.
- */
- public String toString() {
- return String.valueOf( simpleSelector ) + condition;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDescendantSelectorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDescendantSelectorImpl.java
deleted file mode 100644
index 03196bb..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDescendantSelectorImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SimpleSelector;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class provides an implementation for the
- * {@link org.w3c.css.sac.DescendantSelector} interface.
- */
-public class CSSDescendantSelectorImpl extends AbstractDescendantSelector {
-
- /**
- * Creates a new CSSDescendantSelector object.
- */
- public CSSDescendantSelectorImpl(Selector ancestor, SimpleSelector simple) {
- super(ancestor, simple);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Selector#getSelectorType()}.
- */
- public short getSelectorType() {
- return SAC_DESCENDANT_SELECTOR;
- }
-
- /**
- * Tests whether this selector matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- ExtendedSelector p = (ExtendedSelector)getAncestorSelector();
- if (!((ExtendedSelector)getSimpleSelector()).match(e,pseudoE))
- return false;
- for (Node n = e.getParentNode(); n != null; n = n.getParentNode()) {
- if (n.getNodeType() == Node.ELEMENT_NODE &&
- p.match((Element)n, null)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- ((ExtendedSelector)getSimpleSelector()).fillAttributeSet(attrSet);
- }
-
- /**
- * Returns a representation of the selector.
- */
- public String toString() {
- return getAncestorSelector() + " " + getSimpleSelector();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDirectAdjacentSelectorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDirectAdjacentSelectorImpl.java
deleted file mode 100644
index 5e2c683..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDirectAdjacentSelectorImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SimpleSelector;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class provides an implementation for the
- * {@link org.w3c.css.sac.DescendantSelector} interface.
- */
-public class CSSDirectAdjacentSelectorImpl extends AbstractSiblingSelector {
-
- /**
- * Creates a new CSSDirectAdjacentSelector object.
- */
- public CSSDirectAdjacentSelectorImpl(short type,
- Selector parent,
- SimpleSelector simple) {
- super(type, parent, simple);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Selector#getSelectorType()}.
- */
- public short getSelectorType() {
- return SAC_DIRECT_ADJACENT_SELECTOR;
- }
-
- /**
- * Tests whether this selector matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- Node n = e;
- if (!((ExtendedSelector)getSiblingSelector()).match(e, pseudoE))
- return false;
- while ((n = n.getPreviousSibling()) != null &&
- n.getNodeType() != Node.ELEMENT_NODE);
-
- if (n == null)
- return false;
-
- return ((ExtendedSelector)getSelector()).match((Element)n, null);
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- ((ExtendedSelector)getSelector()).fillAttributeSet(attrSet);
- ((ExtendedSelector)getSiblingSelector()).fillAttributeSet(attrSet);
- }
-
- /**
- * Returns a representation of the selector.
- */
- public String toString() {
- return getSelector() + " + " + getSiblingSelector();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDocumentHandlerImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDocumentHandlerImpl.java
deleted file mode 100644
index fc5ef0a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDocumentHandlerImpl.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Stack;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.e4.ui.css.core.dom.CSSProperty;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSImportRuleImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSPageRuleImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSPropertyImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSRuleListImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSStyleDeclarationImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSStyleRuleImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSStyleSheetImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSUnknownRuleImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.CSSValueFactory;
-import org.eclipse.e4.ui.css.core.impl.dom.MediaListImpl;
-import org.eclipse.e4.ui.css.core.sac.ExtendedDocumentHandler;
-import org.w3c.css.sac.CSSException;
-import org.w3c.css.sac.InputSource;
-import org.w3c.css.sac.LexicalUnit;
-import org.w3c.css.sac.SACMediaList;
-import org.w3c.css.sac.SelectorList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-
-/**
- * This class provides an implementation for the
- * {@link org.eclipse.ui.css.core.sac.ExtendedDocumentHandler} interface.
- */
-public class CSSDocumentHandlerImpl implements ExtendedDocumentHandler {
-
- private static Log logger = LogFactory.getLog(CSSDocumentHandlerImpl.class);
-
- private Stack nodeStack;
- private Object nodeRoot = null;
-
- private CSSStyleSheet parentStyleSheet;
-
- private boolean ignore;
-
- public CSSDocumentHandlerImpl() {
- }
-
- public Object getRoot() {
- return nodeRoot;
- }
-
- public void startDocument(InputSource source) throws CSSException {
- if (getNodeStack().empty()) {
- CSSStyleSheetImpl styleSheet = new CSSStyleSheetImpl();
- parentStyleSheet = styleSheet;
-
- // Create the rule list
- CSSRuleListImpl rules = new CSSRuleListImpl();
- styleSheet.setRuleList(rules);
- getNodeStack().push(styleSheet);
- getNodeStack().push(rules);
- } else {
- // Error
- }
- }
-
- public void endDocument(InputSource source) throws CSSException {
-
- // Pop the rule list and style sheet nodes
- getNodeStack().pop();
- nodeRoot = getNodeStack().pop();
- }
-
- public void comment(String text) throws CSSException {
- }
-
- public void ignorableAtRule(String atRule) throws CSSException {
-
- // Create the unknown rule and add it to the rule list
- CSSUnknownRuleImpl ir = new CSSUnknownRuleImpl(parentStyleSheet, null,
- atRule);
- if (!getNodeStack().empty()) {
- ((CSSRuleListImpl) getNodeStack().peek()).add(ir);
- } else {
- // _getNodeStack().push(ir);
- nodeRoot = ir;
- }
- }
-
- public void namespaceDeclaration(String prefix, String uri)
- throws CSSException {
- if (logger.isDebugEnabled()) {
- logger.debug("Declare namespace [prefix=" + prefix + ", uri=" + uri
- + "]");
- }
- }
-
- public void importStyle(String uri, SACMediaList media,
- String defaultNamespaceURI) throws CSSException {
-
- // Create the import rule and add it to the rule list
- CSSImportRuleImpl ir = new CSSImportRuleImpl(parentStyleSheet, null,
- uri, new MediaListImpl(media));
- if (!getNodeStack().empty()) {
- ((CSSRuleListImpl) getNodeStack().peek()).add(ir);
- } else {
- // _getNodeStack().push(ir);
- nodeRoot = ir;
- }
- }
-
- public void startMedia(SACMediaList media) throws CSSException {
-
- ignore = true;
-// // Create the media rule and add it to the rule list
-// CSSMediaRuleImpl mr = new CSSMediaRuleImpl(parentStyleSheet, null,
-// new MediaListImpl(media));
-// if (!getNodeStack().empty()) {
-// ((CSSRuleListImpl) getNodeStack().peek()).add(mr);
-// }
-//
-// // Create the rule list
-// CSSRuleListImpl rules = new CSSRuleListImpl();
-// mr.setRuleList(rules);
-// getNodeStack().push(mr);
-// getNodeStack().push(rules);
- }
-
- public void endMedia(SACMediaList media) throws CSSException {
-
- ignore = false;
-// // Pop the rule list and media rule nodes
-// getNodeStack().pop();
-// nodeRoot = getNodeStack().pop();
- }
-
- public void startPage(String name, String pseudo_page) throws CSSException {
-
- // // Create the page rule and add it to the rule list
- CSSPageRuleImpl pageRule = new CSSPageRuleImpl(parentStyleSheet, null,
- name, pseudo_page);
- if (!getNodeStack().empty()) {
- ((CSSRuleListImpl) getNodeStack().peek()).add(pageRule);
- }
-
- // Create the style declaration
- CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(pageRule);
- pageRule.setStyle(decl);
- getNodeStack().push(pageRule);
- getNodeStack().push(decl);
- }
-
- public void endPage(String name, String pseudo_page) throws CSSException {
-
- // Pop both the style declaration and the page rule nodes
- getNodeStack().pop();
- nodeRoot = getNodeStack().pop();
- }
-
- public void startFontFace() throws CSSException {
- ignore = true;
-// // Create the font face rule and add it to the rule list
-// CSSFontFaceRuleImpl fontFaceRule = new CSSFontFaceRuleImpl(
-// parentStyleSheet, null);
-// if (!getNodeStack().empty()) {
-// ((CSSRuleListImpl) getNodeStack().peek()).add(fontFaceRule);
-// }
-//
-// // Create the style declaration
-// CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(fontFaceRule);
-// fontFaceRule.setStyle(decl);
-// getNodeStack().push(fontFaceRule);
-// getNodeStack().push(decl);
- }
-
- public void endFontFace() throws CSSException {
- ignore = false;
-// // Pop both the style declaration and the font face rule nodes
-// getNodeStack().pop();
-// nodeRoot = getNodeStack().pop();
- }
-
- public void startSelector(SelectorList selectors) throws CSSException {
-
- // Create the style rule and add it to the rule list
- CSSStyleRuleImpl rule = new CSSStyleRuleImpl(parentStyleSheet, null,
- selectors);
- if (!getNodeStack().empty()) {
- ((CSSRuleListImpl) getNodeStack().peek()).add(rule);
- }
-
- // Create the style declaration
- CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(rule);
- rule.setStyle(decl);
- getNodeStack().push(rule);
- getNodeStack().push(decl);
- }
-
- public void endSelector(SelectorList selectors) throws CSSException {
-
- // Pop both the style declaration and the style rule nodes
- getNodeStack().pop();
- nodeRoot = getNodeStack().pop();
- }
-
- public void property(String name, LexicalUnit value, boolean important)
- throws CSSException {
- if (!ignore) {
- CSSStyleDeclarationImpl decl = (CSSStyleDeclarationImpl) getNodeStack()
- .peek();
- decl.addProperty(getCSSProperty(decl, name, value, important));
- }
- }
-
- protected CSSProperty getCSSProperty(CSSStyleDeclaration styleDeclaration,
- String name, LexicalUnit value, boolean important) {
- return new CSSPropertyImpl(name, CSSValueFactory.newValue(value), important);
- }
-
- public Object getNodeRoot() {
- return nodeRoot;
- }
-
- public void setNodeStack(Stack nodeStack) {
- this.nodeStack = nodeStack;
- }
-
- public Stack getNodeStack() {
- if (nodeStack == null)
- nodeStack = new Stack();
- return nodeStack;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSElementSelectorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSElementSelectorImpl.java
deleted file mode 100644
index 9e32ead..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSElementSelectorImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.dom.Element;
-
-/**
- * This class implements the {@link org.w3c.css.sac.ElementSelector} interface.
- */
-public class CSSElementSelectorImpl extends AbstractElementSelector {
-
- /**
- * Creates a new ElementSelector object.
- */
- public CSSElementSelectorImpl(String uri, String name) {
- super(uri, name);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Selector#getSelectorType()}.
- */
- public short getSelectorType() {
- return SAC_ELEMENT_NODE_SELECTOR;
- }
-
- /**
- * Tests whether this selector matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- String name = getLocalName();
- if (name == null) {
- if (namespaceURI != null)
- return namespaceURI.equals(e.getNamespaceURI());
- else
- return true;
- }
- String eName;
- if (e.getPrefix() == null)
- eName = e.getNodeName();
- else
- eName = e.getLocalName();
- // According to CSS 2 section 5.1 element
- // names in selectors are case-sensitive for XML.
- if (eName.equals(name)) {
- if (namespaceURI != null)
- return namespaceURI.equals(e.getNamespaceURI());
- else
- return true;
- }
- return false;
- // For HTML
- // return eName.equalsIgnoreCase(name);
- }
-
- /**
- * Returns the specificity of this selector.
- */
- public int getSpecificity() {
- return (getLocalName() == null) ? 0 : 1;
- }
-
- /**
- * Returns a representation of the selector.
- */
- public String toString() {
- String name = getLocalName();
- if (name == null) {
- return "*";
- }
- return name;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSIdConditionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSIdConditionImpl.java
deleted file mode 100644
index d128135..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSIdConditionImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.AttributeCondition} interface.
- */
-public class CSSIdConditionImpl extends AbstractAttributeCondition {
-
- /**
- * The id attribute namespace URI.
- */
- protected String namespaceURI;
-
- /**
- * The id attribute local name.
- */
- protected String localName;
-
- /**
- * Creates a new CSSAttributeCondition object.
- */
- public CSSIdConditionImpl(String ns, String ln, String value) {
- super(value);
- namespaceURI = ns;
- localName = ln;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Condition#getConditionType()}.
- */
- public short getConditionType() {
- return SAC_ID_CONDITION;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getNamespaceURI()}.
- */
- public String getNamespaceURI() {
- return namespaceURI;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getLocalName()}.
- */
- public String getLocalName() {
- return localName;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getSpecified()}.
- */
- public boolean getSpecified() {
- return true;
- }
-
- /**
- * Tests whether this condition matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- String id = null;
- if (e instanceof CSSStylableElement) {
- id = ((CSSStylableElement) e).getCSSId();
- } else
- id = e.getAttribute("id");
- if (id == null)
- return false;
- return id.equals(getValue());
- // return super.match(e, pseudoE);
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- attrSet.add(localName);
- }
-
- /**
- * Returns the specificity of this condition.
- */
- public int getSpecificity() {
- return 1 << 16;
- }
-
- /**
- * Returns a text representation of this object.
- */
- public String toString() {
- return '#' + getValue();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSLangConditionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSLangConditionImpl.java
deleted file mode 100644
index 9d7b938..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSLangConditionImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.LangCondition;
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.LangCondition} interface.
- */
-public class CSSLangConditionImpl
- implements LangCondition,
- ExtendedCondition {
- /**
- * The language.
- */
- protected String lang;
-
- /**
- * The language with a hyphen suffixed.
- */
- protected String langHyphen;
-
- /**
- * Creates a new LangCondition object.
- */
- public CSSLangConditionImpl(String lang) {
- this.lang = lang.toLowerCase();
- this.langHyphen = lang + '-';
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- * @param obj the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (obj == null || (obj.getClass() != getClass())) {
- return false;
- }
- CSSLangConditionImpl c = (CSSLangConditionImpl)obj;
- return c.lang.equals(lang);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Condition#getConditionType()}.
- */
- public short getConditionType() {
- return SAC_LANG_CONDITION;
- }
-
- /**
- * <b>SAC</b>: Implements {@link org.w3c.css.sac.LangCondition#getLang()}.
- */
- public String getLang() {
- return lang;
- }
-
- /**
- * Returns the specificity of this condition.
- */
- public int getSpecificity() {
- return 1 << 8;
- }
-
- /**
- * Tests whether this condition matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- String s = e.getAttribute("lang").toLowerCase();
- if (s.equals(lang) || s.startsWith(langHyphen)) {
- return true;
- }
-// s = e.getAttributeNS(XMLConstants.XML_NAMESPACE_URI,
-// XMLConstants.XML_LANG_ATTRIBUTE).toLowerCase();
- return s.equals(lang) || s.startsWith(langHyphen);
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- attrSet.add("lang");
- }
-
- /**
- * Returns a text representation of this object.
- */
- public String toString() {
- return ":lang(" + lang + ')';
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSOneOfAttributeConditionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSOneOfAttributeConditionImpl.java
deleted file mode 100644
index bd8ea76..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSOneOfAttributeConditionImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.AttributeCondition} interface.
- */
-public class CSSOneOfAttributeConditionImpl extends CSSAttributeConditionImpl {
- /**
- * Creates a new CSSAttributeCondition object.
- */
- public CSSOneOfAttributeConditionImpl(String localName,
- String namespaceURI, boolean specified, String value) {
- super(localName, namespaceURI, specified, value);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Condition#getConditionType()}.
- */
- public short getConditionType() {
- return SAC_ONE_OF_ATTRIBUTE_CONDITION;
- }
-
- /**
- * Tests whether this condition matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- String attr = e.getAttribute(getLocalName());
- String val = getValue();
- int i = attr.indexOf(val);
- if (i == -1) {
- return false;
- }
- if (i != 0 && !Character.isSpaceChar(attr.charAt(i - 1))) {
- return false;
- }
- int j = i + val.length();
- return (j == attr.length() || (j < attr.length() && Character
- .isSpaceChar(attr.charAt(j))));
- }
-
- /**
- * Returns a text representation of this object.
- */
- public String toString() {
- return "[" + getLocalName() + "~=\"" + getValue() + "\"]";
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSPseudoClassConditionImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSPseudoClassConditionImpl.java
deleted file mode 100644
index 66568cf..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSPseudoClassConditionImpl.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.w3c.dom.Element;
-
-/**
- * This class provides an implementation of the
- * {@link org.w3c.css.sac.AttributeCondition} interface.
- */
-public class CSSPseudoClassConditionImpl extends AbstractAttributeCondition {
- /**
- * The namespaceURI.
- */
- protected String namespaceURI;
-
- /**
- * Creates a new CSSAttributeCondition object.
- */
- public CSSPseudoClassConditionImpl(String namespaceURI, String value) {
- super(value);
- this.namespaceURI = namespaceURI;
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- *
- * @param obj
- * the reference object with which to compare.
- */
- public boolean equals(Object obj) {
- if (!super.equals(obj)) {
- return false;
- }
- CSSPseudoClassConditionImpl c = (CSSPseudoClassConditionImpl) obj;
- return c.namespaceURI.equals(namespaceURI);
- }
-
- /**
- * equal objects should have equal hashCodes.
- *
- * @return hashCode of this CSSPseudoClassCondition
- */
- public int hashCode() {
- return namespaceURI.hashCode();
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Condition#getConditionType()}.
- */
- public short getConditionType() {
- return SAC_PSEUDO_CLASS_CONDITION;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getNamespaceURI()}.
- */
- public String getNamespaceURI() {
- return namespaceURI;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getLocalName()}.
- */
- public String getLocalName() {
- return null;
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.AttributeCondition#getSpecified()}.
- */
- public boolean getSpecified() {
- return false;
- }
-
- /**
- * Tests whether this selector matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- if (pseudoE != null && !pseudoE.equals(getValue()))
- // pseudo instance is filled, it is not valid.
- return false;
- if (!(e instanceof CSSStylableElement))
- return false;
- CSSStylableElement element = (CSSStylableElement) e;
- boolean isPseudoInstanceOf = element.isPseudoInstanceOf(getValue());
- if (!isPseudoInstanceOf)
- return false;
- if (pseudoE == null) {
- // pseudo element is not filled.
- // test if this CSSPseudoClassCondition is NOT a static pseudo
- // instance
- return (!element.isStaticPseudoInstance(getValue()));
- }
- return true;
- }
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- public void fillAttributeSet(Set attrSet) {
- }
-
- /**
- * Returns a text representation of this object.
- */
- public String toString() {
- return ":" + getValue();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSPseudoElementSelectorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSPseudoElementSelectorImpl.java
deleted file mode 100644
index 45825e7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSPseudoElementSelectorImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.dom.Element;
-
-/**
- * This class implements the {@link org.w3c.css.sac.ElementSelector} interface.
- */
-public class CSSPseudoElementSelectorImpl extends AbstractElementSelector {
-
- /**
- * Creates a new CSSPseudoElementSelector object.
- */
- public CSSPseudoElementSelectorImpl(String uri, String name) {
- super(uri, name);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.Selector#getSelectorType()}.
- */
- public short getSelectorType() {
- return SAC_PSEUDO_ELEMENT_SELECTOR;
- }
-
- /**
- * Tests whether this selector matches the given element.
- */
- public boolean match(Element e, String pseudoE) {
- return getLocalName().equalsIgnoreCase(pseudoE);
- }
-
- /**
- * Returns the specificity of this selector.
- */
- public int getSpecificity() {
- return 0;
- }
-
- /**
- * Returns a representation of the selector.
- */
- public String toString() {
- return ":" + getLocalName();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSSelectorFactoryImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSSelectorFactoryImpl.java
deleted file mode 100644
index d608a46..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSSelectorFactoryImpl.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.w3c.css.sac.CSSException;
-import org.w3c.css.sac.CharacterDataSelector;
-import org.w3c.css.sac.Condition;
-import org.w3c.css.sac.ConditionalSelector;
-import org.w3c.css.sac.DescendantSelector;
-import org.w3c.css.sac.ElementSelector;
-import org.w3c.css.sac.NegativeSelector;
-import org.w3c.css.sac.ProcessingInstructionSelector;
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SelectorFactory;
-import org.w3c.css.sac.SiblingSelector;
-import org.w3c.css.sac.SimpleSelector;
-
-/**
- * This class implements the {@link org.w3c.css.sac.SelectorFactory} interface.
- */
-public class CSSSelectorFactoryImpl implements SelectorFactory {
-
- /**
- * The instance of this class.
- */
- public static final SelectorFactory INSTANCE = new CSSSelectorFactoryImpl();
-
- /**
- * This class does not need to be instantiated.
- */
- protected CSSSelectorFactoryImpl() {
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * SelectorFactory#createConditionalSelector(SimpleSelector,Condition)}.
- */
- public ConditionalSelector createConditionalSelector(
- SimpleSelector selector, Condition condition) throws CSSException {
- return new CSSConditionalSelectorImpl(selector, condition);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SelectorFactory#createAnyNodeSelector()}.
- */
- public SimpleSelector createAnyNodeSelector() throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SelectorFactory#createRootNodeSelector()}.
- */
- public SimpleSelector createRootNodeSelector() throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SelectorFactory#createNegativeSelector(SimpleSelector)}.
- */
- public NegativeSelector createNegativeSelector(SimpleSelector selector)
- throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SelectorFactory#createElementSelector(String,String)}.
- */
- public ElementSelector createElementSelector(String namespaceURI,
- String tagName) throws CSSException {
- return new CSSElementSelectorImpl(namespaceURI, tagName);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SelectorFactory#createTextNodeSelector(String)}.
- */
- public CharacterDataSelector createTextNodeSelector(String data)
- throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SelectorFactory#createCDataSectionSelector(String)}.
- */
- public CharacterDataSelector createCDataSectionSelector(String data)
- throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * SelectorFactory#createProcessingInstructionSelector(String,String)}.
- */
- public ProcessingInstructionSelector createProcessingInstructionSelector(
- String target, String data) throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * org.w3c.css.sac.SelectorFactory#createCommentSelector(String)}.
- */
- public CharacterDataSelector createCommentSelector(String data)
- throws CSSException {
- throw new CSSException("Not implemented in CSS2");
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * SelectorFactory#createPseudoElementSelector(String,String)}.
- */
- public ElementSelector createPseudoElementSelector(String namespaceURI,
- String pseudoName) throws CSSException {
- return new CSSPseudoElementSelectorImpl(namespaceURI, pseudoName);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * SelectorFactory#createDescendantSelector(Selector,SimpleSelector)}.
- */
- public DescendantSelector createDescendantSelector(Selector parent,
- SimpleSelector descendant) throws CSSException {
- return new CSSDescendantSelectorImpl(parent, descendant);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * SelectorFactory#createChildSelector(Selector,SimpleSelector)}.
- */
- public DescendantSelector createChildSelector(Selector parent,
- SimpleSelector child) throws CSSException {
- return new CSSChildSelectorImpl(parent, child);
- }
-
- /**
- * <b>SAC</b>: Implements {@link
- * SelectorFactory#createDirectAdjacentSelector(short,Selector,SimpleSelector)}.
- */
- public SiblingSelector createDirectAdjacentSelector(short nodeType,
- Selector child, SimpleSelector directAdjacent) throws CSSException {
- return new CSSDirectAdjacentSelectorImpl(nodeType, child,
- directAdjacent);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/DocumentHandlerFactoryImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/DocumentHandlerFactoryImpl.java
deleted file mode 100644
index ec3dfad..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/DocumentHandlerFactoryImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import org.eclipse.e4.ui.css.core.sac.DocumentHandlerFactory;
-import org.eclipse.e4.ui.css.core.sac.ExtendedDocumentHandler;
-
-/**
- * This class implements the
- * {@link org.eclipse.e4.ui.css.core.sac.IDocumentHandlerFactory} interface.
- */
-public class DocumentHandlerFactoryImpl extends DocumentHandlerFactory {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.sac.IDocumentHandlerFactory#makeDocumentHandler()
- */
- public ExtendedDocumentHandler makeDocumentHandler() {
- return new CSSDocumentHandlerImpl();
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/ExtendedCondition.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/ExtendedCondition.java
deleted file mode 100644
index 8412e81..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/ExtendedCondition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.Condition;
-import org.w3c.dom.Element;
-
-/**
- * This interface provides additional features to the
- * {@link org.w3c.css.sac.Condition} interface.
- */
-public interface ExtendedCondition extends Condition {
-
- /**
- * Tests whether this condition matches the given element.
- */
- boolean match(Element e, String pseudoE);
-
- /**
- * Returns the specificity of this condition.
- */
- int getSpecificity();
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- void fillAttributeSet(Set attrSet);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/ExtendedSelector.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/ExtendedSelector.java
deleted file mode 100644
index 62d0fec..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/ExtendedSelector.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-
- Copyright 2002 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-/* This class copied from org.apache.batik.css.engine.sac */
-
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.Set;
-
-import org.w3c.css.sac.Selector;
-import org.w3c.dom.Element;
-
-/**
- * This interface extends the {@link org.w3c.css.sac.Selector}.
- */
-public interface ExtendedSelector extends Selector {
-
- /**
- * Tests whether this selector matches the given element.
- */
- boolean match(Element e, String pseudoE);
-
- /**
- * Returns the specificity of this selector.
- */
- int getSpecificity();
-
- /**
- * Fills the given set with the attribute names found in this selector.
- */
- void fillAttributeSet(Set attrSet);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/SACParserFactoryImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/SACParserFactoryImpl.java
deleted file mode 100644
index 5d05374..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/SACParserFactoryImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.impl.sac;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.SACConstants;
-import org.eclipse.e4.ui.css.core.sac.SACParserFactory;
-import org.w3c.css.sac.Parser;
-
-/**
- * SAC Parser factory implementation. By default, this SAC FActory support
- * Flute, SteadyState and Batik SAC Parser.
- */
-public class SACParserFactoryImpl extends SACParserFactory {
-
- private static Map parsers = new HashMap();
-
- static {
- // Register Flute SAC Parser
- registerSACParser(SACConstants.SACPARSER_FLUTE);
- // Register Flute SAC CSS3Parser
- registerSACParser(SACConstants.SACPARSER_FLUTE_CSS3);
- // Register SteadyState SAC Parser
- registerSACParser(SACConstants.SACPARSER_STEADYSTATE);
- // Register Batik SAC Parser
- registerSACParser(SACConstants.SACPARSER_BATIK);
- }
-
- public SACParserFactoryImpl() {
- // Flute parser is the default SAC Parser to use.
- super.setPreferredParserName(SACConstants.SACPARSER_BATIK);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.sac.SACParserFactory#makeParser(java.lang.String)
- */
- public Parser makeParser(String name) throws ClassNotFoundException,
- IllegalAccessException, InstantiationException,
- NullPointerException, ClassCastException {
- String classNameParser = (String) parsers.get(name);
- if (classNameParser != null) {
- Class classParser = super.getClass().getClassLoader().loadClass(
- classNameParser);
- return (Parser) classParser.newInstance();
- }
- throw new IllegalAccessException("SAC parser with name=" + name
- + " was not registered into SAC parser factory.");
- }
-
- /**
- * Register SAC parser name.
- *
- * @param parser
- */
- public static void registerSACParser(String parser) {
- registerSACParser(parser, parser);
- }
-
- /**
- * register SAC parser with name <code>name</code> mapped with Class name
- * <code>classNameParser</code>.
- *
- * @param name
- * @param classNameParser
- */
- public static void registerSACParser(String name, String classNameParser) {
- parsers.put(name, classNameParser);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/AbstractResourcesRegistry.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/AbstractResourcesRegistry.java
deleted file mode 100644
index 4c8b6c3..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/AbstractResourcesRegistry.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.resources;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Abstract class resources registry which implement basic cache with Map.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractResourcesRegistry implements IResourcesRegistry {
-
- private Map allResourcesMap = null;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.resources.IResourcesRegistry#getResource(java.lang.Object,
- * java.lang.Object)
- */
- public Object getResource(Object type, Object key) {
- if (allResourcesMap == null)
- return null;
- Map resourcesMap = (Map) allResourcesMap.get(type);
- if (resourcesMap == null)
- return null;
- return resourcesMap.get(key);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.resources.IResourcesRegistry#registerResource(java.lang.Object,
- * java.lang.Object, java.lang.Object)
- */
- public void registerResource(Object type, Object key, Object resource) {
- if (allResourcesMap == null)
- allResourcesMap = new HashMap();
- Map resourcesMap = (Map) allResourcesMap.get(type);
- if (resourcesMap == null) {
- resourcesMap = new HashMap();
- allResourcesMap.put(type, resourcesMap);
- }
- resourcesMap.put(key, resource);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.resources.IResourcesRegistry#unregisterResource(java.lang.Object,
- * java.lang.Object)
- */
- public void unregisterResource(Object type, Object key) {
- if (allResourcesMap == null)
- return;
- Map resourcesMap = (Map) allResourcesMap.get(type);
- if (resourcesMap == null)
- return;
- Object resource = resourcesMap.get(key);
- if (resource != null)
- resourcesMap.remove(resource);
- }
-
- public void unregisterResource(Object resource) {
- Object type = getResourceType(resource);
- if (type != null) {
- Map resourcesMap = (Map) allResourcesMap.get(type);
- if (resourcesMap != null) {
- resourcesMap.remove(resource);
- }
- }
- }
-
- public Object getResourceType(Object resource) {
- return resource.getClass();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.resources.IResourcesRegistry#dispose()
- */
- public void dispose() {
- if (allResourcesMap == null)
- return;
- // Loop for all resources stored into cache
- Set allResources = allResourcesMap.entrySet();
- for (Iterator iterator = allResources.iterator(); iterator.hasNext();) {
- Map.Entry entry = (Map.Entry) iterator.next();
- Object type = entry.getKey();
- Map resourcesMap = (Map) entry.getValue();
- Set resources = resourcesMap.entrySet();
- for (Iterator iterator2 = resources.iterator(); iterator2.hasNext();) {
- Map.Entry entry2 = (Map.Entry) iterator2.next();
- // Dispose the current resource.
- disposeResource(type, (String) entry2.getKey(), entry2
- .getValue());
- }
- }
- allResourcesMap = null;
- }
-
- public abstract void disposeResource(Object type, String key,
- Object resource);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/CSSResourcesHelpers.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/CSSResourcesHelpers.java
deleted file mode 100644
index bcb66d6..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/CSSResourcesHelpers.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.resources;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.RGBColor;
-
-/**
- * CSS Resources Helper to manage {@link IResourcesRegistry}.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSResourcesHelpers {
-
- public static String getCSSValueKey(CSSValue value) {
- if (value instanceof CSS2FontProperties)
- return getCSSFontPropertiesKey((CSS2FontProperties) value);
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)
- return getCSSPrimitiveValueKey((CSSPrimitiveValue) value);
- return null;
- }
-
- /**
- * Return the key of the CSSPrimitiveValue <code>value</code> which is
- * used to cache Resource into {@link IResourcesRegistry}.
- *
- * @param value
- * @return
- */
- public static String getCSSPrimitiveValueKey(CSSPrimitiveValue value) {
- switch (value.getPrimitiveType()) {
- case CSSPrimitiveValue.CSS_IDENT:
- case CSSPrimitiveValue.CSS_URI:
- String s = value.getStringValue();
- // Test if s is Color Name
- if (CSS2ColorHelper.isColorName(s)) {
- RGBColor rgbColor = CSS2ColorHelper.getRGBColor(s);
- if (rgbColor != null) {
- return getCSSRGBColorKey(rgbColor);
- }
- }
- return value.getStringValue();
- case CSSPrimitiveValue.CSS_RGBCOLOR:
- RGBColor rgbColor = value.getRGBColorValue();
- return getCSSRGBColorKey(rgbColor);
- }
- return null;
- }
-
- public static String getCSSRGBColorKey(RGBColor rgbColor) {
- if (rgbColor == null)
- return null;
- String rgb = ((int) rgbColor.getGreen().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER))
- + "_";
- rgb += ((int) rgbColor.getRed().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER))
- + "_";
- rgb += ((int) rgbColor.getBlue().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER))
- + "";
- return rgb;
- }
-
- public static String getCSSFontPropertiesKey(
- CSS2FontProperties fontProperties) {
- return fontProperties.getFamily() + "_" + fontProperties.getSize()
- + "_" + fontProperties.getStyle() + "_"
- + fontProperties.getWeight();
- }
-
- /**
- * Return the resource type of <code>type</code> cached into
- * <code>resourcesRegistry</code> with CSSPrimitiveValue
- * <code>value</code> key.
- *
- * @param resourcesRegistry
- * @param type
- * @param value
- * @return
- */
- public static Object getResource(IResourcesRegistry resourcesRegistry,
- Object type, CSSPrimitiveValue value) {
- String key = getCSSPrimitiveValueKey(value);
- return getResource(resourcesRegistry, type, key);
- }
-
- /**
- * Return the resource type of <code>type</code> cached into
- * <code>resourcesRegistry</code> with key <code>key</code>.
- *
- * @param resourcesRegistry
- * @param type
- * @param key
- * @return
- */
- public static Object getResource(IResourcesRegistry resourcesRegistry,
- Object type, String key) {
- if (key == null)
- return null;
- if (resourcesRegistry != null)
- return resourcesRegistry.getResource(type, key);
- return null;
- }
-
- /**
- * Register the <code>resource</code> type of <code>type</code> into
- * <code>resourcesRegistry</code> with CSSPrimitiveValue
- * <code>value</code> key.
- *
- * @param resourcesRegistry
- * @param type
- * @param value
- * @param resource
- */
- public static void registerResource(IResourcesRegistry resourcesRegistry,
- Object type, CSSPrimitiveValue value, Object resource) {
- if (resourcesRegistry != null) {
- String key = getCSSPrimitiveValueKey(value);
- if (key != null)
- resourcesRegistry.registerResource(type, key, resource);
- }
- }
-
- /**
- * Register the <code>resource</code> type of <code>type</code> into
- * <code>resourcesRegistry</code> with <code>key</code>.
- *
- * @param resourcesRegistry
- * @param type
- * @param key
- * @param resource
- */
- public static void registerResource(IResourcesRegistry resourcesRegistry,
- Object type, String key, Object resource) {
- if (key == null)
- return;
- if (resourcesRegistry != null) {
- resourcesRegistry.registerResource(type, key, resource);
- }
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/IResourcesRegistry.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/IResourcesRegistry.java
deleted file mode 100644
index 67f647f..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/resources/IResourcesRegistry.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.resources;
-
-/**
- * Interface Resources Registry to cache Resources and dispose it if need.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public interface IResourcesRegistry {
-
- /**
- * Return resource type of <code>type</code> stored into cache with
- * <code>key</code>.
- *
- * @param type
- * Resource type like Font, Color, Cursor, Image
- * @param key
- * @return
- */
- public Object getResource(Object type, Object key);
-
- /**
- * Register into cache the resource <code>resource</code> type of
- * <code>type</code> with key <code>key</code>.
- *
- * @param type
- * Resource type like Font, Color, Cursor, Image
- * @param key
- * @param resource
- */
- public void registerResource(Object type, Object key, Object resource);
-
- /**
- * Unregister from cache the resource <code>resource</code> type of
- * <code>type</code> with key <code>key</code>.
- *
- * @param type
- * @param key
- */
- public void unregisterResource(Object type, Object key);
-
- /**
- * Dispose all resources stored into cache.
- */
- public void dispose();
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/DocumentHandlerFactory.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/DocumentHandlerFactory.java
deleted file mode 100644
index 34862b7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/DocumentHandlerFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.sac;
-
-import org.eclipse.e4.ui.css.core.impl.sac.DocumentHandlerFactoryImpl;
-
-/**
- * Factory to get instance of {@link DocumentHandlerFactory}.
- */
-public abstract class DocumentHandlerFactory implements IDocumentHandlerFactory {
-
- /**
- * Return instance of {@link DocumentHandlerFactory}.
- *
- * @return
- */
- public static DocumentHandlerFactory newInstance() {
- return new DocumentHandlerFactoryImpl();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ExtendedDocumentHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ExtendedDocumentHandler.java
deleted file mode 100644
index 70e461f..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ExtendedDocumentHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.sac;
-
-import java.util.Stack;
-
-import org.w3c.css.sac.DocumentHandler;
-
-/**
- * Extends {@link DocumentHandler} to get the root node.
- */
-public interface ExtendedDocumentHandler extends DocumentHandler {
-
- /**
- * Return root node.
- *
- * @return
- */
- public Object getNodeRoot();
-
- /**
- * Set node stack.
- *
- * @param statck
- */
- public void setNodeStack(Stack statck);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/IDocumentHandlerFactory.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/IDocumentHandlerFactory.java
deleted file mode 100644
index 588ae21..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/IDocumentHandlerFactory.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.sac;
-
-/**
- * Factory interface to get instance of {@link ExtendedDocumentHandler}.
- */
-public interface IDocumentHandlerFactory {
-
- /**
- * Return default instance of {@link ExtendedDocumentHandler}.
- *
- * @return
- */
- public ExtendedDocumentHandler makeDocumentHandler();
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ISACParserFactory.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ISACParserFactory.java
deleted file mode 100644
index c55bee0..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ISACParserFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.sac;
-
-import org.w3c.css.sac.Parser;
-
-/**
- * SAC parser factory interface to get instance of SAC {@link Parser}.
- */
-public interface ISACParserFactory {
-
- /**
- * Return default instance of SAC Parser. If preferredParserName is filled,
- * it return the instance of SAC Parser registered with this name, otherwise
- * this method search teh SAC Parser class name to instanciate into System
- * property with key org.w3c.css.sac.parser.
- */
- public Parser makeParser() throws ClassNotFoundException,
- IllegalAccessException, InstantiationException,
- NullPointerException, ClassCastException;
-
- /**
- * Return instance of SAC Parser registered into the factory with name
- * <code>name</code>.
- *
- * @param name
- * @return
- * @throws ClassNotFoundException
- * @throws IllegalAccessException
- * @throws InstantiationException
- * @throws NullPointerException
- * @throws ClassCastException
- */
- public abstract Parser makeParser(String name)
- throws ClassNotFoundException, IllegalAccessException,
- InstantiationException, NullPointerException, ClassCastException;;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ParserNotFoundException.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ParserNotFoundException.java
deleted file mode 100644
index 7de0c20..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/ParserNotFoundException.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.sac;
-
-/**
- * Exception used when SAC parser is not retrieved.
- */
-public class ParserNotFoundException extends RuntimeException {
-
- public ParserNotFoundException(Throwable throwable) {
- super(throwable);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/SACParserFactory.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/SACParserFactory.java
deleted file mode 100644
index ccd0735..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/sac/SACParserFactory.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.sac;
-
-import org.eclipse.e4.ui.css.core.impl.sac.SACParserFactoryImpl;
-import org.w3c.css.sac.Parser;
-import org.w3c.css.sac.helpers.ParserFactory;
-
-/**
- * SAC Parser Factory.
- */
-public abstract class SACParserFactory extends ParserFactory implements
- ISACParserFactory {
-
- private String preferredParserName;
-
- /**
- * Return default instance of SAC Parser. If preferredParserName is filled,
- * it return the instance of SAC Parser registered with this name, otherwise
- * this method search teh SAC Parser class name to instanciate into System
- * property with key org.w3c.css.sac.parser.
- */
- public Parser makeParser() throws ClassNotFoundException,
- IllegalAccessException, InstantiationException,
- NullPointerException, ClassCastException {
- if (preferredParserName != null)
- return makeParser(preferredParserName);
- return super.makeParser();
- }
-
- /**
- * Return preferred SAC parser name if it is filled and null otherwise.
- *
- * @return
- */
- public String getPreferredParserName() {
- return preferredParserName;
- }
-
- /**
- * Set the preferred SAC parser name to use when makeParser is called.
- *
- * @param preferredParserName
- */
- public void setPreferredParserName(String preferredParserName) {
- this.preferredParserName = preferredParserName;
- }
-
- /**
- * Return instance of SACParserFactory
- *
- * @return
- */
- public static ISACParserFactory newInstance() {
- // TODO : manage new instance of SAC Parser Factory like
- // SAXParserFactory.
- return new SACParserFactoryImpl();
- }
-
- /**
- * Return instance of SAC Parser registered into the factory with name
- * <code>name</code>.
- *
- * @param name
- * @return
- * @throws ClassNotFoundException
- * @throws IllegalAccessException
- * @throws InstantiationException
- * @throws NullPointerException
- * @throws ClassCastException
- */
- public abstract Parser makeParser(String name)
- throws ClassNotFoundException, IllegalAccessException,
- InstantiationException, NullPointerException, ClassCastException;
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSHTMLSerializerConfiguration.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSHTMLSerializerConfiguration.java
deleted file mode 100644
index 02ad022..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSHTMLSerializerConfiguration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.serializers;
-
-/**
- * CSS HTML Serializer configuration used by {@link CSSSerializer} to filter the
- * attribute type of the HTML widget like input[type='text'].
- */
-public class CSSHTMLSerializerConfiguration extends CSSSerializerConfiguration {
-
- public static final CSSSerializerConfiguration INSTANCE = new CSSHTMLSerializerConfiguration();
-
- public CSSHTMLSerializerConfiguration() {
- super.addAttributeFilter("type");
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java
deleted file mode 100644
index b5e9cd0..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.serializers;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * CSS Serializer to retrieve default CSSStyleDeclaration of the SWT Widgets.
- */
-
-public class CSSSerializer {
-
- public CSSSerializer() {
-
- }
-
- /**
- * Build CSS Style Sheet content of the <code>element</code> Object by
- * using {@link CSSEngine} engine configuration. The serialization result is
- * stored into the <code>writer</code>. If
- * <code>serializeChildNodes</code> is true, the method will serialize too
- * the child nodes of the <code>element</code>.
- *
- * @param writer
- * @param engine
- * @param element
- * @param serializeChildNodes
- * @throws IOException
- */
- public void serialize(Writer writer, CSSEngine engine, Object element,
- boolean serializeChildNodes) throws IOException {
- serialize(writer, engine, element, serializeChildNodes, null);
- }
-
- /**
- * Build CSS Style Sheet content of the <code>element</code> Object by
- * using {@link CSSEngine} engine configuration. The serialization result is
- * stored into the <code>writer</code>. If
- * <code>serializeChildNodes</code> is true, the method will serialize too
- * the child nodes of the <code>element</code>. The
- * {@link CSSSerializerConfiguration} <code>configuration</code> is used
- * to generate selector with condition like Text[style='SWT.MULTI'].
- *
- * @param writer
- * @param engine
- * @param element
- * @param serializeChildNodes
- * @param configuration
- * @throws IOException
- */
- public void serialize(Writer writer, CSSEngine engine, Object element,
- boolean serializeChildNodes,
- CSSSerializerConfiguration configuration) throws IOException {
- Map selectors = new HashMap();
- serialize(writer, engine, element, serializeChildNodes, selectors,
- configuration);
- boolean firstSelector = true;
- for (Iterator iterator = selectors.entrySet().iterator(); iterator
- .hasNext();) {
- Map.Entry entry = (Map.Entry) iterator.next();
- String selectorName = (String) entry.getKey();
- CSSStyleDeclaration styleDeclaration = (CSSStyleDeclaration) entry
- .getValue();
- if (styleDeclaration != null) {
- int length = styleDeclaration.getLength();
- // Start selector
- startSelector(writer, selectorName, firstSelector);
- firstSelector = false;
- for (int i = 0; i < length; i++) {
- String propertyName = styleDeclaration.item(i);
- String propertyValue = styleDeclaration
- .getPropertyValue(propertyName);
- property(writer, propertyName, propertyValue);
- }
- // End selector
- endSelector(writer, selectorName);
- }
- }
- }
-
- /**
- * Build CSS Style Sheet content of the <code>element</code> Object by
- * using {@link CSSEngine} engine configuration. The serialization result is
- * stored into the <code>writer</code>. If
- * <code>serializeChildNodes</code> is true, the method will serialize too
- * the child nodes of the <code>element</code>. The
- * {@link CSSSerializerConfiguration} <code>configuration</code> is used
- * to generate selector with condition like Text[style='SWT.MULTI'].
- *
- * Map of <code>selectors</code> contains the selector already built.
- *
- * @param writer
- * @param engine
- * @param element
- * @param serializeChildNodes
- * @param selectors
- * @param configuration
- * @throws IOException
- */
- protected void serialize(Writer writer, CSSEngine engine, Object element,
- boolean serializeChildNodes, Map selectors,
- CSSSerializerConfiguration configuration) throws IOException {
- Element elt = engine.getElement(element);
- if (elt != null) {
- String selectorName = elt.getLocalName();
- CSSStyleDeclaration styleDeclaration = engine
- .getDefaultStyleDeclaration(element, null);
-
- if (configuration != null) {
- String[] attributesFilter = configuration.getAttributesFilter();
- for (int i = 0; i < attributesFilter.length; i++) {
- String attributeFilter = attributesFilter[i];
- String value = elt.getAttribute(attributeFilter);
- if (value != null && value.length() > 0) {
- if (value.indexOf(".") != -1) {
- value = "'" + value + "'";
- }
- selectorName += "[" + attributeFilter + "=" + value
- + "]";
- break;
- }
- }
- }
-
- selectors.put(selectorName, styleDeclaration);
- if (serializeChildNodes) {
- NodeList nodes = elt.getChildNodes();
- if (nodes != null) {
- for (int k = 0; k < nodes.getLength(); k++) {
- serialize(writer, engine, nodes.item(k),
- serializeChildNodes, selectors, configuration);
- }
- }
- }
- }
- }
-
- /**
- * Generate start selector.
- *
- * @param writer
- * @param selectorName
- * @param firstSelector
- * @throws IOException
- */
- protected void startSelector(Writer writer, String selectorName,
- boolean firstSelector) throws IOException {
- if (firstSelector == false)
- writer.write("\n\n");
- writer.write(selectorName + " {");
- }
-
- /**
- * Generate end selector.
- *
- * @param writer
- * @param selectorName
- * @throws IOException
- */
- protected void endSelector(Writer writer, String selectorName)
- throws IOException {
- writer.write("\n}");
- }
-
- /**
- * Generate CSS Property.
- *
- * @param writer
- * @param propertyName
- * @param propertyValue
- * @throws IOException
- */
- private void property(Writer writer, String propertyName,
- String propertyValue) throws IOException {
- writer.write("\n\t" + propertyName + ":" + propertyValue + ";");
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializerConfiguration.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializerConfiguration.java
deleted file mode 100644
index 291914e..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializerConfiguration.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.serializers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * CSS Serializer configuration used by {@link CSSSerializer} to filter the
- * attribute of the widget like Text[style='SWT.MULTI'].
- */
-public class CSSSerializerConfiguration {
-
- private static final String[] EMPTY_STRING = new String[0];
-
- private List attributesFilter = null;
-
- /**
- * Add attribute name <code>attributeName</code> to filter.
- *
- * @param attributeName
- */
- public void addAttributeFilter(String attributeName) {
- if (attributesFilter == null)
- attributesFilter = new ArrayList();
- attributesFilter.add(attributeName);
- }
-
- /**
- * Return list of attribute name to filter.
- *
- * @return
- */
- public String[] getAttributesFilter() {
- if (attributesFilter != null)
- return (String[]) attributesFilter.toArray(EMPTY_STRING);
- return EMPTY_STRING;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/FileResourcesLocatorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/FileResourcesLocatorImpl.java
deleted file mode 100644
index 4ad5288..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/FileResourcesLocatorImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.util.impl.resources;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.e4.ui.css.core.util.resources.IResourceLocator;
-
-/**
- * Basic File resources locator implementation.
- */
-public class FileResourcesLocatorImpl implements IResourceLocator {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IURIResolver#resolve(java.lang.String)
- */
- public String resolve(String uri) {
- return uri;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IResourceLocator#getInputStream(java.lang.String)
- */
- public InputStream getInputStream(String uri) throws Exception {
- return new FileInputStream(new File(uri));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IResourceLocator#getReader(java.lang.String)
- */
- public Reader getReader(String uri) throws Exception {
- return new FileReader(new File(uri));
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/HttpResourcesLocatorImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/HttpResourcesLocatorImpl.java
deleted file mode 100644
index 65cccbf..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/HttpResourcesLocatorImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.util.impl.resources;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-
-import org.eclipse.e4.ui.css.core.util.resources.IResourceLocator;
-
-/**
- * Http resources locator implementation.
- */
-public class HttpResourcesLocatorImpl implements IResourceLocator {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IURIResolver#resolve(java.lang.String)
- */
- public String resolve(String uri) {
- if (uri.startsWith("http"))
- return uri;
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IResourceLocator#getInputStream(java.lang.String)
- */
- public InputStream getInputStream(String uri) throws Exception {
- URL url = new java.net.URL((new File("./")).toURL(), uri);
- return url.openStream();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IResourceLocator#getReader(java.lang.String)
- */
- public Reader getReader(String uri) throws Exception {
- // TODO
- return null;// new FileReader(new File(uri));
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/ResourcesLocatorManager.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/ResourcesLocatorManager.java
deleted file mode 100644
index af464a7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/impl/resources/ResourcesLocatorManager.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.util.impl.resources;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.e4.ui.css.core.util.resources.IResourceLocator;
-import org.eclipse.e4.ui.css.core.util.resources.IResourcesLocatorManager;
-import org.eclipse.e4.ui.css.core.utils.StringUtils;
-
-/**
- * Resources locator manager implementation.
- */
-public class ResourcesLocatorManager implements IResourcesLocatorManager {
-
- /**
- * ResourcesLocatorManager Singleton
- */
- public static final IResourcesLocatorManager INSTANCE = new ResourcesLocatorManager();
-
- /**
- * List of IResourceLocator instance which was registered.
- */
- private List uriResolvers = null;
-
- public ResourcesLocatorManager() {
- registerResourceLocator(new HttpResourcesLocatorImpl());
- registerResourceLocator(new FileResourcesLocatorImpl());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IResourcesLocatorManager#registerResourceLocator(org.eclipse.e4.ui.css.core.util.resources.IResourceLocator)
- */
- public void registerResourceLocator(IResourceLocator resourceLocator) {
- if (uriResolvers == null)
- uriResolvers = new ArrayList();
- uriResolvers.add(resourceLocator);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IResourcesLocatorManager#unregisterResourceLocator(org.eclipse.e4.ui.css.core.util.resources.IResourceLocator)
- */
- public void unregisterResourceLocator(IResourceLocator resourceLocator) {
- if (uriResolvers == null)
- return;
- uriResolvers.remove(resourceLocator);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.util.resources.IURIResolver#resolve(java.lang.String)
- */
- public String resolve(String uri) {
- if (StringUtils.isEmpty(uri))
- return null;
- if (uriResolvers == null)
- return null;
- // Loop for IResourceLocator registered and return the uri resolved
- // as soon as an IResourceLocator return an uri resolved which is not
- // null.
- for (Iterator iterator = uriResolvers.iterator(); iterator.hasNext();) {
- IResourceLocator resolver = (IResourceLocator) iterator.next();
- String s = resolver.resolve(uri);
- if (s != null)
- return s;
- }
- return null;
- }
-
- public InputStream getInputStream(String uri) throws Exception {
- if (StringUtils.isEmpty(uri))
- return null;
- if (uriResolvers == null)
- return null;
- // Loop for IResourceLocator registered and return the InputStream from
- // the uri resolved
- // as soon as an IResourceLocator return an uri resolved which is not
- // null.
- for (Iterator iterator = uriResolvers.iterator(); iterator.hasNext();) {
- IResourceLocator resolver = (IResourceLocator) iterator.next();
- String s = resolver.resolve(uri);
- if (s != null) {
- InputStream inputStream = resolver.getInputStream(uri);
- if (inputStream != null)
- return inputStream;
- }
- }
- return null;
- }
-
- public Reader getReader(String uri) throws Exception {
- if (StringUtils.isEmpty(uri))
- return null;
- if (uriResolvers == null)
- return null;
- // Loop for IResourceLocator registered and return the Reader from
- // the uri resolved
- // as soon as an IResourceLocator return an uri resolved which is not
- // null.
- for (Iterator iterator = uriResolvers.iterator(); iterator.hasNext();) {
- IResourceLocator resolver = (IResourceLocator) iterator.next();
- String s = resolver.resolve(uri);
- if (s != null) {
- Reader reader = resolver.getReader(uri);
- if (reader != null)
- return reader;
- }
- }
-
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IResourceLocator.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IResourceLocator.java
deleted file mode 100644
index 393098a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IResourceLocator.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.util.resources;
-
-import java.io.InputStream;
-import java.io.Reader;
-
-/**
- * Resources locator to get {@link InputStream} or {@link Reader} from an URI.
- */
-public interface IResourceLocator extends IURIResolver {
-
- /**
- * Return {@link InputStream} from the <code>uri</code>.
- *
- * @param uri
- * @return
- * @throws Exception
- */
- public InputStream getInputStream(String uri) throws Exception;
-
- /**
- * Return {@link Reader} from the <code>uri</code>.
- *
- * @param uri
- * @return
- * @throws Exception
- */
- public Reader getReader(String uri) throws Exception;
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IResourcesLocatorManager.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IResourcesLocatorManager.java
deleted file mode 100644
index cef0fb7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IResourcesLocatorManager.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.util.resources;
-
-/**
- * Resources locator manage to register/unregister {@link IResourceLocator}.
- */
-public interface IResourcesLocatorManager extends IResourceLocator {
-
- /**
- * Register <code>resourceLocator</code>.
- *
- * @param resourceLocator
- */
- public void registerResourceLocator(IResourceLocator resourceLocator);
-
- /**
- * Unregister <code>resourceLocator</code>.
- *
- * @param resourceLocator
- */
- public void unregisterResourceLocator(IResourceLocator resourceLocator);
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IURIResolver.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IURIResolver.java
deleted file mode 100644
index 346aec5..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/util/resources/IURIResolver.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.util.resources;
-
-/**
- * Interface URI resolver to resolve URI.
- */
-public interface IURIResolver {
-
- /**
- * Return the uri resolved.
- *
- * @param uri
- * @return
- */
- public String resolve(String uri);
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/ClassUtils.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/ClassUtils.java
deleted file mode 100644
index bc9c346..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/ClassUtils.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.utils;
-
-/**
- * Class utils.
- */
-public class ClassUtils {
-
- /**
- * Return the simple name of Class <code>c</code>.
- *
- * @param c
- * @return
- */
- public static String getSimpleName(Class c) {
- String name = c.getName();
- int index = name.lastIndexOf(".");
- if (index > 0) {
- name = name.substring(index + 1, name.length());
- }
- return name;
- }
-
- /**
- * Return the package name of Class <code>c</code>.
- *
- * @param c
- * @return
- */
- public static String getPackageName(Class c) {
- String name = c.getName();
- int index = name.lastIndexOf(".");
- if (index > 0) {
- return name.substring(0, index);
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/NumberUtils.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/NumberUtils.java
deleted file mode 100644
index 2d4c8d2..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/NumberUtils.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.utils;
-
-/**
- * Helper for Number.
- */
-public class NumberUtils {
-
- /**
- * Return true if long <code>x</code> is odd and false otherwise.
- *
- * @param x
- * @return
- */
- public static boolean isOdd(long x) {
- return ((x % 2) == 1);
- }
-
- /**
- * Return true if int <code>x</code> is odd and false otherwise.
- *
- * @param x
- * @return
- */
- public static boolean isOdd(int x) {
- return isOdd((long) x);
- }
-
- /**
- * Return true if short <code>x</code> is odd and false otherwise.
- *
- * @param x
- * @return
- */
- public static boolean isOdd(short x) {
- return isOdd((long) x);
- }
-
- /**
- * Return true if byte <code>x</code> is odd and false otherwise.
- *
- * @param x
- * @return
- */
- public static boolean isOdd(byte x) {
- return isOdd((long) x);
- }
-
- /**
- * Return true if long <code>x</code> is even and false otherwise.
- *
- * @param x
- * @return
- */
- public static boolean isEven(long x) {
- return ((x % 2) == 0);
- }
-
- /**
- * Return true if int <code>x</code> is event and false otherwise.
- *
- * @param x
- * @return
- */
- public static boolean isEven(int x) {
- return isEven((long) x);
- }
-
- /**
- * Return true if short <code>x</code> is even and false otherwise.
- *
- * @param x
- * @return
- */
- public static boolean isEven(short x) {
- return isEven((long) x);
- }
-
- /**
- * Return true if byte <code>x</code> is even and false otherwise.
- *
- * @param x
- * @return
- */
- public static boolean isEven(byte x) {
- return isEven((long) x);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/Platform.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/Platform.java
deleted file mode 100644
index 829c2a5..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/Platform.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.utils;
-
-/**
- * Platform utils.
- */
-public class Platform {
-
- public static boolean isOSX = System.getProperty("os.name").equals(
- "Mac OS X");
-
- public static boolean isJRE13 = System.getProperty("java.version")
- .startsWith("1.3");
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/StringUtils.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/StringUtils.java
deleted file mode 100644
index 0788758..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/utils/StringUtils.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.core.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-/**
- * Helper for String.
- */
-public class StringUtils {
-
- /**
- * Replace <b>oldString</b> occurences with <b>newString</b> occurences of
- * the String <b>line</b> and return the result.
- *
- * @param line
- * @param oldString
- * @param newString
- * @return
- */
- public static final String replace(String line, String oldString,
- String newString) {
- int i = 0;
- if ((i = line.indexOf(oldString, i)) >= 0) {
- char line2[] = line.toCharArray();
- char newString2[] = newString.toCharArray();
- int oLength = oldString.length();
- StringBuffer buf = new StringBuffer(line2.length);
- buf.append(line2, 0, i).append(newString2);
- i += oLength;
- int j;
- for (j = i; (i = line.indexOf(oldString, i)) > 0; j = i) {
- buf.append(line2, j, i - j).append(newString2);
- i += oLength;
- }
-
- buf.append(line2, j, line2.length - j);
- return buf.toString();
- } else {
- return line;
- }
- }
-
- /**
- * Split String <b>line</b> with delimiter <b>delim</b> and return result
- * inti array of String.
- *
- * @param line
- * @param delim
- * @return
- */
- public static String[] split(String line, String delim) {
- List list = new ArrayList();
- for (StringTokenizer t = new StringTokenizer(line, delim); t
- .hasMoreTokens(); list.add(t.nextToken()))
- ;
- return (String[]) list.toArray(new String[list.size()]);
- }
-
- /**
- * Return true if String value is null or empty.
- *
- * @param value
- * @return
- */
- public static boolean isEmpty(String value) {
- return (value == null || value.length() < 1);
- }
-
- // Capitalizing
- // -----------------------------------------------------------------------
- /**
- * <p>
- * Capitalizes all the whitespace separated words in a String. Only the
- * first letter of each word is changed. To convert the rest of each word to
- * lowercase at the same time, use {@link #capitalizeFully(String)}.
- * </p>
- *
- * <p>
- * Whitespace is defined by {@link Character#isWhitespace(char)}. A
- * <code>null</code> input String returns <code>null</code>.
- * Capitalization uses the unicode title case, normally equivalent to upper
- * case.
- * </p>
- *
- * <pre>
- * WordUtils.capitalize(null) = null
- * WordUtils.capitalize("") = ""
- * WordUtils.capitalize("i am FINE") = "I Am FINE"
- * </pre>
- *
- * @param str
- * the String to capitalize, may be null
- * @return capitalized String, <code>null</code> if null String input
- * @see #uncapitalize(String)
- * @see #capitalizeFully(String)
- */
- public static String capitalize(String str) {
- return capitalize(str, null);
- }
-
- /**
- * <p>
- * Capitalizes all the delimiter separated words in a String. Only the first
- * letter of each word is changed. To convert the rest of each word to
- * lowercase at the same time, use {@link #capitalizeFully(String, char[])}.
- * </p>
- *
- * <p>
- * The delimiters represent a set of characters understood to separate
- * words. The first string character and the first non-delimiter character
- * after a delimiter will be capitalized.
- * </p>
- *
- * <p>
- * A <code>null</code> input String returns <code>null</code>.
- * Capitalization uses the unicode title case, normally equivalent to upper
- * case.
- * </p>
- *
- * <pre>
- * WordUtils.capitalize(null, *) = null
- * WordUtils.capitalize("", *) = ""
- * WordUtils.capitalize(*, new char[0]) = *
- * WordUtils.capitalize("i am fine", null) = "I Am Fine"
- * WordUtils.capitalize("i aM.fine", {'.'}) = "I aM.Fine"
- * </pre>
- *
- * @param str
- * the String to capitalize, may be null
- * @param delimiters
- * set of characters to determine capitalization, null means
- * whitespace
- * @return capitalized String, <code>null</code> if null String input
- * @see #uncapitalize(String)
- * @see #capitalizeFully(String)
- * @since 2.1
- */
- public static String capitalize(String str, char[] delimiters) {
- int delimLen = (delimiters == null ? -1 : delimiters.length);
- if (str == null || str.length() == 0 || delimLen == 0) {
- return str;
- }
- int strLen = str.length();
- StringBuffer buffer = new StringBuffer(strLen);
- boolean capitalizeNext = true;
- for (int i = 0; i < strLen; i++) {
- char ch = str.charAt(i);
-
- if (isDelimiter(ch, delimiters)) {
- buffer.append(ch);
- capitalizeNext = true;
- } else if (capitalizeNext) {
- buffer.append(Character.toTitleCase(ch));
- capitalizeNext = false;
- } else {
- buffer.append(ch);
- }
- }
- return buffer.toString();
- }
-
- /**
- * Is the character a delimiter.
- *
- * @param ch
- * the character to check
- * @param delimiters
- * the delimiters
- * @return true if it is a delimiter
- */
- private static boolean isDelimiter(char ch, char[] delimiters) {
- if (delimiters == null) {
- return Character.isWhitespace(ch);
- }
- for (int i = 0, isize = delimiters.length; i < isize; i++) {
- if (ch == delimiters[i]) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/engine/CSSXMLEngineImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/engine/CSSXMLEngineImpl.java
deleted file mode 100644
index 6c44925..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/engine/CSSXMLEngineImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.xml.engine;
-
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyFontHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyTextHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.impl.engine.CSSEngineImpl;
-import org.eclipse.e4.ui.css.xml.properties.css2.CSSPropertyBackgroundXMLHandler;
-import org.eclipse.e4.ui.css.xml.properties.css2.CSSPropertyFontXMLHandler;
-import org.eclipse.e4.ui.css.xml.properties.css2.CSSPropertyTextXMLHandler;
-
-/**
- * {@link CSSEngine} implementation to apply style sheet to XML DOM.
- */
-public class CSSXMLEngineImpl extends CSSEngineImpl {
-
- public CSSXMLEngineImpl() {
- // Register XML CSS Property Background Handler
- super.registerCSSPropertyHandler(ICSSPropertyBackgroundHandler.class,
- CSSPropertyBackgroundXMLHandler.INSTANCE);
- // Register XML CSS Property Text Handler
- super.registerCSSPropertyHandler(ICSSPropertyTextHandler.class,
- CSSPropertyTextXMLHandler.INSTANCE);
- // Register XML CSS Property Font Handler
- super.registerCSSPropertyHandler(ICSSPropertyFontHandler.class,
- CSSPropertyFontXMLHandler.INSTANCE);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyBackgroundXMLHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyBackgroundXMLHandler.java
deleted file mode 100644
index b92d5a7..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyBackgroundXMLHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.xml.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyBackgroundHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- */
-public class CSSPropertyBackgroundXMLHandler extends
- AbstractCSSPropertyBackgroundHandler {
-
- public final static ICSSPropertyBackgroundHandler INSTANCE = new CSSPropertyBackgroundXMLHandler();
-
- public boolean applyCSSProperty(Object node, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (node instanceof Element) {
- super.applyCSSProperty((Element) node, property, value, pseudo,
- engine);
- return true;
- }
- return false;
- }
-
- public String retrieveCSSPropertyBackgroundAttachment(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyBackgroundColor(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyBackgroundImage(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyBackgroundPosition(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyBackgroundRepeat(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyFontXMLHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyFontXMLHandler.java
deleted file mode 100644
index 522135a..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyFontXMLHandler.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.xml.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyFontHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyFontHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- */
-public class CSSPropertyFontXMLHandler extends AbstractCSSPropertyFontHandler {
-
- public final static ICSSPropertyFontHandler INSTANCE = new CSSPropertyFontXMLHandler();
-
- public boolean applyCSSProperty(Object node, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (node instanceof Element && ((Node) node).getOwnerDocument() != null) {
- super.applyCSSProperty((Element) node, property, value, pseudo,
- engine);
- return true;
- }
- return false;
- }
-
- public void applyCSSPropertyFontSize(Object node, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- Element element = (Element) node;
- // Add size attribute
- int size = (int) ((CSSPrimitiveValue) value)
- .getFloatValue(CSSPrimitiveValue.CSS_PT);
- element.setAttribute("size", size + "");
- }
- }
-
- public void applyCSSPropertyFontWeight(Object node, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- Element element = (Element) node;
- String weight = ((CSSPrimitiveValue) value).getStringValue();
- if ("bold".equals(weight.toLowerCase())) {
- insertElement(element, "b");
- }
- }
- }
-
- public void applyCSSPropertyFontStyle(Object node, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- Element element = (Element) node;
- String style = ((CSSPrimitiveValue) value).getStringValue();
- if ("italic".equals(style)) {
- insertElement(element, "i");
- }
- }
- }
-
- public String retrieveCSSPropertyFontAdjust(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyFontFamily(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyFontSize(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyFontStretch(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyFontStyle(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyFontVariant(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String retrieveCSSPropertyFontWeight(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- private void insertElement(Element element, String elementName) {
- Element b = element.getOwnerDocument().createElement(elementName);
- NodeList nodes = element.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
- b.appendChild(node.cloneNode(true));
- node.getParentNode().removeChild(node);
- }
- element.appendChild(b);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyTextXMLHandler.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyTextXMLHandler.java
deleted file mode 100644
index be961e6..0000000
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/xml/properties/css2/CSSPropertyTextXMLHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.xml.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyTextHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyTextHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- */
-public class CSSPropertyTextXMLHandler extends AbstractCSSPropertyTextHandler {
-
- public final static ICSSPropertyTextHandler INSTANCE = new CSSPropertyTextXMLHandler();
-
- public boolean applyCSSProperty(Object node, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (node instanceof Element) {
- super.applyCSSProperty((Element) node, property, value, pseudo,
- engine);
- return true;
- }
- return false;
- }
-
- public void applyCSSPropertyColor(Object node, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- // Add color attribute
- Element element = (Element) node;
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- element.setAttribute("color", primitiveValue.getStringValue());
- }
- }
-
- public String retrieveCSSPropertyColor(Object node, CSSEngine engine)
- throws Exception {
- Element element = (Element) node;
- return element.getAttribute("color");
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/.classpath b/bundles/org.eclipse.e4.ui.css.swt/.classpath
deleted file mode 100644
index 64c5e31..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.e4.ui.css.swt/.project b/bundles/org.eclipse.e4.ui.css.swt/.project
deleted file mode 100644
index bfc428c..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.e4.ui.css.swt</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.e4.ui.css.swt/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.ui.css.swt/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index a2707d6..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Tue Nov 18 20:31:44 EST 2008
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
diff --git a/bundles/org.eclipse.e4.ui.css.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.css.swt/META-INF/MANIFEST.MF
deleted file mode 100644
index ad18d52..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,29 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: CSS SWT Plug-in
-Bundle-SymbolicName: org.eclipse.e4.ui.css.swt
-Bundle-Version: 0.9.0.qualifier
-Export-Package: org.eclipse.e4.ui.css.swt,
- org.eclipse.e4.ui.css.swt.dom,
- org.eclipse.e4.ui.css.swt.dom.html,
- org.eclipse.e4.ui.css.swt.engine,
- org.eclipse.e4.ui.css.swt.engine.html,
- org.eclipse.e4.ui.css.swt.helpers,
- org.eclipse.e4.ui.css.swt.properties,
- org.eclipse.e4.ui.css.swt.properties.converters,
- org.eclipse.e4.ui.css.swt.properties.css2,
- org.eclipse.e4.ui.css.swt.properties.css2.lazy.background,
- org.eclipse.e4.ui.css.swt.properties.css2.lazy.border,
- org.eclipse.e4.ui.css.swt.properties.css2.lazy.classification,
- org.eclipse.e4.ui.css.swt.properties.css2.lazy.font,
- org.eclipse.e4.ui.css.swt.properties.css2.lazy.text,
- org.eclipse.e4.ui.css.swt.resources,
- org.eclipse.e4.ui.css.swt.selectors,
- org.eclipse.e4.ui.css.swt.serializers
-Require-Bundle: org.apache.commons.logging;bundle-version="1.0.4",
- org.apache.xerces;bundle-version="2.8.0",
- org.eclipse.e4.ui.css.core;bundle-version="0.9.0",
- org.eclipse.swt;bundle-version="3.4.1",
- org.w3c.css.sac;bundle-version="1.3.0",
- org.apache.commons.beanutils;bundle-version="1.7.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/bundles/org.eclipse.e4.ui.css.swt/about.html b/bundles/org.eclipse.e4.ui.css.swt/about.html
deleted file mode 100644
index 3ce4e7e..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>November 20, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.swt/build.properties b/bundles/org.eclipse.e4.ui.css.swt/build.properties
deleted file mode 100644
index b107977..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-source.. = src/
-bin.includes = META-INF/,\
- .
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/CSSSWTConstants.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/CSSSWTConstants.java
deleted file mode 100644
index 895c7ff..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/CSSSWTConstants.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt;
-
-import org.eclipse.e4.ui.css.core.dom.properties.CSSBorderProperties;
-
-public class CSSSWTConstants {
-
- /**
- * Key value for setting and getting the CSS class name of a widget.
- * Clients may rely on the value of this key if they want to avoid a dependency on this package.
- * @see Widget.getData(String) Widget.setData(String, Object)
- */
- public static final String CSS_CLASS_NAME_KEY = "org.eclipse.e4.ui.css.CssClassName";
-
- /**
- * Key value for setting and getting the CSS ID of a widget.
- * Clients may rely on the value of this key if they want to avoid a dependency on this package.
- * @see Widget.getData(String) Widget.setData(String, Object)
- */
- public static final String CSS_ID_KEY = "org.eclipse.e4.ui.css.id";
-
-
- /**
- * Constant used to store {@link CSSBorderProperties} instance into SWT
- * control data.
- */
- public static final String CONTROL_CSS2BORDER_KEY = "org.eclipse.e4.ui.core.css.swt.CONTROL_CSS2BORDER_KEY";
-
- /**
- * Constant used to store {@link CSS2FontProperties} instance into SWT
- * control data.
- */
- // public static final String CONTROL_CSS2FONT_KEY =
- // "org.eclipse.e4.ui.core.css.swt.CONTROL_CSS2FONT_KEY";
- /**
- * Constant used to store String Text into SWT control data.
- */
- public static final String TEXT_KEY = "org.eclipse.e4.ui.core.css.swt.TEXT_KEY";
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/SWTElement.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/SWTElement.java
deleted file mode 100644
index 70dd501..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/SWTElement.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.dom;
-
-import org.apache.commons.beanutils.PropertyUtils;
-import org.eclipse.e4.ui.css.core.dom.ElementAdapter;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.utils.ClassUtils;
-import org.eclipse.e4.ui.css.core.utils.NumberUtils;
-import org.eclipse.e4.ui.css.swt.CSSSWTConstants;
-import org.eclipse.e4.ui.css.swt.helpers.SWTStyleHelpers;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Widget;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * w3c Element which wrap SWT widget.
- */
-public class SWTElement extends ElementAdapter implements NodeList {
-
- /**
- * Convenience method for getting the CSS class of a widget.
- * @param widget SWT widget with associated CSS class name
- * @return CSS class name
- */
- public static String getCSSClass(Widget widget) {
- return (String) widget.getData(CSSSWTConstants.CSS_CLASS_NAME_KEY);
- }
-
- /**
- * Convenience method for getting the CSS ID of a widget.
- * @param widget SWT widget with associated CSS id
- * @return CSS ID
- */
- public static String getID(Widget widget) {
- return (String) widget.getData(CSSSWTConstants.CSS_ID_KEY);
- }
-
- /**
- * Convenience method for setting the CSS class of a widget.
- * @param widget SWT widget with associated CSS class name
- * @param className class name to set
- */
- public static void setCSSClass(Widget widget, String className) {
- widget.setData(CSSSWTConstants.CSS_CLASS_NAME_KEY, className);
- }
-
- /**
- * Convenience method for setting the CSS ID of a widget.
- * @param widget SWT widget with associated CSS id
- * @param id CSS id to set
- */
- public static void setID(Widget widget, String id) {
- widget.setData(CSSSWTConstants.CSS_ID_KEY, id);
- }
-
- protected String localName;
-
- protected String namespaceURI;
-
- protected String swtStyles;
-
- public SWTElement(Widget widget, CSSEngine engine) {
- super(widget, engine);
- this.localName = computeLocalName();
- this.namespaceURI = computeNamespaceURI();
- this.computeStaticPseudoInstances();
- this.swtStyles = this.computeAttributeSWTStyle();
- }
-
- /**
- * Compute local name.
- *
- * @return
- */
- protected String computeLocalName() {
- // The localName is simple class name
- // of the SWT widget. For instance
- // for the org.eclipse.swt.widgets.Label
- // localName is Label
- // CSS selector will use this localName
- // ex : Label {background-color:red;}
- Widget widget = getWidget();
- Class clazz = widget.getClass();
- return ClassUtils.getSimpleName(clazz);
- }
-
- /**
- * Compute namespaceURI.
- *
- * @return
- */
- protected String computeNamespaceURI() {
- // The NamespaceURI is package name
- // of the SWT widget. For instance
- // for the org.eclipse.swt.widgets.Label
- // namespaceURI is org.eclipse.swt.widgets.Label
- // CSS selector will use this localName
- // @namespace eclipse org.eclipse.swt.widgets.Label
- // ex : eclipse|Label {background-color:red;}
- Widget widget = getWidget();
- Class clazz = widget.getClass();
- return ClassUtils.getPackageName(clazz);
- }
-
- /**
- * Compute static pseudo instances.
- *
- */
- protected void computeStaticPseudoInstances() {
- Widget widget = getWidget();
- if (widget instanceof CTabFolder) {
- // it's CTabFolder. Set selected as static pseudo instance.
- // because this widget define methods
- // CTabFolder#setSelectionBackground (Color color)
- // which set background Color when a CTabItem is selected.
- super.addStaticPseudoInstance("selected");
- }
- }
-
- /**
- * Compute attribute SWT style.
- *
- * @return
- */
- protected String computeAttributeSWTStyle() {
- return SWTStyleHelpers.getSWTWidgetStyleAsString(getWidget());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.ElementAdapter#getAttribute(java.lang.String)
- */
- public String getAttribute(String attr) {
- Widget widget = getWidget();
- if (attr.equals("style")) {
- return swtStyles;
- }
- Object o = widget.getData(attr.toLowerCase());
- if (o != null)
- return o.toString();
- try {
- o = PropertyUtils.getProperty(widget, attr);
- if (o != null)
- return o.toString();
- } catch (Exception e) {
- // e.printStackTrace();
- }
- return "";
- }
-
- public String getLocalName() {
- return localName;
- }
-
- public String getNamespaceURI() {
- return namespaceURI;
- }
-
- public Node getParentNode() {
- Widget widget = getWidget();
- if (widget instanceof Control) {
- Control control = (Control) widget;
- Composite parent = control.getParent();
- if (parent != null) {
- Element element = getElement(parent);
- return element;
- }
- }
- return null;
- }
-
- public NodeList getChildNodes() {
- return this;
- }
-
- public int getLength() {
- Widget widget = getWidget();
- if (widget instanceof Composite) {
- return ((Composite) widget).getChildren().length;
- }
- return 0;
- }
-
- public Node item(int index) {
- Widget widget = getWidget();
- if (widget instanceof Composite) {
- Widget w = ((Composite) widget).getChildren()[index];
- return getElement(w);
- }
- return null;
- }
-
- protected Widget getWidget() {
- return (Widget) getNativeWidget();
- }
-
- public String getCSSId() {
- Widget widget = getWidget();
- Object id = getID(widget);
- if (id != null)
- return id.toString();
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.CSSStylableElement#getCSSClass()
- */
- public String getCSSClass() {
- Widget widget = getWidget();
- Object id = getCSSClass(widget);
- if (id != null)
- return id.toString();
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.CSSStylableElement#getCSSStyle()
- */
- public String getCSSStyle() {
- Widget widget = getWidget();
- //TODO should have key in CSSSWT
- Object id = widget.getData("style");
- if (id != null)
- return id.toString();
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.css.core.dom.ElementAdapter#isPseudoInstanceOf(java.lang.String)
- */
- public boolean isPseudoInstanceOf(String s) {
- if ("enabled".equals(s)) {
- Control control = (Control) getNativeWidget();
- return control.isEnabled();
- }
- if ("disabled".equals(s)) {
- Control control = (Control) getNativeWidget();
- return !control.isEnabled();
- }
- if ("checked".equals(s)) {
- if (getNativeWidget() instanceof Button) {
- Button button = (Button) getNativeWidget();
- return button.getSelection();
- }
- return false;
- }
- if ("visible".equals(s)) {
- Control control = (Control) getNativeWidget();
- return !control.isVisible();
- }
- if ("focus".equals(s)) {
- Control control = (Control) getNativeWidget();
- if (control.isFocusControl()) {
- return control.getData("focusLost") == null;
- }
- }
- if ("hover".equals(s)) {
- Control control = (Control) getNativeWidget();
- return control.getData("mouseHover") != null;
- }
- if ("odd".equals(s)) {
- Object widget = getNativeWidget();
- if (widget instanceof TableItem) {
- TableItem tableItem = (TableItem) widget;
- int index = tableItem.getParent().indexOf(tableItem);
- return NumberUtils.isOdd(index);
- }
- }
- if ("even".equals(s)) {
- Object widget = getNativeWidget();
- if (widget instanceof TableItem) {
- TableItem tableItem = (TableItem) widget;
- int index = tableItem.getParent().indexOf(tableItem);
- return NumberUtils.isEven(index);
- }
- }
- return super.isPseudoInstanceOf(s);
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/SWTElementProvider.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/SWTElementProvider.java
deleted file mode 100644
index def2784..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/SWTElementProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.dom;
-
-import org.eclipse.e4.ui.css.core.dom.IElementProvider;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.widgets.Widget;
-import org.w3c.dom.Element;
-
-/**
- * {@link IElementProvider} SWT implementation to retrieve w3c Element {@link SWTElement} linked
- * to SWT widget.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class SWTElementProvider implements IElementProvider {
-
- public static final IElementProvider INSTANCE = new SWTElementProvider();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.dom.IElementProvider#getElement(java.lang.Object)
- */
- public Element getElement(Object element, CSSEngine engine) {
- if (element instanceof Widget) {
- // element is SWT Widget
- Widget widget = (Widget) element;
- // Return the w3c Element linked to the SWT widget.
- return SWTElementHelpers.getElement(widget, engine);
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/html/SWTHTMLElement.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/html/SWTHTMLElement.java
deleted file mode 100644
index 09a80b9..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/html/SWTHTMLElement.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.dom.html;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.dom.SWTElement;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Scrollable;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * w3c Element which wrap SWT widget to manage HTML/XUL selectors.
- */
-public class SWTHTMLElement extends SWTElement {
-
- protected String attributeType;
-
- public SWTHTMLElement(Widget widget, CSSEngine engine) {
- super(widget, engine);
- attributeType = computeAttributeType();
- }
-
- public String getAttribute(String attr) {
- if ("type".equals(attr))
- return attributeType;
- return super.getAttribute(attr);
- }
-
- protected String computeLocalName() {
- Widget widget = getWidget();
- // HTML name
- if (widget instanceof Text) {
- int style = widget.getStyle();
- if ((style | SWT.MULTI) == style)
- return "textarea";
- return "input";
- }
- if (widget instanceof Button)
- return "input";
- if (widget instanceof Combo)
- return "select";
- if (widget instanceof CCombo)
- return "select";
- if (widget instanceof Label)
- return "label";
- if (widget instanceof Shell)
- return "body";
- if (widget instanceof Canvas)
- return "canvas";
- if (widget instanceof Scrollable)
- return "div";
- if (widget instanceof List)
- return "body";
- if (widget instanceof Group)
- return "div";
- if (widget instanceof Link)
- return "a";
- if (widget instanceof Composite)
- return "div";
- // XUL name
- if (widget instanceof Tree)
- return "tree";
- if (widget instanceof Table)
- return "listbox";
- return super.computeLocalName();
- }
-
- protected String computeAttributeType() {
- Widget widget = getWidget();
- if (widget instanceof Button) {
- Button button = (Button) widget;
- int style = button.getStyle();
- if ((style | SWT.RADIO) == style)
- return "radio";
- if ((style | SWT.CHECK) == style)
- return "checkbox";
- return "button";
- }
- if (widget instanceof Text) {
- Text text = (Text) widget;
- if ((text.getStyle() & SWT.PASSWORD) != 0)
- return "password";
- else if ((text.getStyle() & SWT.MULTI) != 0)
- return "";
- else
- return "text";
- }
- return "";
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/html/SWTHTMLElementProvider.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/html/SWTHTMLElementProvider.java
deleted file mode 100644
index 8bb3419..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/dom/html/SWTHTMLElementProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.dom.html;
-
-import org.eclipse.e4.ui.css.core.dom.IElementProvider;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.dom.SWTElementProvider;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.widgets.Widget;
-import org.w3c.dom.Element;
-
-/**
- * {@link IElementProvider} SWT implementation to retrieve w3c Element
- * {@link SWTHTMLElement} linked to SWT widget.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class SWTHTMLElementProvider extends SWTElementProvider {
-
- public static final IElementProvider INSTANCE = new SWTHTMLElementProvider();
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.dom.IElementProvider#getElement(java.lang.Object)
- */
- public Element getElement(Object element, CSSEngine engine) {
- if (element instanceof Widget) {
- Widget widget = (Widget) element;
- return SWTElementHelpers.getHTMLElement(widget, engine);
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/AbstractCSSSWTEngineImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/AbstractCSSSWTEngineImpl.java
deleted file mode 100644
index 5a2a378..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/AbstractCSSSWTEngineImpl.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.engine;
-
-import org.eclipse.e4.ui.css.core.impl.engine.CSSEngineImpl;
-import org.eclipse.e4.ui.css.core.resources.IResourcesRegistry;
-import org.eclipse.e4.ui.css.swt.dom.SWTElementProvider;
-import org.eclipse.e4.ui.css.swt.properties.converters.CSSValueSWTColorConverterImpl;
-import org.eclipse.e4.ui.css.swt.properties.converters.CSSValueSWTCursorConverterImpl;
-import org.eclipse.e4.ui.css.swt.properties.converters.CSSValueSWTFontConverterImpl;
-import org.eclipse.e4.ui.css.swt.properties.converters.CSSValueSWTFontDataConverterImpl;
-import org.eclipse.e4.ui.css.swt.properties.converters.CSSValueSWTGradientConverterImpl;
-import org.eclipse.e4.ui.css.swt.properties.converters.CSSValueSWTImageConverterImpl;
-import org.eclipse.e4.ui.css.swt.properties.converters.CSSValueSWTRGBConverterImpl;
-import org.eclipse.e4.ui.css.swt.resources.SWTResourcesRegistry;
-import org.eclipse.e4.ui.css.swt.selectors.DynamicPseudoClassesSWTFocusHandler;
-import org.eclipse.e4.ui.css.swt.selectors.DynamicPseudoClassesSWTHoverHandler;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * CSS SWT Engine implementation which configure CSSEngineImpl to apply styles
- * to SWT widgets.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSSWTEngineImpl extends CSSEngineImpl {
-
- protected Display display;
-
- public AbstractCSSSWTEngineImpl(Display display) {
- this(display, false);
- }
-
- public AbstractCSSSWTEngineImpl(Display display, boolean lazyApplyingStyles) {
- this.display = display;
-
- // Register SWT Element Provider to retrieve
- // w3c Element SWTElement coming from SWT widget.
- super.setElementProvider(SWTElementProvider.INSTANCE);
-
- /** Initialize CSS Property Handlers * */
-
- this.initializeCSSPropertyHandlers();
-
- /** Initialize Dynamic pseudo classes * */
-
- // Register SWT Focus Handler
- super.registerDynamicPseudoClassHandler("focus",
- DynamicPseudoClassesSWTFocusHandler.INSTANCE);
- // Register SWT Hover Handler
- super.registerDynamicPseudoClassHandler("hover",
- DynamicPseudoClassesSWTHoverHandler.INSTANCE);
-
- /** Initialize SWT CSSValue converter * */
-
- // Register SWT RGB CSSValue Converter
- super.registerCSSValueConverter(CSSValueSWTRGBConverterImpl.INSTANCE);
- // Register SWT Color CSSValue Converter
- super.registerCSSValueConverter(CSSValueSWTColorConverterImpl.INSTANCE);
- // Register SWT Gradient CSSValue Converter
- super
- .registerCSSValueConverter(CSSValueSWTGradientConverterImpl.INSTANCE);
- // Register SWT Cursor CSSValue Converter
- super
- .registerCSSValueConverter(CSSValueSWTCursorConverterImpl.INSTANCE);
- // Register SWT Font CSSValue Converter
- super.registerCSSValueConverter(CSSValueSWTFontConverterImpl.INSTANCE);
- // Register SWT FontData CSSValue Converter
- super
- .registerCSSValueConverter(CSSValueSWTFontDataConverterImpl.INSTANCE);
- // Register SWT Image CSSValue Converter
- super.registerCSSValueConverter(CSSValueSWTImageConverterImpl.INSTANCE);
-
- if (lazyApplyingStyles) {
- new CSSSWTApplyStylesListener(Display.findDisplay(Thread
- .currentThread()), this);
- }
- }
-
- protected abstract void initializeCSSPropertyHandlers();
-
- public IResourcesRegistry getResourcesRegistry() {
- IResourcesRegistry resourcesRegistry = super.getResourcesRegistry();
- if (resourcesRegistry == null) {
- super.setResourcesRegistry(new SWTResourcesRegistry(display));
- }
- return super.getResourcesRegistry();
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTApplyStylesListener.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTApplyStylesListener.java
deleted file mode 100644
index eb41b74..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTApplyStylesListener.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.engine;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * Add SWT filter to the {@link Display} to apply styles when SWT widget is
- * resized or showed.
- */
-public class CSSSWTApplyStylesListener {
-
- private final static String WIDGET_ALREADY_ADDED = "WIDGET_ALREADY_ADDED";
-
- private CSSEngine engine;
-
- public CSSSWTApplyStylesListener(Display display, CSSEngine engine) {
- this.engine = engine;
- display.addFilter(SWT.Resize, new ResizeListener());
- display.addFilter(SWT.Show, new ShowListener());
- }
-
- private final boolean isWidgetAlreadyAdded(Widget widget) {
- if (widget == null)
- return true;
- return widget.getData(WIDGET_ALREADY_ADDED) != null;
- }
-
- private class ResizeListener implements Listener {
-
- public void handleEvent(Event event) {
- // On resize, apply styles (on the first resize)
- Widget widget = event.widget;
- if (!isWidgetAlreadyAdded(widget)) {
- widget.setData(WIDGET_ALREADY_ADDED, WIDGET_ALREADY_ADDED);
- if (engine != null) {
- engine.applyStyles(widget, false);
- }
- }
- }
- }
-
- private class ShowListener implements Listener {
-
- public void handleEvent(Event event) {
- Widget widget = event.widget;
- if (widget instanceof Shell)
- ((Shell) widget).pack();
- }
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTEngineImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTEngineImpl.java
deleted file mode 100644
index 4bea01f..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTEngineImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.engine;
-
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyBorderHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyClassificationHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyFontHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyTextHandler;
-import org.eclipse.e4.ui.css.swt.properties.css2.CSSPropertyBackgroundSWTHandler;
-import org.eclipse.e4.ui.css.swt.properties.css2.CSSPropertyBorderSWTHandler;
-import org.eclipse.e4.ui.css.swt.properties.css2.CSSPropertyClassificationSWTHandler;
-import org.eclipse.e4.ui.css.swt.properties.css2.CSSPropertyFontSWTHandler;
-import org.eclipse.e4.ui.css.swt.properties.css2.CSSPropertyTextSWTHandler;
-import org.eclipse.e4.ui.css.xml.properties.css2.CSSPropertyBackgroundXMLHandler;
-import org.eclipse.e4.ui.css.xml.properties.css2.CSSPropertyFontXMLHandler;
-import org.eclipse.e4.ui.css.xml.properties.css2.CSSPropertyTextXMLHandler;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * CSS SWT Engine implementation which configure CSSEngineImpl to apply styles
- * to SWT widgets with static handler strategy.
- */
-public class CSSSWTEngineImpl extends AbstractCSSSWTEngineImpl {
-
- public CSSSWTEngineImpl(Display display) {
- super(display);
- }
-
- public CSSSWTEngineImpl(Display display, boolean lazyApplyingStyles) {
- super(display, lazyApplyingStyles);
- }
-
- protected void initializeCSSPropertyHandlers() {
- // Register SWT CSS Property Background Handler
- super.registerCSSPropertyHandler(ICSSPropertyBackgroundHandler.class,
- CSSPropertyBackgroundSWTHandler.INSTANCE);
- // Register SWT CSS Property Border Handler
- super.registerCSSPropertyHandler(ICSSPropertyBorderHandler.class,
- CSSPropertyBorderSWTHandler.INSTANCE);
- // Register SWT CSS Property Classification Handler
- super.registerCSSPropertyHandler(
- ICSSPropertyClassificationHandler.class,
- CSSPropertyClassificationSWTHandler.INSTANCE);
- // Register SWT CSS Property Text Handler
- super.registerCSSPropertyHandler(ICSSPropertyTextHandler.class,
- CSSPropertyTextSWTHandler.INSTANCE);
- // Register SWT CSS Property Font Handler
- super.registerCSSPropertyHandler(ICSSPropertyFontHandler.class,
- CSSPropertyFontSWTHandler.INSTANCE);
-
- // Register XML CSS Property Background Handler
- super.registerCSSPropertyHandler(ICSSPropertyBackgroundHandler.class,
- CSSPropertyBackgroundXMLHandler.INSTANCE);
- // Register XML CSS Property Text Handler
- super.registerCSSPropertyHandler(ICSSPropertyTextHandler.class,
- CSSPropertyTextXMLHandler.INSTANCE);
- // Register XML CSS Property Font Handler
- super.registerCSSPropertyHandler(ICSSPropertyFontHandler.class,
- CSSPropertyFontXMLHandler.INSTANCE);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTLazyHandlerEngineImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTLazyHandlerEngineImpl.java
deleted file mode 100644
index d410e20..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/CSSSWTLazyHandlerEngineImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.engine;
-
-import org.eclipse.swt.widgets.Display;
-
-/**
- * CSS SWT Engine implementation which configure CSSEngineImpl to apply styles
- * to SWT widgets with lazy handler strategy.
- */
-public class CSSSWTLazyHandlerEngineImpl extends AbstractCSSSWTEngineImpl {
-
- public CSSSWTLazyHandlerEngineImpl(Display display) {
- super(display);
- }
-
- public CSSSWTLazyHandlerEngineImpl(Display display,
- boolean lazyApplyingStyles) {
- super(display, lazyApplyingStyles);
- }
-
- protected void initializeCSSPropertyHandlers() {
- super
- .registerPackage("org.eclipse.e4.ui.css.swt.properties.css2.lazy.classification");
- super
- .registerPackage("org.eclipse.e4.ui.css.swt.properties.css2.lazy.border");
- super
- .registerPackage("org.eclipse.e4.ui.css.swt.properties.css2.lazy.font");
- super
- .registerPackage("org.eclipse.e4.ui.css.swt.properties.css2.lazy.background");
- super
- .registerPackage("org.eclipse.e4.ui.css.swt.properties.css2.lazy.text");
-
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/html/CSSSWTHTMLEngineImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/html/CSSSWTHTMLEngineImpl.java
deleted file mode 100644
index 8ce6d22..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/engine/html/CSSSWTHTMLEngineImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.engine.html;
-
-/**
- * CSS SWT Engine implementation which configure CSSEngineImpl to apply styles
- * to SWT widgets with static handler strategy and manage HTML selector.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-import org.eclipse.e4.ui.css.swt.dom.html.SWTHTMLElementProvider;
-import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.widgets.Display;
-
-public class CSSSWTHTMLEngineImpl extends CSSSWTEngineImpl {
-
- public CSSSWTHTMLEngineImpl(Display display) {
- this(display, false);
- }
-
- public CSSSWTHTMLEngineImpl(Display display, boolean lazyApplyingStyles) {
- super(display, lazyApplyingStyles);
- // Register SWT HTML Element Provider to retrieve
- // w3c Element SWTHTMLElement coming from SWT widget.
- super.setElementProvider(SWTHTMLElementProvider.INSTANCE);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java
deleted file mode 100644
index 285cd2c..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.helpers;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper;
-import org.eclipse.e4.ui.css.core.css2.CSS2RGBColorImpl;
-import org.eclipse.e4.ui.css.core.dom.properties.Gradient;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.CSSValueList;
-import org.w3c.dom.css.RGBColor;
-
-public class CSSSWTColorHelper {
-
- /*--------------- SWT Color Helper -----------------*/
-
- public static Color getSWTColor(RGBColor rgbColor, Display display) {
- RGB rgb = getRGB(rgbColor);
- return new Color(display, rgb);
- }
-
- public static Color getSWTColor(CSSValue value, Display display) {
- if (value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE)
- return null;
- RGB rgb = getRGB((CSSPrimitiveValue) value);
- if (rgb == null)
- return null;
- Color color = new Color(display, rgb.red, rgb.green, rgb.blue);
- return color;
- }
-
- public static RGB getRGB(String name) {
- RGBColor color = CSS2ColorHelper.getRGBColor(name);
- if (color != null) {
- return getRGB(color);
- }
- return null;
- }
-
- public static RGB getRGB(RGBColor color) {
- return new RGB((int) color.getRed().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER), (int) color.getGreen()
- .getFloatValue(CSSPrimitiveValue.CSS_NUMBER), (int) color
- .getBlue().getFloatValue(CSSPrimitiveValue.CSS_NUMBER));
- }
-
- public static RGB getRGB(CSSValue value) {
- if (value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE)
- return null;
- return getRGB((CSSPrimitiveValue) value);
- }
-
- public static RGB getRGB(CSSPrimitiveValue value) {
- RGB rgb = null;
- switch (value.getPrimitiveType()) {
- case CSSPrimitiveValue.CSS_IDENT:
- case CSSPrimitiveValue.CSS_STRING:
- String string = value.getStringValue();
- rgb = getRGB(string);
- break;
- case CSSPrimitiveValue.CSS_RGBCOLOR:
- RGBColor rgbColor = value.getRGBColorValue();
- rgb = getRGB(rgbColor);
- break;
- }
- return rgb;
- }
-
- public static Integer getPercent(CSSPrimitiveValue value) {
- int percent = 0;
- switch (value.getPrimitiveType()) {
- case CSSPrimitiveValue.CSS_PERCENTAGE:
- percent = (int) value
- .getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE);
- }
- return new Integer(percent);
- }
-
- public static Gradient getGradient(CSSValueList list) {
- Gradient gradient = new Gradient();
- for (int i = 0; i < list.getLength(); i++) {
- CSSValue value = list.item(i);
- if (value.getCssText().equals("gradient"))
- continue;
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- switch (((CSSPrimitiveValue) value).getPrimitiveType()) {
- case CSSPrimitiveValue.CSS_IDENT:
- case CSSPrimitiveValue.CSS_STRING:
- case CSSPrimitiveValue.CSS_RGBCOLOR:
- RGB rgb = getRGB((CSSPrimitiveValue) value);
- if (rgb != null)
- gradient.addRGB(rgb);
- break;
- case CSSPrimitiveValue.CSS_PERCENTAGE:
- gradient.addPercent(getPercent((CSSPrimitiveValue) value));
- break;
- }
- }
- }
- return gradient;
- }
-
- public static RGBColor getRGBColor(Color color) {
- int red = color.getRed();
- int green = color.getGreen();
- int blue = color.getBlue();
- return new CSS2RGBColorImpl(red, green, blue);
- }
-
- public static RGBColor getRGBColor(RGB color) {
- int red = color.red;
- int green = color.green;
- int blue = color.blue;
- return new CSS2RGBColorImpl(red, green, blue);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTCursorHelper.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTCursorHelper.java
deleted file mode 100644
index f64eeea..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTCursorHelper.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.helpers;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSSWTCursorHelper {
-
- /**
- * @see http://www.w3schools.com/css/pr_class_cursor.asp
- */
- public static Cursor getSWTCursor(CSSValue value, Display display) {
- if (!(value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE))
- return null;
- int i = getSWTCursorId((CSSPrimitiveValue) value);
- if (i == SWT.NONE)
- return null;
-
- Cursor cursor = new Cursor(display, i);
- return cursor;
- }
-
- public static String getCSSCursor(Cursor cursor) {
- if (cursor == null)
- return "auto";
- // switch (cursor.getType()) {
- // case Cursor.DEFAULT_CURSOR:
- // // The default cursor (often an arrow)
- // return "default";
- // case Cursor.CROSSHAIR_CURSOR:
- // // The cursor render as a crosshair
- // return "crosshair";
- // case Cursor.HAND_CURSOR:
- // // The cursor render as a pointer (a hand) that indicates a link
- // return "pointer";
- // case Cursor.MOVE_CURSOR:
- // // The cursor indicates something that should be moved
- // return "move";
- // case Cursor.E_RESIZE_CURSOR:
- // // The cursor indicates that an edge of a box is to be moved
- // // right (east)
- // return "e-resize";
- // case Cursor.NE_RESIZE_CURSOR:
- // // The cursor indicates that an edge of a box is to be moved up
- // // and right (north/east)
- // return "ne-resize";
- // case Cursor.NW_RESIZE_CURSOR:
- // // The cursor indicates that an edge of a box is to be moved up
- // // and left (north/west)
- // return "nw-resize";
- // case Cursor.N_RESIZE_CURSOR:
- // // The cursor indicates that an edge of a box is to be moved up
- // // (north)
- // return "n-resize";
- // case Cursor.SE_RESIZE_CURSOR:
- // // The cursor indicates that an edge of a box is to be moved
- // // down and right (south/east)
- // return "se-resize";
- // case Cursor.SW_RESIZE_CURSOR:
- // // The cursor indicates that an edge of a box is to be moved
- // // down and left (south/west)
- // return "sw-resize";
- // case Cursor.S_RESIZE_CURSOR:
- // // The cursor indicates that an edge of a box is to be moved
- // // down (south)
- // return "s-resize";
- // case Cursor.W_RESIZE_CURSOR:
- // // The cursor indicates that an edge of a box is to be moved
- // // left (west)
- // return "w-resize";
- // case Cursor.TEXT_CURSOR:
- // // The cursor indicates text
- // return "text";
- // case Cursor.WAIT_CURSOR:
- // // The cursor indicates that the program is busy (often a watch
- // // or an hourglass)
- // return "wait";
- // // TODO : manage help cursor
- // }
- return "auto";
- }
-
- public static int getSWTCursorId(CSSPrimitiveValue value) {
- String cursorName = value.getStringValue();
- if ("default".equals(cursorName))
- // The default cursor (often an arrow)
- return SWT.NONE;
- if ("auto".equals(cursorName))
- // TODO : manage auto
- // Default. The browser sets a cursor
- return SWT.NONE;
- if ("crosshair".equals(cursorName))
- // The cursor render as a crosshair
- return SWT.CURSOR_CROSS;
- if ("pointer".equals(cursorName))
- // The cursor render as a pointer (a hand) that indicates a link
- return SWT.CURSOR_HAND;
- if ("move".equals(cursorName))
- // The cursor indicates something that should be moved
- return SWT.CURSOR_UPARROW;
- if ("e-resize".equals(cursorName))
- // The cursor indicates that an edge of a box is to be moved right
- // (east)
- return SWT.CURSOR_SIZEE;
- if ("ne-resize".equals(cursorName))
- // The cursor indicates that an edge of a box is to be moved up and
- // right (north/east)
- return SWT.CURSOR_SIZENE;
- if ("nw-resize".equals(cursorName))
- // The cursor indicates that an edge of a box is to be moved up and
- // left (north/west)
- return SWT.CURSOR_SIZENW;
- if ("n-resize".equals(cursorName))
- // The cursor indicates that an edge of a box is to be moved up
- // (north)
- return SWT.CURSOR_SIZEN;
- if ("se-resize".equals(cursorName))
- // The cursor indicates that an edge of a box is to be moved down
- // and right (south/east)
- return SWT.CURSOR_SIZESE;
- if ("sw-resize".equals(cursorName))
- // The cursor indicates that an edge of a box is to be moved down
- // and left (south/west)
- return SWT.CURSOR_SIZESW;
- if ("s-resize".equals(cursorName))
- // The cursor indicates that an edge of a box is to be moved down
- // (south)
- return SWT.CURSOR_SIZES;
- if ("w-resize".equals(cursorName))
- // The cursor indicates that an edge of a box is to be moved left
- // (west)
- return SWT.CURSOR_SIZEW;
- if ("text".equals(cursorName))
- // The cursor indicates text
- return SWT.CURSOR_UPARROW;
- if ("wait".equals(cursorName))
- // The cursor indicates that the program is busy (often a watch or
- // an hourglass)
- return SWT.CURSOR_WAIT;
- if ("help".equals(cursorName))
- // The cursor indicates that help is available (often a question
- // mark or a balloon)
- return SWT.CURSOR_HELP;
- return SWT.NONE;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTFontHelper.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTFontHelper.java
deleted file mode 100644
index 4b798ab..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTFontHelper.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.helpers;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2FontHelper;
-import org.eclipse.e4.ui.css.core.css2.CSS2FontPropertiesHelpers;
-import org.eclipse.e4.ui.css.core.css2.CSS2PrimitiveValueImpl;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontPropertiesImpl;
-import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Widget;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- * CSS SWT Font Helper to :
- * <ul>
- * <li>get CSS2FontProperties from Font of SWT Control.</li>
- * <li>get Font of SWT Control from CSS2FontProperties.</li>
- * </ul>
- */
-public class CSSSWTFontHelper {
-
- /**
- * Get CSS2FontProperties from Control stored into Data of Control. If
- * CSS2FontProperties doesn't exist, create it from Font of Control and
- * store it into Data of Control.
- *
- * @param control
- * @return
- */
- public static CSS2FontProperties getCSS2FontProperties(Widget widget,
- Font font, CSSElementContext context) {
- // Search into Data of Control if CSS2FontProperties exist.
- CSS2FontProperties fontProperties = CSS2FontPropertiesHelpers
- .getCSS2FontProperties(context);
- if (fontProperties == null) {
- // CSS2FontProperties doesn't exist, create it
- fontProperties = getCSS2FontProperties(font);
- // store into ClientProperty the CSS2FontProperties
- CSS2FontPropertiesHelpers.setCSS2FontProperties(fontProperties,
- context);
- }
- return fontProperties;
- }
-
- /**
- * Get CSS2FontProperties from Control stored into Data of Control. If
- * CSS2FontProperties doesn't exist, create it from Font of Control and
- * store it into Data of Control.
- *
- * @param control
- * @return
- */
- public static CSS2FontProperties getCSS2FontProperties(Control control,
- CSSElementContext context) {
- // Search into Data of Control if CSS2FontProperties exist.
- CSS2FontProperties fontProperties = CSS2FontPropertiesHelpers
- .getCSS2FontProperties(context);
- if (fontProperties == null) {
- // CSS2FontProperties doesn't exist, create it
- Font font = control.getFont();
- fontProperties = getCSS2FontProperties(font);
- // store into ClientProperty the CSS2FontProperties
- CSS2FontPropertiesHelpers.setCSS2FontProperties(fontProperties,
- context);
- }
- return fontProperties;
- }
-
- /**
- * Build CSS2FontProperties from SWT Font.
- *
- * @param font
- * @return
- */
- public static CSS2FontProperties getCSS2FontProperties(Font font) {
- // Create CSS Font Properties
- CSS2FontProperties fontProperties = new CSS2FontPropertiesImpl();
- if (font != null) {
- FontData fontData = getFirstFontData(font);
- // Update font-family
- String fontFamily = getFontFamily(font);
- fontProperties.setFamily(new CSS2PrimitiveValueImpl(fontFamily));
- // Update font-size
- int fontSize = fontData.getHeight();
- fontProperties.setSize(new CSS2PrimitiveValueImpl(fontSize));
- // Update font-weight
- String fontWeight = getFontWeight(font);
- fontProperties.setWeight((new CSS2PrimitiveValueImpl(fontWeight)));
- // Update font-style
- String fontStyle = getFontStyle(font);
- fontProperties.setStyle((new CSS2PrimitiveValueImpl(fontStyle)));
- }
- return fontProperties;
- }
-
- /**
- * Get CSS2FontProperties from Font of JComponent and store
- * CSS2FontProperties instance into ClientProperty of JComponent.
- *
- * @param component
- * @return
- */
- public static Font getFont(CSS2FontProperties fontProperties,
- Control control) {
- FontData oldFontData = getFirstFontData(control.getFont());
- return getFont(fontProperties, oldFontData, control.getDisplay());
- }
-
- public static Font getFont(CSS2FontProperties fontProperties,
- FontData oldFontData, Display display) {
- FontData newFontData = getFontData(fontProperties, oldFontData);
- return new Font(display, newFontData);
- }
-
- /**
- * Return FontData from {@link CSS2FontProperties}.
- *
- * @param fontProperties
- * @param control
- * @return
- */
- public static FontData getFontData(CSS2FontProperties fontProperties,
- FontData oldFontData) {
- FontData newFontData = new FontData();
- // Style
- int style = getSWTStyle(fontProperties, oldFontData);
- newFontData.setStyle(style);
- // Height
- CSSPrimitiveValue cssFontSize = fontProperties.getSize();
- if (cssFontSize != null) {
- newFontData.setHeight((int) (cssFontSize)
- .getFloatValue(CSSPrimitiveValue.CSS_PT));
- } else {
- if (oldFontData != null)
- newFontData.setHeight(oldFontData.getHeight());
- }
- // Family
- CSSPrimitiveValue cssFontFamily = fontProperties.getFamily();
- if (cssFontFamily != null)
- newFontData.setName(cssFontFamily.getStringValue());
- else {
- if (oldFontData != null)
- newFontData.setName(oldFontData.getName());
- }
- return newFontData;
- }
-
- /**
- * Return SWT style Font from {@link CSS2FontProperties}.
- *
- * @param fontProperties
- * @param control
- * @return
- */
- public static int getSWTStyle(CSS2FontProperties fontProperties,
- FontData fontData) {
- if (fontData == null)
- return SWT.NONE;
-
- int fontStyle = fontData.getStyle();
- // CSS2 font-style
- CSSPrimitiveValue cssFontStyle = fontProperties.getStyle();
- if (cssFontStyle != null) {
- String style = cssFontStyle.getStringValue();
- if ("italic".equals(style)) {
- fontStyle = fontStyle | SWT.ITALIC;
- } else {
- if (fontStyle == (fontStyle | SWT.ITALIC))
- fontStyle = fontStyle ^ SWT.ITALIC;
- }
- }
- // CSS font-weight
- CSSPrimitiveValue cssFontWeight = fontProperties.getWeight();
- if (cssFontWeight != null) {
- String weight = cssFontWeight.getStringValue();
- if ("bold".equals(weight.toLowerCase())) {
- fontStyle = fontStyle | SWT.BOLD;
- } else {
- if (fontStyle == (fontStyle | SWT.BOLD))
- fontStyle = fontStyle ^ SWT.BOLD;
- }
- }
- return fontStyle;
- }
-
- /**
- * Return CSS Value font-family from Control Font
- *
- * @param control
- * @return
- */
- public static String getFontFamily(Control control) {
- return getFontFamily(control.getFont());
- }
-
- /**
- * Return CSS Value font-family from SWT Font
- *
- * @param font
- * @return
- */
- public static String getFontFamily(Font font) {
- FontData fontData = getFirstFontData(font);
- return getFontFamily(fontData);
- }
-
- public static String getFontFamily(FontData fontData) {
- if (fontData != null) {
- String family = fontData.getName();
- return CSS2FontHelper.getFontFamily(family);
- }
- return null;
- }
-
- /**
- * Return CSS Value font-size from Control Font
- *
- * @param control
- * @return
- */
- public static String getFontSize(Control control) {
- return getFontSize(control.getFont());
- }
-
- /**
- * Return CSS Value font-size from SWT Font
- *
- * @param font
- * @return
- */
- public static String getFontSize(Font font) {
- FontData fontData = getFirstFontData(font);
- return getFontSize(fontData);
- }
-
- public static String getFontSize(FontData fontData) {
- if (fontData != null)
- return CSS2FontHelper.getFontSize(fontData.getHeight());
- return null;
- }
-
- /**
- * Return CSS Value font-style from SWT Font
- *
- * @param control
- * @return
- */
- public static String getFontStyle(Control control) {
- return getFontStyle(control.getFont());
- }
-
- /**
- * Return CSS Value font-style from SWT Font
- *
- * @param font
- * @return
- */
- public static String getFontStyle(Font font) {
- FontData fontData = getFirstFontData(font);
- return getFontStyle(fontData);
- }
-
- public static String getFontStyle(FontData fontData) {
- boolean isItalic = false;
- if (fontData != null) {
- isItalic = isItalic(fontData);
- }
- return CSS2FontHelper.getFontStyle(isItalic);
- }
-
- public static boolean isItalic(FontData fontData) {
- int fontStyle = fontData.getStyle();
- return ((fontStyle | SWT.ITALIC) == fontStyle);
- }
-
- /**
- * Return CSS Value font-weight from Control Font
- *
- * @param control
- * @return
- */
- public static String getFontWeight(Control control) {
- return getFontWeight(control.getFont());
- }
-
- /**
- * Return CSS Value font-weight from Control Font
- *
- * @param font
- * @return
- */
- public static String getFontWeight(Font font) {
- FontData fontData = getFirstFontData(font);
- return getFontWeight(fontData);
- }
-
- public static String getFontWeight(FontData fontData) {
- boolean isBold = false;
- if (fontData != null) {
- isBold = isBold(fontData);
- }
- return CSS2FontHelper.getFontWeight(isBold);
- }
-
- public static boolean isBold(FontData fontData) {
- int fontStyle = fontData.getStyle();
- return ((fontStyle | SWT.BOLD) == fontStyle);
- }
-
- /**
- * Return CSS Value font-family from Control Font
- *
- * @param control
- * @return
- */
- public static String getFontComposite(Control control) {
- return getFontComposite(control.getFont());
- }
-
- /**
- * Return CSS Value font-family from SWT Font
- *
- * @param font
- * @return
- */
- public static String getFontComposite(Font font) {
- FontData fontData = getFirstFontData(font);
- return getFontComposite(fontData);
- }
-
- public static String getFontComposite(FontData fontData) {
- if (fontData != null) {
- StringBuffer composite = new StringBuffer();
- // font-family
- composite.append(getFontFamily(fontData));
- composite.append(" ");
- // font-size
- composite.append(getFontSize(fontData));
- composite.append(" ");
- // font-weight
- composite.append(getFontWeight(fontData));
- composite.append(" ");
- // font-style
- composite.append(getFontStyle(fontData));
- return composite.toString();
- }
- return null;
- }
-
- /**
- * Return first FontData from Control Font.
- *
- * @param control
- * @return
- */
- public static FontData getFirstFontData(Control control) {
- Font font = control.getFont();
- if (font == null)
- return null;
- return getFirstFontData(font);
- }
-
- /**
- *
- * Return first FontData from SWT Font.
- *
- * @param font
- * @return
- */
- public static FontData getFirstFontData(Font font) {
- FontData[] fontDatas = font.getFontData();
- if (fontDatas == null || fontDatas.length < 1)
- return null;
- return fontDatas[0];
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTHelpers.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTHelpers.java
deleted file mode 100644
index b44af75..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTHelpers.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.helpers;
-
-import org.eclipse.e4.ui.css.core.dom.properties.CSSBorderProperties;
-import org.eclipse.e4.ui.css.core.resources.IResourcesRegistry;
-import org.eclipse.e4.ui.css.swt.CSSSWTConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- * SWT Helper to transform CSS w3c object (org.w3c.dom.css.RGBColor....) into
- * SWT object (org.eclipse.swt.graphics.Color...).
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSSWTHelpers {
-
- /*--------------- SWT Font Helper -----------------*/
-
- /*--------------- SWT Cursor Helper -----------------*/
-
- /*--------------- SWT Image Helper -----------------*/
-
- /*--------------- SWT Border Helper -----------------*/
-
- public static PaintListener createBorderPaintListener(
- final Control control, final IResourcesRegistry resourcesRegistry) {
- return new PaintListener() {
- public void paintControl(PaintEvent e) {
- CSSBorderProperties border = (CSSBorderProperties) control
- .getData(CSSSWTConstants.CONTROL_CSS2BORDER_KEY);
- if (border == null)
- return;
- int width = border.getWidth();
- GC gc = e.gc;
- CSSPrimitiveValue value = border.getColor();
- if (value == null)
- return;
- Color color = CSSSWTColorHelper.getSWTColor(value, control
- .getDisplay());
- if (color != null)
- gc.setForeground(color);
- Rectangle rect = control.getBounds();
- if (width == 0) {
- Rectangle rect1 = new Rectangle(rect.x - width, rect.y
- - width, rect.width + 2 * width, rect.height + 2
- * width);
- gc.fillRectangle(rect1);
- } else {
- String borderStyle = border.getStyle();
- // Top Line
- gc.setLineStyle(getLineStyle(borderStyle));
- gc.setLineWidth(width);
- gc.drawLine(rect.x, rect.y - 1, rect.width + 2 * width,
- rect.y - 1);
- // Bottom Line
- gc.setLineStyle(getLineStyle(borderStyle));
- gc.setLineWidth(width);
- gc.drawLine(rect.x, rect.y + rect.height + 1, rect.width
- + 2 * width, rect.y + rect.height + 1);
- // Left Line
- gc.setLineStyle(getLineStyle(borderStyle));
- gc.setLineWidth(width);
- gc.drawLine(rect.x - 1, rect.y - 1, rect.x - 1, rect.y
- + rect.height + 1);
- // Right Line
- gc.setLineStyle(getLineStyle(borderStyle));
- gc.setLineWidth(width);
- gc.drawLine(rect.width + 2 * width, rect.y - 1, rect.width
- + 2 * width, rect.y + rect.height + 1);
- }
- }
- };
- }
-
- public static int getLineStyle(String borderStyle) {
- if (borderStyle == null)
- return SWT.LINE_SOLID;
- // one hidden dotted dashed solid double groove ridge inset outset
- if ("dashed".equals(borderStyle)) {
- return SWT.LINE_DASH;
- }
- if ("dotted".equals(borderStyle)) {
- return SWT.LINE_DOT;
- }
- return SWT.LINE_SOLID;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTImageHelper.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTImageHelper.java
deleted file mode 100644
index e2910a3..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTImageHelper.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.helpers;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.e4.ui.css.core.util.resources.IResourcesLocatorManager;
-import org.eclipse.swt.graphics.Device;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSSWTImageHelper {
-
- public static Image getImage(CSSValue value,
- IResourcesLocatorManager manager, Display display) throws Exception {
- if (value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE)
- return null;
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- switch (primitiveValue.getPrimitiveType()) {
- case CSSPrimitiveValue.CSS_URI:
- String path = primitiveValue.getStringValue();
- return loadImageFromURL(display, path, manager);
- }
- return null;
- }
-
- private static Image loadImageFromURL(Device device, String path,
- IResourcesLocatorManager manager) throws Exception {
- Image result = null;
- InputStream in = null;
- try {
- // URL url = new URL(path);
- in = manager.getInputStream(path);
- result = new Image(device, in);
- // } catch (IOException e) {
- // e.printStackTrace();
- // return null;
- // } catch (SWTException e) {
- // if (e.code != SWT.ERROR_INVALID_IMAGE) {
- // throw e;
- // }
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException e) {
- // e.printStackTrace();
- throw e;
- }
- }
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTElementHelpers.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTElementHelpers.java
deleted file mode 100644
index 35b0ecf..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTElementHelpers.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.helpers;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.dom.SWTElement;
-import org.eclipse.e4.ui.css.swt.dom.html.SWTHTMLElement;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Widget;
-import org.w3c.dom.Element;
-
-/**
- * SWT Helper to link w3c Element with SWT widget.
- */
-public class SWTElementHelpers {
-
- public static final String SWT_ELEMENT_KEY = "org.eclipse.e4.ui.core.css.swt.dom.SWTElement.ELEMENT";
- public static final String SWT_NODELIST_KEY = "org.eclipse.e4.ui.core.css.swt.dom.SWTElement.NODELIST";
-
- private static final Class[] ELEMENT_CONSTRUCTOR_PARAM = { Widget.class,
- CSSEngine.class };
-
- /**
- * Return the w3c Element linked to the SWT widget.
- *
- * @param widget
- * @return
- */
- public static Element getElement(Widget widget, CSSEngine engine,
- Class classElement) throws NoSuchMethodException,
- InvocationTargetException, InstantiationException,
- IllegalAccessException {
- Constructor constructor = classElement
- .getConstructor(ELEMENT_CONSTRUCTOR_PARAM);
- Object[] o = { widget, engine };
- Element newElement = (Element) constructor.newInstance(o);
- return newElement;
- }
-
- /**
- * Return the w3c Element linked to the SWT widget.
- *
- * @param widget
- * @return
- */
- public static Element getElement(Widget widget, CSSEngine engine) {
- try {
- return getElement(widget, engine, SWTElement.class);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Return the w3c Element linked to the SWT widget.
- *
- * @param widget
- * @return
- */
- public static Element getHTMLElement(Widget widget, CSSEngine engine) {
- try {
- return getElement(widget, engine, SWTHTMLElement.class);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Return the SWT Control which is wrapped to the object
- * <code>element</code>.
- *
- * @param element
- * @return
- */
- public static Control getControl(Object element) {
- if (element instanceof Control) {
- return (Control) element;
- } else {
- if (element instanceof CSSStylableElement) {
- CSSStylableElement elt = (CSSStylableElement) element;
- Object widget = elt.getNativeWidget();
- if (widget instanceof Control)
- return (Control) widget;
- }
- }
- return null;
- }
-
- /**
- * Return the SWT Widget which is wrapped to the object <code>element</code>.
- *
- * @param element
- * @return
- */
- public static Widget getWidget(Object element) {
- if (element instanceof Widget) {
- return (Widget) element;
- } else {
- if (element instanceof CSSStylableElement) {
- CSSStylableElement elt = (CSSStylableElement) element;
- Object widget = elt.getNativeWidget();
- if (widget instanceof Widget)
- return (Widget) widget;
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTStyleHelpers.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTStyleHelpers.java
deleted file mode 100644
index 1cc191c..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/SWTStyleHelpers.java
+++ /dev/null
@@ -1,662 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.helpers;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * SWT Helper to get SWT styles {@link Widget} as String.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class SWTStyleHelpers {
-
- /**
- * Return SWT style constant from {@link Widget} <code>widget</code> as
- * String. Each SWT style are separate with space character.
- *
- * @param style
- * @return
- */
- public static String getSWTWidgetStyleAsString(Widget widget) {
- return getSWTWidgetStyleAsString(widget.getStyle(), " ");
- }
-
- /**
- * Return SWT style constant <code>style</code> as String. Each SWT style
- * are separate with <code>separator</code> String.
- *
- * @param style
- * @return
- */
- public static String getSWTWidgetStyleAsString(int style, String separator) {
- StringBuffer swtStyles = new StringBuffer();
- // Use catch error if SWT version doesn't provide
- // the SWT constant
- try {
- if ((style & SWT.BAR) != 0)
- addSWTStyle(swtStyles, "SWT.BAR", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.DROP_DOWN) != 0)
- addSWTStyle(swtStyles, "SWT.DROP_DOWN", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.POP_UP) != 0)
- addSWTStyle(swtStyles, "SWT.POP_UP", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SEPARATOR) != 0)
- addSWTStyle(swtStyles, "SWT.SEPARATOR", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.TOGGLE) != 0)
- addSWTStyle(swtStyles, "SWT.TOGGLE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ARROW) != 0)
- addSWTStyle(swtStyles, "SWT.ARROW", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.PUSH) != 0)
- addSWTStyle(swtStyles, "SWT.PUSH", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.RADIO) != 0)
- addSWTStyle(swtStyles, "SWT.RADIO", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CHECK) != 0)
- addSWTStyle(swtStyles, "SWT.CHECK", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CASCADE) != 0)
- addSWTStyle(swtStyles, "SWT.CASCADE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MULTI) != 0)
- addSWTStyle(swtStyles, "SWT.MULTI", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SINGLE) != 0)
- addSWTStyle(swtStyles, "SWT.SINGLE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.READ_ONLY) != 0)
- addSWTStyle(swtStyles, "SWT.READ_ONLY", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.WRAP) != 0)
- addSWTStyle(swtStyles, "SWT.WRAP", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SEARCH) != 0)
- addSWTStyle(swtStyles, "SWT.SEARCH", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SIMPLE) != 0)
- addSWTStyle(swtStyles, "SWT.SIMPLE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.PASSWORD) != 0)
- addSWTStyle(swtStyles, "SWT.PASSWORD", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SHADOW_IN) != 0)
- addSWTStyle(swtStyles, "SWT.SHADOW_IN", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SHADOW_OUT) != 0)
- addSWTStyle(swtStyles, "SWT.SHADOW_OUT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SHADOW_ETCHED_IN) != 0)
- addSWTStyle(swtStyles, "SWT.SHADOW_ETCHED_IN", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SHADOW_ETCHED_OUT) != 0)
- addSWTStyle(swtStyles, "SWT.SHADOW_ETCHED_OUT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SHADOW_NONE) != 0)
- addSWTStyle(swtStyles, "SWT.SHADOW_NONE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.INDETERMINATE) != 0)
- addSWTStyle(swtStyles, "SWT.INDETERMINATE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.TOOL) != 0)
- addSWTStyle(swtStyles, "SWT.TOOL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NO_TRIM) != 0)
- addSWTStyle(swtStyles, "SWT.NO_TRIM", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.RESIZE) != 0)
- addSWTStyle(swtStyles, "SWT.RESIZE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.TITLE) != 0)
- addSWTStyle(swtStyles, "SWT.TITLE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CLOSE) != 0)
- addSWTStyle(swtStyles, "SWT.CLOSE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MENU) != 0)
- addSWTStyle(swtStyles, "SWT.MENU", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MIN) != 0)
- addSWTStyle(swtStyles, "SWT.MIN", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MAX) != 0)
- addSWTStyle(swtStyles, "SWT.MAX", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.H_SCROLL) != 0)
- addSWTStyle(swtStyles, "SWT.H_SCROLL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.V_SCROLL) != 0)
- addSWTStyle(swtStyles, "SWT.V_SCROLL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.BORDER) != 0)
- addSWTStyle(swtStyles, "SWT.BORDER", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CLIP_CHILDREN) != 0)
- addSWTStyle(swtStyles, "SWT.CLIP_CHILDREN", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CLIP_SIBLINGS) != 0)
- addSWTStyle(swtStyles, "SWT.CLIP_SIBLINGS", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ON_TOP) != 0)
- addSWTStyle(swtStyles, "SWT.ON_TOP", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SHELL_TRIM) != 0)
- addSWTStyle(swtStyles, "SWT.SHELL_TRIM", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.DIALOG_TRIM) != 0)
- addSWTStyle(swtStyles, "SWT.DIALOG_TRIM", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MODELESS) != 0)
- addSWTStyle(swtStyles, "SWT.MODELESS", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MODELESS) != 0)
- addSWTStyle(swtStyles, "SWT.MODELESS", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.PRIMARY_MODAL) != 0)
- addSWTStyle(swtStyles, "SWT.PRIMARY_MODAL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.APPLICATION_MODAL) != 0)
- addSWTStyle(swtStyles, "SWT.APPLICATION_MODAL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SYSTEM_MODAL) != 0)
- addSWTStyle(swtStyles, "SWT.SYSTEM_MODAL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.HIDE_SELECTION) != 0)
- addSWTStyle(swtStyles, "SWT.HIDE_SELECTION", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.FULL_SELECTION) != 0)
- addSWTStyle(swtStyles, "SWT.FULL_SELECTION", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.FLAT) != 0)
- addSWTStyle(swtStyles, "SWT.FLAT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SMOOTH) != 0)
- addSWTStyle(swtStyles, "SWT.SMOOTH", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NO_BACKGROUND) != 0)
- addSWTStyle(swtStyles, "SWT.NO_BACKGROUND", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NO_FOCUS) != 0)
- addSWTStyle(swtStyles, "SWT.NO_FOCUS", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NO_REDRAW_RESIZE) != 0)
- addSWTStyle(swtStyles, "SWT.NO_REDRAW_RESIZE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NO_MERGE_PAINTS) != 0)
- addSWTStyle(swtStyles, "SWT.NO_MERGE_PAINTS", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NO_RADIO_GROUP) != 0)
- addSWTStyle(swtStyles, "SWT.NO_RADIO_GROUP", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LEFT_TO_RIGHT) != 0)
- addSWTStyle(swtStyles, "SWT.LEFT_TO_RIGHT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.RIGHT_TO_LEFT) != 0)
- addSWTStyle(swtStyles, "SWT.RIGHT_TO_LEFT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MIRRORED) != 0)
- addSWTStyle(swtStyles, "SWT.MIRRORED", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.VIRTUAL) != 0)
- addSWTStyle(swtStyles, "SWT.VIRTUAL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.DOUBLE_BUFFERED) != 0)
- addSWTStyle(swtStyles, "SWT.DOUBLE_BUFFERED", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.UP) != 0)
- addSWTStyle(swtStyles, "SWT.UP", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.TOP) != 0)
- addSWTStyle(swtStyles, "SWT.TOP", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.DOWN) != 0)
- addSWTStyle(swtStyles, "SWT.DOWN", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.BOTTOM) != 0)
- addSWTStyle(swtStyles, "SWT.BOTTOM", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LEAD) != 0)
- addSWTStyle(swtStyles, "SWT.LEAD", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LEFT) != 0)
- addSWTStyle(swtStyles, "SWT.LEFT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.TRAIL) != 0)
- addSWTStyle(swtStyles, "SWT.TRAIL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.RIGHT) != 0)
- addSWTStyle(swtStyles, "SWT.RIGHT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CENTER) != 0)
- addSWTStyle(swtStyles, "SWT.CENTER", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.HORIZONTAL) != 0)
- addSWTStyle(swtStyles, "SWT.HORIZONTAL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.VERTICAL) != 0)
- addSWTStyle(swtStyles, "SWT.VERTICAL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.DATE) != 0)
- addSWTStyle(swtStyles, "SWT.DATE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.TIME) != 0)
- addSWTStyle(swtStyles, "SWT.TIME", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CALENDAR) != 0)
- addSWTStyle(swtStyles, "SWT.CALENDAR", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SHORT) != 0)
- addSWTStyle(swtStyles, "SWT.SHORT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MEDIUM) != 0)
- addSWTStyle(swtStyles, "SWT.MEDIUM", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LONG) != 0)
- addSWTStyle(swtStyles, "SWT.LONG", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.MOZILLA) != 0)
- addSWTStyle(swtStyles, "SWT.MOZILLA", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.BALLOON) != 0)
- addSWTStyle(swtStyles, "SWT.BALLOON", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.BEGINNING) != 0)
- addSWTStyle(swtStyles, "SWT.BEGINNING", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.FILL) != 0)
- addSWTStyle(swtStyles, "SWT.FILL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.DBCS) != 0)
- addSWTStyle(swtStyles, "SWT.DBCS", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ALPHA) != 0)
- addSWTStyle(swtStyles, "SWT.ALPHA", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NATIVE) != 0)
- addSWTStyle(swtStyles, "SWT.NATIVE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.PHONETIC) != 0)
- addSWTStyle(swtStyles, "SWT.PHONETIC", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ROMAN) != 0)
- addSWTStyle(swtStyles, "SWT.ROMAN", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ICON_ERROR) != 0)
- addSWTStyle(swtStyles, "SWT.ICON_ERROR", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ICON_INFORMATION) != 0)
- addSWTStyle(swtStyles, "SWT.ICON_INFORMATION", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ICON_QUESTION) != 0)
- addSWTStyle(swtStyles, "SWT.ICON_QUESTION", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ICON_WARNING) != 0)
- addSWTStyle(swtStyles, "SWT.ICON_WARNING", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ICON_WORKING) != 0)
- addSWTStyle(swtStyles, "SWT.ICON_WORKING", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.OK) != 0)
- addSWTStyle(swtStyles, "SWT.OK", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.YES) != 0)
- addSWTStyle(swtStyles, "SWT.YES", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NO) != 0)
- addSWTStyle(swtStyles, "SWT.NO", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CANCEL) != 0)
- addSWTStyle(swtStyles, "SWT.CANCEL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ABORT) != 0)
- addSWTStyle(swtStyles, "SWT.ABORT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.RETRY) != 0)
- addSWTStyle(swtStyles, "SWT.RETRY", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.IGNORE) != 0)
- addSWTStyle(swtStyles, "SWT.IGNORE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.OPEN) != 0)
- addSWTStyle(swtStyles, "SWT.OPEN", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.SAVE) != 0)
- addSWTStyle(swtStyles, "SWT.SAVE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.INHERIT_NONE) != 0)
- addSWTStyle(swtStyles, "SWT.INHERIT_NONE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.INHERIT_DEFAULT) != 0)
- addSWTStyle(swtStyles, "SWT.INHERIT_DEFAULT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.INHERIT_FORCE) != 0)
- addSWTStyle(swtStyles, "SWT.INHERIT_FORCE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ERROR_MENU_NOT_DROP_DOWN) != 0)
- addSWTStyle(swtStyles, "SWT.ERROR_MENU_NOT_DROP_DOWN",
- separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ERROR_MENUITEM_NOT_CASCADE) != 0)
- addSWTStyle(swtStyles, "SWT.ERROR_MENUITEM_NOT_CASCADE",
- separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ERROR_MENU_NOT_BAR) != 0)
- addSWTStyle(swtStyles, "SWT.ERROR_MENU_NOT_BAR", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ERROR_MENU_NOT_POP_UP) != 0)
- addSWTStyle(swtStyles, "SWT.ERROR_MENU_NOT_POP_UP", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.NORMAL) != 0)
- addSWTStyle(swtStyles, "SWT.NORMAL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.BOLD) != 0)
- addSWTStyle(swtStyles, "SWT.BOLD", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.ITALIC) != 0)
- addSWTStyle(swtStyles, "SWT.ITALIC", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CAP_FLAT) != 0)
- addSWTStyle(swtStyles, "SWT.CAP_FLAT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CAP_ROUND) != 0)
- addSWTStyle(swtStyles, "SWT.CAP_ROUND", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.CAP_SQUARE) != 0)
- addSWTStyle(swtStyles, "SWT.CAP_SQUARE", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.JOIN_MITER) != 0)
- addSWTStyle(swtStyles, "SWT.JOIN_MITER", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.JOIN_BEVEL) != 0)
- addSWTStyle(swtStyles, "SWT.JOIN_BEVEL", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LINE_SOLID) != 0)
- addSWTStyle(swtStyles, "SWT.LINE_SOLID", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LINE_DASH) != 0)
- addSWTStyle(swtStyles, "SWT.LINE_DASH", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LINE_DOT) != 0)
- addSWTStyle(swtStyles, "SWT.LINE_DOT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LINE_DASHDOT) != 0)
- addSWTStyle(swtStyles, "SWT.LINE_DASHDOT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LINE_DASHDOTDOT) != 0)
- addSWTStyle(swtStyles, "SWT.LINE_DASHDOTDOT", separator);
- } catch (Exception e) {
- }
- try {
- if ((style & SWT.LINE_CUSTOM) != 0)
- addSWTStyle(swtStyles, "SWT.LINE_CUSTOM", separator);
- } catch (Exception e) {
- }
- return swtStyles.toString();
- }
-
- /**
- * Add SWT String <code>style</code> to the {@link StringBuffer}
- * <cod>swtStyles</code> and separate it with <code>separator</code>
- * String.
- *
- * @param swtStyles
- * @param style
- * @param separator
- */
- private static void addSWTStyle(StringBuffer swtStyles, String style,
- String separator) {
- if (swtStyles.length() > 0)
- swtStyles.append(separator);
- swtStyles.append(style);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/AbstractCSSPropertySWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/AbstractCSSPropertySWTHandler.java
deleted file mode 100644
index 29a4042..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/AbstractCSSPropertySWTHandler.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract CSS Property SWT Handler to check if the <code>element</code>
- * coming from applyCSSProperty and retrieveCSSProperty methods is SWT Control.
- */
-public abstract class AbstractCSSPropertySWTHandler implements
- ICSSPropertyHandler {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.dom.properties.ICSSPropertyHandler#applyCSSProperty(java.lang.Object,
- * java.lang.String, org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- // The SWT control is retrieved
- // the apply CSS property can be done.
- this.applyCSSProperty(control, property, value, pseudo, engine);
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.dom.properties.ICSSPropertyHandler#retrieveCSSProperty(java.lang.Object,
- * java.lang.String, org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- public String retrieveCSSProperty(Object element, String property, String pseudo,
- CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- // The SWT control is retrieved
- // the retrieve CSS property can be done.
- return retrieveCSSProperty(control, property, pseudo, engine);
- }
- return null;
- }
-
- /**
- * Apply CSS Property <code>property</code> (ex : background-color) with
- * CSSValue <code>value</code> (ex : red) into the SWT
- * <code>control</code> (ex : SWT Text, SWT Label).
- *
- * @param control
- * @param property
- * @param value
- * @param pseudo
- * @param engine
- * @throws Exception
- */
- protected abstract void applyCSSProperty(Control control, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception;
-
- /**
- * Retrieve CSS value (ex : red) of CSS Property <code>property</code> (ex :
- * background-color) from the SWT <code>control</code> (ex : SWT Text, SWT
- * Label).
- *
- * @param control
- * @param property
- * @param engine
- * @return
- * @throws Exception
- */
- protected abstract String retrieveCSSProperty(Control control,
- String property, String pseudo, CSSEngine engine) throws Exception;
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/AbstractConvertedCSSPropertySWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/AbstractConvertedCSSPropertySWTHandler.java
deleted file mode 100644
index a83eead..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/AbstractConvertedCSSPropertySWTHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public abstract class AbstractConvertedCSSPropertySWTHandler extends
- AbstractCSSPropertySWTHandler {
-
- protected void applyCSSProperty(Control control, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Object toType = getToType(value);
- if (toType != null) {
- Object newValue = engine.convert(value, toType, control
- .getDisplay());
- // if (newValue != null)
- applyCSSPropertyValue(control, property, newValue, pseudo, engine);
- // else
- // applyCSSPropertyValue(control, property, value, pseudo, engine);
- } else {
- applyCSSPropertyValue(control, property, value, pseudo, engine);
- }
- }
-
- protected String retrieveCSSProperty(Object value, String pseudo, CSSEngine engine) {
- Object toType = getToType(value);
- if (toType != null) {
- try {
- String newValue = engine.convert(value, toType, null);
- return newValue;
- } catch (Exception e) {
-
- }
- }
- return null;
- }
-
- protected abstract void applyCSSPropertyValue(Control control,
- String property, Object value, String pseudo, CSSEngine engine)
- throws Exception;
-
- protected abstract Object getToType(Object value);
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/GradientBackgroundListener.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/GradientBackgroundListener.java
deleted file mode 100644
index 0e264e3..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/GradientBackgroundListener.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.dom.properties.Gradient;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-public class GradientBackgroundListener implements Listener {
- private Gradient grad;
- private Control control;
- private static Map handlers = new HashMap();
-
- private GradientBackgroundListener(Control control, Gradient grad) {
- this.grad = grad;
- this.control = control;
- control.addListener(SWT.Resize, this);
- }
-
- public static void handle(Control control, Gradient grad) {
- GradientBackgroundListener handler = (GradientBackgroundListener) handlers
- .get(control);
- if (handler == null) {
- handler = new GradientBackgroundListener(control, grad);
- handlers.put(control, handler);
- }
- else {
- handler.grad = grad;
- handler.handleEvent(null);
- }
- }
-
- public void handleEvent(Event event) {
- Point size = control.getSize();
- if (size.x <= 0 || size.y <= 0)
- return;
- /*
- * Dispose the old background image.
- */
- Image oldImage = control.getBackgroundImage();
- if (oldImage != null && !oldImage.isDisposed()) {
- oldImage.dispose();
- oldImage = null;
- }
- /*
- * Draw the new background.
- */
- Image newImage = new Image(control.getDisplay(), size.x, size.y);
- GC gc = new GC(newImage);
- List colors = new ArrayList();
- for (Iterator iterator = grad.getRGBs().iterator(); iterator.hasNext();) {
- RGB rgb = (RGB) iterator.next();
- Color color = new Color(control.getDisplay(), rgb.red, rgb.green,
- rgb.blue);
- colors.add(color);
-
- }
- fillGradient(gc, new Rectangle(0, 0, size.x, size.y), colors, grad
- .getPercents(), true);
- gc.dispose();
- for (Iterator iterator = colors.iterator(); iterator.hasNext();) {
- Color c = (Color) iterator.next();
- c.dispose(); // Dispose colors too.
- }
- /*
- * Set the new background.
- */
- control.setBackgroundImage(newImage);
- }
-
- /*
- * Fills a gradient rectangle in the specified gc with the specified colors
- * and percentages.
- *
- * @param gc @param rect @param gradientColors @param gradientPercents
- * @param gradientVertical
- */
- private static void fillGradient(GC gc, Rectangle rect,
- List gradientColors, List gradientPercents, boolean gradientVertical) {
- Color background = (Color) gradientColors
- .get(gradientColors.size() - 1);
- if (gradientColors.size() == 1) {
- if (gradientColors.get(0) != null)
- gc.setBackground((Color) gradientColors.get(0));
- gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
- } else {
- Color lastColor = (Color) gradientColors.get(0);
- int pos = (gradientVertical) ? rect.y : rect.x;
- int loopCount = Math.min(gradientColors.size() - 1,
- gradientPercents.size());
- for (int i = 0; i < loopCount; ++i) {
- gc.setForeground(lastColor);
- lastColor = (Color) gradientColors.get(i + 1);
- if (lastColor == null)
- lastColor = background;
- gc.setBackground(lastColor);
- int grpercent = ((Integer) gradientPercents.get(i)).intValue();
- if (gradientVertical) {
- final int gradientHeight = (grpercent * rect.height / 100)
- - (pos - rect.y);
- gc.fillGradientRectangle(rect.x, pos, rect.width,
- gradientHeight, true);
- pos += gradientHeight;
- } else {
- final int gradientWidth = (grpercent * rect.width / 100)
- - (pos - rect.x);
- gc.fillGradientRectangle(pos, rect.y, gradientWidth,
- rect.height, false);
- pos += gradientWidth;
- }
- }
- if (gradientVertical && pos < rect.height) {
- gc.setBackground(background);
- gc.fillRectangle(rect.x, pos, rect.width, rect.height - pos);
- }
- if (!gradientVertical && pos < rect.width) {
- gc.setBackground(background);
- gc.fillRectangle(pos, rect.y, rect.width - pos, rect.height);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTColorConverterImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTColorConverterImpl.java
deleted file mode 100644
index 27307d2..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTColorConverterImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.converters;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.RGBColor;
-
-/**
- * CSS Value converter to convert :
- * <ul>
- * <li>CSS Value to {@link Color}</li>.
- * <li>{@link Color} to String CSS Value</li>
- * </ul>
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSValueSWTColorConverterImpl extends AbstractCSSValueConverter {
-
- public static final ICSSValueConverter INSTANCE = new CSSValueSWTColorConverterImpl();
-
- public CSSValueSWTColorConverterImpl() {
- super(Color.class);
- }
-
- public Object convert(CSSValue value, CSSEngine engine, Object context)
- throws Exception {
- Display display = (Display) context;
- return CSSSWTColorHelper.getSWTColor(value, display);
- }
-
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception {
- Color color = (Color) value;
- RGBColor rgbColor = CSSSWTColorHelper.getRGBColor(color);
- return CSS2ColorHelper.getColorStringValue(rgbColor, config);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTCursorConverterImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTCursorConverterImpl.java
deleted file mode 100644
index 4708cc9..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTCursorConverterImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.converters;
-
-import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTCursorHelper;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSValueSWTCursorConverterImpl extends AbstractCSSValueConverter {
-
- public static final ICSSValueConverter INSTANCE = new CSSValueSWTCursorConverterImpl();
-
- public CSSValueSWTCursorConverterImpl() {
- super(Cursor.class);
- }
-
- public Object convert(CSSValue value, CSSEngine engine, Object context) {
- Display display = (Display) context;
- return CSSSWTCursorHelper.getSWTCursor(value, display);
-
- }
-
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception {
- Cursor cursor = (Cursor) value;
- return CSSSWTCursorHelper.getCSSCursor(cursor);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTFontConverterImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTFontConverterImpl.java
deleted file mode 100644
index 461e800..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTFontConverterImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.converters;
-
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSValueSWTFontConverterImpl extends
- CSSValueSWTFontDataConverterImpl {
-
- public static final ICSSValueConverter INSTANCE = new CSSValueSWTFontConverterImpl();
-
- public CSSValueSWTFontConverterImpl() {
- super(Font.class);
- }
-
- public Object convert(CSSValue value, CSSEngine engine, Object context)
- throws Exception {
- FontData fontData = (FontData) super.convert(value, engine, context);
- if (fontData != null) {
- Display display = super.getDisplay(context);
- return new Font(display, fontData);
- }
- return null;
- }
-
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception {
- Font font = (Font) value;
- return super.convert(CSSSWTFontHelper.getFirstFontData(font), engine,
- context, config);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTFontDataConverterImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTFontDataConverterImpl.java
deleted file mode 100644
index a3c1e05..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTFontDataConverterImpl.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.converters;
-
-import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * CSS Value converter to convert :
- * <ul>
- * <li>CSS Value to {@link FontData}</li>.
- * <li>{@link FontData} to String CSS Value</li>
- * </ul>
- */
-public class CSSValueSWTFontDataConverterImpl extends AbstractCSSValueConverter {
-
- public static final ICSSValueConverter INSTANCE = new CSSValueSWTFontDataConverterImpl();
-
- public CSSValueSWTFontDataConverterImpl(Object toType) {
- super(toType);
- }
-
- public CSSValueSWTFontDataConverterImpl() {
- super(FontData.class);
- }
-
- public Object convert(CSSValue value, CSSEngine engine, Object context)
- throws Exception {
- FontData fontData = null;
- if (context != null) {
- if (context instanceof Display) {
- Display display = (Display) context;
- Font font = display.getSystemFont();
- fontData = CSSSWTFontHelper.getFirstFontData(font);
- }
- if (context instanceof Control) {
- Control control = (Control) context;
- Font font = control.getFont();
- fontData = CSSSWTFontHelper.getFirstFontData(font);
- }
- if (context instanceof Font) {
- Font font = (Font)context;
- fontData = CSSSWTFontHelper.getFirstFontData(font);
- }
- }
- if (fontData != null) {
- if (value instanceof CSS2FontProperties) {
- return CSSSWTFontHelper.getFontData((CSS2FontProperties) value,
- fontData);
- }
- }
- return null;
- }
-
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception {
- FontData fontData = (FontData) value;
- if (context instanceof String) {
- String property = (String) context;
- if ("font-family".equals(property))
- return CSSSWTFontHelper.getFontFamily(fontData);
- if ("font-size".equals(property))
- return CSSSWTFontHelper.getFontSize(fontData);
- if ("font-style".equals(property))
- return CSSSWTFontHelper.getFontStyle(fontData);
- if ("font-weight".equals(property))
- return CSSSWTFontHelper.getFontWeight(fontData);
- if ("font".equals(property))
- return CSSSWTFontHelper.getFontComposite(fontData);
- }
- return null;
-
- }
-
- protected Display getDisplay(Object context) {
- if (context instanceof Display)
- return (Display) context;
- if (context instanceof Control)
- return ((Control) context).getDisplay();
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTGradientConverterImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTGradientConverterImpl.java
deleted file mode 100644
index f72dee5..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTGradientConverterImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.converters;
-
-import org.eclipse.e4.ui.css.core.dom.properties.Gradient;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.CSSValueList;
-
-/**
- * CSS Value converter to convert :
- * <ul>
- * <li>CSS Value to {@link Gradient}</li>.
- * <li>{@link Gradient} to String CSS Value</li>
- * </ul>
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSValueSWTGradientConverterImpl extends AbstractCSSValueConverter {
-
- public static final ICSSValueConverter INSTANCE = new CSSValueSWTGradientConverterImpl();
-
- public CSSValueSWTGradientConverterImpl() {
- super(Gradient.class);
- }
-
- public Object convert(CSSValue value, CSSEngine engine, Object context) {
- if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST)
- return CSSSWTColorHelper.getGradient((CSSValueList) value);
- return null;
- }
-
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTImageConverterImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTImageConverterImpl.java
deleted file mode 100644
index 8556bf8..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTImageConverterImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.converters;
-
-import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTImageHelper;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSValueSWTImageConverterImpl extends AbstractCSSValueConverter {
-
- public static final ICSSValueConverter INSTANCE = new CSSValueSWTImageConverterImpl();
-
- public CSSValueSWTImageConverterImpl() {
- super(Image.class);
- }
-
- public Object convert(CSSValue value, CSSEngine engine, Object context)
- throws Exception {
- Display display = (Display) context;
- return CSSSWTImageHelper.getImage(value, engine
- .getResourcesLocatorManager(), display);
- }
-
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception {
- // TODO : manage SWT image to CSS value conversion.
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTRGBConverterImpl.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTRGBConverterImpl.java
deleted file mode 100644
index cb118e0..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/converters/CSSValueSWTRGBConverterImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.converters;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.AbstractCSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverter;
-import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper;
-import org.eclipse.swt.graphics.RGB;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.RGBColor;
-
-/**
- * CSS Value converter to convert :
- * <ul>
- * <li>CSS Value to {@link RGB}</li>.
- * <li>{@link RGB} to String CSS Value</li>
- * </ul>
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class CSSValueSWTRGBConverterImpl extends AbstractCSSValueConverter {
-
- public static final ICSSValueConverter INSTANCE = new CSSValueSWTRGBConverterImpl();
-
- public CSSValueSWTRGBConverterImpl() {
- super(RGB.class);
- }
-
- public Object convert(CSSValue value, CSSEngine engine, Object context)
- throws Exception {
- return CSSSWTColorHelper.getRGB(value);
- }
-
- public String convert(Object value, CSSEngine engine, Object context,
- ICSSValueConverterConfig config) throws Exception {
- RGB color = (RGB) value;
- RGBColor rgbColor = CSSSWTColorHelper.getRGBColor(color);
- return CSS2ColorHelper.getColorStringValue(rgbColor, config);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyBackgroundSWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyBackgroundSWTHandler.java
deleted file mode 100644
index e419ef5..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyBackgroundSWTHandler.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.e4.ui.css.core.dom.properties.Gradient;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyBackgroundHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyBackgroundHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.e4.ui.css.swt.properties.GradientBackgroundListener;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyBackgroundSWTHandler extends
- AbstractCSSPropertyBackgroundHandler {
-
- private static Log logger = LogFactory
- .getLog(CSSPropertyBackgroundSWTHandler.class);
-
- public final static ICSSPropertyBackgroundHandler INSTANCE = new CSSPropertyBackgroundSWTHandler();
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- super.applyCSSProperty(control, property, value, pseudo, engine);
- return true;
- }
- return false;
-
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- return super.retrieveCSSProperty(control, property, pseudo, engine);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.dom.properties.css2.AbstractCSSPropertyBackgroundHandler#applyCSSPropertyBackgroundColor(java.lang.Object,
- * org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- public void applyCSSPropertyBackgroundColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- Control control = (Control) element;
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- Color newColor = (Color) engine.convert(value, Color.class, control
- .getDisplay());
- if (control instanceof CTabFolder && "selected".equals(pseudo)) {
- ((CTabFolder) control).setSelectionBackground(newColor);
- } else {
- control.setBackground(newColor);
- }
- } else if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
- Gradient grad = (Gradient) engine.convert(value, Gradient.class,
- control.getDisplay());
- GradientBackgroundListener.handle(control, grad);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.dom.properties.css2.AbstractCSSPropertyBackgroundHandler#applyCSSPropertyBackgroundImage(java.lang.Object,
- * org.w3c.dom.css.CSSValue, java.lang.String,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- public void applyCSSPropertyBackgroundImage(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- Control control = (Control) element;
- Image image = (Image) engine.convert(value, Image.class, control
- .getDisplay());
- if (control instanceof CTabFolder && "selected".equals(pseudo)) {
- ((CTabFolder) control).setSelectionBackground(image);
- } else if (control instanceof Button) {
- Button button = ((Button) control);
- // Image oldImage = button.getImage();
- // if (oldImage != null)
- // oldImage.dispose();
- button.setImage(image);
- } else {
- try {
- control.setBackgroundImage(image);
- } catch (Throwable e) {
- if (logger.isWarnEnabled())
- logger
- .warn("Impossible to manage backround-image, This SWT version doesn't support control.setBackgroundImage(Image image) Method");
- }
- }
- }
-
- public String retrieveCSSPropertyBackgroundAttachment(Object widget,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBackgroundColor(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- Control control = (Control) element;
- Color color = control.getBackground();
- return engine.convert(color, Color.class, null);
- }
-
- public String retrieveCSSPropertyBackgroundImage(Object widget,
- String pseudo, CSSEngine engine) throws Exception {
- // TODO : manage path of Image.
- return "none";
- }
-
- public String retrieveCSSPropertyBackgroundPosition(Object widget,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyBackgroundRepeat(Object widget,
- String pseudo, CSSEngine engine) throws Exception {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyBorderSWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyBorderSWTHandler.java
deleted file mode 100644
index bfdf55e..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyBorderSWTHandler.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.CSSBorderProperties;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyBorderHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyBorderHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.impl.dom.properties.CSSBorderPropertiesImpl;
-import org.eclipse.e4.ui.css.swt.CSSSWTConstants;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTHelpers;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyBorderSWTHandler extends
- AbstractCSSPropertyBorderHandler implements ICSSPropertyHandler2 {
-
- public final static ICSSPropertyBorderHandler INSTANCE = new CSSPropertyBorderSWTHandler();
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- Composite parent = control.getParent();
- if (parent == null)
- return true;
- CSSBorderProperties border = (CSSBorderProperties) control
- .getData(CSSSWTConstants.CONTROL_CSS2BORDER_KEY);
- if (border == null) {
- border = new CSSBorderPropertiesImpl();
- control.setData(CSSSWTConstants.CONTROL_CSS2BORDER_KEY, border);
- parent.addPaintListener(CSSSWTHelpers
- .createBorderPaintListener(control, engine
- .getResourcesRegistry()));
- }
- super.applyCSSProperty(border, property, value, pseudo, engine);
- if((parent.getData("CSS_SUPPORTS_BORDERS") != null) &&
- (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)) {
- int pixelValue = (int) ((CSSPrimitiveValue) value).getFloatValue(CSSPrimitiveValue.CSS_PT);
- if(property.equals("border-width")) {
- ((FillLayout) parent.getLayout()).marginWidth = pixelValue;
- ((FillLayout) parent.getLayout()).marginHeight = pixelValue;
- }
- }
- return true;
- } else {
- if (element instanceof CSSBorderProperties) {
- super
- .applyCSSProperty(element, property, value, pseudo,
- engine);
- return true;
- }
- }
- return false;
-
- }
-
- public void onAllCSSPropertiesApplyed(Object element, CSSEngine engine)
- throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- Composite parent = control.getParent();
- if (parent != null)
- parent.redraw();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyClassificationSWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyClassificationSWTHandler.java
deleted file mode 100644
index 849d150..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyClassificationSWTHandler.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyClassificationHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyClassificationHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyClassificationSWTHandler extends
- AbstractCSSPropertyClassificationHandler {
-
- private static Log logger = LogFactory
- .getLog(CSSPropertyClassificationSWTHandler.class);
-
- public final static ICSSPropertyClassificationHandler INSTANCE = new CSSPropertyClassificationSWTHandler();
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- super.applyCSSProperty(control, property, value, pseudo, engine);
- return true;
- }
- return false;
-
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- return super.retrieveCSSProperty(control, property, pseudo, engine);
- }
- return null;
- }
-
- public void applyCSSPropertyCursor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- final Control control = (Control) element;
- Cursor cursor = (Cursor) engine.convert(value, Cursor.class,
- control.getDisplay());
- control.setCursor(cursor);
- }
- }
-
- public void applyCSSPropertyVisibility(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- Control control = (Control) element;
- CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value;
- String visibility = primitiveValue.getStringValue();
- if ("hidden".equals(visibility))
- control.setVisible(false);
- else if ("collapse".equals(visibility)) {
- // TODO : manage collapse
- control.setVisible(false);
- } else
- control.setVisible(true);
- }
- }
-
- public String retrieveCSSPropertyCursor(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- Control control = (Control) element;
- Cursor cursor = null;
- try {
- cursor = control.getCursor();
- } catch (Throwable e) {
- if (logger.isWarnEnabled())
- logger
- .warn("Impossible to manage cursor, This SWT version doesn't support control.getCursor() Method");
- }
- return engine.convert(cursor, Cursor.class, null);
- }
-
- public String retrieveCSSPropertyVisibility(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- Control control = (Control) element;
- // if (control.isVisible())
- return "visible";
- // return "hidden";
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyFontSWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyFontSWTHandler.java
deleted file mode 100644
index ccf0095..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyFontSWTHandler.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyFontHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyFontHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyFontSWTHandler extends AbstractCSSPropertyFontHandler
- implements ICSSPropertyHandler2 {
-
- public final static ICSSPropertyFontHandler INSTANCE = new CSSPropertyFontSWTHandler();
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- CSS2FontProperties fontProperties = CSSSWTFontHelper
- .getCSS2FontProperties(control, engine
- .getCSSElementContext(control));
- super.applyCSSProperty(fontProperties, property, value, pseudo,
- engine);
- return true;
- } else {
- if (element instanceof CSS2FontProperties) {
- super
- .applyCSSProperty(element, property, value, pseudo,
- engine);
- return true;
- }
- }
- return false;
-
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- return super.retrieveCSSProperty(control, property, pseudo, engine);
- }
- return null;
- }
-
- public String retrieveCSSPropertyFontAdjust(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyFontFamily(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- Control control = (Control) element;
- return CSSSWTFontHelper.getFontFamily(control);
- }
-
- public String retrieveCSSPropertyFontSize(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- Control control = (Control) element;
- return CSSSWTFontHelper.getFontSize(control);
- }
-
- public String retrieveCSSPropertyFontStretch(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyFontStyle(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- Control control = (Control) element;
- return CSSSWTFontHelper.getFontStyle(control);
-
- }
-
- public String retrieveCSSPropertyFontVariant(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public String retrieveCSSPropertyFontWeight(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- Control control = (Control) element;
- return CSSSWTFontHelper.getFontWeight(control);
- }
-
- public void onAllCSSPropertiesApplyed(Object element, CSSEngine engine)
- throws Exception {
- final Control control = SWTElementHelpers.getControl(element);
- if (control == null)
- return;
- CSS2FontProperties fontProperties = CSSSWTFontHelper
- .getCSS2FontProperties(control, engine
- .getCSSElementContext(control));
- if (fontProperties == null)
- return;
- Font font = (Font) engine.convert(fontProperties, Font.class, control);
- control.setFont(font);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyTextSWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyTextSWTHandler.java
deleted file mode 100644
index 5b5d06f..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/CSSPropertyTextSWTHandler.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2;
-
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyTextHandler;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.ICSSPropertyTextHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.CSSSWTConstants;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyTextSWTHandler extends AbstractCSSPropertyTextHandler {
-
- public final static ICSSPropertyTextHandler INSTANCE = new CSSPropertyTextSWTHandler();
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- super.applyCSSProperty(control, property, value, pseudo, engine);
- return true;
- }
- return false;
-
- }
-
- public String retrieveCSSProperty(Object element, String property,
- String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- return super.retrieveCSSProperty(control, property, pseudo, engine);
- }
- return null;
- }
-
- public void applyCSSPropertyColor(Object element, CSSValue value,
- String pseudo, CSSEngine engine) throws Exception {
- Control control = (Control) element;
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- Color newColor = (Color) engine.convert(value, Color.class, control
- .getDisplay());
- if (control instanceof CTabFolder && "selected".equals(pseudo)) {
- ((CTabFolder) control).setSelectionForeground(newColor);
- } else {
- control.setForeground(newColor);
- }
- }
- }
-
- public void applyCSSPropertyTextTransform(Object element,
- final CSSValue value, String pseudo, CSSEngine engine)
- throws Exception {
- Control control = (Control) element;
- String defaultText = (String) control.getData(CSSSWTConstants.TEXT_KEY);
- if (element instanceof Text) {
- final Text text = (Text) control;
- VerifyListener listener = (VerifyListener) text
- .getData("CSSModifyTextListener");
- if (hasTextTransform(value)) {
- if (listener == null) {
- // Add ModifyListener
- listener = new VerifyListener() {
- public void verifyText(VerifyEvent e) {
- // System.out.println(e);
- // int start = e.start;
- // int end = e.end;
- // e.text = getTextTransform(e.text, text.getText(),
- // value);
- }
- };
- text.addVerifyListener(listener);
- text.setData("CSSModifyTextListener", listener);
- }
- } else {
- if (listener != null) {
- text.removeVerifyListener(listener);
- text.setData("CSSModifyTextListener", null);
- }
- }
- String oldText = text.getText();
- String newText = getTextTransform(text.getText(), value,
- defaultText);
- if (!oldText.equals(newText))
- text.setText(newText);
- }
- if (element instanceof Label) {
- Label label = (Label) element;
- label
- .setText(getTextTransform(label.getText(), value,
- defaultText));
- return;
- }
- if (element instanceof Button) {
- Button button = (Button) element;
- button.setText(getTextTransform(button.getText(), value,
- defaultText));
- return;
- }
- }
-
- public String retrieveCSSPropertyColor(Object element, String pseudo,
- CSSEngine engine) throws Exception {
- Control control = (Control) element;
- Color color = control.getForeground();
- return engine.convert(color, Color.class, null);
- }
-
- public String retrieveCSSPropertyTextTransform(Object element,
- String pseudo, CSSEngine engine) throws Exception {
- String text = null;
- Control control = (Control) element;
- // if (control instanceof Text) {
- // final Text controlText = ((Text) element);
- // text = controlText.getText();
- // } else {
- if (control instanceof Label) {
- text = ((Label) element).getText();
- if (text != null)
- control.setData(CSSSWTConstants.TEXT_KEY, text);
- } else {
- if (control instanceof Button) {
- text = ((Button) element).getText();
- if (text != null)
- control.setData(CSSSWTConstants.TEXT_KEY, text);
- }
- }
- // }
- return "none";
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundColorHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundColorHandler.java
deleted file mode 100644
index 294697b..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundColorHandler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.background;
-
-import org.eclipse.e4.ui.css.core.dom.properties.Gradient;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
-import org.eclipse.e4.ui.css.swt.properties.GradientBackgroundListener;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyBackgroundColorHandler extends
- AbstractCSSPropertySWTHandler {
-
- public void applyCSSProperty(Control control, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- Color newColor = (Color) engine.convert(value, Color.class, control
- .getDisplay());
- if (control instanceof CTabFolder && "selected".equals(pseudo)) {
- ((CTabFolder) control).setSelectionBackground(newColor);
- } else {
- control.setBackground(newColor);
- }
- } else if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
- Gradient grad = (Gradient) engine.convert(value, Gradient.class,
- control.getDisplay());
- GradientBackgroundListener.handle(control, grad);
- }
-
- }
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- Color color = control.getBackground();
- return engine.convert(color, Color.class, null);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundHandler.java
deleted file mode 100644
index 0d27468..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.background;
-
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyBackgroundCompositeHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyBackgroundHandler extends
- AbstractCSSPropertyBackgroundCompositeHandler {
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- super.applyCSSPropertyComposite(element, property, value, pseudo,
- engine);
- return true;
- }
- return false;
- }
-
- public String retrieveCSSProperty(Object element, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundImageHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundImageHandler.java
deleted file mode 100644
index 143b191..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/background/CSSPropertyBackgroundImageHandler.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.background;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyBackgroundImageHandler extends
- AbstractCSSPropertySWTHandler {
-
- public void applyCSSProperty(Control control, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Image image = (Image) engine.convert(value, Image.class, control
- .getDisplay());
- if (control instanceof CTabFolder) {
- ((CTabFolder) control).setSelectionBackground(image);
- } else if (control instanceof Button) {
- Button button = ((Button) control);
- Image oldImage = button.getImage();
- if (oldImage != null)
- oldImage.dispose();
- button.setImage(image);
- } else
- control.setBackgroundImage(image);
- }
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return "none";
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/AbstractCSSPropertyBorderSWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/AbstractCSSPropertyBorderSWTHandler.java
deleted file mode 100644
index 9da9742..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/AbstractCSSPropertyBorderSWTHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.border;
-
-import org.eclipse.e4.ui.css.core.css2.CSSBorderPropertiesHelpers;
-import org.eclipse.e4.ui.css.core.dom.properties.CSSBorderProperties;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2Delegate;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.impl.dom.properties.CSSBorderPropertiesImpl;
-import org.eclipse.e4.ui.css.swt.CSSSWTConstants;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTHelpers;
-import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public abstract class AbstractCSSPropertyBorderSWTHandler extends
- AbstractCSSPropertySWTHandler implements ICSSPropertyHandler2Delegate {
-
- public void applyCSSProperty(Control control, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Composite parent = control.getParent();
- if (parent == null)
- return;
- CSSBorderProperties border = (CSSBorderProperties) control
- .getData(CSSSWTConstants.CONTROL_CSS2BORDER_KEY);
- if (border == null) {
- border = new CSSBorderPropertiesImpl();
- control.setData(CSSSWTConstants.CONTROL_CSS2BORDER_KEY, border);
- parent.addPaintListener(CSSSWTHelpers.createBorderPaintListener(
- control, engine.getResourcesRegistry()));
- }
- super.applyCSSProperty(border, property, value, pseudo, engine);
- }
-
- public void applyCSSProperty(CSSBorderProperties border, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- CSSBorderPropertiesHelpers.updateCSSProperty(border, property, value);
- }
-
- public ICSSPropertyHandler2 getCSSPropertyHandler2() {
- return CSSPropertyBorderSWTHandler2.INSTANCE;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderColorHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderColorHandler.java
deleted file mode 100644
index aa88f36..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderColorHandler.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.border;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyBorderColorHandler extends
- AbstractCSSPropertyBorderSWTHandler {
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderHandler.java
deleted file mode 100644
index afd7025..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderHandler.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.border;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2Delegate;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyBorderCompositeHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyBorderHandler extends
- AbstractCSSPropertyBorderCompositeHandler implements
- ICSSPropertyHandler2Delegate {
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- super.applyCSSPropertyComposite(element, property, value, pseudo,
- engine);
- return true;
- }
- return false;
- }
-
- public String retrieveCSSProperty(Object widget, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public ICSSPropertyHandler2 getCSSPropertyHandler2() {
- return CSSPropertyBorderSWTHandler2.INSTANCE;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderSWTHandler2.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderSWTHandler2.java
deleted file mode 100644
index a51ddf1..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderSWTHandler2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.border;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyBorderSWTHandler2 implements ICSSPropertyHandler2 {
-
- public static final ICSSPropertyHandler2 INSTANCE = new CSSPropertyBorderSWTHandler2();
-
- public void onAllCSSPropertiesApplyed(Object element, CSSEngine engine)
- throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- Composite parent = control.getParent();
- if (parent != null)
- parent.redraw();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderStyleHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderStyleHandler.java
deleted file mode 100644
index bfb1f7a..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderStyleHandler.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.border;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyBorderStyleHandler extends
- AbstractCSSPropertyBorderSWTHandler {
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderWidthHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderWidthHandler.java
deleted file mode 100644
index f41128d..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/border/CSSPropertyBorderWidthHandler.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.border;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyBorderWidthHandler extends
- AbstractCSSPropertyBorderSWTHandler {
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return "0";
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/classification/CSSPropertyCursorHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/classification/CSSPropertyCursorHandler.java
deleted file mode 100644
index cf4ac93..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/classification/CSSPropertyCursorHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.classification;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyCursorHandler extends AbstractCSSPropertySWTHandler {
-
- public void applyCSSProperty(Control control, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- Cursor cursor = (Cursor) engine.convert(value, Cursor.class,
- control.getDisplay());
- control.setCursor(cursor);
- }
- }
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- Cursor cursor = control.getCursor();
- return engine.convert(cursor, Cursor.class, null);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/AbstractCSSPropertyFontSWTHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/AbstractCSSPropertyFontSWTHandler.java
deleted file mode 100644
index 309d13a..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/AbstractCSSPropertyFontSWTHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.font;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2FontPropertiesHelpers;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2Delegate;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public abstract class AbstractCSSPropertyFontSWTHandler extends
- AbstractCSSPropertySWTHandler implements ICSSPropertyHandler2Delegate {
-
- public void applyCSSProperty(Control control, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- CSS2FontProperties font = CSSSWTFontHelper.getCSS2FontProperties(
- control, engine.getCSSElementContext(control));
- this.applyCSSProperty(font, property, value, pseudo, engine);
- }
-
- public ICSSPropertyHandler2 getCSSPropertyHandler2() {
- return CSSPropertyFontSWTHandler2.INSTANCE;
- }
-
- public void applyCSSProperty(CSS2FontProperties font, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- CSS2FontPropertiesHelpers.updateCSSPropertyFont(font, property, value);
- }
-
- public abstract String retrieveCSSProperty(Control control,
- String property, String pseudo, CSSEngine engine) throws Exception;
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontFamilyHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontFamilyHandler.java
deleted file mode 100644
index 48c4f08..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontFamilyHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.font;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyFontFamilyHandler extends
- AbstractCSSPropertyFontSWTHandler {
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return CSSSWTFontHelper.getFontFamily(control);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontHandler.java
deleted file mode 100644
index 7bb6e07..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.font;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2Delegate;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyFontCompositeHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.widgets.Control;
-import org.w3c.dom.css.CSSValue;
-
-public class CSSPropertyFontHandler extends
- AbstractCSSPropertyFontCompositeHandler implements
- ICSSPropertyHandler2Delegate {
-
- public boolean applyCSSProperty(Object element, String property,
- CSSValue value, String pseudo, CSSEngine engine) throws Exception {
- Control control = SWTElementHelpers.getControl(element);
- if (control != null) {
- super.applyCSSPropertyComposite(element, property, value, pseudo,
- engine);
- return true;
- }
- return false;
- }
-
- public String retrieveCSSProperty(Object widget, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return null;
- }
-
- public ICSSPropertyHandler2 getCSSPropertyHandler2() {
- return CSSPropertyFontSWTHandler2.INSTANCE;
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontSWTHandler2.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontSWTHandler2.java
deleted file mode 100644
index d3d7694..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontSWTHandler2.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.font;
-
-import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler2;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyFontSWTHandler2 implements ICSSPropertyHandler2 {
-
- public static final ICSSPropertyHandler2 INSTANCE = new CSSPropertyFontSWTHandler2();
-
- public void onAllCSSPropertiesApplyed(Object element, CSSEngine engine)
- throws Exception {
- final Control control = SWTElementHelpers.getControl(element);
- if (control == null)
- return;
- CSS2FontProperties fontProperties =CSSSWTFontHelper.getCSS2FontProperties(
- control, engine.getCSSElementContext(control));
- if (fontProperties == null)
- return;
-
- Font font = (Font) engine.convert(fontProperties, Font.class, control);
- control.setFont(font);
-
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontSizeHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontSizeHandler.java
deleted file mode 100644
index ca0287e..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontSizeHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.font;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyFontSizeHandler extends
- AbstractCSSPropertyFontSWTHandler {
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return CSSSWTFontHelper.getFontSize(control);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontStyleHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontStyleHandler.java
deleted file mode 100644
index 99f2767..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontStyleHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.font;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyFontStyleHandler extends
- AbstractCSSPropertyFontSWTHandler {
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return CSSSWTFontHelper.getFontStyle(control);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontWeightHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontWeightHandler.java
deleted file mode 100644
index dc80f4a..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/font/CSSPropertyFontWeightHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.font;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyFontWeightHandler extends
- AbstractCSSPropertyFontSWTHandler {
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- return CSSSWTFontHelper.getFontWeight(control);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/text/CSSPropertyColorHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/text/CSSPropertyColorHandler.java
deleted file mode 100644
index 123a1c7..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/css2/lazy/text/CSSPropertyColorHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.properties.css2.lazy.text;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.properties.AbstractConvertedCSSPropertySWTHandler;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Control;
-
-public class CSSPropertyColorHandler extends
- AbstractConvertedCSSPropertySWTHandler {
-
- protected void applyCSSPropertyValue(Control control, String property,
- Object value, String pseudo, CSSEngine engine) throws Exception {
- if (value instanceof Color) {
- Color color = (Color) value;
- control.setForeground(color);
- }
- }
-
- public String retrieveCSSProperty(Control control, String property, String pseudo,
- CSSEngine engine) throws Exception {
- Color color = control.getForeground();
- return retrieveCSSProperty(color, pseudo, engine);
- }
-
- protected Object getToType(Object value) {
- return Color.class;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/resources/SWTResourcesRegistry.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/resources/SWTResourcesRegistry.java
deleted file mode 100644
index 33039ab..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/resources/SWTResourcesRegistry.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.resources;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.e4.ui.css.core.resources.AbstractResourcesRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * SWT Resources Registry to cache SWT Resource like Color, Cursor and Font and
- * dispose it.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public class SWTResourcesRegistry extends AbstractResourcesRegistry {
-
- private static Log logger = LogFactory.getLog(SWTResourcesRegistry.class);
-
- public SWTResourcesRegistry(Display display) {
- if (display == null)
- return;
- // When SWT Display will dispose, all SWT resources stored
- // into cache will be dispose it too.
- display.addListener(SWT.Dispose, new Listener() {
- public void handleEvent(Event event) {
- dispose();
- }
- });
- }
-
- public Object getResource(Object type, Object key) {
- Object resource = super.getResource(type, key);
- if (resource != null) {
- // test if resource is disposed
- if (isDisposed(resource)) {
- // SWT Resource is disposed
- // unregister it.
- super.unregisterResource(resource);
- return null;
- }
- }
- return resource;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.resources.AbstractResourcesRegistry#registerResource(java.lang.String,
- * java.lang.Object, java.lang.Object)
- */
- public void registerResource(Object type, Object key, Object resource) {
- if (resource == null)
- return;
- if (logger.isDebugEnabled()) {
- if (resource instanceof Color) {
- logger.debug("Cache SWT Color key=" + key);
- } else if (resource instanceof Cursor) {
- logger.debug("Cache SWT Cursor key=" + key);
- } else if (resource instanceof Font) {
- logger.debug("Cache SWT Font key=" + key);
- } else if (resource instanceof Image) {
- logger.debug("Cache SWT Image key=" + key);
- } else
- logger.debug("Cache Resource key=" + key);
- }
- super.registerResource(type, key, resource);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.resources.AbstractResourcesRegistry#disposeResource(java.lang.Object,
- * java.lang.String, java.lang.Object)
- */
- public void disposeResource(Object type, String key, Object resource) {
- // Dispose SWT Resource
- if (resource instanceof Color) {
- ((Color)resource).dispose();
- if (logger.isDebugEnabled())
- logger.debug("Dispose SWT Color key=" + key);
- } else if (resource instanceof Cursor) {
- ((Cursor)resource).dispose();
- if (logger.isDebugEnabled())
- logger.debug("Dispose SWT Cursor key=" + key);
- } else if (resource instanceof Font) {
- ((Font)resource).dispose();
- if (logger.isDebugEnabled())
- logger.debug("Dispose SWT Font key=" + key);
- } else if (resource instanceof Image) {
- ((Image) resource).dispose();
- if (logger.isDebugEnabled())
- logger.debug("Dispose SWT Image key=" + key);
- } else if (logger.isDebugEnabled())
- logger.debug("Dispose Resource key=" + key);
- }
-
- protected boolean isDisposed(Object resource) {
- if (resource instanceof Color) {
- return ((Color) resource).isDisposed();
- } else if (resource instanceof Font) {
- return ((Font) resource).isDisposed();
- } else if (resource instanceof Image) {
- return ((Image) resource).isDisposed();
- } else if (resource instanceof Cursor) {
- return ((Cursor) resource).isDisposed();
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/AbstractDynamicPseudoClassesControlHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/AbstractDynamicPseudoClassesControlHandler.java
deleted file mode 100644
index c7f3556..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/AbstractDynamicPseudoClassesControlHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.selectors;
-
-import org.eclipse.e4.ui.css.core.dom.selectors.IDynamicPseudoClassesHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.helpers.SWTElementHelpers;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * Abstract SWT class to manage dynamic pseudo classes handler like (...:focus,
- * ...:hover) with SWT Control.
- */
-public abstract class AbstractDynamicPseudoClassesControlHandler implements
- IDynamicPseudoClassesHandler {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.dom.selectors.IDynamicPseudoClassesHandler#intialize(java.lang.Object,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- public void intialize(final Object element, final CSSEngine engine) {
- final Control control = SWTElementHelpers.getControl(element);
- if (control == null)
- return;
- intialize(control, engine);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.dom.selectors.IDynamicPseudoClassesHandler#dispose(java.lang.Object,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- public void dispose(Object element, CSSEngine engine) {
- Control control = SWTElementHelpers.getControl(element);
- if (control == null)
- return;
- dispose(control, engine);
- }
-
- /**
- * Initialize the SWT <code>control</code>. In this method you can add
- * SWT Listener to the control.
- *
- * @param control
- * @param engine
- */
- protected abstract void intialize(Control control, CSSEngine engine);
-
- /**
- * Dispose the SWT <code>control</code>. In this method you can remove
- * SWT Listener to the control.
- *
- * @param control
- * @param engine
- */
- protected abstract void dispose(Control control, CSSEngine engine);
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/DynamicPseudoClassesSWTFocusHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/DynamicPseudoClassesSWTFocusHandler.java
deleted file mode 100644
index b4c5ed8..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/DynamicPseudoClassesSWTFocusHandler.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.selectors;
-
-import org.eclipse.e4.ui.css.core.dom.selectors.IDynamicPseudoClassesHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * SWT class to manage dynamic pseudo classes handler ...:focus with SWT
- * Control.
- */
-public class DynamicPseudoClassesSWTFocusHandler extends
- AbstractDynamicPseudoClassesControlHandler {
-
- public static final IDynamicPseudoClassesHandler INSTANCE = new DynamicPseudoClassesSWTFocusHandler();
-
- private static String FOCUS_LISTENER = "org.eclipse.e4.ui.core.css.swt.selectors.FOCUS_LISTENER";
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.swt.selectors.AbstractDynamicPseudoClassesControlHandler#intialize(org.eclipse.swt.widgets.Control,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- protected void intialize(final Control control, final CSSEngine engine) {
- // Create SWT Focus Listener
- FocusListener focusListener = new FocusListener() {
- public void focusGained(FocusEvent e) {
- // control got focus, apply styles
- // into the SWT control
- try {
- engine.applyStyles(control, false, true);
- } catch (Exception ex) {
- engine.handleExceptions(ex);
- }
- }
-
- public void focusLost(FocusEvent e) {
- try {
- // Set focusLost flag to true
- control.setData("focusLost", Boolean.TRUE);
- // control lost focus, apply styles
- // into the SWT control
- engine.applyStyles(control, false, true);
- } catch (Exception ex) {
- engine.handleExceptions(ex);
- } finally {
- // Set focusLost flag to false
- control.setData("focusLost", null);
- }
- }
- };
- // Register the focus listener into Control Data
- // in order to remove it when dispose method is called.
- control.setData(FOCUS_LISTENER, focusListener);
- // Add the focus listener to the control
- control.addFocusListener(focusListener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.swt.selectors.AbstractDynamicPseudoClassesControlHandler#dispose(org.eclipse.swt.widgets.Control,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- protected void dispose(Control control, CSSEngine engine) {
- // Get the focus listener registered into control data
- FocusListener focusListener = (FocusListener) control
- .getData(FOCUS_LISTENER);
- if (focusListener != null)
- // remove the focus listener to the control
- control.removeFocusListener(focusListener);
- control.setData(FOCUS_LISTENER, null);
- }
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/DynamicPseudoClassesSWTHoverHandler.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/DynamicPseudoClassesSWTHoverHandler.java
deleted file mode 100644
index 7e8a287..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/selectors/DynamicPseudoClassesSWTHoverHandler.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.selectors;
-
-import org.eclipse.e4.ui.css.core.dom.selectors.IDynamicPseudoClassesHandler;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * SWT class to manage dynamic pseudo classes handler ...:hover with SWT
- * Control.
- */
-public class DynamicPseudoClassesSWTHoverHandler extends
- AbstractDynamicPseudoClassesControlHandler {
-
- public static final IDynamicPseudoClassesHandler INSTANCE = new DynamicPseudoClassesSWTHoverHandler();
-
- private static String MOUSE_HOVER_LISTENER = "org.eclipse.e4.ui.core.css.swt.selectors.MOUSE_HOVER_LISTENER";
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.swt.selectors.AbstractDynamicPseudoClassesControlHandler#intialize(org.eclipse.swt.widgets.Control,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- protected void intialize(final Control control, final CSSEngine engine) {
- // Create SWT MouseTrack listener
- MouseTrackAdapter mouseHoverListener = new MouseTrackAdapter() {
- public void mouseEnter(MouseEvent e) {
- try {
- // mouse hover, apply styles
- // into the SWT control
- control.setData("mouseHover", Boolean.TRUE);
- engine.applyStyles(control, false, true);
- } catch (Exception ex) {
- engine.handleExceptions(ex);
- } finally {
- control.setData("mouseHover", null);
- }
- }
-
- public void mouseExit(MouseEvent e) {
- // mouse exit, apply styles
- // into the SWT control
- try {
- control.setData("mouseHover", null);
- engine.applyStyles(control, false, true);
- } catch (Exception ex) {
- engine.handleExceptions(ex);
- }
- }
- };
- control.setData(MOUSE_HOVER_LISTENER, mouseHoverListener);
- control.addMouseTrackListener(mouseHoverListener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.swt.selectors.AbstractDynamicPseudoClassesControlHandler#dispose(org.eclipse.swt.widgets.Control,
- * org.eclipse.e4.ui.core.css.engine.CSSEngine)
- */
- protected void dispose(Control control, CSSEngine engine) {
- // Get the MouseTrack listener registered into control data
- MouseTrackAdapter mouseHoverListener = (MouseTrackAdapter) control
- .getData(MOUSE_HOVER_LISTENER);
- if (mouseHoverListener != null)
- // remove the MouseTrack listener to the control
- control.removeMouseTrackListener(mouseHoverListener);
- control.setData(MOUSE_HOVER_LISTENER, null);
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/serializers/CSSSWTSerializerConfiguration.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/serializers/CSSSWTSerializerConfiguration.java
deleted file mode 100644
index f245059..0000000
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/serializers/CSSSWTSerializerConfiguration.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.css.swt.serializers;
-
-import org.eclipse.e4.ui.css.core.serializers.CSSSerializerConfiguration;
-
-/**
- * {@link CSSSerializerConfiguration} configuration used to get style of SWT control.
- */
-public class CSSSWTSerializerConfiguration extends CSSSerializerConfiguration {
-
- public static final CSSSerializerConfiguration INSTANCE = new CSSSWTSerializerConfiguration();
-
- public CSSSWTSerializerConfiguration() {
- super.addAttributeFilter("style");
- }
-
-}
diff --git a/bundles/org.eclipse.e4.ui.workbench/Application.xmi b/bundles/org.eclipse.e4.ui.workbench/Application.xmi
new file mode 100644
index 0000000..e6dcf86
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench/Application.xmi
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="ASCII"?>
+<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:application="http://www.eclipse.org/ui/2008/Application" xsi:schemaLocation="http://www.eclipse.org/ui/2008/Application ../org.eclipse.e4.ui.model.workbench/model/Application.ecore">
+ <windows x="100" y="100" width="800" height="600">
+ <menu>
+ <items xsi:type="application:MenuItem" name="File">
+ <menu>
+ <items xsi:type="application:MenuItem" id="" name="Do Nothing"/>
+ <items xsi:type="application:MenuItem" iconURI="" name="---" separator="true"/>
+ <items xsi:type="application:MenuItem" iconURI="" name="Exit" command="//@command.0"/>
+ </menu>
+ </items>
+ <items xsi:type="application:MenuItem" name="Edit">
+ <menu>
+ <items xsi:type="application:MenuItem" iconURI="" name="Exit" command="//@command.0"/>
+ </menu>
+ </items>
+ <items xsi:type="application:MenuItem" name="Help">
+ <menu>
+ <items xsi:type="application:MenuItem" iconURI="" name="Exit" command="//@command.0"/>
+ </menu>
+ </items>
+ </menu>
+ <children policy="VerticalComposite">
+ <toolBar>
+ <items xsi:type="application:ToolBarItem" name="You Are Seeing The Default Application.xmi"/>
+ </toolBar>
+ <children xsi:type="application:SashForm" policy="HorizontalSash">
+ <children xsi:type="application:SashForm" policy="VerticalSash">
+ <children xsi:type="application:Stack">
+ <children xsi:type="application:ContributedPart" name="Library" tooltip="" URI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.workbench.ui.internal.parts.SampleView"/>
+ </children>
+ </children>
+ <children xsi:type="application:SashForm" policy="VerticalSash">
+ <children xsi:type="application:ContributedPart" name="Preview" URI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.workbench.ui.internal.parts.SampleView"/>
+ <children xsi:type="application:Stack">
+ <children xsi:type="application:ContributedPart" name="Thumbnails" URI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.workbench.ui.internal.parts.SampleView"/>
+ <children xsi:type="application:ContributedPart" name="Exif" tooltip="" URI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.workbench.ui.internal.parts.SampleView"/>
+ </children>
+ <weights>70</weights>
+ <weights>30</weights>
+ </children>
+ <weights>30</weights>
+ <weights>70</weights>
+ </children>
+ </children>
+ <handlers URI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.workbench.ui.internal.ExitHandler" command="//@command.0"/>
+ </windows>
+ <command id="org.eclipse.e4.ui.workbench.exit" name="Exit"/>
+</application:Application>
diff --git a/bundles/org.eclipse.e4.ui.workbench/META-INF/EWorkbench.xmi b/bundles/org.eclipse.e4.ui.workbench/META-INF/EWorkbench.xmi
new file mode 100644
index 0000000..32385bf
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench/META-INF/EWorkbench.xmi
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ASCII"?>
+<workbench:EWorkbench xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:workbench="http://www.eclipse.org/e4/workbench" xsi:schemaLocation="http://www.eclipse.org/e4/workbench ../../org.eclipse.e4.workbench.emf/model/Workbench.ecore" id="org.eclipse.e4.workbench">
+ <windows id="org.eclipse.e4.workbench.window">
+ <page id="org.eclipse.e4.workbench.ui.page"/>
+ </windows>
+ <styles id="tabViewInActive" gradient="gradient(colors: rgb(255, 255, 255) - rgb(236, 233, 216); percents: (75); vertical: true )"
+ height="20"/>
+ <styles id="tabViewActive" gradient="gradient(colors: rgb(175, 192, 235) - rgb(122, 150, 223); percents: (75); vertical: true )"
+ height="20"/>
+</workbench:EWorkbench>
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/behaviors/IHasInput.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/behaviors/IHasInput.java
new file mode 100644
index 0000000..2d59e16
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/behaviors/IHasInput.java
@@ -0,0 +1,29 @@
+package org.eclipse.e4.workbench.ui.behaviors;
+
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * Interface implemented by classes who want to receive an input.
+ * <p>
+ * If workbench parts implement this interface their input is renewed when the
+ * workbench selection changes. If the selection is not an instance of the type
+ * defined by {@link #getInputType()} and could not be adapted to this type
+ * using {@link Platform#getAdapterManager()} <code>null</code> is passed.
+ * </p>
+ */
+public interface IHasInput {
+ /**
+ * The input type accepted.
+ *
+ * @return the input type to pass in
+ */
+ public Class getInputType();
+
+ /**
+ * Updates the input of the instance
+ *
+ * @param input
+ * the new input or <code>null</code>
+ */
+ public void setInput(Object input);
+}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/.classpath b/examples/org.eclipse.e4.ui.examples.css.rcp/.classpath
deleted file mode 100644
index 64c5e31..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/.project b/examples/org.eclipse.e4.ui.examples.css.rcp/.project
deleted file mode 100644
index aebf1cd..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.e4.ui.examples.css.rcp</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.e4.ui.examples.css.rcp/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 17bb0f3..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Thu Jan 15 12:04:40 EST 2009
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/META-INF/MANIFEST.MF b/examples/org.eclipse.e4.ui.examples.css.rcp/META-INF/MANIFEST.MF
deleted file mode 100644
index 2ef5829..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: CSS RCP Example
-Bundle-SymbolicName: org.eclipse.e4.ui.examples.css.rcp;singleton:=true
-Bundle-Version: 0.9.0
-Bundle-Activator: org.eclipse.e4.ui.examples.css.rcp.Activator
-Require-Bundle: org.eclipse.ui;bundle-version="3.5.0",
- org.eclipse.core.runtime;bundle-version="3.5.0",
- org.eclipse.e4.ui.css.core;bundle-version="0.9.0",
- org.eclipse.e4.ui.css.swt;bundle-version="0.9.0",
- org.w3c.css.sac;bundle-version="1.3.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/build.properties b/examples/org.eclipse.e4.ui.examples.css.rcp/build.properties
deleted file mode 100644
index 4b6aaf2..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/,\
- product_lg.gif,\
- splash.bmp
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/mail.ico b/examples/org.eclipse.e4.ui.examples.css.rcp/icons/mail.ico
deleted file mode 100644
index b000061..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/mail.ico
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample.gif b/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample.icns b/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample.icns
deleted file mode 100644
index 1e92ccc..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample.icns
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample2.gif b/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample2.gif
deleted file mode 100644
index 252d7eb..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample2.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample3.gif b/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample3.gif
deleted file mode 100644
index b949ac9..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/icons/sample3.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/plugin.xml b/examples/org.eclipse.e4.ui.examples.css.rcp/plugin.xml
deleted file mode 100644
index 5499ed6..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/plugin.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- id="application"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- class="org.eclipse.e4.ui.examples.css.rcp.Application">
- </run>
- </application>
- </extension>
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- name="RCP Perspective"
- class="org.eclipse.e4.ui.examples.css.rcp.Perspective"
- id="org.eclipse.e4.ui.examples.css.rcp.perspective">
- </perspective>
- </extension>
- <extension
- point="org.eclipse.ui.views">
- <view
- name="Message"
- allowMultiple="true"
- icon="icons/sample2.gif"
- class="org.eclipse.e4.ui.examples.css.rcp.View"
- id="org.eclipse.e4.ui.examples.css.rcp.view">
- </view>
- <view
- name="Mailboxes"
- allowMultiple="true"
- icon="icons/sample3.gif"
- class="org.eclipse.e4.ui.examples.css.rcp.NavigationView"
- id="org.eclipse.e4.ui.examples.css.rcp.navigationView">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <category
- name="Mail"
- id="org.eclipse.e4.ui.examples.css.rcp.category">
- </category>
- <command
- name="Open Mailbox"
- description="Opens a mailbox"
- categoryId="org.eclipse.e4.ui.examples.css.rcp.category"
- id="org.eclipse.e4.ui.examples.css.rcp.open">
- </command>
- <command
- name="Mark as Read"
- description="Mark the message as having been read"
- categoryId="org.eclipse.e4.ui.examples.css.rcp.category"
- id="org.eclipse.e4.ui.examples.css.rcp.markAsRead">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.bindings">
- <key
- commandId="org.eclipse.e4.ui.examples.css.rcp.open"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+2">
- </key>
- <key
- commandId="org.eclipse.e4.ui.examples.css.rcp.markAsRead"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+3">
- </key>
- <key
- commandId="org.eclipse.ui.file.exit"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+X">
- </key>
- </extension>
- <extension
- id="product"
- point="org.eclipse.core.runtime.products">
- <product
- application="org.eclipse.e4.ui.examples.css.rcp.application"
- name="CSS Mail Example">
- <property
- name="aboutText"
- value="CSS RCP Mail template">
- </property>
- <property
- name="windowImages"
- value="icons/sample2.gif">
- </property>
- <property
- name="aboutImage"
- value="product_lg.gif">
- </property>
- </product>
- </extension>
- <extension
- point="org.eclipse.ui.presentationFactories">
- <factory class="org.eclipse.e4.ui.examples.css.rcp.presentation.CSSPresentationFactory"
- id="org.eclipse.e4.ui.examples.css.rcp.presentationFactory"
- name="CSS Presentation">
- </factory>
- </extension>
-</plugin>
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/product_lg.gif b/examples/org.eclipse.e4.ui.examples.css.rcp/product_lg.gif
deleted file mode 100644
index bd95e28..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/product_lg.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/splash.bmp b/examples/org.eclipse.e4.ui.examples.css.rcp/splash.bmp
deleted file mode 100644
index d7d2e30..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/splash.bmp
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Activator.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Activator.java
deleted file mode 100644
index 792a4d6..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Activator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.e4.ui.examples.css.rcp";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Application.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Application.java
deleted file mode 100644
index b818033..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Application.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import org.eclipse.e4.ui.examples.css.rcp.presentation.CSSPresentationFactory;
-import org.eclipse.equinox.app.IApplication;
-import org.eclipse.equinox.app.IApplicationContext;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferenceConstants;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This class controls all aspects of the application's execution
- */
-public class Application implements IApplication {
-
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
- */
- public Object start(IApplicationContext context) {
- Display display = PlatformUI.createDisplay();
- try {
- PlatformUI.getPreferenceStore().setValue(
- IWorkbenchPreferenceConstants.PRESENTATION_FACTORY_ID,
- CSSPresentationFactory.ID);
-
- int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
- if (returnCode == PlatformUI.RETURN_RESTART) {
- return IApplication.EXIT_RESTART;
- }
- return IApplication.EXIT_OK;
- } finally {
- display.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.app.IApplication#stop()
- */
- public void stop() {
- final IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench == null)
- return;
- final Display display = workbench.getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- if (!display.isDisposed())
- workbench.close();
- }
- });
- }
-
-
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationActionBarAdvisor.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationActionBarAdvisor.java
deleted file mode 100644
index f66e409..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationActionBarAdvisor.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.ICoolBarManager;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarContributionItem;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-
-/**
- * An action bar advisor is responsible for creating, adding, and disposing of the
- * actions added to a workbench window. Each window will be populated with
- * new actions.
- */
-public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
-
- // Actions - important to allocate these only in makeActions, and then use them
- // in the fill methods. This ensures that the actions aren't recreated
- // when fillActionBars is called with FILL_PROXY.
- private IWorkbenchAction exitAction;
- private IWorkbenchAction aboutAction;
- private IWorkbenchAction newWindowAction;
- private OpenViewAction openViewAction;
- private Action markAsReadAction;
-
-
- public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
- super(configurer);
- }
-
- protected void makeActions(final IWorkbenchWindow window) {
- // Creates the actions and registers them.
- // Registering is needed to ensure that key bindings work.
- // The corresponding commands keybindings are defined in the plugin.xml file.
- // Registering also provides automatic disposal of the actions when
- // the window is closed.
-
- exitAction = ActionFactory.QUIT.create(window);
- register(exitAction);
-
- aboutAction = ActionFactory.ABOUT.create(window);
- register(aboutAction);
-
- newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(window);
- register(newWindowAction);
-
- openViewAction = new OpenViewAction(window, "Open Another Message View", View.ID);
- register(openViewAction);
-
- markAsReadAction = new MarkAsReadAction("Mark as Read", window);
- register(markAsReadAction);
-
- }
-
- protected void fillMenuBar(IMenuManager menuBar) {
- MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
- MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
-
- menuBar.add(fileMenu);
- // Add a group marker indicating where action set menus will appear.
- menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- menuBar.add(helpMenu);
-
- // File
- fileMenu.add(newWindowAction);
- fileMenu.add(new Separator());
- fileMenu.add(markAsReadAction);
- fileMenu.add(openViewAction);
- fileMenu.add(new Separator());
- fileMenu.add(exitAction);
-
- // Help
- helpMenu.add(aboutAction);
- }
-
- protected void fillCoolBar(ICoolBarManager coolBar) {
- IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
- coolBar.add(new ToolBarContributionItem(toolbar, "main"));
- toolbar.add(openViewAction);
- toolbar.add(markAsReadAction);
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationWorkbenchAdvisor.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationWorkbenchAdvisor.java
deleted file mode 100644
index c4a655d..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationWorkbenchAdvisor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import java.io.InputStream;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler;
-import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.application.IWorkbenchConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-/**
- * This workbench advisor creates the window advisor, and specifies
- * the perspective id for the initial window.
- */
-public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
-
- private final static String STYLE_SHEET_PATH = "styles/stylesheet.css";
- public static ApplicationWorkbenchAdvisor INSTANCE;
-
- public CSSEngine engine;
-
- public ApplicationWorkbenchAdvisor() {
- super();
- INSTANCE = this;
- }
-
- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
- return new ApplicationWorkbenchWindowAdvisor(configurer);
- }
-
- public String getInitialWindowPerspectiveId() {
- return Perspective.ID;
- }
-
- public void initialize(IWorkbenchConfigurer configurer) {
- super.initialize(configurer);
- engine = initializeStyling();
- }
-
- private CSSEngine initializeStyling() {
- // Instantiate SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(Display.getDefault(), true);
- engine.setErrorHandler(new CSSErrorHandler() {
- public void error(Exception e) {
- e.printStackTrace();
- }
- });
-
- try {
- URL url = FileLocator.find(Activator.getDefault().getBundle(), new Path(STYLE_SHEET_PATH), null);
- InputStream stream = url.openStream();
- engine.parseStyleSheet(stream);
- stream.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return engine;
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationWorkbenchWindowAdvisor.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationWorkbenchWindowAdvisor.java
deleted file mode 100644
index 7753840..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ApplicationWorkbenchWindowAdvisor.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
-
- private final Point INITIAL_SIZE = new Point(650, 400);
-
- public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
- super(configurer);
- }
-
- public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
- return new ApplicationActionBarAdvisor(configurer);
- }
-
- public void preWindowOpen() {
- IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
- configurer.setShowCoolBar(true);
- configurer.setShowStatusLine(false);
- }
-
- public void postWindowOpen() {
- //workaround needed for bug #260791
- getWindowConfigurer().getWindow().getShell().setSize(INITIAL_SIZE);
- }
-
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ICommandIds.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ICommandIds.java
deleted file mode 100644
index 65c1e4d..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/ICommandIds.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-/**
- * Interface defining the application's command IDs.
- * Key bindings can be defined for specific commands.
- * To associate an action with a command, use IAction.setActionDefinitionId(commandId).
- *
- * @see org.eclipse.jface.action.IAction#setActionDefinitionId(String)
- */
-public interface ICommandIds {
-
- public static final String CMD_OPEN = "org.eclipse.e4.ui.examples.css.rcp.open";
- public static final String CMD_MARK_AS_READ = "org.eclipse.e4.ui.examples.css.rcp.markAsRead";
-
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/MarkAsReadAction.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/MarkAsReadAction.java
deleted file mode 100644
index 2f07505..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/MarkAsReadAction.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-public class MarkAsReadAction extends Action {
-
- private final IWorkbenchWindow window;
-
- MarkAsReadAction(String text, IWorkbenchWindow window) {
- super(text);
- this.window = window;
- // The id is used to refer to the action in a menu or toolbar
- setId(ICommandIds.CMD_MARK_AS_READ);
- // Associate the action with a pre-defined command, to allow key bindings.
- setActionDefinitionId(ICommandIds.CMD_MARK_AS_READ);
- setImageDescriptor(org.eclipse.e4.ui.examples.css.rcp.Activator.getImageDescriptor("/icons/sample3.gif"));
- }
-
- public void run() {
- //Mark the message as read
-
- //TODO: Not the recommended way to do this but it's because this examples uses views not editors
- IWorkbenchPart part = window.getActivePage().getActivePart();
- IViewReference[] viewRefs = window.getActivePage().getViewReferences();
-
- for (int i = 0; i < viewRefs.length; i++) {
- IViewReference viewReference = viewRefs[i];
- if(viewReference.getId().equals(View.ID)) {
- View messageView = (View) viewReference.getPart(false);
- if(messageView.isTopMost()) {
- messageView.markAsRead();
- return;
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/NavigationView.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/NavigationView.java
deleted file mode 100644
index c45a6b4..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/NavigationView.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import java.util.ArrayList;
-
-import org.eclipse.e4.ui.css.swt.CSSSWTConstants;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-
-public class NavigationView extends ViewPart {
- public static final String ID = "org.eclipse.e4.ui.examples.css.rcp.navigationView";
- private TreeViewer viewer;
-
- class TreeObject {
- private String name;
- private TreeParent parent;
-
- public TreeObject(String name) {
- this.name = name;
- }
- public String getName() {
- return name;
- }
- public void setParent(TreeParent parent) {
- this.parent = parent;
- }
- public TreeParent getParent() {
- return parent;
- }
- public String toString() {
- return getName();
- }
- }
-
- class TreeParent extends TreeObject {
- private ArrayList children;
- public TreeParent(String name) {
- super(name);
- children = new ArrayList();
- }
- public void addChild(TreeObject child) {
- children.add(child);
- child.setParent(this);
- }
- public void removeChild(TreeObject child) {
- children.remove(child);
- child.setParent(null);
- }
- public TreeObject[] getChildren() {
- return (TreeObject[]) children.toArray(new TreeObject[children.size()]);
- }
- public boolean hasChildren() {
- return children.size()>0;
- }
- }
-
- class ViewContentProvider implements IStructuredContentProvider,
- ITreeContentProvider {
-
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object parent) {
- return getChildren(parent);
- }
-
- public Object getParent(Object child) {
- if (child instanceof TreeObject) {
- return ((TreeObject)child).getParent();
- }
- return null;
- }
-
- public Object[] getChildren(Object parent) {
- if (parent instanceof TreeParent) {
- return ((TreeParent)parent).getChildren();
- }
- return new Object[0];
- }
-
- public boolean hasChildren(Object parent) {
- if (parent instanceof TreeParent)
- return ((TreeParent)parent).hasChildren();
- return false;
- }
- }
-
- class ViewLabelProvider extends LabelProvider {
-
- public String getText(Object obj) {
- return obj.toString();
- }
- public Image getImage(Object obj) {
- String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
- if (obj instanceof TreeParent)
- imageKey = ISharedImages.IMG_OBJ_FOLDER;
- return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
- }
- }
-
- /**
- * We will set up a dummy model to initialize tree heararchy. In real
- * code, you will connect to a real model and expose its hierarchy.
- */
- private TreeObject createDummyModel() {
- TreeObject to1 = new TreeObject("Inbox");
- TreeObject to2 = new TreeObject("Drafts");
- TreeObject to3 = new TreeObject("Sent");
- TreeParent p1 = new TreeParent("me@this.com");
- p1.addChild(to1);
- p1.addChild(to2);
- p1.addChild(to3);
-
- TreeObject to4 = new TreeObject("Inbox");
- TreeParent p2 = new TreeParent("other@aol.com");
- p2.addChild(to4);
-
- TreeParent root = new TreeParent("");
- root.addChild(p1);
- root.addChild(p2);
- return root;
- }
-
- /**
- * This is a callback that will allow us to create the viewer and initialize
- * it.
- */
- public void createPartControl(Composite parent) {
- viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- setCSSID(viewer.getControl(), "navigation");
- viewer.setContentProvider(new ViewContentProvider());
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setInput(createDummyModel());
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-
- private void setCSSID(Widget widget, String name) {
- widget.setData(CSSSWTConstants.CSS_ID_KEY, name);
- //Ideally just changing the widget's id would trigger a re-styling,
- //but until bug #260407 is fixed we must call this next line
- ApplicationWorkbenchAdvisor.INSTANCE.engine.applyStyles(widget, true);
- }
-
-}
\ No newline at end of file
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/OpenViewAction.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/OpenViewAction.java
deleted file mode 100644
index 120b150..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/OpenViewAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-
-public class OpenViewAction extends Action {
-
- private final IWorkbenchWindow window;
- private int instanceNum = 0;
- private final String viewId;
-
- public OpenViewAction(IWorkbenchWindow window, String label, String viewId) {
- this.window = window;
- this.viewId = viewId;
- setText(label);
- // The id is used to refer to the action in a menu or toolbar
- setId(ICommandIds.CMD_OPEN);
- // Associate the action with a pre-defined command, to allow key bindings.
- setActionDefinitionId(ICommandIds.CMD_OPEN);
- setImageDescriptor(org.eclipse.e4.ui.examples.css.rcp.Activator.getImageDescriptor("/icons/sample2.gif"));
- }
-
- public void run() {
- if(window != null) {
- try {
- window.getActivePage().showView(viewId, Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
- } catch (PartInitException e) {
- MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
- }
- }
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Perspective.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Perspective.java
deleted file mode 100644
index 048f7ab..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/Perspective.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-public class Perspective implements IPerspectiveFactory {
-
- public static String ID = "org.eclipse.e4.ui.examples.css.rcp.perspective";
-
- public void createInitialLayout(IPageLayout layout) {
- String editorArea = layout.getEditorArea();
- layout.setEditorAreaVisible(false);
-
- layout.addStandaloneView(NavigationView.ID, false, IPageLayout.LEFT, 0.25f, editorArea);
- IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP, 0.5f, editorArea);
- folder.addPlaceholder(View.ID + ":*");
- folder.addView(View.ID);
-
- layout.getViewLayout(NavigationView.ID).setCloseable(false);
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/View.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/View.java
deleted file mode 100644
index b17aa36..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/View.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp;
-
-import org.eclipse.e4.ui.css.swt.CSSSWTConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.part.ViewPart;
-
-public class View extends ViewPart {
-
- public static final String ID = "org.eclipse.e4.ui.examples.css.rcp.view";
- public static View TOPMOST;
-
- private boolean read = false;
- private Label dateWidget;
-
- public void createPartControl(Composite parent) {
- Composite top = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- top.setLayout(layout);
- setCSSClassName(top, "messageBanner");
- // top banner
- Composite banner = new Composite(top, SWT.NONE);
- banner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
- layout = new GridLayout();
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.numColumns = 2;
- banner.setLayout(layout);
- setCSSClassName(banner, "messageBanner");
-
- // setup bold font
- // we'll do this in CSS now instead
-// Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
-
- Label l = new Label(banner, SWT.WRAP);
- l.setText("Subject:");
-// l.setFont(boldFont);
- setCSSClassName(l, "messageTitle");
-
- l = new Label(banner, SWT.WRAP);
- setCSSClassName(l, "messageBannerContent");
- setCSSClassName(l, "messageSubject");
- l.setText("This is a message about the cool Eclipse RCP!");
-
- l = new Label(banner, SWT.WRAP);
- l.setText("From:");
-// l.setFont(boldFont);
- setCSSClassName(l, "messageTitle");
-
- final Link link = new Link(banner, SWT.NONE);
- link.setText("<a>nicole@mail.org</a>");
- setCSSClassName(link, "messageBannerContent");
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MessageDialog.openInformation(getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now.");
- }
- });
-
- l = new Label(banner, SWT.WRAP);
- l.setText("Date: ");
-// l.setFont(boldFont);
- setCSSClassName(l, "messageTitle");
- l = new Label(banner, SWT.WRAP);
- dateWidget = l;
- l.setText("10:34 am "); // add space since we know it will be italic and that gets clipped due to SWT bug
-
- setCSSClassName(l, "messageBannerContent");
- updateCSSForReadState();
-
- // message contents
- Text text = new Text(top, SWT.MULTI | SWT.WRAP);
- text.setText("This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n"+
- "- add a top-level menu and toolbar with actions\n"+
- "- add keybindings to actions\n" +
- "- create views that can't be closed and\n"+
- " multiple instances of the same view\n"+
- "- perspectives with placeholders for new views\n"+
- "- use the default about dialog\n"+
- "- create a product definition\n");
- text.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- TOPMOST = this;
- }
-
- public void setFocus() {
- TOPMOST = this;
- }
-
- //TODO: the recommended way to do this but it's because this examples uses views not editors
- public boolean isTopMost() {
- return TOPMOST == this;
- }
-
- public void markAsRead() {
- read = true;
- updateCSSForReadState();
- }
-
- private void setCSSClassName(Widget widget, String name) {
- widget.setData(CSSSWTConstants.CSS_CLASS_NAME_KEY, name);
- //Ideally just changing the widget's CSS class would trigger a re-styling,
- //but until bug #260407 is fixed we must call this next line
- ApplicationWorkbenchAdvisor.INSTANCE.engine.applyStyles(widget, true);
- }
-
- private void updateCSSForReadState() {
- setCSSClassName(
- dateWidget,
- read
- ? "messageDateRead"
- : "messageDateUnRead"
- );
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/presentation/CSSPresentationFactory.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/presentation/CSSPresentationFactory.java
deleted file mode 100644
index 3df00d2..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/presentation/CSSPresentationFactory.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.eclipse.e4.ui.examples.css.rcp.presentation;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPreferenceConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultMultiTabListener;
-import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultSimpleTabListener;
-import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultThemeListener;
-import org.eclipse.ui.internal.presentations.util.PresentablePartFolder;
-import org.eclipse.ui.internal.presentations.util.StandardEditorSystemMenu;
-import org.eclipse.ui.internal.presentations.util.StandardViewSystemMenu;
-import org.eclipse.ui.internal.presentations.util.TabbedStackPresentation;
-import org.eclipse.ui.presentations.IStackPresentationSite;
-import org.eclipse.ui.presentations.StackPresentation;
-import org.eclipse.ui.presentations.WorkbenchPresentationFactory;
-
-/**
- *
- * @since 3.4
- *
- */
-public class CSSPresentationFactory extends
- WorkbenchPresentationFactory {
-
- public static String ID = "org.eclipse.e4.ui.examples.css.rcp.presentationFactory";
-
- // don't reset these dynamically, so just keep the information static.
- // see bug:
- // 75422 [Presentations] Switching presentation to R21 switches immediately,
- // but only partially
- private static int editorTabPosition = PlatformUI.getPreferenceStore()
- .getInt(IWorkbenchPreferenceConstants.EDITOR_TAB_POSITION);
- private static int viewTabPosition = PlatformUI.getPreferenceStore()
- .getInt(IWorkbenchPreferenceConstants.VIEW_TAB_POSITION);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.presentations.AbstractPresentationFactory#createEditorPresentation(org.eclipse.swt.widgets.Composite,
- * org.eclipse.ui.presentations.IStackPresentationSite)
- */
- public StackPresentation createEditorPresentation(Composite parent,
- IStackPresentationSite site) {
- CSSTabFolder folder = new CSSTabFolder(parent,
- editorTabPosition | SWT.BORDER, site
- .supportsState(IStackPresentationSite.STATE_MINIMIZED),
- site.supportsState(IStackPresentationSite.STATE_MAXIMIZED));
-
- /*
- * Set the minimum characters to display, if the preference is something
- * other than the default. This is mainly intended for RCP applications
- * or for expert users (i.e., via the plug-in customization file).
- *
- * Bug 32789.
- */
- final IPreferenceStore store = PlatformUI.getPreferenceStore();
- if (store
- .contains(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS)) {
- final int minimumCharacters = store
- .getInt(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS);
- if (minimumCharacters >= 0) {
- folder.setMinimumCharacters(minimumCharacters);
- }
- }
-
- PresentablePartFolder partFolder = new PresentablePartFolder(folder);
-
- TabbedStackPresentation result = new TabbedStackPresentation(site,
- partFolder, new StandardEditorSystemMenu(site));
-
- DefaultThemeListener themeListener = new DefaultThemeListener(folder,
- result.getTheme());
- result.getTheme().addListener(themeListener);
-
- new DefaultMultiTabListener(result.getApiPreferences(),
- IWorkbenchPreferenceConstants.SHOW_MULTIPLE_EDITOR_TABS, folder);
-
- new DefaultSimpleTabListener(result.getApiPreferences(),
- IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
- folder);
-
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.presentations.AbstractPresentationFactory#createViewPresentation(org.eclipse.swt.widgets.Composite,
- * org.eclipse.ui.presentations.IStackPresentationSite)
- */
- public StackPresentation createViewPresentation(Composite parent,
- IStackPresentationSite site) {
-
- CSSTabFolder folder = new CSSTabFolder(parent, viewTabPosition
- | SWT.BORDER, site
- .supportsState(IStackPresentationSite.STATE_MINIMIZED), site
- .supportsState(IStackPresentationSite.STATE_MAXIMIZED));
-
- final IPreferenceStore store = PlatformUI.getPreferenceStore();
- final int minimumCharacters = store
- .getInt(IWorkbenchPreferenceConstants.VIEW_MINIMUM_CHARACTERS);
- if (minimumCharacters >= 0) {
- folder.setMinimumCharacters(minimumCharacters);
- }
-
- PresentablePartFolder partFolder = new PresentablePartFolder(folder);
-
- folder.setUnselectedCloseVisible(false);
- folder.setUnselectedImageVisible(true);
-
- TabbedStackPresentation result = new TabbedStackPresentation(site,
- partFolder, new StandardViewSystemMenu(site));
-
- DefaultThemeListener themeListener = new DefaultThemeListener(folder,
- result.getTheme());
- result.getTheme().addListener(themeListener);
-
- new DefaultSimpleTabListener(result.getApiPreferences(),
- IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
- folder);
-
- return result;
- }
-
-
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/presentation/CSSTabFolder.java b/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/presentation/CSSTabFolder.java
deleted file mode 100644
index 791a41c..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/src/org/eclipse/e4/ui/examples/css/rcp/presentation/CSSTabFolder.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.examples.css.rcp.presentation;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder;
-
-/**
- * @since 3.1
- */
-public class CSSTabFolder extends DefaultTabFolder {
-
- public CSSTabFolder(Composite parent, int flags, boolean allowMin,
- boolean allowMax) {
- super(parent, flags, allowMin, allowMax);
- // TODO Auto-generated constructor stub
- }
- public void updateColors() {
- //do nothing, CSS will handle
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css.rcp/styles/stylesheet.css b/examples/org.eclipse.e4.ui.examples.css.rcp/styles/stylesheet.css
deleted file mode 100644
index 99583b2..0000000
--- a/examples/org.eclipse.e4.ui.examples.css.rcp/styles/stylesheet.css
+++ /dev/null
@@ -1,61 +0,0 @@
-Shell {
- font-family: "Times New Roman"
- font-size: 12;
-}
-
-ToolBar, Button {
- font-family: "Times New Roman";
- font-size: 9;
-}
-
-Text {
- font-family: "Comic Sans MS";
- font-size: 10;
- color: #666666;
- background-color: #f8f8f8;
-}
-
-#navigation {
- font-family: "Times New Roman";
- font-size: 8;
- color: #666666;
- background-color: #f8f8f8;
-}
-
-.messageBanner {
- background-color: #f0f0f0;
-}
-
-.messageTitle {
- font-weight: bold;
- background-color: #f0f0f0;
-}
-
-.messageBannerContent {
- background-color: #f0f0f0;
-}
-
-.messageSubject {
- font-size: 11;
-}
-.messageDateUnRead {
- font-style: italic;
-}
-
-.messageDateRead {
- font-style: normal;
-}
-
-
-CTabFolder {
- font-family: "Verdana";
- font-weight: normal;
- font-size: 10;
- color: #666666;
- background-color: white;
-}
-
-CTabFolder:selected {
- color: #AA4400;
- background-color: #f0f0f0;
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css/.classpath b/examples/org.eclipse.e4.ui.examples.css/.classpath
deleted file mode 100644
index 64c5e31..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.e4.ui.examples.css/.project b/examples/org.eclipse.e4.ui.examples.css/.project
deleted file mode 100644
index afc7c91..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.e4.ui.examples.css</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7c53145..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Wed Dec 17 23:52:03 EST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/org.eclipse.e4.ui.examples.css/META-INF/MANIFEST.MF b/examples/org.eclipse.e4.ui.examples.css/META-INF/MANIFEST.MF
deleted file mode 100644
index 30041a3..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Css Examples Plug-in
-Bundle-SymbolicName: org.eclipse.e4.ui.examples.css
-Bundle-Version: 0.9.0.qualifier
-Bundle-Activator: org.eclipse.e4.ui.examples.css.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.e4.ui.css.core,
- org.eclipse.e4.ui.css.jface,
- org.eclipse.e4.ui.css.swt,
- org.apache.commons.logging,
- org.apache.xerces,
- org.eclipse.swt,
- org.w3c.css.sac,
- org.apache.commons.beanutils
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.e4.ui.examples.css.editor
diff --git a/examples/org.eclipse.e4.ui.examples.css/build.properties b/examples/org.eclipse.e4.ui.examples.css/build.properties
deleted file mode 100644
index 34d2e4d..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/examples/org.eclipse.e4.ui.examples.css/images/bluefade-banner.gif b/examples/org.eclipse.e4.ui.examples.css/images/bluefade-banner.gif
deleted file mode 100644
index 672442f..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/images/bluefade-banner.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css/images/bluefade-full.gif b/examples/org.eclipse.e4.ui.examples.css/images/bluefade-full.gif
deleted file mode 100644
index 4ed90dc..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/images/bluefade-full.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/Activator.java b/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/Activator.java
deleted file mode 100644
index 0f6f137..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/Activator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.e4.ui.examples.css;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.e4.ui.examples.css";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSEditor.java b/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSEditor.java
deleted file mode 100644
index 40d6ab0..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSEditor.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.examples.css.editor;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Date;
-
-import org.eclipse.e4.ui.css.core.dom.IElementProvider;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler;
-import org.eclipse.e4.ui.css.core.serializers.CSSHTMLSerializerConfiguration;
-import org.eclipse.e4.ui.css.core.serializers.CSSSerializer;
-import org.eclipse.e4.ui.css.core.serializers.CSSSerializerConfiguration;
-
-/**
- * Abstract CSS Editor.
- */
-public abstract class AbstractCSSEditor {
-
- /**
- * CSS Engine.
- */
- protected CSSEngine engine;
-
- /**
- * CSS Serializer
- */
- protected CSSSerializer serializer;
-
- protected String nativeWidgetDir;
-
- protected java.util.List cssFiles = new ArrayList();
-
- protected AbstractCSSEditor(String nativeWidgetDir) {
- this.nativeWidgetDir = nativeWidgetDir;
- }
-
- /**
- * Return CSS Engine configured.
- *
- * @return
- */
- protected CSSEngine getCSSEngine() {
- if (engine == null) {
- // Get SWT CSS Engine
- engine = createCSSEngine();
- // Error
- engine.setErrorHandler(new CSSErrorHandler() {
- public void error(Exception e) {
- handleExceptions(e);
- }
- });
-
- } else {
- // Remove all style sheets.
- engine.reset();
- }
-
- if (isHTMLSelector()) {
- // Register HTML Element Provider to retrieve
- // w3c Element HTMLElement coming from Native Widget.
- engine.setElementProvider(getHTMLElementProvider());
- } else {
- // Register Native Widget (SWT, Swing...) Element Provider to
- // retrieve
- // w3c Element Element coming from Native Widget.
- engine.setElementProvider(getNativeWidgetElementProvider());
- }
- return engine;
- }
-
- /**
- * Apply Styles comming from <code>getStyleSheetContent()</code> method to
- * implement <code>widget</code>.
- *
- * @param widget
- */
- protected void applyStyles(Object widget) {
- try {
- Date d1 = new Date();
- engine = getCSSEngine();
- // 1. Parse Style Sheet coming from getStyleSheetContent().
- StringReader reader = new StringReader(getStyleSheetContent());
- engine.parseStyleSheet(reader);
-
- // 2. Apply styles
- engine.applyStyles(widget, true, true);
- Date d2 = new Date();
-
- // 3. Display time elapsed
- setCSSEngineStatuts("Apply style with "
- + (d2.getTime() - d1.getTime()) + "ms.");
-
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- }
-
- /**
- * Apply styles to the fully window or left panel widget.
- */
- protected void applyStyles() {
- if (mustApplyStylesToWindow()) {
- applyStyles(getWindowNativeWidget());
- } else
- applyStyles(getLeftPanelNativeWidget());
- }
-
- protected void fillTextareaWithStyleSheetContent(File file) {
- try {
- fillTextareaWithStyleSheetContent(new FileInputStream(file));
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- /**
- * Fill the TextArea which store the style sheet content with the
- * <code>stream</code> content.
- *
- * @param stream
- */
- protected void fillTextareaWithStyleSheetContent(InputStream stream) {
- try {
- StringWriter writer = new StringWriter();
- InputStreamReader streamReader = new InputStreamReader(stream);
- BufferedReader buffer = new BufferedReader(streamReader);
- String line = "";
- boolean b = false;
- while (null != (line = buffer.readLine())) {
- if (b)
- writer.write("\n");
- writer.write(line);
- b = true;
- }
- buffer.close();
- streamReader.close();
- String content = writer.toString();
- setStyleSheetContent(content);
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- protected void fillTextareaWithDefaultStyleSheetContent() {
- if (mustApplyStylesToWindow())
- fillTextareaWithDefaultStyleSheetContent(getWindowNativeWidget());
- else
- fillTextareaWithDefaultStyleSheetContent(getLeftPanelNativeWidget());
- }
-
- protected void fillTextareaWithDefaultStyleSheetContent(Object widget) {
- if (serializer == null)
- this.serializer = new CSSSerializer();
- StringWriter writer = new StringWriter();
- try {
- CSSSerializerConfiguration configuration = (isHTMLSelector() ? getCSSHTMLSerializerConfiguration()
- : getCSSNativeWidgetSerializerConfiguration());
- serializer.serialize(writer, getCSSEngine(), widget, true,
- configuration);
- setStyleSheetContent(writer.toString());
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- protected void applyStylesFromSelectedFile() {
- int index = getCSSFilesWidgetSelectionIndex();
- if (index == -1)
- if (getCSSFilesWidgetItemCount() > 1) {
- index = 1;
- selectCSSFilesWidget(index);
- // cssFilesWidget.select(index);
- }
- if (index < 1) {
- setStyleSheetContent("");
- return;
- }
- File file = (File) cssFiles.get(index - 1);
- fillTextareaWithStyleSheetContent(file);
- }
-
- protected void populateCSSFiles() {
- removeAllCSSFilesWidget();
- int size = cssFiles.size();
- for (int i = 0; i < size; i++) {
- cssFiles.remove(0);
- }
- addItemCSSFilesWidget("None");
- File baseDir = getBaseStyleDir();
- File[] files = baseDir.listFiles();
- for (int i = 0; i < files.length; i++) {
- File file = files[i];
- if (file.isFile()) {
- addItemCSSFilesWidget(file.getName());
- cssFiles.add(file);
- }
- }
- }
-
- /**
- * Display CSS Engine error
- *
- * @param e
- */
- protected void handleExceptions(Exception e) {
- e.printStackTrace();
- }
-
- protected File getBaseStyleDir() {
- if (isHTMLSelector())
- return new File(getBaseStyleDirName() + "/html");
- if (nativeWidgetDir != null)
- return new File(getBaseStyleDirName() + "/" + nativeWidgetDir);
- return new File(getBaseStyleDirName());
- }
-
- protected String getBaseStyleDirName() {
- return "styles";
- }
-
- /**
- * Create Instance of CSS Engine
- *
- * @return
- */
- protected abstract CSSEngine createCSSEngine();
-
- /**
- * Return true if HTML selector must be used and false if Native Widget
- * Selector must be used.
- *
- * @return
- */
- protected abstract boolean isHTMLSelector();
-
- /**
- * Return Native Widget Element provider.
- *
- * @return
- */
- protected abstract IElementProvider getNativeWidgetElementProvider();
-
- /**
- * Return HTML Element provider.
- *
- * @return
- */
- protected abstract IElementProvider getHTMLElementProvider();
-
- /**
- * Return style sheet content.
- *
- * @return
- */
- protected abstract String getStyleSheetContent();
-
- /**
- * Set style sheet content.
- *
- * @param content
- */
- protected abstract void setStyleSheetContent(String content);
-
- /**
- * Set CSS Engine status.
- *
- * @param status
- */
- protected abstract void setCSSEngineStatuts(String status);
-
- /**
- * Return true if Styles must be applied to the fully Window and false
- * otherwise.
- *
- * @return
- */
- protected abstract boolean mustApplyStylesToWindow();
-
- /**
- * Get Window Native Widget.
- *
- * @return
- */
- protected abstract Object getWindowNativeWidget();
-
- /**
- * Get Left Panel Native widget.
- *
- * @return
- */
- protected abstract Object getLeftPanelNativeWidget();
-
- /**
- * Return CSS Serializer configuration for Native Widget.
- *
- * @return
- */
- protected abstract CSSSerializerConfiguration getCSSNativeWidgetSerializerConfiguration();
-
- /**
- * Return CSS Serializer configuration for HTML.
- *
- * @return
- */
- protected CSSSerializerConfiguration getCSSHTMLSerializerConfiguration() {
- return CSSHTMLSerializerConfiguration.INSTANCE;
- }
-
- /**
- * Return selection index of CSS files widget.
- *
- * @return
- */
- protected abstract int getCSSFilesWidgetSelectionIndex();
-
- /**
- * Return item count of CSS files widget.
- *
- * @return
- */
- protected abstract int getCSSFilesWidgetItemCount();
-
- /**
- * Select item of CSS files widget at <code>index</code>.
- *
- * @param index
- */
- protected abstract void selectCSSFilesWidget(int index);
-
- /**
- * Remove all items of CSS files widget.
- */
- protected abstract void removeAllCSSFilesWidget();
-
- /**
- * Add item of CSS files widget.
- *
- * @param item
- */
- protected abstract void addItemCSSFilesWidget(String item);
-
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSSWTEditor.java b/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSSWTEditor.java
deleted file mode 100644
index ab9ef71..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSSWTEditor.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.examples.css.editor;
-
-import java.io.File;
-import java.util.ArrayList;
-
-import org.eclipse.e4.ui.css.core.css2.CSS2FontPropertiesHelpers;
-import org.eclipse.e4.ui.css.core.dom.IElementProvider;
-import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.examples.css.editor.AbstractCSSEditor;
-import org.eclipse.e4.ui.css.core.serializers.CSSSerializerConfiguration;
-import org.eclipse.e4.ui.css.swt.dom.SWTElementProvider;
-import org.eclipse.e4.ui.css.swt.dom.html.SWTHTMLElementProvider;
-import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.e4.ui.css.swt.serializers.CSSSWTSerializerConfiguration;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.ColorDialog;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.FontDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract CSS SWT Editor.
- */
-public abstract class AbstractCSSSWTEditor extends AbstractCSSEditor {
-
- protected static final String[] CSS_FILE_EXTENSION = { "*.css" };
-
- private Display display;
-
- /**
- * Textarea which contains content of CSS style sheet.
- */
- private StyledText textArea;
-
- private Button cacheResourcesCheckbox;
-
- /**
- * HTML checkbox to set if CSS must be typed with HTML syntaxe or SWT
- * syntax.
- */
- private Button htmlCheckbox;
-
- /**
- * Label wich display time elapsed when CSS Engine apply styles.
- */
- private Label statusLabel;
-
- /**
- * Apply style when text area change
- */
- private Button applyStyleWhenTextAreaChangeCheckbox;
-
- /**
- * Launch Apply style
- */
- private Button applyStyleToShellCheckbox;
-
- protected Shell shell;
-
- private Composite leftPanel;
-
- private List cssFilesWidget;
-
- private java.util.List cssFiles = new ArrayList();
-
- private Text selectedCSSPropertyNameText = null;
-
- private Text selectedCSSPropertyValueText = null;
-
- protected int currentLine = -1;
-
- protected AbstractCSSSWTEditor(String nativeWidgetDir,
- String[] styleFileExtension) {
- super(nativeWidgetDir);
- }
-
- protected AbstractCSSSWTEditor() {
- super("swt");
- }
-
- public void display() {
-
- display = new Display();
- shell = new Shell(display, SWT.SHELL_TRIM);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- shell.setLayout(layout);
-
- // create Menus
- createMenus(shell);
-
- /*
- * Create a sash form.
- */
- SashForm form = new SashForm(shell, SWT.NONE);
- form.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- /*
- * Create left panel with SWT Contents.
- */
- createLeftPanel(form);
-
- /*
- * Create right panel with TextArea which contains CSS to load.
- */
- createRightPanel(form);
- form.setWeights(new int[] { 30, 80 });
-
- /*
- * Now we open the shell.
- */
- shell.setSize(new Point(800, 600));
- shell.open();
- shell.setText("CSS Editors");
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
-
- /*-------------------- Menus --------------------**/
-
- /**
- * Create Menus File, Options
- *
- * @param shell
- */
- protected void createMenus(Shell shell) {
- Menu menu = new Menu(shell, SWT.BAR);
- shell.setMenuBar(menu);
- // Create File item Menu
- createMenuItemFile(menu, shell);
- // Create Options item Menu
- // createMenuItemOptions(menu);
- }
-
- /**
- * Create Menu item File with sub menu New and Open
- *
- * @param menu
- * @param shell
- */
- protected void createMenuItemFile(Menu menu, final Shell shell) {
- MenuItem menuFileHeader = new MenuItem(menu, SWT.CASCADE);
- menuFileHeader.setText("&File");
- // File menu
- Menu menuFile = new Menu(shell, SWT.DROP_DOWN);
- menuFileHeader.setMenu(menuFile);
- // New item menu
- MenuItem itemNew = new MenuItem(menuFile, SWT.PUSH);
- itemNew.setText("&New...");
- itemNew.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fillTextareaWithDefaultStyleSheetContent();
- }
- });
- // Open item menu
- MenuItem itemOpen = new MenuItem(menuFile, SWT.PUSH);
- itemOpen.setText("&Open...");
- itemOpen.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- FileDialog dialog = new FileDialog(shell, SWT.NULL);
- dialog.setFilterExtensions(CSS_FILE_EXTENSION);
- dialog.setText("Select CSS style file");
- dialog.setFilterPath(getBaseStyleDir().getAbsolutePath());
- String path = dialog.open();
- if (path != null) {
- File file = new File(path);
- fillTextareaWithStyleSheetContent(file);
- }
- }
- });
-
- }
-
- /**
- * Create Menu item Options
- *
- * @param menu
- */
- protected void createMenuItemOptions(Menu menu) {
- MenuItem menuOptionsHeader = new MenuItem(menu, SWT.CASCADE);
- menuOptionsHeader.setText("&Options");
- // Options menu
- Menu menuOptions = new Menu(shell, SWT.DROP_DOWN);
- menuOptionsHeader.setMenu(menuOptions);
- // New item menu
- MenuItem itemNew = new MenuItem(menuOptions, SWT.CHECK);
- itemNew.setText("&Cache Resource...");
-
- }
-
- /*-------------------- Panel --------------------**/
-
- protected void createLeftPanel(Composite parent) {
- leftPanel = new Composite(parent, SWT.NONE);
- leftPanel.setLayout(new FillLayout());
- createContent(leftPanel);
- }
-
- protected void createRightPanel(Composite parent) {
-
- SashForm form = new SashForm(parent, SWT.NONE);
- form.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- Composite composite = new Composite(form, SWT.NONE);
- composite.setLayout(layout);
-
- statusLabel = new Label(composite, SWT.NONE);
- statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Create TextArea which contains CSS content.
- textArea = new StyledText(composite, SWT.MULTI | SWT.V_SCROLL
- | SWT.BORDER);
- textArea.setLayoutData(new GridData(GridData.FILL_BOTH));
- textArea.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (applyStyleWhenTextAreaChangeCheckbox.getSelection())
- applyStyles();
- }
- });
-
- textArea.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- displaySelectedCSSProperty();
- }
- });
- textArea.addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- displaySelectedCSSProperty();
- }
- });
-
- layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- composite = new Composite(form, SWT.NONE);
- composite.setLayout(layout);
-
- Group group = new Group(composite, SWT.NONE);
- group.setText("Selected CSS Property");
- layout = new GridLayout(2, true);
- layout.verticalSpacing = 3;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(group, SWT.NONE);
- label.setText("CSS Property name");
- selectedCSSPropertyNameText = new Text(group, SWT.BORDER
- | SWT.READ_ONLY);
- selectedCSSPropertyNameText.setLayoutData(new GridData(
- GridData.FILL_HORIZONTAL));
-
- label = new Label(group, SWT.NONE);
- label.setText("CSS Property value");
- selectedCSSPropertyValueText = new Text(group, SWT.BORDER);
- selectedCSSPropertyValueText.setLayoutData(new GridData(
- GridData.FILL_HORIZONTAL));
- selectedCSSPropertyValueText.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
-
- String property = selectedCSSPropertyNameText.getText();
- property += ":";
- property += selectedCSSPropertyValueText.getText();
- updateSelectedCSSPropertyValue(property);
- }
- });
-
- final Button b = new Button(group, SWT.PUSH | SWT.BORDER);
- b.setText("Change Color");
- b.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ColorDialog colorDialog = new ColorDialog(shell);
- colorDialog.setText("ColorDialog Demo");
- String cssValue = selectedCSSPropertyValueText.getText();
- if (cssValue != null && cssValue.length() > 0) {
- try {
- CSSValue value = engine.parsePropertyValue(cssValue);
- RGB rgb = (RGB) engine.convert(value, RGB.class, null);
- if (rgb != null)
- colorDialog.setRGB(rgb);
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- // engine.convert(, RGB.class,);
- }
- RGB newColor = colorDialog.open();
- if (newColor != null) {
- try {
- cssValue = engine.convert(newColor, RGB.class,
- selectedCSSPropertyNameText.getText());
- if (cssValue == null)
- return;
- selectedCSSPropertyValueText.setText(cssValue);
- String property = selectedCSSPropertyNameText.getText();
- property += ":";
- property += selectedCSSPropertyValueText.getText();
- updateSelectedCSSPropertyValue(property);
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- }
- }
- });
-
- final Button b2 = new Button(group, SWT.PUSH | SWT.BORDER);
- b2.setText("Change Font");
- b2.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- FontDialog fontDialog = new FontDialog(shell);
- fontDialog.setText("Choose the font");
- String value = selectedCSSPropertyValueText.getText();
- try {
- String propertyName = selectedCSSPropertyNameText.getText();
- CSSValue cssValue = engine.parsePropertyValue(value);
- CSS2FontProperties fontProperties = CSS2FontPropertiesHelpers
- .createCSS2FontProperties(cssValue, propertyName);
- FontData fontData = (FontData) engine.convert(fontProperties,
- FontData.class, display);
- if (fontData != null) {
- FontData[] fontDatas = { fontData };
- fontDialog.setFontList(fontDatas);
- }
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- FontData newFontData = fontDialog.open();
- if (newFontData != null) {
- try {
- String cssValue = engine.convert(newFontData,
- FontData.class, selectedCSSPropertyNameText
- .getText());
- if (cssValue == null)
- return;
- selectedCSSPropertyValueText.setText(cssValue);
- String property = selectedCSSPropertyNameText.getText();
- property += ":";
- property += selectedCSSPropertyValueText.getText();
- updateSelectedCSSPropertyValue(property);
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- }
- }
- });
-
- group = new Group(composite, SWT.NONE);
- group.setText("CSS Engine options");
- layout = new GridLayout();
- layout.verticalSpacing = 3;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- cacheResourcesCheckbox = new Button(group, SWT.CHECK);
- cacheResourcesCheckbox.setText("Cache Color, Font and Cursor");
- cacheResourcesCheckbox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (!cacheResourcesCheckbox.getSelection()) {
- engine.getResourcesRegistry().dispose();
- }
- }
- });
- cacheResourcesCheckbox.setSelection(true);
-
- applyStyleWhenTextAreaChangeCheckbox = new Button(group, SWT.CHECK);
- applyStyleWhenTextAreaChangeCheckbox
- .setText("Apply style when textarea change");
- applyStyleWhenTextAreaChangeCheckbox.setSelection(true);
-
- htmlCheckbox = new Button(group, SWT.CHECK);
- htmlCheckbox.setText("is HTML Selector? (otherwise it's SWT Selector)");
- htmlCheckbox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- populateCSSFiles();
- applyStylesFromSelectedFile();
- }
- });
-
- // Create CSS files list
- cssFilesWidget = new List(group, SWT.NONE);
- cssFilesWidget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- cssFilesWidget.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- applyStylesFromSelectedFile();
- }
- });
- populateCSSFiles();
-
- // Create Apply Style Button.
- applyStyleToShellCheckbox = new Button(group, SWT.CHECK);
- applyStyleToShellCheckbox.setText("Apply style to Shell?");
- applyStyleToShellCheckbox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (applyStyleToShellCheckbox.getSelection()) {
- applyStyles();
- } else {
- // Apply styles with NONE style to reset
- // styles applied into TextArea...
- engine = getCSSEngine();
- engine.applyStyles(shell, true);
- // Apply styles
- applyStyles();
- }
-
- }
- });
-
- Button applyStyleButton = new Button(group, SWT.BORDER);
- applyStyleButton.setText("Apply style");
- applyStyleButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- applyStyles();
- }
- });
-
- form.setWeights(new int[] { 120, 90 });
-
- // Select the first CSS style file
- applyStylesFromSelectedFile();
- }
-
- public abstract void createContent(Composite parent);
-
- protected void displaySelectedCSSProperty() {
- selectedCSSPropertyNameText.setText("");
- selectedCSSPropertyValueText.setText("");
- int start = -1;
- int end = -1;
-
-// if (currentLine != -1)
-// textArea.setLineBackground(currentLine, 1, null);
-
- currentLine = textArea.getLineAtOffset(textArea.getCaretOffset());
- if (currentLine + 1 >= textArea.getLineCount())
- return;
- start = textArea.getOffsetAtLine(currentLine);
- end = textArea.getOffsetAtLine(currentLine + 1) - 2;
- if (start <= end) {
- String lineText = textArea.getText(start, end);
- lineText = lineText.trim();
- int index = lineText.indexOf(":");
- if (index > 0) {
- if (lineText.indexOf("{") != -1)
- return;
- String property = lineText.substring(0, index);
- String value = lineText.substring(index + 1, lineText.length());
- value = value.replaceAll(";", "");
- // Remove comment
- int commentIndex = value.indexOf("/*");
- if (commentIndex > 0)
- value = value.substring(0, commentIndex);
- selectedCSSPropertyNameText.setText(property);
- selectedCSSPropertyValueText.setText(value);
-
-// textArea.setLineBackground(currentLine, 1, display
-// .getSystemColor(SWT.COLOR_MAGENTA));
- }
- }
- }
-
- protected void updateSelectedCSSPropertyValue(String text) {
- if (currentLine != -1 && currentLine + 1 >= textArea.getLineCount())
- return;
- int start = textArea.getOffsetAtLine(currentLine);
- int end = textArea.getOffsetAtLine(currentLine + 1) - 2;
-
- String startLineText = textArea.getText(0, start);
- String endLineText = textArea.getText(end, textArea.getCharCount() - 1);
- if (!text.endsWith(";") && !endLineText.startsWith(";"))
- text += ";";
- if (endLineText.startsWith(":"))
- endLineText.substring(1, endLineText.length());
- String newContent = startLineText + text + endLineText;
- textArea.setText(newContent);
- }
-
- /*-------------------- AbstractCSSEditor methods implementation --------------------**/
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#createCSSEngine()
- */
- protected CSSEngine createCSSEngine() {
- return new CSSSWTEngineImpl(shell.getDisplay());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getHTMLElementProvider()
- */
- protected IElementProvider getHTMLElementProvider() {
- return SWTHTMLElementProvider.INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getNativeWidgetElementProvider()
- */
- protected IElementProvider getNativeWidgetElementProvider() {
- return SWTElementProvider.INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#isHTMLSelector()
- */
- protected boolean isHTMLSelector() {
- return htmlCheckbox.getSelection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getStyleSheetContent()
- */
- protected String getStyleSheetContent() {
- return textArea.getText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#setStyleSheetContent(java.lang.String)
- */
- protected void setStyleSheetContent(String content) {
- textArea.setText(content);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#setCSSEngineStatuts(java.lang.String)
- */
- protected void setCSSEngineStatuts(String status) {
- statusLabel.setText(status);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#mustApplyStylesToWindow()
- */
- protected boolean mustApplyStylesToWindow() {
- return applyStyleToShellCheckbox.getSelection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getLeftPanelNativeWidget()
- */
- protected Object getLeftPanelNativeWidget() {
- return leftPanel;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getWindowNativeWidget()
- */
- protected Object getWindowNativeWidget() {
- return shell;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getCSSNativeWidgetSerializerConfiguration()
- */
- protected CSSSerializerConfiguration getCSSNativeWidgetSerializerConfiguration() {
- return CSSSWTSerializerConfiguration.INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getCSSFileWidgetItemCount()
- */
- protected int getCSSFilesWidgetItemCount() {
- return cssFilesWidget.getItemCount();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getCSSFileWidgetSelectionIndex()
- */
- protected int getCSSFilesWidgetSelectionIndex() {
- return cssFilesWidget.getSelectionIndex();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#selectCSSFileWidget(int)
- */
- protected void selectCSSFilesWidget(int index) {
- cssFilesWidget.select(index);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#addCSSFilesWidget(java.lang.String)
- */
- protected void addItemCSSFilesWidget(String item) {
- cssFilesWidget.add(item);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#removeAllCSSFilesWidget()
- */
- protected void removeAllCSSFilesWidget() {
- cssFilesWidget.removeAll();
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/CSSEditorSWTWidgets.java b/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/CSSEditorSWTWidgets.java
deleted file mode 100644
index 03ee5e4..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/CSSEditorSWTWidgets.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.ui.examples.css.editor;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSEditorSWTWidgets extends AbstractCSSSWTEditor {
-
- public void createContent(Composite parent) {
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(layout);
-
- // Create SWT Text
- Text text = new Text(composite, SWT.BORDER);
- text.setText("bla bla bla...");
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Create SWT Text [SWT.MULTI]
- Text textArea = new Text(composite, SWT.MULTI | SWT.BORDER);
- textArea.setText("bla bla bla...[SWT.MULTI]");
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.heightHint = 100;
- textArea.setLayoutData(gridData);
-
- // Create SWT Label
- Label label = new Label(composite, SWT.NONE);
- label.setText("bla bla bla...");
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Create Button
- Button button = new Button(composite, SWT.BORDER);
- button.setText("SWT Button");
-
- // Create Button [SWT.CHECK]
- Button checkbox = new Button(composite, SWT.CHECK);
- checkbox.setText("SWT Button [SWT.CHECK]");
-
- // Create Button [SWT.RADIO]
- Button radio = new Button(composite, SWT.RADIO);
- radio.setText("SWT Button [SWT.RADIO]");
-
- // Create Combo
- Combo combo = new Combo(composite, SWT.BORDER);
- combo.add("Item 1");
- combo.add("Item 2");
- combo.select(0);
-
- // Create CTabFolder
- CTabFolder tabFolder = new CTabFolder(composite, SWT.CLOSE);
- tabFolder.setUnselectedCloseVisible(true);
- tabFolder.setUnselectedImageVisible(true);
-
- CTabItem tabItem1 = new CTabItem(tabFolder, SWT.NONE);
- tabItem1.setText("Tab 1");
-
- CTabItem tabItem2 = new CTabItem(tabFolder, SWT.NONE);
- tabItem2.setText("Tab 2");
-
- tabFolder.setSelection(0);
- }
-
- public static void main(String[] args) {
- CSSEditorSWTWidgets editor = new CSSEditorSWTWidgets();
- editor.display();
- }
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/html/Osx.css b/examples/org.eclipse.e4.ui.examples.css/styles/html/Osx.css
deleted file mode 100644
index 46390e0..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/styles/html/Osx.css
+++ /dev/null
@@ -1,10 +0,0 @@
-body {
- font-family: "Lucida Grande",Serif;
- font-size: 11;
-}
-
-input {
- font-family: "Lucida Grande",Serif;
- font-size: 9;
-}
-
diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/html/Vista.css b/examples/org.eclipse.e4.ui.examples.css/styles/html/Vista.css
deleted file mode 100644
index 09093bd..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/styles/html/Vista.css
+++ /dev/null
@@ -1,12 +0,0 @@
-body, Tree {
- font-family: Calibri;
- font-size: 10;
- background-color: rgb(233,234,238);
- color: rgb(70,70,70);
-}
-
-
-input {
- font-family: Calibri;
- font-size: 10;
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Example.css b/examples/org.eclipse.e4.ui.examples.css/styles/swt/Example.css
deleted file mode 100644
index 53c8437..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Example.css
+++ /dev/null
@@ -1,17 +0,0 @@
-Shell, SashForm {
- font-family: "Terminal";
- font-size: 12;
- background: url(./images/bluefade-banner.gif);
-}
-
-ToolBar, Button {
- font-family: "Terminal";
- font-size: 9;
- background: url(./images/bluefade-banner.gif);
-}
-
-Text {
- font-family: "Terminal";
- font-size: 11;
- background: url(./images/bluefade-full.gif);
-}
diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Osx.css b/examples/org.eclipse.e4.ui.examples.css/styles/swt/Osx.css
deleted file mode 100644
index c4f0a6b..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Osx.css
+++ /dev/null
@@ -1,10 +0,0 @@
-Shell, SashForm {
- font-family: "Lucida Grande",Serif;
- font-size: 11;
-}
-
-ToolBar, Text, Button {
- font-family: "Lucida Grande",Serif;
- font-size: 9;
-}
-
diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Vista.css b/examples/org.eclipse.e4.ui.examples.css/styles/swt/Vista.css
deleted file mode 100644
index cacaa82..0000000
--- a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Vista.css
+++ /dev/null
@@ -1,13 +0,0 @@
-Shell, Tree {
- font-family: Calibri;
- font-size: 10;
- background-color: rgb(233,234,238);
- color: rgb(70,70,70);
-}
-SashForm {
- background-color: black;
-}
-Text {
- font-family: Calibri;
- font-size: 10;
-}
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/.classpath b/tests/org.eclipse.e4.ui.compatibility.tests/.classpath
deleted file mode 100644
index 64c5e31..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/.project b/tests/org.eclipse.e4.ui.compatibility.tests/.project
deleted file mode 100644
index d30cf88..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.e4.ui.compatibility.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.e4.ui.compatibility.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3ec4f6f..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Wed Dec 03 10:11:21 EST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.e4.ui.compatibility.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 765be5a..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Tests Plug-in
-Bundle-SymbolicName: org.eclipse.e4.ui.compatibility.tests; singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Activator: org.eclipse.e4.ui.compatibility.tests.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/build.properties b/tests/org.eclipse.e4.ui.compatibility.tests/build.properties
deleted file mode 100644
index caaec51..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/,\
- contexts.xml
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/contexts.xml b/tests/org.eclipse.e4.ui.compatibility.tests/contexts.xml
deleted file mode 100644
index 02e26e4..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/contexts.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<contexts>
- <context id="viewer" title="Sample View">
- <description>This is the context help for the sample view with a table viewer. It was generated by a PDE template.</description>
- <topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
- <enablement>
- <with variable="platform">
- <test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
- </with>
- </enablement>
- </topic>
- </context>
-</contexts>
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/icons/sample.gif b/tests/org.eclipse.e4.ui.compatibility.tests/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/plugin.xml b/tests/org.eclipse.e4.ui.compatibility.tests/plugin.xml
deleted file mode 100644
index 174ac33..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/plugin.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- point="org.eclipse.ui.views">
- <category
- name="Sample Category"
- id="org.eclipse.e4.ui.compatibility.tests">
- </category>
- <view
- class="TestViews.CompatView"
- id="org.eclipse.e4.ui.compatibility.tests.test1"
- name="Compat View"
- restorable="true">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension
- targetID="org.eclipse.jdt.ui.JavaPerspective">
- <view
- ratio="0.5"
- relative="org.eclipse.ui.views.TaskList"
- relationship="right"
- id="org.eclipse.e4.ui.compatibility.tests.views.SampleView">
- </view>
- </perspectiveExtension>
- </extension>
- <extension
- point="org.eclipse.help.contexts">
- <contexts
- file="contexts.xml">
- </contexts>
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/src/TestViews/CompatView.java b/tests/org.eclipse.e4.ui.compatibility.tests/src/TestViews/CompatView.java
deleted file mode 100644
index 0bd0644..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/src/TestViews/CompatView.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package TestViews;
-
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-
-
-/**
- * This sample class demonstrates how to plug-in a new
- * workbench view. The view shows data obtained from the
- * model. The sample creates a dummy model on the fly,
- * but a real implementation would connect to the model
- * available either in this or another plug-in (e.g. the workspace).
- * The view is connected to the model using a content provider.
- * <p>
- * The view uses a label provider to define how model
- * objects should be presented in the view. Each
- * view can present the same model objects using
- * different labels and icons, if needed. Alternatively,
- * a single label provider can be shared between views
- * in order to ensure that objects of the same type are
- * presented in the same way everywhere.
- * <p>
- */
-
-public class CompatView extends ViewPart {
-
- /**
- * The ID of the view as specified by the extension.
- */
- public static final String ID = "pprj.views.EricView"; //$NON-NLS-1$
-
- private TableViewer viewer;
-
- /*
- * The content provider class is responsible for
- * providing objects to the view. It can wrap
- * existing objects in adapters or simply return
- * objects as-is. These objects may be sensitive
- * to the current input of the view, or ignore
- * it and always show the same content
- * (like Task List, for example).
- */
-
- class ViewContentProvider implements IStructuredContentProvider {
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- }
- public void dispose() {
- }
- public Object[] getElements(Object parent) {
- return new String[] { "One", "Two", "Three" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object obj, int index) {
- return getText(obj);
- }
- public Image getColumnImage(Object obj, int index) {
- return getImage(obj);
- }
- public Image getImage(Object obj) {
- return PlatformUI.getWorkbench().
- getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
- }
- }
- class NameSorter extends ViewerSorter {
- }
-
- /**
- * The constructor.
- */
- public CompatView() {
- }
-
- /**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
- */
- public void createPartControl(Composite parent) {
- viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setContentProvider(new ViewContentProvider());
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setSorter(new NameSorter());
- viewer.setInput(this);
- //viewer.setInput(getViewSite());
-
- // Create the help context id for the viewer's control
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "PPrj.viewer");
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/src/org/eclipse/e4/ui/compatibility/tests/Activator.java b/tests/org.eclipse.e4.ui.compatibility.tests/src/org/eclipse/e4/ui/compatibility/tests/Activator.java
deleted file mode 100644
index ae7e800..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/src/org/eclipse/e4/ui/compatibility/tests/Activator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.e4.ui.compatibility.tests;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.e4.ui.compatibility.tests";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
diff --git a/tests/org.eclipse.e4.ui.compatibility.tests/src/org/eclipse/e4/ui/compatibility/tests/views/SampleView.java b/tests/org.eclipse.e4.ui.compatibility.tests/src/org/eclipse/e4/ui/compatibility/tests/views/SampleView.java
deleted file mode 100644
index 1306502..0000000
--- a/tests/org.eclipse.e4.ui.compatibility.tests/src/org/eclipse/e4/ui/compatibility/tests/views/SampleView.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.eclipse.e4.ui.compatibility.tests.views;
-
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.*;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.SWT;
-
-
-/**
- * This sample class demonstrates how to plug-in a new
- * workbench view. The view shows data obtained from the
- * model. The sample creates a dummy model on the fly,
- * but a real implementation would connect to the model
- * available either in this or another plug-in (e.g. the workspace).
- * The view is connected to the model using a content provider.
- * <p>
- * The view uses a label provider to define how model
- * objects should be presented in the view. Each
- * view can present the same model objects using
- * different labels and icons, if needed. Alternatively,
- * a single label provider can be shared between views
- * in order to ensure that objects of the same type are
- * presented in the same way everywhere.
- * <p>
- */
-
-public class SampleView extends ViewPart {
-
- /**
- * The ID of the view as specified by the extension.
- */
- public static final String ID = "org.eclipse.e4.ui.compatibility.tests.views.SampleView";
-
- private TableViewer viewer;
- private Action action1;
- private Action action2;
- private Action doubleClickAction;
-
- /*
- * The content provider class is responsible for
- * providing objects to the view. It can wrap
- * existing objects in adapters or simply return
- * objects as-is. These objects may be sensitive
- * to the current input of the view, or ignore
- * it and always show the same content
- * (like Task List, for example).
- */
-
- class ViewContentProvider implements IStructuredContentProvider {
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- }
- public void dispose() {
- }
- public Object[] getElements(Object parent) {
- return new String[] { "One", "Two", "Three" };
- }
- }
- class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object obj, int index) {
- return getText(obj);
- }
- public Image getColumnImage(Object obj, int index) {
- return getImage(obj);
- }
- public Image getImage(Object obj) {
- return PlatformUI.getWorkbench().
- getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
- }
- }
- class NameSorter extends ViewerSorter {
- }
-
- /**
- * The constructor.
- */
- public SampleView() {
- }
-
- /**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
- */
- public void createPartControl(Composite parent) {
- viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setContentProvider(new ViewContentProvider());
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setSorter(new NameSorter());
- viewer.setInput(getViewSite());
-
- // Create the help context id for the viewer's control
- PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.eclipse.e4.ui.compatibility.tests.viewer");
- makeActions();
- hookContextMenu();
- hookDoubleClickAction();
- contributeToActionBars();
- }
-
- private void hookContextMenu() {
- MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- SampleView.this.fillContextMenu(manager);
- }
- });
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, viewer);
- }
-
- private void contributeToActionBars() {
- IActionBars bars = getViewSite().getActionBars();
- fillLocalPullDown(bars.getMenuManager());
- fillLocalToolBar(bars.getToolBarManager());
- }
-
- private void fillLocalPullDown(IMenuManager manager) {
- manager.add(action1);
- manager.add(new Separator());
- manager.add(action2);
- }
-
- private void fillContextMenu(IMenuManager manager) {
- manager.add(action1);
- manager.add(action2);
- // Other plug-ins can contribute there actions here
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- private void fillLocalToolBar(IToolBarManager manager) {
- manager.add(action1);
- manager.add(action2);
- }
-
- private void makeActions() {
- action1 = new Action() {
- public void run() {
- showMessage("Action 1 executed");
- }
- };
- action1.setText("Action 1");
- action1.setToolTipText("Action 1 tooltip");
- action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
-
- action2 = new Action() {
- public void run() {
- showMessage("Action 2 executed");
- }
- };
- action2.setText("Action 2");
- action2.setToolTipText("Action 2 tooltip");
- action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
- doubleClickAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- showMessage("Double-click detected on "+obj.toString());
- }
- };
- }
-
- private void hookDoubleClickAction() {
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- doubleClickAction.run();
- }
- });
- }
- private void showMessage(String message) {
- MessageDialog.openInformation(
- viewer.getControl().getShell(),
- "Sample View",
- message);
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/.classpath b/tests/org.eclipse.e4.ui.tests.css.core/.classpath
deleted file mode 100644
index 5e4c1fe..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/.project b/tests/org.eclipse.e4.ui.tests.css.core/.project
deleted file mode 100644
index 120869c..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.e4.ui.tests.css.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.e4.ui.tests.css.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ff8e07b..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Wed Jan 14 22:16:26 CET 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/CSS Core Test Suite.launch b/tests/org.eclipse.e4.ui.tests.css.core/CSS Core Test Suite.launch
deleted file mode 100644
index f683631..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/CSS Core Test Suite.launch
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<booleanAttribute key="com.mountainminds.eclemma.core.INPLACE_INSTRUMENTATION" value="true"/>
-<listAttribute key="com.mountainminds.eclemma.core.INSTRUMENTATION_PATHS"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CssCoreTestSuite.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.e4.ui.tests.css.core.CssCoreTestSuite"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.e4.ui.tests.css.core"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value=""/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="false"/>
-</launchConfiguration>
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/META-INF/MANIFEST.MF b/tests/org.eclipse.e4.ui.tests.css.core/META-INF/MANIFEST.MF
deleted file mode 100644
index faa8bfe..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: e4 css core tests
-Bundle-SymbolicName: org.eclipse.e4.ui.tests.css.core
-Bundle-Version: 0.9.0.qualifier
-Bundle-Activator: org.eclipse.e4.ui.tests.css.core.Activator
-Require-Bundle: org.eclipse.core.runtime,
- org.junit,
- org.eclipse.swt,
- org.eclipse.e4.ui.css.core,
- org.eclipse.e4.ui.css.swt,
- org.w3c.css.sac,
- org.eclipse.core.tests.harness
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/build.properties b/tests/org.eclipse.e4.ui.tests.css.core/build.properties
deleted file mode 100644
index d1444fe..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- test.xml
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/Activator.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/Activator.java
deleted file mode 100644
index 405decf..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/Activator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.e4.ui.tests.css.core;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.e4.ui.tests.css.core";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CssCoreTestSuite.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CssCoreTestSuite.java
deleted file mode 100644
index 8b2b086..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CssCoreTestSuite.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.e4.ui.tests.css.core;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.e4.ui.tests.css.core.parser.CascadeTest;
-import org.eclipse.e4.ui.tests.css.core.parser.FontFaceRulesTest;
-import org.eclipse.e4.ui.tests.css.core.parser.MediaRulesTest;
-import org.eclipse.e4.ui.tests.css.core.parser.RGBColorImplTest;
-import org.eclipse.e4.ui.tests.css.core.parser.StyleRuleTest;
-import org.eclipse.e4.ui.tests.css.core.parser.ViewCSSTest;
-
-public class CssCoreTestSuite extends TestSuite {
-
- public static Test suite() {
- return new CssCoreTestSuite();
- }
-
- public CssCoreTestSuite() {
- // $JUnit-BEGIN$
- addTestSuite(CascadeTest.class);
- addTestSuite(FontFaceRulesTest.class);
- addTestSuite(MediaRulesTest.class);
- addTestSuite(RGBColorImplTest.class);
- addTestSuite(StyleRuleTest.class);
- addTestSuite(ViewCSSTest.class);
- // $JUnit-END$
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/CascadeTest.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/CascadeTest.java
deleted file mode 100644
index 94b119c..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/CascadeTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.tests.css.core.parser;
-
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.e4.ui.css.core.impl.dom.DocumentCSSImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.ViewCSSImpl;
-import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.e4.ui.tests.css.core.util.ParserTestUtil;
-import org.eclipse.e4.ui.tests.css.core.util.TestElement;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.ViewCSS;
-
-
-public class CascadeTest extends TestCase {
-
- private Display display;
- private CSSSWTEngineImpl engine;
-
- protected void setUp() throws Exception {
- display = Display.getDefault();
- engine = new CSSSWTEngineImpl(display);
- }
-
- public void testPosition() throws Exception {
- // Two rules with the same specificity, the second rule should take
- // precedence because of its position in the stylesheet
- String css = "Button { color: blue; font-weight: bold; }\n"
- + "Button { color: black }\n";
- ViewCSS viewCSS = createViewCss(css);
-
- TestElement button = new TestElement("Button", engine);
- CSSStyleDeclaration style = viewCSS.getComputedStyle(button, null);
- assertEquals("black", style.getPropertyCSSValue("color").getCssText());
- assertEquals("bold", style.getPropertyCSSValue("font-weight")
- .getCssText());
- }
-
- public void testSpecificity() throws Exception {
- // Two rules with different specificity, the first should take
- // precedence because of its higher specificity
- String css = "Label, Button.special { color: black; }\n"
- + "Button { color: blue; font-weight: bold; }\n";
- ViewCSS viewCSS = createViewCss(css);
-
- TestElement button = new TestElement("Button", engine);
- CSSStyleDeclaration style = viewCSS.getComputedStyle(button, null);
- assertEquals("blue", style.getPropertyCSSValue("color").getCssText());
-
- button.setClass("special");
- style = viewCSS.getComputedStyle(button, null);
- assertEquals("black", style.getPropertyCSSValue("color").getCssText());
- assertEquals("bold", style.getPropertyCSSValue("font-weight")
- .getCssText());
- }
-
- public void testSpecificities() throws Exception {
- // Different specificities
- String css = "* { color: black; }\n"
- + "Button { color: blue; }\n"
- + "Button[BORDER] { color: gray; }\n"
- + "Button.special { color: green; }\n"
- + "Button#myid { color: red; }\n";
- ViewCSS viewCSS = createViewCss(css);
-
- TestElement label = new TestElement("Label", engine);
- CSSStyleDeclaration style = viewCSS.getComputedStyle(label, null);
- assertEquals("black", style.getPropertyCSSValue("color").getCssText());
-
- TestElement button = new TestElement("Button", engine);
- style = viewCSS.getComputedStyle(button, null);
- assertEquals("blue", style.getPropertyCSSValue("color").getCssText());
-
- button.setAttribute("BORDER", "true");
- style = viewCSS.getComputedStyle(button, null);
- assertEquals("gray", style.getPropertyCSSValue("color").getCssText());
-
- button.setClass("special");
- style = viewCSS.getComputedStyle(button, null);
- assertEquals("green", style.getPropertyCSSValue("color").getCssText());
-
- button.setId("myid");
- style = viewCSS.getComputedStyle(button, null);
- assertEquals("red", style.getPropertyCSSValue("color").getCssText());
- }
-
- private static ViewCSS createViewCss(String css) throws IOException {
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- DocumentCSSImpl docCss = new DocumentCSSImpl();
- docCss.addStyleSheet(styleSheet);
- return new ViewCSSImpl(docCss);
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/FontFaceRulesTest.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/FontFaceRulesTest.java
deleted file mode 100644
index 36bbe0e..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/FontFaceRulesTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.tests.css.core.parser;
-
-import junit.framework.TestCase;
-
-import org.eclipse.e4.ui.tests.css.core.util.ParserTestUtil;
-import org.w3c.dom.css.CSSStyleSheet;
-
-/**
- * Assert that <code>@font-face</code> rules are ignored.
- */
-public class FontFaceRulesTest extends TestCase {
-
- public void testEmptyFontFaceRule() throws Exception {
- String css = "@font-face {}\n"
- + "Label { background-color: #FF0000 }";
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- assertNotNull(styleSheet);
- assertEquals(1, styleSheet.getCssRules().getLength());
- }
-
- public void testFontFaceRuleWithProperties() throws Exception {
- String css = "@font-face {\n"
- + " font-family: \"Robson Celtic\";\n"
- + " src: url(\"http://site/fonts/rob-celt\")\n" + "}\n"
- + "Label { background-color: #FF0000 }";
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- assertNotNull(styleSheet);
- assertEquals(1, styleSheet.getCssRules().getLength());
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/MediaRulesTest.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/MediaRulesTest.java
deleted file mode 100644
index 2ca3ebe..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/MediaRulesTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.tests.css.core.parser;
-
-import junit.framework.TestCase;
-
-import org.eclipse.e4.ui.tests.css.core.util.ParserTestUtil;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleSheet;
-
-/**
- * Assert that <code>@media</code> rules are ignored.
- */
-public class MediaRulesTest extends TestCase {
-
- public void testMediaRule() throws Exception {
- String css = "@media screen, print {\n"
- + "BODY { line-height: 1.2 }\n"
- + "}\n" + "Label { background-color: #FF0000 }";
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- assertNotNull(styleSheet);
- CSSRuleList rules = styleSheet.getCssRules();
-
- //THIS TEST KNOWN TO FAIL Dec 16/08
- assertEquals(1, rules.getLength());
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/RGBColorImplTest.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/RGBColorImplTest.java
deleted file mode 100644
index e297588..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/RGBColorImplTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.tests.css.core.parser;
-
-import junit.framework.TestCase;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.tests.css.core.util.ParserTestUtil;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.RGBColor;
-
-
-public class RGBColorImplTest extends TestCase {
-
- public void testGetCssText() throws Exception {
- CSSEngine engine = ParserTestUtil.createEngine();
- CSSValue value = engine.parsePropertyValue("#FF8000");
- assertTrue( value instanceof RGBColor );
- assertEquals( "rgb(255, 128, 0)", value.getCssText() );
-
- // Out-of-range values should be clipped
- // http://www.w3.org/TR/CSS21/syndata.html#value-def-color
- value = engine.parsePropertyValue("rgb( 300, -10, 42 )");
- assertTrue( value instanceof RGBColor );
-// assertEquals( "rgb(255, 0, 42)", value.getCssText() );
-
-// value = engine.parsePropertyValue("rgb( 110%, 50%, -10% )");
-// assertTrue( value instanceof RGBColor );
-// assertEquals( "rgb(100%, 50%, 0%)", value.getCssText() );
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/StyleRuleTest.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/StyleRuleTest.java
deleted file mode 100644
index f7225ba..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/StyleRuleTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.tests.css.core.parser;
-
-import junit.framework.TestCase;
-
-import org.eclipse.e4.ui.tests.css.core.util.ParserTestUtil;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleRule;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.CSSValue;
-import org.w3c.dom.css.RGBColor;
-
-
-public class StyleRuleTest extends TestCase {
-
- public void testSimpleStyleRule() throws Exception {
- String css = "Label { color: #FF0000 }";
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- assertNotNull(styleSheet);
- CSSRuleList rules = styleSheet.getCssRules();
- assertEquals(1, rules.getLength());
- CSSRule rule = rules.item(0);
- assertEquals(CSSRule.STYLE_RULE, rule.getType());
- }
-
- public void testHexColor() throws Exception {
- String css = "Label { color: #FF0220 }";
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- CSSRuleList rules = styleSheet.getCssRules();
- CSSRule rule = rules.item(0);
- assertEquals(CSSRule.STYLE_RULE, rule.getType());
- CSSStyleDeclaration style = ((CSSStyleRule) rule).getStyle();
- CSSValue value = style.getPropertyCSSValue("color");
- assertTrue(value instanceof CSSPrimitiveValue);
- RGBColor colorValue = ((CSSPrimitiveValue) value).getRGBColorValue();
- assertEquals(255.0f, colorValue.getRed().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER), 0f);
- assertEquals(2.0f, colorValue.getGreen().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER), 0f);
- assertEquals(32.0f, colorValue.getBlue().getFloatValue(
- CSSPrimitiveValue.CSS_NUMBER), 0f);
- }
-
- public void testNamedColor() throws Exception {
- String css = "Label { color: green }";
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- CSSRuleList rules = styleSheet.getCssRules();
- CSSRule rule = rules.item(0);
- assertEquals(CSSRule.STYLE_RULE, rule.getType());
- CSSStyleDeclaration style = ((CSSStyleRule) rule).getStyle();
- CSSValue value = style.getPropertyCSSValue("color");
- assertTrue(value instanceof CSSPrimitiveValue);
- String colorString = ((CSSPrimitiveValue) value).getStringValue();
- assertEquals("green", colorString);
- }
-
- public void testFont() throws Exception {
- String css = "Label { font: Verdana }";
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- CSSRuleList rules = styleSheet.getCssRules();
- CSSRule rule = rules.item(0);
- assertEquals(CSSRule.STYLE_RULE, rule.getType());
- CSSStyleDeclaration style = ((CSSStyleRule) rule).getStyle();
- CSSValue value = style.getPropertyCSSValue("font");
- assertTrue(value instanceof CSSPrimitiveValue);
- String colorString = ((CSSPrimitiveValue) value).getStringValue();
- assertEquals("Verdana", colorString);
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/ViewCSSTest.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/ViewCSSTest.java
deleted file mode 100644
index 92da1f4..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/ViewCSSTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.tests.css.core.parser;
-
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.e4.ui.css.core.impl.dom.DocumentCSSImpl;
-import org.eclipse.e4.ui.css.core.impl.dom.ViewCSSImpl;
-import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.e4.ui.tests.css.core.util.ParserTestUtil;
-import org.eclipse.e4.ui.tests.css.core.util.TestElement;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.css.ViewCSS;
-
-
-public class ViewCSSTest extends TestCase {
-
- private Display display;
- private CSSSWTEngineImpl engine;
-
- protected void setUp() throws Exception {
- display = Display.getDefault();
- engine = new CSSSWTEngineImpl(display);
- }
-
- public void testGetComputedStyle() throws Exception {
- // Two rules with the same specificity, the second rule should take
- // precedence because of its position in the stylesheet
- String css = "Label { color: black; }"
- + "Button { color: blue; font-weight: bold; }\n"
- + "Button { color: green; }\n";
- ViewCSS viewCSS = createViewCss(css);
-
- TestElement shell = new TestElement("Shell", engine);
- CSSStyleDeclaration shellStyle = viewCSS.getComputedStyle(shell, null);
- assertNull( shellStyle );
-
- TestElement label = new TestElement("Label", engine);
- CSSStyleDeclaration labelStyle = viewCSS.getComputedStyle(label, null);
- assertNotNull( labelStyle );
- assertEquals( 1, labelStyle.getLength() );
-
- TestElement button = new TestElement("Button", engine);
- CSSStyleDeclaration buttonStyle = viewCSS.getComputedStyle(button, null);
- assertNotNull( buttonStyle );
- assertEquals( 2, buttonStyle.getLength() );
- }
-
- private static ViewCSS createViewCss(String css) throws IOException {
- CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
- DocumentCSSImpl docCss = new DocumentCSSImpl();
- docCss.addStyleSheet(styleSheet);
- return new ViewCSSImpl(docCss);
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/util/ParserTestUtil.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/util/ParserTestUtil.java
deleted file mode 100644
index 1d402b4..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/util/ParserTestUtil.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.tests.css.core.util;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler;
-import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-
-public final class ParserTestUtil {
-
- private static final CSSErrorHandler ERROR_HANDLER = new CSSErrorHandler() {
- public void error(Exception e) {
- throw new RuntimeException(e);
- }
- };
-
- private ParserTestUtil() {
- // prevent instantiation
- }
-
- public static CSSStyleSheet parseCss(String css)
- throws IOException {
- CSSEngine engine = createEngine();
- StyleSheet result = engine.parseStyleSheet(new StringReader(css));
- return (CSSStyleSheet) result;
- }
-
- public static CSSEngine createEngine() {
- Display display = Display.getDefault();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.setErrorHandler(ERROR_HANDLER);
- return engine;
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/util/TestElement.java b/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/util/TestElement.java
deleted file mode 100644
index a5f46bc..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/util/TestElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 EclipseSource and others. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package org.eclipse.e4.ui.tests.css.core.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.e4.ui.css.core.dom.ElementAdapter;
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Dummy DOM Element implementation for testing.
- */
-public class TestElement extends ElementAdapter {
-
- private final String typeName;
- private String className;
- private String id;
- private Map attrs = new HashMap();
-
- public TestElement(String type, CSSEngine engine) {
- super(null, engine);
- this.typeName = type;
- }
-
- public void setClass(String className) {
- this.className = className;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public void setAttribute(String name, String value) {
- attrs.put(name, value);
- }
-
- public String getAttribute(String name) {
- String value = (String) attrs.get(name);
- return value == null ? "" : value;
- }
-
- public String getLocalName() {
- return typeName;
- }
-
- public NodeList getChildNodes() {
- return null;
- }
-
- public String getNamespaceURI() {
- return null;
- }
-
- public Node getParentNode() {
- return null;
- }
-
- public String getCSSClass() {
- return className;
- }
-
- public String getCSSId() {
- return id;
- }
-
- public String getCSSStyle() {
- return null;
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.core/test.xml b/tests/org.eclipse.e4.ui.tests.css.core/test.xml
deleted file mode 100644
index 5cda948..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.core/test.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}/../.." />
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.e4.ui.tests.css.core" />
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test/library.xml" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp />
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml" />
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="sniff-folder" value="${eclipse-home}/databinding_sniff_folder" />
- <delete dir="${sniff-folder}" quiet="true" />
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${sniff-folder}" />
- <property name="plugin-name" value="${plugin-name}" />
- <property name="classname" value="org.eclipse.e4.ui.tests.css.core.CssCoreTestSuite" />
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml" />
- <property name="output-file" value="${plugin-name}.xml" />
- </ant>
- </target>
-</project>
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/.classpath b/tests/org.eclipse.e4.ui.tests.css.swt/.classpath
deleted file mode 100644
index 64c5e31..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/.project b/tests/org.eclipse.e4.ui.tests.css.swt/.project
deleted file mode 100644
index 4a54a07..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.e4.ui.tests.css.swt</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.e4.ui.tests.css.swt/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 16f4bde..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Dec 09 15:34:19 EST 2008
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/CSS SWT Test Suite.launch b/tests/org.eclipse.e4.ui.tests.css.swt/CSS SWT Test Suite.launch
deleted file mode 100644
index cdc4a0b..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/CSS SWT Test Suite.launch
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<booleanAttribute key="com.mountainminds.eclemma.core.INPLACE_INSTRUMENTATION" value="true"/>
-<listAttribute key="com.mountainminds.eclemma.core.INSTRUMENTATION_PATHS"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CssSwtTestSuite.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.e4.ui.tests.css.swt.CssSwtTestSuite"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.e4.ui.tests.css.swt"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value=""/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="false"/>
-</launchConfiguration>
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/META-INF/MANIFEST.MF b/tests/org.eclipse.e4.ui.tests.css.swt/META-INF/MANIFEST.MF
deleted file mode 100644
index 4407da5..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: e4 css swt tests
-Bundle-SymbolicName: org.eclipse.e4.ui.tests.css.swt; singleton:=true
-Bundle-Version: 0.9.0.qualifier
-Bundle-Activator: org.eclipse.e4.ui.tests.css.swt.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.junit,
- org.eclipse.swt,
- org.eclipse.e4.ui.css.core,
- org.eclipse.e4.ui.css.swt,
- org.w3c.css.sac,
- org.eclipse.core.tests.harness
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/build.properties b/tests/org.eclipse.e4.ui.tests.css.swt/build.properties
deleted file mode 100644
index d1444fe..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- test.xml
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/Activator.java b/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/Activator.java
deleted file mode 100644
index 37ee678..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/Activator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.e4.ui.tests.css.swt;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.e4.ui.tests.css.swt";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CSSTestCase.java b/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CSSTestCase.java
deleted file mode 100644
index 935ba92..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CSSTestCase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.e4.ui.tests.css.swt;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import junit.framework.TestCase;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler;
-import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.widgets.Display;
-
-public class CSSTestCase extends TestCase {
-
- public CSSEngine createEngine(String styleSheet, Display display) {
- CSSEngine engine = new CSSSWTEngineImpl(display);
-
- engine.setErrorHandler(new CSSErrorHandler() {
- public void error(Exception e) {
- fail(e.getMessage());
- }
- });
-
- try {
- engine.parseStyleSheet(new StringReader(styleSheet));
- } catch (IOException e) {
- fail(e.getMessage());
- }
- return engine;
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CTabFolderTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CTabFolderTest.java
deleted file mode 100644
index d1f1242..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CTabFolderTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.eclipse.e4.ui.tests.css.swt;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class CTabFolderTest extends CSSTestCase {
-
- static final RGB RED = new RGB(255, 0, 0);
- static final RGB GREEN = new RGB(0, 255, 0);
- static final RGB BLUE = new RGB(0, 0, 255);
- static final RGB WHITE = new RGB(255, 255, 255);
-
- protected CTabFolder createTestCTabFolder(String styleSheet) {
- Display display = Display.getDefault();
- CSSEngine engine = createEngine(styleSheet, display);
-
- // Create widgets
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
- Composite panel = new Composite(shell, SWT.NONE);
- panel.setLayout(new FillLayout());
-
- CTabFolder folderToTest = new CTabFolder(panel, SWT.NONE);
- CTabItem tab1 = new CTabItem(folderToTest, SWT.NONE);
- tab1.setText("A TAB ITEM");
-
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
- return folderToTest;
- }
-
- public void testBackgroundColor() throws Exception {
- CTabFolder folderToTest = createTestCTabFolder("CTabFolder { background-color: #0000FF }");
- assertEquals(BLUE, folderToTest.getBackground().getRGB());
- folderToTest.getShell().close();
- }
-
- public void testTextColor() throws Exception {
- CTabFolder folderToTest = createTestCTabFolder("CTabFolder { color: #0000FF }");
- assertEquals(BLUE, folderToTest.getForeground().getRGB());
- folderToTest.getShell().close();
- }
-
-// public void testGradientColor() throws Exception {
-// CTabFolder folderToTest = createTestCTabFolder("CTabFolder { background-color: #FF0000 #0000FF }");
-// assertEquals(BLUE, folderToTest.getSelectionBackground());
-// folderToTest.getShell().close();
-// }
-
- public void testSelectedPseudo() throws Exception {
- CTabFolder folderToTest = createTestCTabFolder(
- "CTabFolder { color: #FFFFFF; background-color: #0000FF }\n" +
- "CTabFolder:selected { color: #FF0000; background-color: #00FF00 }");
- assertEquals(WHITE, folderToTest.getForeground().getRGB());
- assertEquals(BLUE, folderToTest.getBackground().getRGB());
- assertEquals(RED, folderToTest.getSelectionForeground().getRGB());
- assertEquals(GREEN, folderToTest.getSelectionBackground().getRGB());
- folderToTest.getShell().close();
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CssSwtTestSuite.java b/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CssSwtTestSuite.java
deleted file mode 100644
index 637a707..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CssSwtTestSuite.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.e4.ui.tests.css.swt;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class CssSwtTestSuite extends TestSuite {
- /**
- * Returns the suite. This is required to use the JUnit Launcher.
- */
- public static final Test suite() {
- return new CssSwtTestSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public CssSwtTestSuite() {
- addTestSuite(LabelTest.class);
- addTestSuite(CTabFolderTest.class);
- addTestSuite(IdClassLabelColorTest.class);
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/IdClassLabelColorTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/IdClassLabelColorTest.java
deleted file mode 100644
index 941ade9..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/IdClassLabelColorTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.e4.ui.tests.css.swt;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.swt.dom.SWTElement;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/*
- * Tests the CSS class and Id rules
- */
-
-public class IdClassLabelColorTest extends CSSTestCase {
-
- static final RGB RED = new RGB(255, 0, 0);
- static final RGB GREEN = new RGB(0, 255, 0);
- static final RGB BLUE = new RGB(0, 0, 255);
-
- static final String CSS_CLASS_NAME = "makeItGreenClass";
- static final String CSS_ID = "makeItBlueID";
-
- protected Label createTestLabel(String styleSheet) {
- Display display = Display.getDefault();
- CSSEngine engine = createEngine(styleSheet, display);
-
- // Create widgets
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel = new Composite(shell, SWT.NONE);
- panel.setLayout(new FillLayout());
-
- Label labelToTest = new Label(panel, SWT.NONE);
- labelToTest.setText("Some label text");
- SWTElement.setCSSClass(labelToTest, CSS_CLASS_NAME);
- SWTElement.setID(labelToTest, CSS_ID);
-
- // Apply styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
- return labelToTest;
- }
-
- //For completeness, test that the html type rule works
- public void testWidgetClass() throws Exception {
- Label label = createTestLabel("Label { background-color: #FF0000 }");
- assertEquals(RED, label.getBackground().getRGB());
- }
-
- //Test the CSS class rule
- public void testCssClass() throws Exception {
- Label labelToTest = createTestLabel("." + CSS_CLASS_NAME + " { background-color: #00FF00 }");
-
- //Ensure the widget actually thinks it has this CSS class
- assertEquals(SWTElement.getCSSClass(labelToTest), CSS_CLASS_NAME);
-
- assertEquals(GREEN, labelToTest.getBackground().getRGB());
- }
-
- //Test the id rule
- public void testWidgetId() throws Exception {
- Label labelToTest = createTestLabel("#" + CSS_ID + " { background-color: #0000FF }");
-
- //Ensure the widget actually thinks it has this ID
- assertEquals(SWTElement.getID(labelToTest), CSS_ID);
-
- assertEquals(BLUE, labelToTest.getBackground().getRGB());
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/LabelTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/LabelTest.java
deleted file mode 100644
index 80899d2..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/LabelTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.e4.ui.tests.css.swt;
-
-import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-public class LabelTest extends CSSTestCase {
-
- static final RGB RED = new RGB(255, 0, 0);
- static final RGB GREEN = new RGB(0, 255, 0);
- static final RGB BLUE = new RGB(0, 0, 255);
-
- protected Label createTestLabel(String styleSheet) {
- Display display = Display.getDefault();
- CSSEngine engine = createEngine(styleSheet, display);
-
- // Create widgets
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel = new Composite(shell, SWT.NONE);
- panel.setLayout(new FillLayout());
-
- Label labelToTest = new Label(panel, SWT.NONE);
- labelToTest.setText("Some label text");
-
- // Apply styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
- return labelToTest;
- }
-
-
- public void testColor() throws Exception {
- Label labelToTest = createTestLabel("Label { background-color: #FF0000; color: #0000FF }");
- assertEquals(RED, labelToTest.getBackground().getRGB());
- assertEquals(BLUE, labelToTest.getForeground().getRGB());
- labelToTest.getShell().close();
- }
-
- public void testFontRegular() throws Exception {
- Label labelToTest = createTestLabel("Label { font: Verdana 16px }");
- assertEquals(1, labelToTest.getFont().getFontData().length);
- FontData fontData = labelToTest.getFont().getFontData()[0];
- assertEquals("Verdana", fontData.getName());
- assertEquals(16, fontData.getHeight());
- assertEquals(SWT.NORMAL, fontData.getStyle());
- labelToTest.getShell().close();
- }
-
- public void testFontBold() throws Exception {
- Label labelToTest = createTestLabel("Label { font: Arial 12px; font-weight: bold }");
- assertEquals(1, labelToTest.getFont().getFontData().length);
- FontData fontData = labelToTest.getFont().getFontData()[0];
- assertEquals("Arial", fontData.getName());
- assertEquals(12, fontData.getHeight());
- assertEquals(SWT.BOLD, fontData.getStyle());
- labelToTest.getShell().close();
- }
-
- public void testFontItalic() throws Exception {
- Label labelToTest = createTestLabel("Label { font-style: italic }");
- assertEquals(1, labelToTest.getFont().getFontData().length);
- FontData fontData = labelToTest.getFont().getFontData()[0];
- assertEquals(SWT.ITALIC, fontData.getStyle());
- labelToTest.getShell().close();
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/test.xml b/tests/org.eclipse.e4.ui.tests.css.swt/test.xml
deleted file mode 100644
index 83f82e6..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/test.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}/../.." />
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.e4.ui.tests.css.swt" />
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test/library.xml" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp />
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml" />
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="sniff-folder" value="${eclipse-home}/databinding_sniff_folder" />
- <delete dir="${sniff-folder}" quiet="true" />
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${sniff-folder}" />
- <property name="plugin-name" value="${plugin-name}" />
- <property name="classname" value="org.eclipse.e4.ui.tests.css.swt.CssSwtTestSuite" />
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml" />
- <property name="output-file" value="${plugin-name}.xml" />
- </ant>
- </target>
-</project>
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/dom/parsers/CSSParserTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/dom/parsers/CSSParserTest.java
deleted file mode 100644
index e38abd9..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/dom/parsers/CSSParserTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.core.dom.parsers;
-
-import org.akrogen.tkui.css.core.resources.CSSCoreResources;
-import org.w3c.css.sac.InputSource;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleSheet;
-
-public class CSSParserTest {
-
- public static void main(String[] args) {
- try {
- ICSSParserFactory factory = CSSParserFactory.newInstance();
- CSSParser cssParser = factory.makeCSSParser();
-
- InputSource styleSheetSource = new InputSource();
- styleSheetSource.setByteStream(CSSCoreResources.getHTMLSimple());
-
- CSSStyleSheet styleSheet = cssParser
- .parseStyleSheet(styleSheetSource);
-
- // Loop for CSS Rules list parsed
- CSSRuleList ruleList = styleSheet.getCssRules();
- int length = ruleList.getLength();
- for (int i = 0; i < length; i++) {
- CSSRule rule = ruleList.item(i);
- System.out.println(rule);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/examples/csseditors/AbstractCSSEditor.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/examples/csseditors/AbstractCSSEditor.java
deleted file mode 100644
index 2e7315a..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/examples/csseditors/AbstractCSSEditor.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.core.examples.csseditors;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Date;
-
-import org.akrogen.tkui.css.core.dom.IElementProvider;
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.core.engine.CSSErrorHandler;
-import org.akrogen.tkui.css.core.serializers.CSSHTMLSerializerConfiguration;
-import org.akrogen.tkui.css.core.serializers.CSSSerializer;
-import org.akrogen.tkui.css.core.serializers.CSSSerializerConfiguration;
-
-/**
- * Abstract CSS Editor.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSEditor {
-
- /**
- * CSS Engine.
- */
- protected CSSEngine engine;
-
- /**
- * CSS Serializer
- */
- protected CSSSerializer serializer;
-
- protected String nativeWidgetDir;
-
- protected java.util.List cssFiles = new ArrayList();
-
- protected AbstractCSSEditor(String nativeWidgetDir) {
- this.nativeWidgetDir = nativeWidgetDir;
- }
-
- /**
- * Return CSS Engine configured.
- *
- * @return
- */
- protected CSSEngine getCSSEngine() {
- if (engine == null) {
- // Get SWT CSS Engine
- engine = createCSSEngine();
- // Error
- engine.setErrorHandler(new CSSErrorHandler() {
- public void error(Exception e) {
- handleExceptions(e);
- }
- });
-
- } else {
- // Remove all style sheets.
- engine.reset();
- }
-
- if (isHTMLSelector()) {
- // Register HTML Element Provider to retrieve
- // w3c Element HTMLElement coming from Native Widget.
- engine.setElementProvider(getHTMLElementProvider());
- } else {
- // Register Native Widget (SWT, Swing...) Element Provider to
- // retrieve
- // w3c Element Element coming from Native Widget.
- engine.setElementProvider(getNativeWidgetElementProvider());
- }
- return engine;
- }
-
- /**
- * Apply Styles comming from <code>getStyleSheetContent()</code> method to
- * implement <code>widget</code>.
- *
- * @param widget
- */
- protected void applyStyles(Object widget) {
- try {
- Date d1 = new Date();
- engine = getCSSEngine();
- // 1. Parse Style Sheet coming from getStyleSheetContent().
- StringReader reader = new StringReader(getStyleSheetContent());
- engine.parseStyleSheet(reader);
-
- // 2. Apply styles
- engine.applyStyles(widget, true, true);
- Date d2 = new Date();
-
- // 3. Display time elapsed
- setCSSEngineStatuts("Apply style with "
- + (d2.getTime() - d1.getTime()) + "ms.");
-
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- }
-
- /**
- * Apply styles to the fully window or left panel widget.
- */
- protected void applyStyles() {
- if (mustApplyStylesToWindow()) {
- applyStyles(getWindowNativeWidget());
- } else
- applyStyles(getLeftPanelNativeWidget());
- }
-
- protected void fillTextareaWithStyleSheetContent(File file) {
- try {
- fillTextareaWithStyleSheetContent(new FileInputStream(file));
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- /**
- * Fill the TextArea which store the style sheet content with the
- * <code>stream</code> content.
- *
- * @param stream
- */
- protected void fillTextareaWithStyleSheetContent(InputStream stream) {
- try {
- StringWriter writer = new StringWriter();
- InputStreamReader streamReader = new InputStreamReader(stream);
- BufferedReader buffer = new BufferedReader(streamReader);
- String line = "";
- boolean b = false;
- while (null != (line = buffer.readLine())) {
- if (b)
- writer.write("\n");
- writer.write(line);
- b = true;
- }
- buffer.close();
- streamReader.close();
- String content = writer.toString();
- setStyleSheetContent(content);
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- protected void fillTextareaWithDefaultStyleSheetContent() {
- if (mustApplyStylesToWindow())
- fillTextareaWithDefaultStyleSheetContent(getWindowNativeWidget());
- else
- fillTextareaWithDefaultStyleSheetContent(getLeftPanelNativeWidget());
- }
-
- protected void fillTextareaWithDefaultStyleSheetContent(Object widget) {
- if (serializer == null)
- this.serializer = new CSSSerializer();
- StringWriter writer = new StringWriter();
- try {
- CSSSerializerConfiguration configuration = (isHTMLSelector() ? getCSSHTMLSerializerConfiguration()
- : getCSSNativeWidgetSerializerConfiguration());
- serializer.serialize(writer, getCSSEngine(), widget, true,
- configuration);
- setStyleSheetContent(writer.toString());
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- protected void applyStylesFromSelectedFile() {
- int index = getCSSFilesWidgetSelectionIndex();
- if (index == -1)
- if (getCSSFilesWidgetItemCount() > 1) {
- index = 1;
- selectCSSFilesWidget(index);
- // cssFilesWidget.select(index);
- }
- if (index < 1) {
- setStyleSheetContent("");
- return;
- }
- File file = (File) cssFiles.get(index - 1);
- fillTextareaWithStyleSheetContent(file);
- }
-
- protected void populateCSSFiles() {
- removeAllCSSFilesWidget();
- int size = cssFiles.size();
- for (int i = 0; i < size; i++) {
- cssFiles.remove(0);
- }
- addItemCSSFilesWidget("None");
- File baseDir = getBaseStyleDir();
- File[] files = baseDir.listFiles();
- for (int i = 0; i < files.length; i++) {
- File file = files[i];
- if (file.isFile()) {
- addItemCSSFilesWidget(file.getName());
- cssFiles.add(file);
- }
- }
- }
-
- /**
- * Display CSS Engine error
- *
- * @param e
- */
- protected void handleExceptions(Exception e) {
- e.printStackTrace();
- }
-
- protected File getBaseStyleDir() {
- if (isHTMLSelector())
- return new File(getBaseStyleDirName() + "/html");
- if (nativeWidgetDir != null)
- return new File(getBaseStyleDirName() + "/" + nativeWidgetDir);
- return new File(getBaseStyleDirName());
- }
-
- protected String getBaseStyleDirName() {
- return "styles";
- }
-
- /**
- * Create Instance of CSS Engine
- *
- * @return
- */
- protected abstract CSSEngine createCSSEngine();
-
- /**
- * Return true if HTML selector must be used and false if Native Widget
- * Selector must be used.
- *
- * @return
- */
- protected abstract boolean isHTMLSelector();
-
- /**
- * Return Native Widget Element provider.
- *
- * @return
- */
- protected abstract IElementProvider getNativeWidgetElementProvider();
-
- /**
- * Return HTML Element provider.
- *
- * @return
- */
- protected abstract IElementProvider getHTMLElementProvider();
-
- /**
- * Return style sheet content.
- *
- * @return
- */
- protected abstract String getStyleSheetContent();
-
- /**
- * Set style sheet content.
- *
- * @param content
- */
- protected abstract void setStyleSheetContent(String content);
-
- /**
- * Set CSS Engine status.
- *
- * @param status
- */
- protected abstract void setCSSEngineStatuts(String status);
-
- /**
- * Return true if Styles must be applied to the fully Window and false
- * otherwise.
- *
- * @return
- */
- protected abstract boolean mustApplyStylesToWindow();
-
- /**
- * Get Window Native Widget.
- *
- * @return
- */
- protected abstract Object getWindowNativeWidget();
-
- /**
- * Get Left Panel Native widget.
- *
- * @return
- */
- protected abstract Object getLeftPanelNativeWidget();
-
- /**
- * Return CSS Serializer configuration for Native Widget.
- *
- * @return
- */
- protected abstract CSSSerializerConfiguration getCSSNativeWidgetSerializerConfiguration();
-
- /**
- * Return CSS Serializer configuration for HTML.
- *
- * @return
- */
- protected CSSSerializerConfiguration getCSSHTMLSerializerConfiguration() {
- return CSSHTMLSerializerConfiguration.INSTANCE;
- }
-
- /**
- * Return selection index of CSS files widget.
- *
- * @return
- */
- protected abstract int getCSSFilesWidgetSelectionIndex();
-
- /**
- * Return item count of CSS files widget.
- *
- * @return
- */
- protected abstract int getCSSFilesWidgetItemCount();
-
- /**
- * Select item of CSS files widget at <code>index</code>.
- *
- * @param index
- */
- protected abstract void selectCSSFilesWidget(int index);
-
- /**
- * Remove all items of CSS files widget.
- */
- protected abstract void removeAllCSSFilesWidget();
-
- /**
- * Add item of CSS files widget.
- *
- * @param item
- */
- protected abstract void addItemCSSFilesWidget(String item);
-
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/CSSCoreResources.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/CSSCoreResources.java
deleted file mode 100644
index 11b925f..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/CSSCoreResources.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.core.resources;
-
-import java.io.InputStream;
-
-public class CSSCoreResources {
-
- /*--- HTML Styles --*/
-
- public static InputStream getHTMLSimple() {
- return CSSCoreResources.class.getResourceAsStream("html/simple-html.css");
- }
-
- public static InputStream getHTMLFont() {
- return CSSCoreResources.class.getResourceAsStream("html/font-html.css");
- }
-
-
- public static InputStream getHTMLMatrix() {
- return CSSCoreResources.class.getResourceAsStream("html/Matrix.css");
- }
-
- public static InputStream getStyleCLass() {
- return CSSCoreResources.class.getResourceAsStream("style-class.css");
- }
-
-
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/html/font-html.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/html/font-html.css
deleted file mode 100644
index 4d67609..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/html/font-html.css
+++ /dev/null
@@ -1,14 +0,0 @@
-font {
- color:red;
-}
-
-font#MyId {
- color:yellow;
- font-size:5;
-}
-
-.purpleClass {
- color:purple;
- font-weight:bold;
- font-style:italic;
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/html/simple-html.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/html/simple-html.css
deleted file mode 100644
index 253ecf0..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/html/simple-html.css
+++ /dev/null
@@ -1,46 +0,0 @@
-body {
- text-decoration: none;
- color: navy;
- font-family: "arial";
- font-size: 12pt;
- font-weight: medium;
-}
-.title {
- text-decoration: bold;
- color: green;
- font-family: "ms sans serif";
- font-size: 24pt;
- font-weight: heavy;
-}
-
-.bold {
- text-decoration: bold;
- color: black;
- font-family: "courier, arial";
- font-size: 14pt;
- font-weight: heavy;
-}
-
-a:link {
- text-decoration: none;
- color: red;
- font-family:
- "ms sans serif";
- font-size: 12pt;
- font-weight: heavy;
-}
-
-.head {
- color: #000000;
- font-family: "ms sans serif";
- font-size: 35px;
- margin-top: 35px;
- margin-left: 28px;
-}
-
-.foo {
- text-decoration: underline;
- color: #00FF00;
- font-family: "courier";
- font-size: 14pt;
- font-weight: heavy; }
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/style-class.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/style-class.css
deleted file mode 100644
index 78540b9..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/resources/style-class.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.blueClass {
- color:blue;
-}
-
-.greenClass {
- color:green;
-}
-
-.redClass {
- color:red;
-}
-
-.yellowClass {
- color:yellow;
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/MockDocumentHandler.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/MockDocumentHandler.java
deleted file mode 100644
index 3ee0e3f..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/MockDocumentHandler.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.core.sac;
-
-import org.w3c.css.sac.AttributeCondition;
-import org.w3c.css.sac.CSSException;
-import org.w3c.css.sac.Condition;
-import org.w3c.css.sac.ConditionalSelector;
-import org.w3c.css.sac.ElementSelector;
-import org.w3c.css.sac.InputSource;
-import org.w3c.css.sac.LexicalUnit;
-import org.w3c.css.sac.SACMediaList;
-import org.w3c.css.sac.Selector;
-import org.w3c.css.sac.SelectorList;
-
-public class MockDocumentHandler implements org.w3c.css.sac.DocumentHandler {
-
- public void comment(String text) throws CSSException {
- System.out.println("MockDocumentHandler#comment], text=" + text);
-
- }
-
- public void endDocument(InputSource source) throws CSSException {
- System.out.println("[MockDocumentHandler#endDocument], source= "
- + source);
-
- }
-
- public void endFontFace() throws CSSException {
- System.out.println("[MockDocumentHandler#endFontFace]");
-
- }
-
- public void endMedia(SACMediaList media) throws CSSException {
- System.out.println("[MockDocumentHandler#media], media=" + media);
-
- }
-
- public void endPage(String name, String pseudo_page) throws CSSException {
- System.out.println("[MockDocumentHandler#endPage], name=" + name
- + ", pseudo_page=" + pseudo_page);
-
- }
-
- public void endSelector(SelectorList selectors) throws CSSException {
- int length = selectors.getLength();
- System.out.println("[MockDocumentHandler#endSelector], selectors="
- + selectors + ", length=" + length);
- for (int i = 0; i < length; i++) {
- Selector selector = selectors.item(i);
- if (selector instanceof ElementSelector) {
- // Element selector
- ElementSelector elementSelector = (ElementSelector) selector;
- System.out.println("\tElementSelector=> localName="
- + elementSelector.getLocalName());
- } else if (selector instanceof ConditionalSelector) {
- ConditionalSelector conditionalSelector = (ConditionalSelector) selector;
- System.out.println("\tConditionalSelector");
- Condition condition = conditionalSelector.getCondition();
- if (condition instanceof AttributeCondition) {
- AttributeCondition attributeCondition = (AttributeCondition) condition;
- System.out
- .println("\t\tCondition (type=AttributeCondition)=> localName="
- + attributeCondition.getLocalName()
- + ", value="
- + attributeCondition.getValue());
- } else {
- System.out.println("\t\tCondition=>" + condition);
- }
-
- } else
- System.out.println(selector);
- }
-
- }
-
- public void ignorableAtRule(String atRule) throws CSSException {
- // TODO Auto-generated method stub
-
- }
-
- public void importStyle(String uri, SACMediaList media,
- String defaultNamespaceURI) throws CSSException {
- // TODO Auto-generated method stub
-
- }
-
- public void namespaceDeclaration(String prefix, String uri)
- throws CSSException {
- // TODO Auto-generated method stub
-
- }
-
- public void property(String name, LexicalUnit value, boolean important)
- throws CSSException {
- System.out.println("[MockDocumentHandler#property], name=" + name
- + ", value=" + value);
-
- }
-
- public void startDocument(InputSource source) throws CSSException {
- // TODO Auto-generated method stub
-
- }
-
- public void startFontFace() throws CSSException {
- // TODO Auto-generated method stub
-
- }
-
- public void startMedia(SACMediaList media) throws CSSException {
- // TODO Auto-generated method stub
-
- }
-
- public void startPage(String name, String pseudo_page) throws CSSException {
- // TODO Auto-generated method stub
-
- }
-
- public void startSelector(SelectorList selectors) throws CSSException {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/AbstractParseStyleSheet.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/AbstractParseStyleSheet.java
deleted file mode 100644
index f62e201..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/AbstractParseStyleSheet.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.core.sac.parsers;
-
-import org.akrogen.tkui.css.core.resources.CSSCoreResources;
-import org.akrogen.tkui.css.core.sac.ISACParserFactory;
-import org.akrogen.tkui.css.core.sac.MockDocumentHandler;
-import org.akrogen.tkui.css.core.sac.SACParserFactory;
-import org.w3c.css.sac.DocumentHandler;
-import org.w3c.css.sac.InputSource;
-import org.w3c.css.sac.Parser;
-
-public abstract class AbstractParseStyleSheet {
-
- private String parserName;
-
- public AbstractParseStyleSheet(String parserName) {
- this.parserName = parserName;
- }
-
- public void parseStyleSheet() {
- ISACParserFactory factory = SACParserFactory.newInstance();
- try {
- // 1. Get SAC Parser
- Parser parser = factory.makeParser(parserName);
- if (parser != null) {
- System.out.println("SAC Parser used="
- + parser.getClass().getName());
- // 2. Set SAC Document Handler into parser
- DocumentHandler handler = new MockDocumentHandler();
- parser.setDocumentHandler(handler);
- // 3. Parse text.css
- InputSource styleSheetSource = new InputSource();
- styleSheetSource
- .setByteStream(CSSCoreResources.getHTMLSimple());
- parser.parseStyleSheet(styleSheetSource);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/batik/ParseStyleSheet.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/batik/ParseStyleSheet.java
deleted file mode 100644
index 1bcc888..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/batik/ParseStyleSheet.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.core.sac.parsers.batik;
-
-import org.akrogen.tkui.css.core.SACConstants;
-import org.akrogen.tkui.css.core.sac.parsers.AbstractParseStyleSheet;
-
-public class ParseStyleSheet extends AbstractParseStyleSheet {
-
- public ParseStyleSheet() {
- super(SACConstants.SACPARSER_BATIK);
- }
-
- public static void main(String[] args) {
- ParseStyleSheet p = new ParseStyleSheet();
- p.parseStyleSheet();
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/flute/ParseStyleSheet.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/flute/ParseStyleSheet.java
deleted file mode 100644
index 55676b9..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/core/sac/parsers/flute/ParseStyleSheet.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.core.sac.parsers.flute;
-
-import org.akrogen.tkui.css.core.SACConstants;
-import org.akrogen.tkui.css.core.sac.parsers.AbstractParseStyleSheet;
-
-public class ParseStyleSheet extends AbstractParseStyleSheet {
-
- public ParseStyleSheet() {
- super(SACConstants.SACPARSER_FLUTE);
- }
-
- public static void main(String[] args) {
- ParseStyleSheet p = new ParseStyleSheet();
- p.parseStyleSheet();
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/xml/engine/CSSXMLEngineImplTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/xml/engine/CSSXMLEngineImplTest.java
deleted file mode 100644
index e7d49f0..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/xml/engine/CSSXMLEngineImplTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.xml.engine;
-
-import java.io.StringWriter;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.core.impl.engine.CSSErrorHandlerImpl;
-import org.akrogen.tkui.css.core.resources.CSSCoreResources;
-import org.akrogen.tkui.css.xml.engine.CSSXMLEngineImpl;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.w3c.dom.Document;
-
-public class CSSXMLEngineImplTest {
-
- public static void main(String[] args) {
-
- // Instanciate XML CSS Engine
- CSSEngine engine = new CSSXMLEngineImpl();
- engine.setErrorHandler(CSSErrorHandlerImpl.INSTANCE);
-
- try {
-
- engine.parseStyleSheet(CSSCoreResources.getHTMLFont());
-
- // Load XML into DOM
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.parse(CSSXMLEngineImplTest.class
- .getResourceAsStream("test.xhtml"));
-
- // Apply Styles
- engine.applyStyles(document.getDocumentElement(), true);
-
- StringWriter writer = new StringWriter();
- OutputFormat outputFormat = new OutputFormat();
- outputFormat.setOmitXMLDeclaration(true);
- XMLSerializer serializer = new XMLSerializer(writer, outputFormat);
- serializer.serialize(document);
-
- System.out.println(writer.toString());
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/xml/engine/test.xhtml b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/xml/engine/test.xhtml
deleted file mode 100644
index 164697c..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/core/test/org/akrogen/tkui/css/xml/engine/test.xhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-<html>
- <font>bla bla bla...</font>
-</html>
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/html/Osx.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/html/Osx.css
deleted file mode 100644
index 46390e0..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/html/Osx.css
+++ /dev/null
@@ -1,10 +0,0 @@
-body {
- font-family: "Lucida Grande",Serif;
- font-size: 11;
-}
-
-input {
- font-family: "Lucida Grande",Serif;
- font-size: 9;
-}
-
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/html/Vista.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/html/Vista.css
deleted file mode 100644
index 09093bd..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/html/Vista.css
+++ /dev/null
@@ -1,12 +0,0 @@
-body, Tree {
- font-family: Calibri;
- font-size: 10;
- background-color: rgb(233,234,238);
- color: rgb(70,70,70);
-}
-
-
-input {
- font-family: Calibri;
- font-size: 10;
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/swt/Osx.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/swt/Osx.css
deleted file mode 100644
index fddfa82..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/swt/Osx.css
+++ /dev/null
@@ -1,12 +0,0 @@
-Shell, SashForm {
- font-family: "Lucida Grande",Serif;
- font-size: 11;
- background: url(./images/osx_back.jpg);
-}
-
-ToolBar, Text, Button {
- font-family: "Lucida Grande",Serif;
- font-size: 9;
- background: url(./images/osx_back.jpg);
-}
-
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/swt/Vista.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/swt/Vista.css
deleted file mode 100644
index cacaa82..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/styles/swt/Vista.css
+++ /dev/null
@@ -1,13 +0,0 @@
-Shell, Tree {
- font-family: Calibri;
- font-size: 10;
- background-color: rgb(233,234,238);
- color: rgb(70,70,70);
-}
-SashForm {
- background-color: black;
-}
-Text {
- font-family: Calibri;
- font-size: 10;
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/core/examples/csseditors/AbstractCSSEditor.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/core/examples/csseditors/AbstractCSSEditor.java
deleted file mode 100644
index 2e7315a..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/core/examples/csseditors/AbstractCSSEditor.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.core.examples.csseditors;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Date;
-
-import org.akrogen.tkui.css.core.dom.IElementProvider;
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.core.engine.CSSErrorHandler;
-import org.akrogen.tkui.css.core.serializers.CSSHTMLSerializerConfiguration;
-import org.akrogen.tkui.css.core.serializers.CSSSerializer;
-import org.akrogen.tkui.css.core.serializers.CSSSerializerConfiguration;
-
-/**
- * Abstract CSS Editor.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSEditor {
-
- /**
- * CSS Engine.
- */
- protected CSSEngine engine;
-
- /**
- * CSS Serializer
- */
- protected CSSSerializer serializer;
-
- protected String nativeWidgetDir;
-
- protected java.util.List cssFiles = new ArrayList();
-
- protected AbstractCSSEditor(String nativeWidgetDir) {
- this.nativeWidgetDir = nativeWidgetDir;
- }
-
- /**
- * Return CSS Engine configured.
- *
- * @return
- */
- protected CSSEngine getCSSEngine() {
- if (engine == null) {
- // Get SWT CSS Engine
- engine = createCSSEngine();
- // Error
- engine.setErrorHandler(new CSSErrorHandler() {
- public void error(Exception e) {
- handleExceptions(e);
- }
- });
-
- } else {
- // Remove all style sheets.
- engine.reset();
- }
-
- if (isHTMLSelector()) {
- // Register HTML Element Provider to retrieve
- // w3c Element HTMLElement coming from Native Widget.
- engine.setElementProvider(getHTMLElementProvider());
- } else {
- // Register Native Widget (SWT, Swing...) Element Provider to
- // retrieve
- // w3c Element Element coming from Native Widget.
- engine.setElementProvider(getNativeWidgetElementProvider());
- }
- return engine;
- }
-
- /**
- * Apply Styles comming from <code>getStyleSheetContent()</code> method to
- * implement <code>widget</code>.
- *
- * @param widget
- */
- protected void applyStyles(Object widget) {
- try {
- Date d1 = new Date();
- engine = getCSSEngine();
- // 1. Parse Style Sheet coming from getStyleSheetContent().
- StringReader reader = new StringReader(getStyleSheetContent());
- engine.parseStyleSheet(reader);
-
- // 2. Apply styles
- engine.applyStyles(widget, true, true);
- Date d2 = new Date();
-
- // 3. Display time elapsed
- setCSSEngineStatuts("Apply style with "
- + (d2.getTime() - d1.getTime()) + "ms.");
-
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- }
-
- /**
- * Apply styles to the fully window or left panel widget.
- */
- protected void applyStyles() {
- if (mustApplyStylesToWindow()) {
- applyStyles(getWindowNativeWidget());
- } else
- applyStyles(getLeftPanelNativeWidget());
- }
-
- protected void fillTextareaWithStyleSheetContent(File file) {
- try {
- fillTextareaWithStyleSheetContent(new FileInputStream(file));
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- /**
- * Fill the TextArea which store the style sheet content with the
- * <code>stream</code> content.
- *
- * @param stream
- */
- protected void fillTextareaWithStyleSheetContent(InputStream stream) {
- try {
- StringWriter writer = new StringWriter();
- InputStreamReader streamReader = new InputStreamReader(stream);
- BufferedReader buffer = new BufferedReader(streamReader);
- String line = "";
- boolean b = false;
- while (null != (line = buffer.readLine())) {
- if (b)
- writer.write("\n");
- writer.write(line);
- b = true;
- }
- buffer.close();
- streamReader.close();
- String content = writer.toString();
- setStyleSheetContent(content);
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- protected void fillTextareaWithDefaultStyleSheetContent() {
- if (mustApplyStylesToWindow())
- fillTextareaWithDefaultStyleSheetContent(getWindowNativeWidget());
- else
- fillTextareaWithDefaultStyleSheetContent(getLeftPanelNativeWidget());
- }
-
- protected void fillTextareaWithDefaultStyleSheetContent(Object widget) {
- if (serializer == null)
- this.serializer = new CSSSerializer();
- StringWriter writer = new StringWriter();
- try {
- CSSSerializerConfiguration configuration = (isHTMLSelector() ? getCSSHTMLSerializerConfiguration()
- : getCSSNativeWidgetSerializerConfiguration());
- serializer.serialize(writer, getCSSEngine(), widget, true,
- configuration);
- setStyleSheetContent(writer.toString());
- } catch (Exception e) {
- handleExceptions(e);
- }
- }
-
- protected void applyStylesFromSelectedFile() {
- int index = getCSSFilesWidgetSelectionIndex();
- if (index == -1)
- if (getCSSFilesWidgetItemCount() > 1) {
- index = 1;
- selectCSSFilesWidget(index);
- // cssFilesWidget.select(index);
- }
- if (index < 1) {
- setStyleSheetContent("");
- return;
- }
- File file = (File) cssFiles.get(index - 1);
- fillTextareaWithStyleSheetContent(file);
- }
-
- protected void populateCSSFiles() {
- removeAllCSSFilesWidget();
- int size = cssFiles.size();
- for (int i = 0; i < size; i++) {
- cssFiles.remove(0);
- }
- addItemCSSFilesWidget("None");
- File baseDir = getBaseStyleDir();
- File[] files = baseDir.listFiles();
- for (int i = 0; i < files.length; i++) {
- File file = files[i];
- if (file.isFile()) {
- addItemCSSFilesWidget(file.getName());
- cssFiles.add(file);
- }
- }
- }
-
- /**
- * Display CSS Engine error
- *
- * @param e
- */
- protected void handleExceptions(Exception e) {
- e.printStackTrace();
- }
-
- protected File getBaseStyleDir() {
- if (isHTMLSelector())
- return new File(getBaseStyleDirName() + "/html");
- if (nativeWidgetDir != null)
- return new File(getBaseStyleDirName() + "/" + nativeWidgetDir);
- return new File(getBaseStyleDirName());
- }
-
- protected String getBaseStyleDirName() {
- return "styles";
- }
-
- /**
- * Create Instance of CSS Engine
- *
- * @return
- */
- protected abstract CSSEngine createCSSEngine();
-
- /**
- * Return true if HTML selector must be used and false if Native Widget
- * Selector must be used.
- *
- * @return
- */
- protected abstract boolean isHTMLSelector();
-
- /**
- * Return Native Widget Element provider.
- *
- * @return
- */
- protected abstract IElementProvider getNativeWidgetElementProvider();
-
- /**
- * Return HTML Element provider.
- *
- * @return
- */
- protected abstract IElementProvider getHTMLElementProvider();
-
- /**
- * Return style sheet content.
- *
- * @return
- */
- protected abstract String getStyleSheetContent();
-
- /**
- * Set style sheet content.
- *
- * @param content
- */
- protected abstract void setStyleSheetContent(String content);
-
- /**
- * Set CSS Engine status.
- *
- * @param status
- */
- protected abstract void setCSSEngineStatuts(String status);
-
- /**
- * Return true if Styles must be applied to the fully Window and false
- * otherwise.
- *
- * @return
- */
- protected abstract boolean mustApplyStylesToWindow();
-
- /**
- * Get Window Native Widget.
- *
- * @return
- */
- protected abstract Object getWindowNativeWidget();
-
- /**
- * Get Left Panel Native widget.
- *
- * @return
- */
- protected abstract Object getLeftPanelNativeWidget();
-
- /**
- * Return CSS Serializer configuration for Native Widget.
- *
- * @return
- */
- protected abstract CSSSerializerConfiguration getCSSNativeWidgetSerializerConfiguration();
-
- /**
- * Return CSS Serializer configuration for HTML.
- *
- * @return
- */
- protected CSSSerializerConfiguration getCSSHTMLSerializerConfiguration() {
- return CSSHTMLSerializerConfiguration.INSTANCE;
- }
-
- /**
- * Return selection index of CSS files widget.
- *
- * @return
- */
- protected abstract int getCSSFilesWidgetSelectionIndex();
-
- /**
- * Return item count of CSS files widget.
- *
- * @return
- */
- protected abstract int getCSSFilesWidgetItemCount();
-
- /**
- * Select item of CSS files widget at <code>index</code>.
- *
- * @param index
- */
- protected abstract void selectCSSFilesWidget(int index);
-
- /**
- * Remove all items of CSS files widget.
- */
- protected abstract void removeAllCSSFilesWidget();
-
- /**
- * Add item of CSS files widget.
- *
- * @param item
- */
- protected abstract void addItemCSSFilesWidget(String item);
-
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/CSSSWTEngineSimpleTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/CSSSWTEngineSimpleTest.java
deleted file mode 100644
index b3cb036..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/CSSSWTEngineSimpleTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTEngineSimpleTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- // Create SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(display);
- // Parse style sheet
- engine.parseStyleSheet(new StringReader(
- "Label {color:red;} Text {background-color:green;}"));
-
- /*--- Start UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- /*--- End UI SWT ---*/
-
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/CSSSWTEngineTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/CSSSWTEngineTest.java
deleted file mode 100644
index ed57bdd..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/CSSSWTEngineTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.resources.CSSSWTResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTEngineTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- // Instanciate SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(CSSSWTResources.getSWT());
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label 2 [label.setData('MyId')]");
- label2.setData("id", "MyId");
-
- Label label3 = new Label(panel1, SWT.NONE);
- label3.setText("Label 3 [label.setData('MyId2')]");
- label3.setData("id", "MyId2");
-
- // Composite
- Composite panel2 = new Composite(panel1, SWT.NONE);
- panel2.setLayout(new FillLayout());
-
- // Label
- Label label4 = new Label(panel2, SWT.NONE);
- label4.setText("Label 4");
-
- /*--- End UI SWT ---*/
-
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/className/CSSSWTEngineCLassNameTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/className/CSSSWTEngineCLassNameTest.java
deleted file mode 100644
index a441890..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/className/CSSSWTEngineCLassNameTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.className;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTEngineCLassNameTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- // Instanciate SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(display);
- // Parse style class name.
- engine
- .parseStyleSheet(new StringReader(
- ".blueClass {color:blue;} .greenClass {color:green;} .redClass {color:red;} .yellowClass {color:yellow;}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [class=redClass]");
- label1.setData("class", "redClass");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label 2 [class=blueClass]");
- label2.setData("class", "blueClass");
-
- Label label3 = new Label(panel1, SWT.NONE);
- label3.setText("Label 3 [class=yellowClass]");
- label3.setData("class", "yellowClass");
-
- // Composite
- Composite panel2 = new Composite(panel1, SWT.NONE);
- panel2.setLayout(new FillLayout());
-
- // Label
- Label label4 = new Label(panel2, SWT.NONE);
- label4.setText("Label 4 [class=greenClass]");
- label4.setData("class", "greenClass");
-
- /*--- End UI SWT ---*/
-
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/html/CSSSWTHTMLEngineTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/html/CSSSWTHTMLEngineTest.java
deleted file mode 100644
index 5cd0c28..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/html/CSSSWTHTMLEngineTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.html;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTHTMLEngineTest {
- public static void main(String[] args) {
- try {
- Display display = new Display();
- // Create SWT CSS Engine
- CSSEngine engine = new CSSSWTHTMLEngineImpl(display);
- // Parse style sheet
- engine.parseStyleSheet(new StringReader(
- "label {color:red;} input {background-color:green;}"));
-
- /*--- Start UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- /*--- End UI SWT ---*/
-
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/lazy/CSSSWTLazyEngineTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/lazy/CSSSWTLazyEngineTest.java
deleted file mode 100644
index 6add62f..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/lazy/CSSSWTLazyEngineTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.lazy;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.akrogen.tkui.css.swt.resources.CSSSWTResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTLazyEngineTest {
-
- public static void main(String[] args) {
- try {
-
- // Instanciate Display at first
- Display display = new Display();
-
- // Instanciate SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(display, true);
- engine.parseStyleSheet(CSSSWTResources.getSWT());
-
- /*--- UI SWT ---*/
-
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label 2 [label.setData('MyId')]");
- label2.setData("id", "MyId");
-
- Label label3 = new Label(panel1, SWT.NONE);
- label3.setText("Label 3 [label.setData('MyId2')]");
- label3.setData("id", "MyId2");
-
- // Composite
- Composite panel2 = new Composite(panel1, SWT.NONE);
- panel2.setLayout(new FillLayout());
-
- // Label
- Label label4 = new Label(panel2, SWT.NONE);
- label4.setText("Label 4");
-
- /*--- End UI SWT ---*/
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/lazy/CSSSWTLazyHandlerEngineTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/lazy/CSSSWTLazyHandlerEngineTest.java
deleted file mode 100644
index 607d494..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/lazy/CSSSWTLazyHandlerEngineTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.lazy;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.impl.engine.CSSErrorHandlerImpl;
-import org.akrogen.tkui.css.swt.engine.CSSSWTLazyHandlerEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTLazyHandlerEngineTest {
-
- public static void main(String[] args) {
- Display display = new Display();
- CSSSWTLazyHandlerEngineImpl engine = new CSSSWTLazyHandlerEngineImpl(
- display);
- // CSSEngine Print stack trace when Exception is thrown
- engine.setErrorHandler(CSSErrorHandlerImpl.INSTANCE);
-
- try {
- engine
- .parseStyleSheet(new StringReader(
- "Label:hover {color:red;border:solid green 2px;font:30px Arial italic normal;background: url(./images/icons/type/class.gif) yellow;} "
- + "Text {cursor:wait;background-color:white red 100%;} "));
-
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("vfvfvf");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
- // engine.getResourcesRegistry().dispose();
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/pseudoClasses/CSSSWTEnginePseudoClassesTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/pseudoClasses/CSSSWTEnginePseudoClassesTest.java
deleted file mode 100644
index edb2c23..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/pseudoClasses/CSSSWTEnginePseudoClassesTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.pseudoClasses;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.akrogen.tkui.css.swt.resources.CSSSWTResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTEnginePseudoClassesTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- // Instanciate SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(CSSSWTResources.getSWTPseudoCLass());
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
- text1.setEnabled(false);
-
- Text text2 = new Text(panel1, SWT.NONE);
- text2.setText("bla bla bla...");
-
- Text text3 = new Text(panel1, SWT.NONE);
- text3.setText("bla bla bla...");
-
- final Button checkbox = new Button(panel1, SWT.CHECK);
- checkbox.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- System.out.println(checkbox.getSelection());
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
- }
- });
-
- final Button radio = new Button(panel1, SWT.RADIO);
-
- final Button button = new Button(panel1, SWT.BORDER);
- button.setText("SWT Button");
-
- /*--- End UI SWT ---*/
-
- shell.pack();
- shell.open();
-
- // Apply Styles
- engine.applyStyles(shell, true);
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/style/CSSSWTEngineStyleTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/style/CSSSWTEngineStyleTest.java
deleted file mode 100644
index d9657c1..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/style/CSSSWTEngineStyleTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.style;
-
-import org.akrogen.tkui.css.core.dom.CSSStylableElement;
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.w3c.dom.css.CSS2Properties;
-
-public class CSSSWTEngineStyleTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- // Instanciate SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(display);
- // engine.parseStyleSheet(CSSCoreResources.getStyleCLass());
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [color:red;]");
- CSSStylableElement stylableElement = (CSSStylableElement) engine
- .getElement(label1);
- CSS2Properties style = stylableElement.getStyle();
- style.setBackgroundColor("red");
- style.setFontSize("20");
- style.setFontFamily("Roman");
- style.setFontWeight("bold");
- style.setFontStyle("italic");
- style.setColor("white");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/styleDeclaration/CSSSWTEngineStyleDeclarationTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/styleDeclaration/CSSSWTEngineStyleDeclarationTest.java
deleted file mode 100644
index 45d82ad..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/styleDeclaration/CSSSWTEngineStyleDeclarationTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.styleDeclaration;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTEngineStyleDeclarationTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- // Instanciate SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(display);
- // engine.parseStyleSheet(CSSCoreResources.getStyleCLass());
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [color:red;]");
- engine.parseAndApplyStyleDeclaration(label1, "color:red;");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label 2 [color:blue;]");
- engine.parseAndApplyStyleDeclaration(label2, "color:blue;");
-
- Label label3 = new Label(panel1, SWT.NONE);
- label3.setText("Label 3 [color:yellow;]");
- engine.parseAndApplyStyleDeclaration(label3, "color:yellow;");
-
- // Composite
- Composite panel2 = new Composite(panel1, SWT.NONE);
- panel2.setLayout(new FillLayout());
-
- // Label
- Label label4 = new Label(panel2, SWT.NONE);
- label4.setText("Label 4 [color:green;]");
- engine.parseAndApplyStyleDeclaration(label4, "color:green;");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/styleDeclaration/CSSSWTEngineStyleDeclarationTest2.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/styleDeclaration/CSSSWTEngineStyleDeclarationTest2.java
deleted file mode 100644
index 28926ae..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/styleDeclaration/CSSSWTEngineStyleDeclarationTest2.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.styleDeclaration;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSWTEngineStyleDeclarationTest2 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- // Instanciate SWT CSS Engine
- CSSEngine engine = new CSSSWTEngineImpl(display);
-
- // engine.parseStyleSheet(CSSCoreResources.getStyleCLass());
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [color:red;]");
- label1.setData("style", "color:red;");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label 2 [color:blue;]");
- label2.setData("style", "color:blue;");
-
- Label label3 = new Label(panel1, SWT.NONE);
- label3.setText("Label 3 [color:yellow;]");
- label3.setData("style", "color:yellow;");
-
- // Composite
- Composite panel2 = new Composite(panel1, SWT.NONE);
- panel2.setLayout(new FillLayout());
-
- // Label
- Label label4 = new Label(panel2, SWT.NONE);
- label4.setText("Label 4 [color:green;]");
- label4.setData("style", "color:green;");
-
- /*--- End UI SWT ---*/
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/CSSSWTTableViewerEngineTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/CSSSWTTableViewerEngineTest.java
deleted file mode 100644
index 3e0b4db..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/CSSSWTTableViewerEngineTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.table;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.akrogen.tkui.css.swt.engine.table.viewers.MyCSSLabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-public class CSSSWTTableViewerEngineTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
-
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine
- .parseStyleSheet(new StringReader(
- "TableItem:odd {font:Roman 12 italic normal; background-color: #2BAFFA; color:white; background-image: url(./images/icons/type/class.gif);}"
- + "TableItem:even {background-color:#edb5f4, 100%; color:black;}"));
-
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- final List datas = new ArrayList();
- for (int i = 0; i < 20; i++) {
- datas.add("Item" + i);
- }
-
- final TableViewer tableViewer = new TableViewer(panel1);
- tableViewer.setContentProvider(new IStructuredContentProvider() {
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- public Object[] getElements(Object inputElement) {
- return datas.toArray();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput,
- Object newInput) {
-
- }
- });
- tableViewer.setLabelProvider(new MyCSSLabelProvider(engine,
- tableViewer));
-
- Table table = tableViewer.getTable();
- table.setHeaderVisible(true);
-
- TableColumn tableColumn = new TableColumn(table, SWT.LEFT, 0);
- tableColumn.setText("Name");
- tableColumn.setWidth(200);
- table.setLinesVisible(true);
-
- tableViewer.setInput(datas);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/CSSSWTTableViewerEngineTest2.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/CSSSWTTableViewerEngineTest2.java
deleted file mode 100644
index d7fb731..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/CSSSWTTableViewerEngineTest2.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.table;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.akrogen.tkui.css.swt.engine.table.viewers.MyCSSTableLabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-public class CSSSWTTableViewerEngineTest2 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
-
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine
- .parseStyleSheet(new StringReader(
- "TableItem:odd {font:Roman 12 italic normal; background-color: #2BAFFA; color:white; background-image: url(./images/icons/type/class.gif);}"
- + "TableItem:even {background-color:#edb5f4, 100%; color:black;}"));
-
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
-
- final List datas = new ArrayList();
- for (int i = 0; i < 20; i++) {
- datas.add(new Item("Item" + i + "_0", "Item" + i + "_1"));
- }
-
- final TableViewer tableViewer = new TableViewer(panel1);
- tableViewer.setContentProvider(new IStructuredContentProvider() {
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- public Object[] getElements(Object inputElement) {
- return datas.toArray();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput,
- Object newInput) {
-
- }
- });
- tableViewer.setLabelProvider(new MyCSSTableLabelProvider(engine,
- tableViewer));
-
- Table table = tableViewer.getTable();
- table.setHeaderVisible(true);
-
- TableColumn tableColumn1 = new TableColumn(table, SWT.LEFT, 0);
- tableColumn1.setText("Name");
- tableColumn1.setWidth(200);
-
- TableColumn tableColumn2 = new TableColumn(table, SWT.LEFT, 0);
- tableColumn2.setText("Lastname");
- tableColumn2.setWidth(200);
-
- table.setLinesVisible(true);
-
- tableViewer.setInput(datas);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public static class Item {
-
- private String item0;
- private String item1;
-
- public Item(String item0, String item1) {
- this.item0 = item0;
- this.item1 = item1;
- }
-
- public String getItem0() {
- return item0;
- }
-
- public String getItem1() {
- return item1;
- }
-
- }
-
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/viewers/MyCSSLabelProvider.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/viewers/MyCSSLabelProvider.java
deleted file mode 100644
index f7bdfa6..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/viewers/MyCSSLabelProvider.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.table.viewers;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.jface.viewers.CSSLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-
-public class MyCSSLabelProvider extends CSSLabelProvider {
-
- public MyCSSLabelProvider(CSSEngine engine, TableViewer tableViewer) {
- super(engine, tableViewer);
- }
-
- public String getText(Object element) {
- return element.toString();
- }
-
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/viewers/MyCSSTableLabelProvider.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/viewers/MyCSSTableLabelProvider.java
deleted file mode 100644
index 7167c5b..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/engine/table/viewers/MyCSSTableLabelProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.engine.table.viewers;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.jface.viewers.CSSTableLabelProvider;
-import org.akrogen.tkui.css.swt.engine.table.CSSSWTTableViewerEngineTest2;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.graphics.Image;
-
-public class MyCSSTableLabelProvider extends CSSTableLabelProvider {
-
- public MyCSSTableLabelProvider(CSSEngine engine, TableViewer tableViewer) {
- super(engine, tableViewer);
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- CSSSWTTableViewerEngineTest2.Item item = (CSSSWTTableViewerEngineTest2.Item) element;
- switch (columnIndex) {
- case 0:
- return item.getItem0();
- case 1:
- return item.getItem1();
- }
- return null;
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/AbstractChatExample.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/AbstractChatExample.java
deleted file mode 100644
index a93a3f9..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/AbstractChatExample.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.examples.chat;
-
-import java.io.InputStream;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.core.impl.engine.CSSErrorHandlerImpl;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.akrogen.tkui.css.swt.resources.CSSSWTResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-
-public abstract class AbstractChatExample {
-
- protected static Display display;
- private static CTabFolder tabFolder;
- private static Tree tree;
- private static final String[] GROUPS = new String[] { "Work", "RCP Dev",
- "Friends" };
- private static final String[] NAMES = new String[] { "Betty Zechman",
- "Susan Adams", "Samantha Daryn", "Ted Amado" };
- private static final String INPUT_TEXT = "Do you know where I can find the Eclipsecon ppt template?";
- private static final String OUTPUT_TEXT = "Matt> Gotta sec to chat?\n\r\n\rBetty> Sure what's up";
-
- private InputStream styleSheetStream;
-
- protected CSSEngine engine;
-
- public AbstractChatExample(InputStream styleSheetStream) {
- this.styleSheetStream = styleSheetStream;
- }
-
- public void display() throws Exception {
- /*
- * Create the display and shell.
- */
- display = new Display();
- final Shell shell = new Shell(display);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- shell.setLayout(layout);
- /*
- * Create a toolbar
- */
- {
- ToolBar toolbar = new ToolBar(shell, SWT.FLAT | SWT.RIGHT
- | SWT.NO_FOCUS);
- toolbar.setForeground(display.getSystemColor(SWT.COLOR_RED));
- toolbar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL));
- ToolItem item = new ToolItem(toolbar, SWT.PUSH);
- item.setText("File");
- item = new ToolItem(toolbar, SWT.PUSH);
- item.setText("Edit");
- item = new ToolItem(toolbar, SWT.PUSH);
- item.setText("Help");
- }
-
-
- if (styleSheetStream == null) {
- // Create Styles themes
- createThemesStyleComposite(shell);
- }
-
- /*
- * Create a sash form.
- */
- SashForm form = new SashForm(shell, SWT.NONE);
- form.setLayoutData(new GridData(GridData.FILL_BOTH));
- /*
- * Create the buddylist tree.
- */
- {
- tree = new Tree(form, SWT.SINGLE);
- tree.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- if (((TreeItem) e.item).getParentItem() != null) {
- try {
- createChatControl(e.item);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- }
-
- public void widgetSelected(SelectionEvent e) {
- }
- });
- for (int i = 0; i < GROUPS.length; i++) {
- String g = GROUPS[i];
- TreeItem parentItem = new TreeItem(tree, SWT.NONE);
- parentItem.setText(g);
- for (int j = 0; j < NAMES.length; j++) {
- String n = NAMES[j];
- TreeItem item = new TreeItem(parentItem, SWT.NONE);
- item.setText(n);
- }
- parentItem.setExpanded(true);
- }
- }
- /*
- * Add the tabfolder
- */
- {
- tabFolder = new CTabFolder(form, SWT.CLOSE);
- tabFolder.setUnselectedCloseVisible(true);
- tabFolder.setUnselectedImageVisible(true);
- form.setWeights(new int[] { 30, 70 });
- // open a couple chats
- createChatControl(tree.getItem(0).getItems()[0]);
- createChatControl(tree.getItem(0).getItems()[1]);
- tabFolder.setSelection(tabFolder.getItem(0));
- }
- /*
- * Create a statusbar
- */
- {
- CLabel statusbar = new CLabel(shell, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- statusbar.setLayoutData(gd);
- statusbar.setText("Samantha Daryn is online");
- }
- /*
- * StyleHelper is used to parse and apply styles.
- */
- engine = getCSSEngine();
- if (styleSheetStream != null) {
- engine.parseStyleSheet(styleSheetStream);
- engine.applyStyles(shell, true);
- }
- /*
- * Now we open the shell.
- */
- shell.setSize(new Point(600, 600));
- shell.open();
- shell.setText("CSS Instant Messaging");
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
-
- /*
- * The key listeners we add workaround a bug int Text that don't repaint
- * properly when they have background images.
- */
- protected void createChatControl(Widget item) throws Exception {
- CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);
- tabItem.setText("Chat with " + ((TreeItem) item).getText());
- SashForm textForm = new SashForm(tabFolder, SWT.VERTICAL);
- final Text text1 = new Text(textForm, SWT.MULTI);
- text1.setData("id", "output");
- text1.setText(OUTPUT_TEXT);
- text1.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent arg0) {
- text1.redraw();
- }
- });
- final Text text2 = new Text(textForm, SWT.MULTI);
- text2.setData("id", "input");
- text2.setText(INPUT_TEXT);
- text2.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent arg0) {
- text2.redraw();
- }
- });
- tabItem.setControl(textForm);
- textForm.setWeights(new int[] { 80, 20 });
- getCSSEngine().applyStyles(textForm, false);
- tabFolder.setSelection(tabItem);
- }
-
- protected void createThemesStyleComposite(final Composite parent) {
- Composite themesComposite = new Composite(parent, SWT.NONE);
- FillLayout fillLayout = new FillLayout();
- themesComposite.setLayout(fillLayout);
- // no style Radio
- Label noStyleLabel = new Label(themesComposite, SWT.NONE);
- noStyleLabel.setText("No style");
- Button noStyleRadio = new Button(themesComposite, SWT.RADIO);
- noStyleRadio.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- CSSEngine engine = getCSSEngine();
- engine.reset();
- engine.applyStyles(parent, true, true);
- }
- });
- // Matrix style Radio
- Label matrixStyleLabel = new Label(themesComposite, SWT.NONE);
- matrixStyleLabel.setText("Matrix style");
- Button matrixStyleRadio = new Button(themesComposite, SWT.RADIO);
- matrixStyleRadio.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- CSSEngine engine = getCSSEngine();
- engine.reset();
- try {
- engine.parseStyleSheet(CSSSWTResources.getSWTMatrix());
- engine.applyStyles(parent, true, true);
- }
- catch(Exception ex) {
- ex.printStackTrace();
- }
- }
- });
- // Osx style Radio
- Label osxStyleLabel = new Label(themesComposite, SWT.NONE);
- osxStyleLabel.setText("Osx style");
- Button osxStyleRadio = new Button(themesComposite, SWT.RADIO);
- osxStyleRadio.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- CSSEngine engine = getCSSEngine();
- engine.reset();
- try {
- engine.parseStyleSheet(CSSSWTResources.getSWTOsx());
- engine.applyStyles(parent, true, true);
- }
- catch(Exception ex) {
- ex.printStackTrace();
- }
- }
- });
- // Vista style Radio
- Label vistaStyleLabel = new Label(themesComposite, SWT.NONE);
- vistaStyleLabel.setText("Vista style");
- Button vistaStyleRadio = new Button(themesComposite, SWT.RADIO);
- vistaStyleRadio.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- CSSEngine engine = getCSSEngine();
- engine.reset();
- try {
- engine.parseStyleSheet(CSSSWTResources.getSWTVista());
- engine.applyStyles(parent, true, true);
- }
- catch(Exception ex) {
- ex.printStackTrace();
- }
- }
- });
- }
-
- protected CSSEngine getCSSEngine() {
- if (engine == null) {
- engine = new CSSSWTEngineImpl(display);
- // Print stack trace when Exception is thrown
- engine.setErrorHandler(CSSErrorHandlerImpl.INSTANCE);
- }
- return engine;
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithMatrixStyle.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithMatrixStyle.java
deleted file mode 100644
index f5ea1d5..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithMatrixStyle.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.examples.chat;
-
-import org.akrogen.tkui.css.swt.resources.CSSSWTResources;
-
-
-public class ChatWithMatrixStyle extends AbstractChatExample {
-
- public ChatWithMatrixStyle() {
- super(CSSSWTResources.getSWTMatrix());
- }
-
- public static void main(String[] args) {
- ChatWithMatrixStyle testMatrix = new ChatWithMatrixStyle();
- try {
- testMatrix.display();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithOsxStyle.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithOsxStyle.java
deleted file mode 100644
index 5cecd3b..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithOsxStyle.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.examples.chat;
-
-import org.akrogen.tkui.css.swt.resources.CSSSWTResources;
-
-public class ChatWithOsxStyle extends AbstractChatExample {
-
- public ChatWithOsxStyle() {
- super(CSSSWTResources.getSWTOsx());
- }
-
- public static void main(String[] args) {
- ChatWithOsxStyle testOsx = new ChatWithOsxStyle();
- try {
- testOsx.display();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithStylesAppliedAtRuntime.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithStylesAppliedAtRuntime.java
deleted file mode 100644
index 3ce664e..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithStylesAppliedAtRuntime.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.examples.chat;
-
-public class ChatWithStylesAppliedAtRuntime extends AbstractChatExample {
-
- public ChatWithStylesAppliedAtRuntime() {
- super(null);
- }
-
- public static void main(String[] args) {
- ChatWithStylesAppliedAtRuntime chat = new ChatWithStylesAppliedAtRuntime();
- try {
- chat.display();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithVistaStyle.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithVistaStyle.java
deleted file mode 100644
index 9374593..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/chat/ChatWithVistaStyle.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.examples.chat;
-
-import org.akrogen.tkui.css.swt.resources.CSSSWTResources;
-
-public class ChatWithVistaStyle extends AbstractChatExample {
-
- public ChatWithVistaStyle() {
- super(CSSSWTResources.getSWTVista());
- }
-
- public static void main(String[] args) {
- ChatWithVistaStyle testVista = new ChatWithVistaStyle();
- try {
- testVista.display();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/csseditors/AbstractCSSSWTEditor.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/csseditors/AbstractCSSSWTEditor.java
deleted file mode 100644
index 0f667be..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/csseditors/AbstractCSSSWTEditor.java
+++ /dev/null
@@ -1,671 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.examples.csseditors;
-
-import java.io.File;
-import java.util.ArrayList;
-
-import org.akrogen.tkui.css.core.css2.CSS2FontPropertiesHelpers;
-import org.akrogen.tkui.css.core.dom.IElementProvider;
-import org.akrogen.tkui.css.core.dom.properties.css2.CSS2FontProperties;
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.core.examples.csseditors.AbstractCSSEditor;
-import org.akrogen.tkui.css.core.serializers.CSSSerializerConfiguration;
-import org.akrogen.tkui.css.swt.dom.SWTElementProvider;
-import org.akrogen.tkui.css.swt.dom.html.SWTHTMLElementProvider;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.akrogen.tkui.css.swt.serializers.CSSSWTSerializerConfiguration;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.ColorDialog;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.FontDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.w3c.dom.css.CSSValue;
-
-/**
- * Abstract CSS SWT Editor.
- *
- * @version 1.0.0
- * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
- */
-public abstract class AbstractCSSSWTEditor extends AbstractCSSEditor {
-
- protected static final String[] CSS_FILE_EXTENSION = { "*.css" };
-
- private Display display;
-
- /**
- * Textarea wich contains content of CSS style sheet.
- */
- private StyledText textArea;
-
- private Button cacheResourcesCheckbox;
-
- /**
- * HTML checkbox to set if CSS must be typed with HTML syntaxe or SWT
- * syntax.
- */
- private Button htmlCheckbox;
-
- /**
- * Label wich display time elapsed when CSS Engine apply styles.
- */
- private Label statusLabel;
-
- /**
- * Apply style when text area change
- */
- private Button applyStyleWhenTextAreaChangeCheckbox;
-
- /**
- * Launch Apply style
- */
- private Button applyStyleToShellCheckbox;
-
- private Shell shell;
-
- private Composite leftPanel;
-
- private List cssFilesWidget;
-
- private java.util.List cssFiles = new ArrayList();
-
- private Text selectedCSSPropertyNameText = null;
-
- private Text selectedCSSPropertyValueText = null;
-
- protected int currentLine = -1;
-
- protected AbstractCSSSWTEditor(String nativeWidgetDir,
- String[] styleFileExtension) {
- super(nativeWidgetDir);
- }
-
- protected AbstractCSSSWTEditor() {
- super("swt");
- }
-
- public void display() {
-
- display = new Display();
- shell = new Shell(display, SWT.SHELL_TRIM);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- shell.setLayout(layout);
-
- // create Menus
- createMenus(shell);
-
- /*
- * Create a sash form.
- */
- SashForm form = new SashForm(shell, SWT.NONE);
- form.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- /*
- * Create left panel with SWT Contents.
- */
- createLeftPanel(form);
-
- /*
- * Create right panel with TextArea which contains CSS to load.
- */
- createRightPanel(form);
- form.setWeights(new int[] { 30, 80 });
-
- /*
- * Now we open the shell.
- */
- shell.setSize(new Point(800, 600));
- shell.open();
- shell.setText("CSS Editors");
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
-
- /*-------------------- Menus --------------------**/
-
- /**
- * Create Menus File, Options
- *
- * @param shell
- */
- protected void createMenus(Shell shell) {
- Menu menu = new Menu(shell, SWT.BAR);
- shell.setMenuBar(menu);
- // Create File item Menu
- createMenuItemFile(menu, shell);
- // Create Options item Menu
- // createMenuItemOptions(menu);
- }
-
- /**
- * Create Menu item File with sub menu New and Open
- *
- * @param menu
- * @param shell
- */
- protected void createMenuItemFile(Menu menu, final Shell shell) {
- MenuItem menuFileHeader = new MenuItem(menu, SWT.CASCADE);
- menuFileHeader.setText("&File");
- // File menu
- Menu menuFile = new Menu(shell, SWT.DROP_DOWN);
- menuFileHeader.setMenu(menuFile);
- // New item menu
- MenuItem itemNew = new MenuItem(menuFile, SWT.PUSH);
- itemNew.setText("&New...");
- itemNew.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fillTextareaWithDefaultStyleSheetContent();
- }
- });
- // Open item menu
- MenuItem itemOpen = new MenuItem(menuFile, SWT.PUSH);
- itemOpen.setText("&Open...");
- itemOpen.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- FileDialog dialog = new FileDialog(shell, SWT.NULL);
- dialog.setFilterExtensions(CSS_FILE_EXTENSION);
- dialog.setText("Select CSS style file");
- dialog.setFilterPath(getBaseStyleDir().getAbsolutePath());
- String path = dialog.open();
- if (path != null) {
- File file = new File(path);
- fillTextareaWithStyleSheetContent(file);
- }
- }
- });
-
- }
-
- /**
- * Create Menu item Options
- *
- * @param menu
- */
- protected void createMenuItemOptions(Menu menu) {
- MenuItem menuOptionsHeader = new MenuItem(menu, SWT.CASCADE);
- menuOptionsHeader.setText("&Options");
- // Options menu
- Menu menuOptions = new Menu(shell, SWT.DROP_DOWN);
- menuOptionsHeader.setMenu(menuOptions);
- // New item menu
- MenuItem itemNew = new MenuItem(menuOptions, SWT.CHECK);
- itemNew.setText("&Cache Resource...");
-
- }
-
- /*-------------------- Panel --------------------**/
-
- protected void createLeftPanel(Composite parent) {
- leftPanel = new Composite(parent, SWT.NONE);
- leftPanel.setLayout(new FillLayout());
- createContent(leftPanel);
- }
-
- protected void createRightPanel(Composite parent) {
-
- SashForm form = new SashForm(parent, SWT.NONE);
- form.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- Composite composite = new Composite(form, SWT.NONE);
- composite.setLayout(layout);
-
- statusLabel = new Label(composite, SWT.NONE);
- statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Create TextArea which contains CSS content.
- textArea = new StyledText(composite, SWT.MULTI | SWT.V_SCROLL
- | SWT.BORDER);
- textArea.setLayoutData(new GridData(GridData.FILL_BOTH));
- textArea.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (applyStyleWhenTextAreaChangeCheckbox.getSelection())
- applyStyles();
- }
- });
-
- textArea.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- displaySelectedCSSProperty();
- }
- });
- textArea.addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- displaySelectedCSSProperty();
- }
- });
-
- layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- composite = new Composite(form, SWT.NONE);
- composite.setLayout(layout);
-
- Group group = new Group(composite, SWT.NONE);
- group.setText("Selected CSS Property");
- layout = new GridLayout(2, true);
- layout.verticalSpacing = 3;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(group, SWT.NONE);
- label.setText("CSS Property name");
- selectedCSSPropertyNameText = new Text(group, SWT.BORDER
- | SWT.READ_ONLY);
- selectedCSSPropertyNameText.setLayoutData(new GridData(
- GridData.FILL_HORIZONTAL));
-
- label = new Label(group, SWT.NONE);
- label.setText("CSS Property value");
- selectedCSSPropertyValueText = new Text(group, SWT.BORDER);
- selectedCSSPropertyValueText.setLayoutData(new GridData(
- GridData.FILL_HORIZONTAL));
- selectedCSSPropertyValueText.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
-
- String property = selectedCSSPropertyNameText.getText();
- property += ":";
- property += selectedCSSPropertyValueText.getText();
- updateSelectedCSSPropertyValue(property);
- }
- });
-
- final Button b = new Button(group, SWT.PUSH | SWT.BORDER);
- b.setText("Change Color");
- b.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ColorDialog colorDialog = new ColorDialog(shell);
- colorDialog.setText("ColorDialog Demo");
- String cssValue = selectedCSSPropertyValueText.getText();
- if (cssValue != null && cssValue.length() > 0) {
- try {
- CSSValue value = engine.parsePropertyValue(cssValue);
- RGB rgb = (RGB) engine.convert(value, RGB.class, null);
- if (rgb != null)
- colorDialog.setRGB(rgb);
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- // engine.convert(, RGB.class,);
- }
- RGB newColor = colorDialog.open();
- if (newColor != null) {
- try {
- cssValue = engine.convert(newColor, RGB.class,
- selectedCSSPropertyNameText.getText());
- if (cssValue == null)
- return;
- selectedCSSPropertyValueText.setText(cssValue);
- String property = selectedCSSPropertyNameText.getText();
- property += ":";
- property += selectedCSSPropertyValueText.getText();
- updateSelectedCSSPropertyValue(property);
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- }
- }
- });
-
- final Button b2 = new Button(group, SWT.PUSH | SWT.BORDER);
- b2.setText("Change Font");
- b2.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- FontDialog fontDialog = new FontDialog(shell);
- fontDialog.setText("Choose the font");
- String value = selectedCSSPropertyValueText.getText();
- try {
- String propertyName = selectedCSSPropertyNameText.getText();
- CSSValue cssValue = engine.parsePropertyValue(value);
- CSS2FontProperties fontProperties = CSS2FontPropertiesHelpers
- .createCSS2FontProperties(cssValue, propertyName);
- FontData fontData = (FontData) engine.convert(fontProperties,
- FontData.class, display);
- if (fontData != null) {
- FontData[] fontDatas = { fontData };
- fontDialog.setFontList(fontDatas);
- }
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- FontData newFontData = fontDialog.open();
- if (newFontData != null) {
- try {
- String cssValue = engine.convert(newFontData,
- FontData.class, selectedCSSPropertyNameText
- .getText());
- if (cssValue == null)
- return;
- selectedCSSPropertyValueText.setText(cssValue);
- String property = selectedCSSPropertyNameText.getText();
- property += ":";
- property += selectedCSSPropertyValueText.getText();
- updateSelectedCSSPropertyValue(property);
- } catch (Exception ex) {
- handleExceptions(ex);
- }
- }
- }
- });
-
- group = new Group(composite, SWT.NONE);
- group.setText("CSS Engine options");
- layout = new GridLayout();
- layout.verticalSpacing = 3;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- cacheResourcesCheckbox = new Button(group, SWT.CHECK);
- cacheResourcesCheckbox.setText("Cache Color, Font and Cursor");
- cacheResourcesCheckbox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (!cacheResourcesCheckbox.getSelection()) {
- engine.getResourcesRegistry().dispose();
- }
- }
- });
- cacheResourcesCheckbox.setSelection(true);
-
- applyStyleWhenTextAreaChangeCheckbox = new Button(group, SWT.CHECK);
- applyStyleWhenTextAreaChangeCheckbox
- .setText("Apply style when textarea change");
- applyStyleWhenTextAreaChangeCheckbox.setSelection(true);
-
- htmlCheckbox = new Button(group, SWT.CHECK);
- htmlCheckbox.setText("is HTML Selector? (otherwise it's SWT Selector)");
- htmlCheckbox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- populateCSSFiles();
- applyStylesFromSelectedFile();
- }
- });
-
- // Create CSS files list
- cssFilesWidget = new List(group, SWT.NONE);
- cssFilesWidget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- cssFilesWidget.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- applyStylesFromSelectedFile();
- }
- });
- populateCSSFiles();
-
- // Create Apply Style Button.
- applyStyleToShellCheckbox = new Button(group, SWT.CHECK);
- applyStyleToShellCheckbox.setText("Apply sytle to fully Shell?");
- applyStyleToShellCheckbox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (applyStyleToShellCheckbox.getSelection()) {
- applyStyles();
- } else {
- // Apply styles with NONE style to reset
- // styles applied into TextArea...
- engine = getCSSEngine();
- engine.applyStyles(shell, true);
- // Apply styles
- applyStyles();
- }
-
- }
- });
-
- Button applyStyleButton = new Button(group, SWT.BORDER);
- applyStyleButton.setText("Apply style");
- applyStyleButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- applyStyles();
- }
- });
-
- form.setWeights(new int[] { 120, 90 });
-
- // Select the first CSS style file
- applyStylesFromSelectedFile();
- }
-
- public abstract void createContent(Composite parent);
-
- protected void displaySelectedCSSProperty() {
- selectedCSSPropertyNameText.setText("");
- selectedCSSPropertyValueText.setText("");
- int start = -1;
- int end = -1;
-
-// if (currentLine != -1)
-// textArea.setLineBackground(currentLine, 1, null);
-
- currentLine = textArea.getLineAtOffset(textArea.getCaretOffset());
- if (currentLine + 1 >= textArea.getLineCount())
- return;
- start = textArea.getOffsetAtLine(currentLine);
- end = textArea.getOffsetAtLine(currentLine + 1) - 2;
- if (start <= end) {
- String lineText = textArea.getText(start, end);
- lineText = lineText.trim();
- int index = lineText.indexOf(":");
- if (index > 0) {
- if (lineText.indexOf("{") != -1)
- return;
- String property = lineText.substring(0, index);
- String value = lineText.substring(index + 1, lineText.length());
- value = value.replaceAll(";", "");
- // Remove comment
- int commentIndex = value.indexOf("/*");
- if (commentIndex > 0)
- value = value.substring(0, commentIndex);
- selectedCSSPropertyNameText.setText(property);
- selectedCSSPropertyValueText.setText(value);
-
-// textArea.setLineBackground(currentLine, 1, display
-// .getSystemColor(SWT.COLOR_MAGENTA));
- }
- }
- }
-
- protected void updateSelectedCSSPropertyValue(String text) {
- if (currentLine != -1 && currentLine + 1 >= textArea.getLineCount())
- return;
- int start = textArea.getOffsetAtLine(currentLine);
- int end = textArea.getOffsetAtLine(currentLine + 1) - 2;
-
- String startLineText = textArea.getText(0, start);
- String endLineText = textArea.getText(end, textArea.getCharCount() - 1);
- if (!text.endsWith(";") && !endLineText.startsWith(";"))
- text += ";";
- if (endLineText.startsWith(":"))
- endLineText.substring(1, endLineText.length());
- String newContent = startLineText + text + endLineText;
- textArea.setText(newContent);
- }
-
- /*-------------------- AbstractCSSEditor methods implementation --------------------**/
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#createCSSEngine()
- */
- protected CSSEngine createCSSEngine() {
- return new CSSSWTEngineImpl(shell.getDisplay());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#getHTMLElementProvider()
- */
- protected IElementProvider getHTMLElementProvider() {
- return SWTHTMLElementProvider.INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#getNativeWidgetElementProvider()
- */
- protected IElementProvider getNativeWidgetElementProvider() {
- return SWTElementProvider.INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#isHTMLSelector()
- */
- protected boolean isHTMLSelector() {
- return htmlCheckbox.getSelection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#getStyleSheetContent()
- */
- protected String getStyleSheetContent() {
- return textArea.getText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#setStyleSheetContent(java.lang.String)
- */
- protected void setStyleSheetContent(String content) {
- textArea.setText(content);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#setCSSEngineStatuts(java.lang.String)
- */
- protected void setCSSEngineStatuts(String status) {
- statusLabel.setText(status);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#mustApplyStylesToWindow()
- */
- protected boolean mustApplyStylesToWindow() {
- return applyStyleToShellCheckbox.getSelection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#getLeftPanelNativeWidget()
- */
- protected Object getLeftPanelNativeWidget() {
- return leftPanel;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#getWindowNativeWidget()
- */
- protected Object getWindowNativeWidget() {
- return shell;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#getCSSNativeWidgetSerializerConfiguration()
- */
- protected CSSSerializerConfiguration getCSSNativeWidgetSerializerConfiguration() {
- return CSSSWTSerializerConfiguration.INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#getCSSFileWidgetItemCount()
- */
- protected int getCSSFilesWidgetItemCount() {
- return cssFilesWidget.getItemCount();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#getCSSFileWidgetSelectionIndex()
- */
- protected int getCSSFilesWidgetSelectionIndex() {
- return cssFilesWidget.getSelectionIndex();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#selectCSSFileWidget(int)
- */
- protected void selectCSSFilesWidget(int index) {
- cssFilesWidget.select(index);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#addCSSFilesWidget(java.lang.String)
- */
- protected void addItemCSSFilesWidget(String item) {
- cssFilesWidget.add(item);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.akrogen.tkui.core.css.examples.csseditors.AbstractCSSEditor#removeAllCSSFilesWidget()
- */
- protected void removeAllCSSFilesWidget() {
- cssFilesWidget.removeAll();
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/csseditors/CSSEditorSWTWidgets.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/csseditors/CSSEditorSWTWidgets.java
deleted file mode 100644
index a8d7973..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/examples/csseditors/CSSEditorSWTWidgets.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.examples.csseditors;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TreeItem;
-
-public class CSSEditorSWTWidgets extends AbstractCSSSWTEditor {
-
- public void createContent(Composite parent) {
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 3;
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(layout);
-
- // Create SWT Text
- Text text = new Text(composite, SWT.BORDER);
- text.setText("bla bla bla...");
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Create SWT Text [SWT.MULTI]
- Text textArea = new Text(composite, SWT.MULTI | SWT.BORDER);
- textArea.setText("bla bla bla...[SWT.MULTI]");
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.heightHint = 100;
- textArea.setLayoutData(gridData);
-
- // Create SWT Label
- Label label = new Label(composite, SWT.NONE);
- label.setText("bla bla bla...");
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Create Button
- Button button = new Button(composite, SWT.BORDER);
- button.setText("SWT Button");
-
- // Create Button [SWT.CHECK]
- Button checkbox = new Button(composite, SWT.CHECK);
- checkbox.setText("SWT Button [SWT.CHECK]");
-
- // Create Button [SWT.RADIO]
- Button radio = new Button(composite, SWT.RADIO);
- radio.setText("SWT Button [SWT.RADIO]");
-
- // Create Combo
- Combo combo = new Combo(composite, SWT.BORDER);
- combo.add("Item 1");
- combo.add("Item 2");
- combo.select(0);
-
- // Create CTabFolder
- CTabFolder tabFolder = new CTabFolder(composite, SWT.CLOSE);
- tabFolder.setUnselectedCloseVisible(true);
- tabFolder.setUnselectedImageVisible(true);
-
- CTabItem tabItem1 = new CTabItem(tabFolder, SWT.NONE);
- tabItem1.setText("Tab 1");
-
- CTabItem tabItem2 = new CTabItem(tabFolder, SWT.NONE);
- tabItem2.setText("Tab 2");
-
- tabFolder.setSelection(0);
- }
-
- public static void main(String[] args) {
- CSSEditorSWTWidgets editor = new CSSEditorSWTWidgets();
- editor.display();
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/CSSSWTResources.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/CSSSWTResources.java
deleted file mode 100644
index b2f18c9..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/CSSSWTResources.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.resources;
-
-import java.io.InputStream;
-
-public class CSSSWTResources {
-
- /*--- SWT Styles --*/
-
- public static InputStream getSWT() {
- return CSSSWTResources.class.getResourceAsStream("swt/swt.css");
- }
-
- public static InputStream getSWTMatrix() {
- return CSSSWTResources.class.getResourceAsStream("swt/Matrix.css");
- }
-
- public static InputStream getSWTVista() {
- return CSSSWTResources.class.getResourceAsStream("swt/Vista.css");
- }
-
- public static InputStream getSWTOsx() {
- return CSSSWTResources.class.getResourceAsStream("swt/Osx.css");
- }
-
- public static InputStream getSWTPseudoCLass() {
- return CSSSWTResources.class
- .getResourceAsStream("swt/pseudo-class.css");
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/Osx.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/Osx.css
deleted file mode 100644
index 55cedba..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/Osx.css
+++ /dev/null
@@ -1,31 +0,0 @@
-Shell, SashForm, Button, Label {
- font-family: "Lucida Grande",Serif;
- font-size: 11;
- background: url(./images/osx_back.jpg);
-}
-
-ToolBar, CLabel {
- font-family: "Lucida Grande",Serif;
- font-size: 9;
- background: url(./images/osx_back.jpg);
-}
-
-Tree {
- font-family: "Lucida Grande",Serif;
- font-size: 11;
- background-color: lightgrey, white, white, lightgrey, 10%, 90% 100%;
-}
-
-CTabFolder:selected {
- background: url(./images/osx_tab.jpg);
- background-color: rgb(162,208,242);
- color: black;
-}
-
-CTabFolder {
- font-family: "Lucida Grande",Serif;
- font-size: 11;
- font-weight: normal;
- background-color: lightgrey;
- color: black;
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/Vista.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/Vista.css
deleted file mode 100644
index 228ec7a..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/Vista.css
+++ /dev/null
@@ -1,50 +0,0 @@
-Shell, Tree, Button, Label {
- font-family: Roman;
- font-size: 10;
- background-color: rgb(233,234,238);
- color: rgb(70,70,70);
-}
-SashForm {
- background-color: black;
-}
-Text {
- font-family: Calibri;
- font-size: 10;
-}
-ToolBar {
- background-color: gradient,
- white,
- white,
- rgb(214,222,223),
- rgb(219,226,228),
- rgb(210,217,219),
- rgb(224,229,231),
- white,
- white,
- 5%, 5%, 45%, 45%, 98%, 98%, 100%;
- color: white;
-}
-
-CLabel {
- font-family: Calibri;
- font-size: 10;
- background-color: gradient,
- rgb(67,71,82),
- rgb(59,62,70),
- rgb(47,48,48),
- rgb(76,76,76),
- 40%, 40%, 100%;
- color: white;
-}
-
-CTabFolder:selected {
- background: url(./images/vista_tab2.jpg);
- color: white;
-}
-
-CTabFolder {
- font-family: Calibri;
- font-size: 10;
- background-color: rgb(233,234,238);
- color: rgb(70,70,70);
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/pseudo-class.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/pseudo-class.css
deleted file mode 100644
index 40076ce..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/pseudo-class.css
+++ /dev/null
@@ -1,19 +0,0 @@
-Text:disabled {
- background-color:blue;
-}
-
-Text:focus {
- background-color:red;
-}
-
-Button[type="checkbox"][visible="true"] {
- background-color:green;
-}
-
-Button[type="radio"] {
- background-color:yellow;
-}
-
-Button[type="button"] {
- background: url(./images/icons/type/class.gif);
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/swt.css b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/swt.css
deleted file mode 100644
index 5dca81f..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/resources/swt/swt.css
+++ /dev/null
@@ -1,24 +0,0 @@
-Composite Composite Label {
- font-weight:normal;
- font-style: italic;
- color:green;
-}
-
-Label {
- font-weight:bold;
- font-family: "Arial";
- color:red;
- font-size: 20;
-}
-
-Label#MyId {
- color:blue;
-}
-
-Label#MyId2 {
- color:yellow;
-}
-
-Text {
- background-color:#6495ED;
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest1.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest1.java
deleted file mode 100644
index 105d699..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest1.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.attribute;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * Selector= E[foo] an E element with a "foo" attribute
- *
- */
-public class SWTAttributeSelectorTest1 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "Label[foo] {color:red} Label {color:green}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label foo");
- label1.setData("foo", "bar");
-
- // Label
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label ");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest2.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest2.java
deleted file mode 100644
index 8190989..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest2.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.attribute;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * Selector=E[foo="bar"] an E element whose "foo" attribute value is exactly
- * equal to "bar"
- *
- */
-public class SWTAttributeSelectorTest2 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "Label[foo=\"bar\"] {color:red} Label {color:green}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label foo");
- label1.setData("foo", "bar");
-
- // Label
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label ");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest3.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest3.java
deleted file mode 100644
index 868055c..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest3.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.attribute;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * Selector=E[foo~="bar"] an E element whose "foo" attribute value is a list of
- * space-separated values, one of which is exactly equal to "bar"
- *
- */
-public class SWTAttributeSelectorTest3 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "Label[foo~=\"bar\"] {color:red} Label {color:green}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label foo");
- label1.setData("foo", "it's bar");
-
- // Label
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label ");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest4.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest4.java
deleted file mode 100644
index f9fccd2..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest4.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.attribute;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * Selector=E[foo^="bar"] an E element whose "foo" attribute value begins
- * exactly with the string "bar"
- *
- * NOT SUPPORTED (CSS3)
- */
-public class SWTAttributeSelectorTest4 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "Label[foo^=\"bar\"] {color:red} Label {color:green}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label foo");
- label1.setData("foo", "bar bla bla bla");
-
- // Label
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label ");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest5.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest5.java
deleted file mode 100644
index 806543b..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest5.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.attribute;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * Selector=E[foo$="bar"] an E element whose "foo" attribute value ends exactly
- * with the string "bar"
- *
- * NOT SUPPORTED (CSS3)
- */
-public class SWTAttributeSelectorTest5 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "Label[foo$=\"bar\"] {color:red} Label {color:green}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label foo");
- label1.setData("foo", "bar bla bla bla");
-
- // Label
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label ");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest6.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest6.java
deleted file mode 100644
index 1b053f3..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest6.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.attribute;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * Selector=E[foo*="bar"] an E element whose "foo" attribute value contains the
- * substring "bar"
- *
- * NOT SUPPORTED (CSS3)
- */
-public class SWTAttributeSelectorTest6 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "Label[foo*=\"bar\"] {color:red} Label {color:green}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label foo");
- label1.setData("foo", "bar bla bla bla");
-
- // Label
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label ");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest7.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest7.java
deleted file mode 100644
index da02867..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/attribute/SWTAttributeSelectorTest7.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.attribute;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * Selector=E[hreflang|="en"] an E element whose "hreflang" attribute has a
- * hyphen-separated list of values beginning (from the left) with "en"
- *
- */
-public class SWTAttributeSelectorTest7 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "Label[hreflang|=\"en\"] {color:red} Label {color:green}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label england");
- label1.setData("hreflang", "england");
-
- // Label
- Label label2 = new Label(panel1, SWT.NONE);
- label2.setText("Label ");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/type/SWTTypeSelectorTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/type/SWTTypeSelectorTest.java
deleted file mode 100644
index 6f43f51..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/type/SWTTypeSelectorTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.type;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- *
- * Selector= label Text
- *
- */
-public class SWTTypeSelectorTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "Label {color:red} Text {color:green}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [color:red;]");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/SWTUniversalSelectorTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/SWTUniversalSelectorTest.java
deleted file mode 100644
index e41d3b9..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/SWTUniversalSelectorTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.universal;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- *
- * Selector= * {color:red}
- *
- */
-public class SWTUniversalSelectorTest {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader("* {color:red}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [color:red;]");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest1.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest1.java
deleted file mode 100644
index 285eed6..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest1.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.universal.ns;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- *
- * Selector= swt|* {color:red} => all elements org.eclipse.swt.widgets
- *
- */
-public class SWTUniversalSelectorNSTest1 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader(
- "@namespace swt \"org.eclipse.swt.widgets\"; "
- + "swt|* {color:red}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [color:red;]");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest2.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest2.java
deleted file mode 100644
index f7817cc..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest2.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.universal.ns;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- *
- * Selector= *|* {color:red} => all elements
- *
- */
-public class SWTUniversalSelectorNSTest2 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader("*|* {color:red}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [color:red;]");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest3.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest3.java
deleted file mode 100644
index 60a8e98..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/selectors/universal/ns/SWTUniversalSelectorNSTest3.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.selectors.universal.ns;
-
-import java.io.StringReader;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- *
- * Selector= |* {color:red} => all elements without any declared namespace
- *
- */
-public class SWTUniversalSelectorNSTest3 {
-
- public static void main(String[] args) {
- try {
- Display display = new Display();
- CSSEngine engine = new CSSSWTEngineImpl(display);
- engine.parseStyleSheet(new StringReader("|* {color:red}"));
-
- /*--- UI SWT ---*/
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- FillLayout layout = new FillLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new FillLayout());
-
- // Label
- Label label1 = new Label(panel1, SWT.NONE);
- label1.setText("Label 0 [color:red;]");
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- /*--- End UI SWT ---*/
- // Apply Styles
- engine.applyStyles(shell, true);
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/serializers/CSSSerializerSWTTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/serializers/CSSSerializerSWTTest.java
deleted file mode 100644
index 78300d2..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/swt/serializers/CSSSerializerSWTTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.swt.serializers;
-
-import java.io.StringWriter;
-
-import org.akrogen.tkui.css.core.engine.CSSEngine;
-import org.akrogen.tkui.css.core.serializers.CSSHTMLSerializerConfiguration;
-import org.akrogen.tkui.css.core.serializers.CSSSerializer;
-import org.akrogen.tkui.css.swt.engine.CSSSWTEngineImpl;
-import org.akrogen.tkui.css.swt.engine.html.CSSSWTHTMLEngineImpl;
-import org.akrogen.tkui.css.swt.serializers.CSSSWTSerializerConfiguration;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class CSSSerializerSWTTest {
-
- private static Color COLOR_GREEN = null;
-
- private static Cursor CURSOR_HELP = null;
-
- public static void main(String[] args) {
- try {
-
- /*--- UI SWT ---*/
- Display display = new Display();
- createResources(display);
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- GridLayout layout = new GridLayout();
- shell.setLayout(layout);
-
- Composite panel1 = new Composite(shell, SWT.NONE);
- panel1.setLayout(new GridLayout());
-
- // Text
- Text text1 = new Text(panel1, SWT.NONE);
- text1.setText("bla bla bla...");
-
- // TextArea
- Text textarea = new Text(panel1, SWT.MULTI);
- textarea.setText("bla bla bla...");
-
- // Label
- Label label3 = new Label(panel1, SWT.NONE);
- label3.setText("Label 3");
- label3.setBackground(COLOR_GREEN);
- label3.setCursor(CURSOR_HELP);
-
- // Create Button
- Button button = new Button(panel1, SWT.BORDER);
- button.setText("SWT Button");
-
- // Create Button [SWT.CHECK]
- Button checkbox = new Button(panel1, SWT.CHECK);
- checkbox.setText("SWT Button [SWT.CHECK]");
-
- // Create Button [SWT.RADIO]
- Button radio = new Button(panel1, SWT.RADIO);
- radio.setText("SWT Button [SWT.RADIO]");
-
- // Create Combo
- Combo combo = new Combo(panel1, SWT.BORDER);
- combo.add("Item 1");
- combo.add("Item 2");
- combo.select(0);
-
- /*--- End UI SWT ---*/
-
- // Serialize Shell and children SWT Widgets
- // STWT Selector
- CSSEngine engine = new CSSSWTEngineImpl(display);
- System.out
- .println("***************** CSS SWT Selector *****************");
- CSSSerializer serializer = new CSSSerializer();
- StringWriter writer = new StringWriter();
- serializer.serialize(writer, engine, shell, true,
- CSSSWTSerializerConfiguration.INSTANCE);
- System.out.println(writer.toString());
-
- // HTML Selector
- engine = new CSSSWTHTMLEngineImpl(display);
- System.out
- .println("***************** CSS SWT-HTML Selector *****************");
- writer = new StringWriter();
- serializer.serialize(writer, engine, shell, true,
- CSSHTMLSerializerConfiguration.INSTANCE);
- System.out.println(writer.toString());
-
- shell.pack();
- shell.open();
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
-
- display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private static void createResources(Display display) {
- COLOR_GREEN = new Color(display, 0, 255, 0);
- CURSOR_HELP = new Cursor(display, SWT.CURSOR_HELP);
-
- display.addListener(SWT.Dispose, new Listener() {
- public void handleEvent(Event event) {
- disposeResources();
- }
- });
- }
-
- private static void disposeResources() {
- COLOR_GREEN.dispose();
- CURSOR_HELP.dispose();
- }
-}
diff --git a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/uiforms/engine/html/CSSFormTextTest.java b/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/uiforms/engine/html/CSSFormTextTest.java
deleted file mode 100644
index 1707919..0000000
--- a/tests/org.eclipse.e4.ui.tests.css.swt/tkuiTestsToRefactor/swt/test/org/akrogen/tkui/css/uiforms/engine/html/CSSFormTextTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Angelo Zerr and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.akrogen.tkui.css.uiforms.engine.html;
-
-
-public class CSSFormTextTest {
- public static void main(String[] args) {
- try {
-// Display display = new Display();
-// FormToolkit toolkit = new FormToolkit(display);
-//
-// // Create SWT CSS Engine
-// CSSEngine engine = new CSSSWTEngineImpl(display);
-// // Parse style sheet
-// engine.parseStyleSheet(new StringReader(
-// "Label {color:red;} "
-// + "FormText {color:white;background-color:#2BAFFA;font-size:11;}"
-// + "Text {background-color:green;}"));
-//
-// /*--- Start UI SWT ---*/
-// Shell shell = new Shell(display, SWT.SHELL_TRIM);
-// FillLayout layout = new FillLayout();
-// shell.setLayout(layout);
-//
-// Form form = toolkit.createForm(shell);
-// form.setText("Hello, Eclipse Forms");
-// Composite body = form.getBody();
-// layout = new FillLayout();
-// body.setLayout(layout);
-//
-// // Label
-// Label label1 = toolkit.createLabel(body, "bla bla bla");
-//
-// // Text
-// Text text1 = toolkit.createText(body, "bla bla bla");
-//
-// FormText formText = toolkit.createFormText(body, true);
-// formText.setText(
-// "<form>"
-// + "<p><img href=\"eclipse\"/> Eclipse Projects: </p>"
-// + "<li><b>Platform</b> - Eclipse frameworks</li>"
-// + "<li><b>JDT</b> - Java development tools</li>"
-// + "<li><b>PDE</b> - Plug-in development environment</li>"
-// + "</form>",
-// true,
-// true);
-//
-// /*--- End UI SWT ---*/
-//
-// // Apply Styles
-// engine.applyStyles(body, true);
-//
-// shell.pack();
-// shell.open();
-//
-// while (!shell.isDisposed()) {
-// if (!display.readAndDispatch())
-// display.sleep();
-// }
-//
-// display.dispose();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}