Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ jobs:
if: github.ref == 'refs/heads/main'

swtbot:
runs-on: windows-latest
runs-on: ubuntu-latest
needs:
- java
permissions:
Expand Down Expand Up @@ -318,6 +318,13 @@ jobs:
path: ~/.m2/repository
key: ${{ runner.os }}-m2repo-${{ hashFiles('**/java/bundles/org.eclipse.set.releng.target/org.eclipse.set.releng.target.target', 'pom.xml') }}
restore-keys: ${{ runner.os }}-m2repo-

- name: Install xvfb + GTK
run: |
sudo apt-get update
sudo apt-get install -y xvfb libgtk-3-0 libgtk2.0-0
export DISPLAY=:99
Xvfb :99 -screen 0 1920x1080x24 &

- name: Run Test
id: test-steps
Expand All @@ -327,6 +334,7 @@ jobs:
if [[ "${{ github.event_name }}" == "pull_request" || "${{github.ref}}" == refs/heads/release/* ]]; then
m2RepoPath="file://${{ env.DEPLOY_DIR }}"
fi
export DISPLAY=:99
mvn -T 1.5C -U -B -f java-test/pom.xml clean verify \
--settings ./.github/settings.xml \
-Dskip-test=false \
Expand Down
5 changes: 5 additions & 0 deletions java-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,16 @@ public interface ToolboxProperties {
public static final String TMP_BASE_DIR = "toolbox.tmpdir";

/**
* Property key for the default directory of the toolbox application.
* Property key for the default directory of the toolbox application on
* windows.
*/
public static final String TOOLBOX_DEFAULT_DIRECTORY = "toolbox.defaultdir";
public static final String TOOLBOX_DEFAULT_DIRECTORY_WIN = "toolbox.defaultdir.win";

/**
* Property key for the default directory of the toolbox application on
* linux.
*/
public static final String TOOLBOX_DEFAULT_DIRECTORY_LINUX = "toolbox.defaultdir.linux";

/**
* Property key for the default NatTable line height.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (c) 2025 DB InfraGO AG and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
*/
package org.eclipse.set.basis.constants;

/**
* The supported os
*
* @author truong
*/
public enum ToolboxOS {
/**
* Windows
*/
WIN,
/**
* Linux
*/
LINUX
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
50463
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,17 @@ protected void loadConfiguration() {
/* */});
configuration = (UserConfiguration) objectReader
.readValue(configurationFile);
configuration.lastOpenFiles.removeIf(p -> !p.toFile().exists());
configuration.lastOpenCompareFiles
.removeIf(p -> !p.toFile().exists());
if (configuration.lastOpenFiles != null
&& !configuration.lastOpenFiles.isEmpty()) {
configuration.lastOpenFiles.removeIf(p -> !p.toFile().exists());
}

if (configuration.lastOpenCompareFiles != null
&& !configuration.lastOpenCompareFiles.isEmpty()) {
configuration.lastOpenCompareFiles
.removeIf(p -> !p.toFile().exists());
}

saveConfiguration();
} catch (final IOException e) {
// If the configuration isn't valid, create a new one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.eclipse.set.basis.ProjectInitializationData;
import org.eclipse.set.basis.Wrapper;
import org.eclipse.set.basis.constants.ToolboxConstants;
import org.eclipse.set.basis.constants.ToolboxOS;
import org.eclipse.set.basis.exceptions.ErrorStatus;
import org.eclipse.set.basis.extensions.PathExtensions;
import org.eclipse.set.basis.files.ToolboxFileFilter;
Expand All @@ -46,6 +47,7 @@
import org.eclipse.set.core.services.dialog.DialogService;
import org.eclipse.set.core.services.files.ToolboxFileService;
import org.eclipse.set.custom.extensions.FileDialogExtensions;
import org.eclipse.set.utils.ToolboxConfiguration;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
Expand Down Expand Up @@ -581,8 +583,12 @@ public void openDirectoryAfterExport(final Shell shell, final Path path) {
messages.DialogService_OpenDirectoryAfterExport_ShowDir);
if (result == 1) {
try {
final String openExplorerCmd = ToolboxConfiguration
.getCurrentOS() == ToolboxOS.LINUX ? "nautilus" //$NON-NLS-1$
: "explorer"; //$NON-NLS-1$
Runtime.getRuntime()
.exec(new String[] { "explorer", path.toString() }); //$NON-NLS-1$
.exec(new String[] { openExplorerCmd,
path.toString() });
} catch (final IOException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,9 @@ private boolean forceFocusAndShowPart(final String id) {
final Wrapper<Boolean> result = new Wrapper<>();
final List<MWindow> windows = application.getChildren();
final MWindow mWindow = windows.get(0);

Display.getDefault().syncExec(() -> {
((org.eclipse.swt.widgets.Shell) mWindow.getWidget()).forceFocus();
mWindow.getContext().activate();
showPartImpl(id);
result.setValue(Boolean.valueOf(true));
broker.post(UIEvents.REQUEST_ENABLEMENT_UPDATE_TOPIC,
Expand Down
2 changes: 1 addition & 1 deletion java/bundles/org.eclipse.set.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
label="Eclipse Signalling Engineering Toolbox Feature"
version="2.6.0.qualifier"
provider-name="Eclipse Signalling Engineering Toolbox"
os="win32">
os="linux,win32">

<description>
Eclipse Signalling Engineering Toolbox main feature, containing the entirety of the toolbox.
Expand Down
Loading
Loading