Project: Eclipse_Platform_UI
Bug 266970 [CSS] Widget.setData keys should be qualified
Reported: 2009-03-03 23:11:23 | Status: resolved fixed

There are many cases where we use Widget.setData(keyString, value) to remember some CSS value. See SWTElement for many examples. These key strings are often of the form "active", "hover", etc. They should be fully qualified to reduce conflicts since others may be using the widget's setData. So should instead be: "active" -> "org.eclipse.e4.ui.css.swt.active" "hover" -> "org.eclipse.e4.ui.css.swt.hover" Also, we should have final static fields to hold keys with these as values, eg. in DynamicPseudoClassesSWTActiveHandler we would have final static String WIDGET_ACTIVE_KEY = "org.eclipse.e4.ui.css.swt.activeLost"

Files changed in fix:
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/selectors/DynamicPseudoClassesSWTActiveHandler.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