Skip to content

Commit 4c2135d

Browse files
committed
1 parent 73ea7e9 commit 4c2135d

File tree

16 files changed

+122
-38
lines changed

16 files changed

+122
-38
lines changed

bundles/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/BrowserInformationControl.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2018 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
13+
* Tue Ton - support for FreeBSD
1314
*******************************************************************************/
1415
package org.eclipse.jface.internal.text.html;
1516

@@ -294,7 +295,7 @@ public void setInput(Object input) {
294295

295296
String scrollbarStyle= "overflow:scroll;"; //$NON-NLS-1$
296297
// workaround for bug 546870, don't use a horizontal scrollbar on Linux as its broken for GTK3 and WebKit
297-
if (Util.isLinux()) {
298+
if (Util.isLinux() || Util.isFreeBSD()) {
298299
scrollbarStyle= "word-wrap:break-word;"; //$NON-NLS-1$
299300
}
300301
// The default "overflow:auto" would not result in a predictable width for the client area

bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2015 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
13+
* Tue Ton - support for FreeBSD
1314
*******************************************************************************/
1415

1516
package org.eclipse.jface.util;
@@ -562,6 +563,16 @@ public static boolean isMac() {
562563
return WS_CARBON.equals(ws) || WS_COCOA.equals(ws);
563564
}
564565

566+
/**
567+
* Common WS query helper method.
568+
* @return <code>true</code> for FreeBSD platform
569+
* @since 3.5
570+
*/
571+
public static boolean isFreeBSD() {
572+
final String ws = SWT.getPlatform();
573+
return WS_GTK.equals(ws);
574+
}
575+
565576
/**
566577
* Common WS query helper method.
567578
* @return <code>true</code> for linux platform

bundles/org.eclipse.ui.browser/plugin.xml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<?eclipse version="3.0"?>
33
<!--
4-
Copyright (c) 2005, 2015 IBM Corporation and others.
4+
Copyright (c) 2005, 2025 IBM Corporation and others.
55
66
This program and the accompanying materials
77
are made available under the terms of the Eclipse Public License 2.0
@@ -14,6 +14,7 @@
1414
IBM Corporation - initial API and implementation
1515
Martin Oberhuber (Wind River) - [292882] Default Browser on Solaris
1616
Martin Oberhuber (Wind River) - [293175] Default external web browser not found when running 32-bit Eclipse on 64-bit Ubuntu 9.04
17+
Tue Ton - support for FreeBSD
1718
-->
1819

1920
<plugin>
@@ -94,7 +95,7 @@
9495
<browser
9596
id="org.eclipse.ui.browser.firefox"
9697
name="%browserFirefox"
97-
os="linux,aix,hpux,solaris"
98+
os="freebsd,linux,aix,hpux,solaris"
9899
executable="firefox"
99100
factoryclass="org.eclipse.ui.internal.browser.browsers.MozillaFactory">
100101
<location>
@@ -104,28 +105,28 @@
104105
<browser
105106
id="org.eclipse.ui.browser.chrome"
106107
name="%browserChrome"
107-
os="linux,aix,hpux,solaris"
108+
os="freebsd,linux,aix,hpux,solaris"
108109
executable="google-chrome">
109110
<location>usr/bin/google-chrome</location>
110111
</browser>
111112
<browser
112113
id="org.eclipse.ui.browser.chromium"
113114
name="%browserChromium"
114-
os="linux"
115+
os="freebsd,linux"
115116
executable="chromium-browser">
116117
<location>usr/bin/chromium-browser</location>
117118
</browser>
118119
<browser
119120
id="org.eclipse.ui.browser.konqueror"
120121
name="%browserKonqueror"
121-
os="linux,aix,hpux,solaris"
122+
os="freebsd,linux,aix,hpux,solaris"
122123
executable="konqueror">
123124
<location>usr/bin/konqueror</location>
124125
</browser>
125126
<browser
126127
id="org.eclipse.ui.browser.epiphany"
127128
name="%browserEpiphany"
128-
os="linux"
129+
os="freebsd,linux"
129130
executable="epiphany">
130131
<location>
131132
usr/bin/epiphany

bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2003, 2019 IBM Corporation and others.
2+
* Copyright (c) 2003, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,6 +13,7 @@
1313
* Martin Oberhuber (Wind River) - [292882] Default Browser on Solaris
1414
* Tomasz Zarna (Tasktop Technologies) - [429546] External Browser with parameters
1515
* Christoph Läubrich - Bug 552773 - Simplify logging in platform code base
16+
* Tue Ton - support for FreeBSD
1617
*******************************************************************************/
1718
package org.eclipse.ui.internal.browser;
1819

@@ -75,6 +76,18 @@ public static boolean isLinux() {
7576
return false;
7677
}
7778

79+
/**
80+
* Returns true if we're running on FreeBSD.
81+
*
82+
* @return boolean
83+
*/
84+
public static boolean isFreeBSD() {
85+
String os = System.getProperty("os.name"); //$NON-NLS-1$
86+
if (os != null && os.toLowerCase().contains("freebsd")) //$NON-NLS-1$
87+
return true;
88+
return false;
89+
}
90+
7891
/**
7992
* Open a dialog window.
8093
*

bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TitleRegion.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2016 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
13+
* Tue Ton - support for FreeBSD
1314
*******************************************************************************/
1415
package org.eclipse.ui.internal.forms.widgets;
1516

@@ -212,6 +213,9 @@ private Point layout(Composite composite, boolean move, int x, int y,
212213
if (Constants.OS_LINUX.equalsIgnoreCase(os)) {
213214
tw += 1; // See Bug 342610
214215
}
216+
else if (Constants.OS_FREEBSD.equalsIgnoreCase(os)) {
217+
tw += 1; // See Bug 342610
218+
}
215219
if (bsize != null)
216220
tw -= bsize.x + SPACING;
217221
if (msize != null)

bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/part/ResourceTransfer.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2015 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,7 @@
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
1313
* Andrey Loskutov <[email protected]> - Bug 205678
14+
* Tue Ton - support for FreeBSD
1415
*******************************************************************************/
1516
package org.eclipse.ui.part;
1617

@@ -167,7 +168,7 @@ protected Object nativeToJava(TransferData transferData) {
167168
int count = in.readInt();
168169
if (count > MAX_RESOURCES_TO_TRANSFER) {
169170
String message = "Transfer aborted, too many resources: " + count + "."; //$NON-NLS-1$ //$NON-NLS-2$
170-
if (Util.isLinux()) {
171+
if (Util.isLinux() || Util.isFreeBSD()) {
171172
message += "\nIf you are running in x11vnc environment please consider to switch to vncserver " + //$NON-NLS-1$
172173
"+ vncviewer or to run x11vnc without clipboard support " + //$NON-NLS-1$
173174
"(use '-noclipboard' and '-nosetclipboard' arguments)."; //$NON-NLS-1$

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2013, 2016 IBM Corporation and others.
2+
* Copyright (c) 2013, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,6 +12,7 @@
1212
* IBM Corporation - initial API and implementation
1313
* Lars Vogel <[email protected]> - Bug 474273
1414
* Simon Scholz <[email protected]> - Bug 487772, 486777
15+
* Tue Ton - support for FreeBSD
1516
******************************************************************************/
1617

1718
package org.eclipse.ui.internal.ide.handlers;
@@ -97,7 +98,7 @@ public Object execute(final ExecutionEvent event) {
9798

9899
File dir = item.getWorkspace().getRoot().getLocation().toFile();
99100
Process p;
100-
if (Util.isLinux() || Util.isMac()) {
101+
if (Util.isLinux() || Util.isMac() || Util.isFreeBSD()) {
101102
p = Runtime.getRuntime().exec(new String[] { "/bin/sh", "-c", launchCmd }, null, dir); //$NON-NLS-1$ //$NON-NLS-2$
102103
} else {
103104
p = Runtime.getRuntime().exec(launchCmd, null, dir);
@@ -180,7 +181,7 @@ private String formShowInSytemExplorerCommand(File path) throws IOException {
180181
}
181182

182183
private String quotePath(String path) {
183-
if (Util.isLinux() || Util.isMac()) {
184+
if (Util.isLinux() || Util.isMac() || Util.isFreeBSD()) {
184185
// Quote for usage inside "", man sh, topic QUOTING:
185186
path = path.replaceAll("[\"$`]", "\\\\$0"); //$NON-NLS-1$ //$NON-NLS-2$
186187
}

bundles/org.eclipse.ui.themes/plugin.xml

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
id="org.eclipse.e4.ui.css.theme.e4_classic"
99
label="%theme.classic">
1010
</theme>
11+
<theme
12+
basestylesheeturi="css/e4-dark_linux.css"
13+
id="org.eclipse.e4.ui.css.theme.e4_dark"
14+
label="%theme.dark"
15+
os="freebsd">
16+
</theme>
1117
<theme
1218
basestylesheeturi="css/e4-dark_linux.css"
1319
id="org.eclipse.e4.ui.css.theme.e4_dark"
@@ -33,6 +39,12 @@
3339
label="%theme.dark"
3440
os="macosx">
3541
</theme>
42+
<theme
43+
basestylesheeturi="css/e4_default_gtk.css"
44+
id="org.eclipse.e4.ui.css.theme.e4_default"
45+
label="%theme.light"
46+
os="freebsd">
47+
</theme>
3648
<theme
3749
basestylesheeturi="css/e4_default_gtk.css"
3850
id="org.eclipse.e4.ui.css.theme.e4_default"

bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceDialog.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2019 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,6 +12,7 @@
1212
* IBM Corporation - initial API and implementation
1313
* SAP SE, [email protected] - Bug 487357: Make find dialog content scrollable
1414
* Pierre-Yves B., [email protected] - Bug 121634: [find/replace] status bar must show the string being searched when "String Not Found"
15+
* Tue Ton - support for FreeBSD
1516
*******************************************************************************/
1617
package org.eclipse.ui.texteditor;
1718

@@ -1157,7 +1158,7 @@ private void updateFindHistory() {
11571158
fFindField.removeModifyListener(fFindModifyListener);
11581159

11591160
// XXX: Workaround for Combo bug on Linux (see bug 404202 and bug 410603)
1160-
if (Util.isLinux()) {
1161+
if (Util.isLinux() || Util.isFreeBSD()) {
11611162
fFindModifyListener.ignoreNextEvent();
11621163
}
11631164

@@ -1174,7 +1175,7 @@ private void updateReplaceHistory() {
11741175
fReplaceField.removeModifyListener(fReplaceModifyListener);
11751176

11761177
// XXX: Workaround for Combo bug on Linux (see bug 404202 and bug 410603)
1177-
if (Util.isLinux()) {
1178+
if (Util.isLinux() || Util.isFreeBSD()) {
11781179
fReplaceModifyListener.ignoreNextEvent();
11791180
}
11801181

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/themes/WorkbenchThemeManager.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2004, 2017 IBM Corporation and others.
2+
* Copyright (c) 2004, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* IBM Corporation - initial API and implementation
13+
* Tue Ton - support for FreeBSD
1314
*******************************************************************************/
1415
package org.eclipse.ui.internal.themes;
1516

@@ -179,7 +180,7 @@ private synchronized void init() {
179180
private void updateThemes() {
180181
// This code was added to fix a windows specific issue, see Bug 19229
181182
// However, it's causing issues on Linux, see Bug 563001
182-
if (Util.isLinux()) {
183+
if (Util.isLinux() || Util.isFreeBSD()) {
183184
return;
184185
}
185186

bundles/org.eclipse.urischeme/src/org/eclipse/urischeme/IOperatingSystemRegistration.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
/*******************************************************************************
2-
* Copyright (c) 2018 SAP SE and others.
2+
* Copyright (c) 2018, 2025 SAP SE and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
66
* http://www.eclipse.org/legal/epl-v10.html
77
*
88
* Contributors:
99
* SAP SE - initial version
10+
* Tue Ton - support for FreeBSD
1011
*******************************************************************************/
1112
package org.eclipse.urischeme;
1213

1314
import java.util.Collection;
1415
import java.util.List;
1516

1617
import org.eclipse.core.runtime.Platform;
17-
import org.eclipse.urischeme.internal.registration.RegistrationLinux;
1818
import org.eclipse.urischeme.internal.registration.RegistrationMacOsX;
19+
import org.eclipse.urischeme.internal.registration.RegistrationUnix;
1920
import org.eclipse.urischeme.internal.registration.RegistrationWindows;
2021

2122
/**
2223
* Interface for registration or uri schemes in the different operating systems
23-
* (macOS, Linux and Windows)<br>
24+
* (macOS, Linux, FreeBSD and Windows)<br>
2425
* Call <code>getInstance()</code> to get an OS specific instance.
2526
*/
2627
public interface IOperatingSystemRegistration {
@@ -35,7 +36,9 @@ static IOperatingSystemRegistration getInstance() {
3536
if (Platform.OS_MACOSX.equals(Platform.getOS())) {
3637
return new RegistrationMacOsX();
3738
} else if (Platform.OS_LINUX.equals(Platform.getOS())) {
38-
return new RegistrationLinux();
39+
return new RegistrationUnix();
40+
} else if (Platform.OS_FREEBSD.equals(Platform.getOS())) {
41+
return new RegistrationUnix();
3942
} else if (Platform.OS_WIN32.equals(Platform.getOS())) {
4043
return new RegistrationWindows();
4144
}

0 commit comments

Comments
 (0)