From ff1364c17004b493619b4a9cfbecb7380898ef1c Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Wed, 6 May 2026 17:16:24 +0200 Subject: [PATCH] Remove unused BootstrapTheme3x and its dummy.css BootstrapTheme3x was a reflective bootstrap helper added in 2010 (bug 310153, commit 99e054cf44) so org.eclipse.ui.internal.Workbench could activate the e4 styling engine without taking a hard dependency on org.eclipse.e4.ui.css.swt.theme. The Workbench call site was removed in 2011 by commit ad3c59ac43 ("Merge remote branch 'e4/master' Merge in the e4.ui stuff, plus the compat org.eclipse.ui.workbench"), the big merge that brought the e4 UI stack into the platform; styling initialization moved into the new e4-based workbench and the bridge became dead code. Nothing in the platform tree has referenced the class since, and the dummy.css it registered as the default theme is empty. Drop the class, the css/dummy.css placeholder, and the now-empty css/ entry from build.properties. --- .../build.properties | 1 - .../css/dummy.css | 0 .../swt/internal/theme/BootstrapTheme3x.java | 50 ------------------- 3 files changed, 51 deletions(-) delete mode 100644 bundles/org.eclipse.e4.ui.css.swt.theme/css/dummy.css delete mode 100644 bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/BootstrapTheme3x.java diff --git a/bundles/org.eclipse.e4.ui.css.swt.theme/build.properties b/bundles/org.eclipse.e4.ui.css.swt.theme/build.properties index 939f3ec5460..763d5179ae7 100644 --- a/bundles/org.eclipse.e4.ui.css.swt.theme/build.properties +++ b/bundles/org.eclipse.e4.ui.css.swt.theme/build.properties @@ -15,7 +15,6 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ - css/,\ OSGI-INF/,\ about.html,\ plugin.properties diff --git a/bundles/org.eclipse.e4.ui.css.swt.theme/css/dummy.css b/bundles/org.eclipse.e4.ui.css.swt.theme/css/dummy.css deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/BootstrapTheme3x.java b/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/BootstrapTheme3x.java deleted file mode 100644 index 0f6f7d83f69..00000000000 --- a/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/BootstrapTheme3x.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Tom Schindl and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Tom Schindl - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.ui.css.swt.internal.theme; - -import org.eclipse.e4.ui.css.swt.theme.ITheme; -import org.eclipse.e4.ui.css.swt.theme.IThemeEngine; -import org.eclipse.e4.ui.css.swt.theme.IThemeManager; -import org.eclipse.swt.widgets.Display; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; - -/* - * ATTENTION WHEN RENAMING, REMOVING, ... you need to update 3.x org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java - */ -/** - * This class allows 3.x code to bootstrap the themes engine with having a real dependency on it - */ -public class BootstrapTheme3x { - public BootstrapTheme3x(Display display) { - this(display, null); - } - - public BootstrapTheme3x(Display display, String themeId) { - Bundle bundle = FrameworkUtil.getBundle(BootstrapTheme3x.class); - BundleContext context = bundle.getBundleContext(); - ServiceReference ref = context - .getServiceReference(IThemeManager.class); - IThemeManager mgr = context.getService(ref); - final IThemeEngine engine = mgr.getEngineForDisplay(display); - ITheme theme = engine.registerTheme(IThemeEngine.DEFAULT_THEME_ID, "Default Theme", "platform:/plugin/org.eclipse.e4.ui.css.swt.theme/css/dummy.css"); - if( themeId == null ) { - engine.setTheme(theme, false); - } else { - engine.setTheme(themeId, false); - } - } -} \ No newline at end of file