fix a custom color problem (#1382)

fix a custom color problem
This commit is contained in:
Chao MENG
2018-01-22 10:07:31 +08:00
committed by kjwang-talend
parent 87d2e41f2e
commit ccd42eeca6

View File

@@ -27,6 +27,7 @@ import org.talend.designer.runprocess.IRunProcessService;
import org.talend.repository.model.IMetadataService;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryService;
import org.w3c.dom.css.CSSStyleDeclaration;
/**
* DOC ggu class global comment. Detailled comment
@@ -150,4 +151,20 @@ public class CoreUIPlugin extends AbstractUIPlugin {
setCSSClass(widget, className, true);
}
public static String removeCSSAttribute(Object widget, String attr) {
CSSStyleDeclaration cssStyleDeclaration = getCSSStyleDeclaration(widget);
if (cssStyleDeclaration != null) {
return cssStyleDeclaration.removeProperty(attr);
}
return null;
}
private static CSSStyleDeclaration getCSSStyleDeclaration(Object widget) {
IStylingEngine cssStylingEngine = getCSSStylingEngine();
if (cssStylingEngine != null) {
return cssStylingEngine.getStyle(widget);
}
return null;
}
}