diff --git a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/BrowserInformationControl.java b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/BrowserInformationControl.java index 6042241b376..b066c35ee11 100644 --- a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/BrowserInformationControl.java +++ b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/BrowserInformationControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2018 IBM Corporation and others. + * Copyright (c) 2000, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,6 +10,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Tue Ton - support for FreeBSD *******************************************************************************/ package org.eclipse.jface.internal.text.html; @@ -294,7 +295,7 @@ public void setInput(Object input) { String scrollbarStyle= "overflow:scroll;"; //$NON-NLS-1$ // workaround for bug 546870, don't use a horizontal scrollbar on Linux as its broken for GTK3 and WebKit - if (Util.isLinux()) { + if (Util.isLinux() || Util.isFreeBSD()) { scrollbarStyle= "word-wrap:break-word;"; //$NON-NLS-1$ } // The default "overflow:auto" would not result in a predictable width for the client area diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java index c10af71974d..bbf4dba6544 100644 --- a/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java +++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,6 +10,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Tue Ton - support for FreeBSD *******************************************************************************/ package org.eclipse.jface.util; @@ -562,6 +563,16 @@ public static boolean isMac() { return WS_CARBON.equals(ws) || WS_COCOA.equals(ws); } + /** + * Common WS query helper method. + * @return true for FreeBSD platform + * @since 3.5 + */ + public static boolean isFreeBSD() { + final String ws = SWT.getPlatform(); + return WS_GTK.equals(ws); + } + /** * Common WS query helper method. * @return true for linux platform diff --git a/bundles/org.eclipse.ui.browser/plugin.xml b/bundles/org.eclipse.ui.browser/plugin.xml index 710b15fa3b0..6c38854bf23 100644 --- a/bundles/org.eclipse.ui.browser/plugin.xml +++ b/bundles/org.eclipse.ui.browser/plugin.xml @@ -1,7 +1,7 @@ @@ -94,7 +95,7 @@ @@ -104,28 +105,28 @@ usr/bin/google-chrome usr/bin/chromium-browser usr/bin/konqueror usr/bin/epiphany diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java index 86d260f8df4..6531bd12eb9 100644 --- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java +++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2019 IBM Corporation and others. + * Copyright (c) 2003, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -13,6 +13,7 @@ * Martin Oberhuber (Wind River) - [292882] Default Browser on Solaris * Tomasz Zarna (Tasktop Technologies) - [429546] External Browser with parameters * Christoph Läubrich - Bug 552773 - Simplify logging in platform code base + * Tue Ton - support for FreeBSD *******************************************************************************/ package org.eclipse.ui.internal.browser; @@ -75,6 +76,18 @@ public static boolean isLinux() { return false; } + /** + * Returns true if we're running on FreeBSD. + * + * @return boolean + */ + public static boolean isFreeBSD() { + String os = System.getProperty("os.name"); //$NON-NLS-1$ + if (os != null && os.toLowerCase().contains("freebsd")) //$NON-NLS-1$ + return true; + return false; + } + /** * Open a dialog window. * diff --git a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TitleRegion.java b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TitleRegion.java index b3aa9f19b63..e986c76d097 100644 --- a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TitleRegion.java +++ b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TitleRegion.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,6 +10,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Tue Ton - support for FreeBSD *******************************************************************************/ package org.eclipse.ui.internal.forms.widgets; @@ -212,6 +213,9 @@ private Point layout(Composite composite, boolean move, int x, int y, if (Constants.OS_LINUX.equalsIgnoreCase(os)) { tw += 1; // See Bug 342610 } + else if (Constants.OS_FREEBSD.equalsIgnoreCase(os)) { + tw += 1; // See Bug 342610 + } if (bsize != null) tw -= bsize.x + SPACING; if (msize != null) diff --git a/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/part/ResourceTransfer.java b/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/part/ResourceTransfer.java index a671e221a21..42d82853996 100644 --- a/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/part/ResourceTransfer.java +++ b/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/part/ResourceTransfer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -11,6 +11,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Andrey Loskutov - Bug 205678 + * Tue Ton - support for FreeBSD *******************************************************************************/ package org.eclipse.ui.part; @@ -167,7 +168,7 @@ protected Object nativeToJava(TransferData transferData) { int count = in.readInt(); if (count > MAX_RESOURCES_TO_TRANSFER) { String message = "Transfer aborted, too many resources: " + count + "."; //$NON-NLS-1$ //$NON-NLS-2$ - if (Util.isLinux()) { + if (Util.isLinux() || Util.isFreeBSD()) { message += "\nIf you are running in x11vnc environment please consider to switch to vncserver " + //$NON-NLS-1$ "+ vncviewer or to run x11vnc without clipboard support " + //$NON-NLS-1$ "(use '-noclipboard' and '-nosetclipboard' arguments)."; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java index 87b7b1c5ff7..91c452face1 100644 --- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java +++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2016 IBM Corporation and others. + * Copyright (c) 2013, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -12,6 +12,7 @@ * IBM Corporation - initial API and implementation * Lars Vogel - Bug 474273 * Simon Scholz - Bug 487772, 486777 + * Tue Ton - support for FreeBSD ******************************************************************************/ package org.eclipse.ui.internal.ide.handlers; @@ -97,7 +98,7 @@ public Object execute(final ExecutionEvent event) { File dir = item.getWorkspace().getRoot().getLocation().toFile(); Process p; - if (Util.isLinux() || Util.isMac()) { + if (Util.isLinux() || Util.isMac() || Util.isFreeBSD()) { p = Runtime.getRuntime().exec(new String[] { "/bin/sh", "-c", launchCmd }, null, dir); //$NON-NLS-1$ //$NON-NLS-2$ } else { p = Runtime.getRuntime().exec(launchCmd, null, dir); @@ -180,7 +181,7 @@ private String formShowInSytemExplorerCommand(File path) throws IOException { } private String quotePath(String path) { - if (Util.isLinux() || Util.isMac()) { + if (Util.isLinux() || Util.isMac() || Util.isFreeBSD()) { // Quote for usage inside "", man sh, topic QUOTING: path = path.replaceAll("[\"$`]", "\\\\$0"); //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/bundles/org.eclipse.ui.themes/plugin.xml b/bundles/org.eclipse.ui.themes/plugin.xml index 8d12cceadef..22dac2eccbe 100644 --- a/bundles/org.eclipse.ui.themes/plugin.xml +++ b/bundles/org.eclipse.ui.themes/plugin.xml @@ -8,6 +8,12 @@ id="org.eclipse.e4.ui.css.theme.e4_classic" label="%theme.classic"> + + + + + * (macOS, Linux, FreeBSD and Windows)
* Call getInstance() to get an OS specific instance. */ public interface IOperatingSystemRegistration { @@ -35,7 +36,9 @@ static IOperatingSystemRegistration getInstance() { if (Platform.OS_MACOSX.equals(Platform.getOS())) { return new RegistrationMacOsX(); } else if (Platform.OS_LINUX.equals(Platform.getOS())) { - return new RegistrationLinux(); + return new RegistrationUnix(); + } else if (Platform.OS_FREEBSD.equals(Platform.getOS())) { + return new RegistrationUnix(); } else if (Platform.OS_WIN32.equals(Platform.getOS())) { return new RegistrationWindows(); } diff --git a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationLinux.java b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationUnix.java similarity index 93% rename from bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationLinux.java rename to bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationUnix.java index 3396a58c680..8b44513770a 100644 --- a/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationLinux.java +++ b/bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/internal/registration/RegistrationUnix.java @@ -1,5 +1,6 @@ /******************************************************************************* - * Copyright (c) 2018 SAP SE and others. + * Copyright (c) 2018, 2025 SAP SE 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 @@ -7,6 +8,7 @@ * * Contributors: * SAP SE - initial version + * Tue Ton - support for FreeBSD *******************************************************************************/ package org.eclipse.urischeme.internal.registration; @@ -22,7 +24,7 @@ import org.eclipse.urischeme.IScheme; import org.eclipse.urischeme.ISchemeInformation; -public class RegistrationLinux implements IOperatingSystemRegistration { +public class RegistrationUnix implements IOperatingSystemRegistration { private static final String DEFAULT_PRODUCT_NAME = "Eclipse SDK"; //$NON-NLS-1$ private static final String USER_HOME = System.getProperty("user.home"); //$NON-NLS-1$ @@ -39,7 +41,7 @@ public class RegistrationLinux implements IOperatingSystemRegistration { private IProcessExecutor processExecutor; private String productName; - public RegistrationLinux() { + public RegistrationUnix() { this(new FileProvider(), new ProcessExecutor(), getProductName()); } @@ -49,7 +51,7 @@ private static String getProductName() { return name == null ? DEFAULT_PRODUCT_NAME : name; } - public RegistrationLinux(IFileProvider fileProvider, IProcessExecutor processExecutor, String productName) { + public RegistrationUnix(IFileProvider fileProvider, IProcessExecutor processExecutor, String productName) { this.fileProvider = fileProvider; this.processExecutor = processExecutor; this.productName = productName; @@ -171,8 +173,8 @@ private String getEclipseHomeLocation() { } /** - * Only one application can handle a specific uri scheme on Linux. This - * information is stored de-centrally in the .desktop file and registered in a + * Only one application can handle a specific uri scheme on Unix-based FreeBSD/Linux. + * This information is stored de-centrally in the .desktop file and registered in a * central database. Registering an uri scheme that is already handled by * another application would also include changing the other application's * .desktop file - which can have unknown side effects. diff --git a/features/org.eclipse.e4.rcp/feature.xml b/features/org.eclipse.e4.rcp/feature.xml index d9657478cde..de878543f22 100644 --- a/features/org.eclipse.e4.rcp/feature.xml +++ b/features/org.eclipse.e4.rcp/feature.xml @@ -220,6 +220,20 @@ arch="x86_64" version="0.0.0"/> + + + + + + + + 4.0.0 @@ -90,6 +91,8 @@ + + diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationLinux.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationUnix.java similarity index 98% rename from tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationLinux.java rename to tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationUnix.java index 7f89af3dbd5..a856f1052f3 100644 --- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationLinux.java +++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationUnix.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018 SAP SE and others. + * Copyright (c) 2018, 2025 SAP SE 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 @@ -7,6 +7,7 @@ * * Contributors: * SAP SE - initial version + * Tue Ton - support for FreeBSD *******************************************************************************/ package org.eclipse.urischeme.internal.registration; @@ -32,7 +33,7 @@ import org.junit.BeforeClass; import org.junit.Test; -public class TestUnitRegistrationLinux { +public class TestUnitRegistrationUnix { private static final String PRODUCT_NAME = "myProduct"; private static final String USER_HOME = System.getProperty("user.home"); @@ -68,7 +69,7 @@ public void setup() { System.setProperty(ECLIPSE_HOME_LOCATION, "file:/home/myuser/Eclipse/"); System.setProperty(ECLIPSE_LAUNCHER, "/home/myuser/Eclipse/Eclipse"); - registration = new RegistrationLinux(fileProvider, processStub, PRODUCT_NAME); + registration = new RegistrationUnix(fileProvider, processStub, PRODUCT_NAME); } @BeforeClass diff --git a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java index fb9638b51c2..990a3655f92 100644 --- a/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java +++ b/tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/suite/AllUnitTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018 SAP SE and others. + * Copyright (c) 2018, 2025 SAP SE and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,6 +10,7 @@ * * Contributors: * SAP SE - initial version + * Tue Ton - support for FreeBSD *******************************************************************************/ package org.eclipse.urischeme.suite; @@ -17,8 +18,8 @@ import org.eclipse.urischeme.internal.UriSchemeProcessorUnitTest; import org.eclipse.urischeme.internal.registration.TestUnitDesktopFileWriter; import org.eclipse.urischeme.internal.registration.TestUnitPlistFileWriter; -import org.eclipse.urischeme.internal.registration.TestUnitRegistrationLinux; import org.eclipse.urischeme.internal.registration.TestUnitRegistrationMacOsX; +import org.eclipse.urischeme.internal.registration.TestUnitRegistrationUnix; import org.eclipse.urischeme.internal.registration.TestUnitRegistrationWindows; import org.eclipse.urischeme.internal.registration.TestUnitRegistryWriter; import org.eclipse.urischeme.internal.registration.TestUnitWinRegistry; @@ -31,7 +32,7 @@ TestUnitPlistFileWriter.class, // TestUnitDesktopFileWriter.class, // TestUnitRegistrationMacOsX.class, // - TestUnitRegistrationLinux.class, // + TestUnitRegistrationUnix.class, // TestUnitRegistrationWindows.class, // TestUnitRegistryWriter.class, // TestUnitWinRegistry.class, //