Search in sources :

Example 6 with CSSSWTEngineImpl

use of org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl in project eclipse.platform.ui by eclipse-platform.

the class ViewCSSTest method setUp.

@BeforeEach
public void setUp() {
    display = Display.getDefault();
    engine = new CSSSWTEngineImpl(display);
}
Also used : CSSSWTEngineImpl(org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 7 with CSSSWTEngineImpl

use of org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl in project eclipse.pde by eclipse-pde.

the class CssSpyPart method getCSSEngine.

/**
 * @return the CSS engine governing the argument, or null if none
 */
public static CSSEngine getCSSEngine(Object o) {
    CSSEngine engine = null;
    if (o instanceof CSSStylableElement) {
        CSSStylableElement element = (CSSStylableElement) o;
        engine = WidgetElement.getEngine((Widget) element.getNativeWidget());
    }
    if (engine == null && o instanceof Widget) {
        if (((Widget) o).isDisposed()) {
            return null;
        }
        engine = WidgetElement.getEngine((Widget) o);
    }
    if (engine == null && Display.getCurrent() != null) {
        engine = new CSSSWTEngineImpl(Display.getCurrent());
    }
    return engine;
}
Also used : CSSSWTEngineImpl(org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl) Widget(org.eclipse.swt.widgets.Widget) CSSEngine(org.eclipse.e4.ui.css.core.engine.CSSEngine) CSSStylableElement(org.eclipse.e4.ui.css.core.dom.CSSStylableElement)

Aggregations

CSSSWTEngineImpl (org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl)7 CSSEngine (org.eclipse.e4.ui.css.core.engine.CSSEngine)3 IOException (java.io.IOException)2 Widget (org.eclipse.swt.widgets.Widget)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 InputStream (java.io.InputStream)1 StringReader (java.io.StringReader)1 URL (java.net.URL)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 InvalidRegistryObjectException (org.eclipse.core.runtime.InvalidRegistryObjectException)1 IScopeContext (org.eclipse.core.runtime.preferences.IScopeContext)1 InjectionException (org.eclipse.e4.core.di.InjectionException)1 CSSStylableElement (org.eclipse.e4.ui.css.core.dom.CSSStylableElement)1 OSGiResourceLocator (org.eclipse.e4.ui.css.core.util.impl.resources.OSGiResourceLocator)1 WidgetElement (org.eclipse.e4.ui.css.swt.dom.WidgetElement)1 IThemeEngine (org.eclipse.e4.ui.css.swt.theme.IThemeEngine)1 MApplicationElement (org.eclipse.e4.ui.model.application.MApplicationElement)1 MUIElement (org.eclipse.e4.ui.model.application.ui.MUIElement)1 IStylingEngine (org.eclipse.e4.ui.services.IStylingEngine)1 EObject (org.eclipse.emf.ecore.EObject)1