From 87c974189f0959f8b0b26f9e67afda518f9a1243 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 15 Apr 2025 10:10:13 +0200 Subject: [PATCH 01/11] Adding main branch info --- README.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.adoc b/README.adoc index 514fe090..d1133cc2 100644 --- a/README.adoc +++ b/README.adoc @@ -2,6 +2,10 @@ This is the example code for the https://learn.vogella.com/courses/details/rich-client-platform[Eclipse RCP commercial training] from vogella GmbH. It is also used in the http://www.vogella.com/books/eclipsercp.html[Eclipse Rich Client Platform book]. +=== Default branch + +_main_ is the default branch of this repository. +It contains the latest stable version of the code. === Running the application From d0a9d1dee821f4dab8328ce0172e7c427fd282ac Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 29 Apr 2025 10:25:22 +0200 Subject: [PATCH 02/11] ImageWithText added --- com.vogella.swt.widgets/image/vogella.svg | 1959 +++++++++++++++++ .../vogella/swt/widgets/ImageWithText.java | 50 + 2 files changed, 2009 insertions(+) create mode 100644 com.vogella.swt.widgets/image/vogella.svg create mode 100644 com.vogella.swt.widgets/src/com/vogella/swt/widgets/ImageWithText.java diff --git a/com.vogella.swt.widgets/image/vogella.svg b/com.vogella.swt.widgets/image/vogella.svg new file mode 100644 index 00000000..c9797435 --- /dev/null +++ b/com.vogella.swt.widgets/image/vogella.svg @@ -0,0 +1,1959 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.vogella.swt.widgets/src/com/vogella/swt/widgets/ImageWithText.java b/com.vogella.swt.widgets/src/com/vogella/swt/widgets/ImageWithText.java new file mode 100644 index 00000000..063c760a --- /dev/null +++ b/com.vogella.swt.widgets/src/com/vogella/swt/widgets/ImageWithText.java @@ -0,0 +1,50 @@ +package com.vogella.swt.widgets; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Canvas; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; + +public class ImageWithText extends Canvas { + + private Image image; + + public ImageWithText(Composite parent, int style) { + super(parent, style); + Display display = parent.getDisplay(); + image = new Image(parent.getDisplay(), ImageWithText.class.getResourceAsStream("/image/vogella.svg")); + + // Add PaintListener to draw image and text + this.addPaintListener(new PaintListener() { + public void paintControl(PaintEvent e) { + Rectangle bounds = image.getBounds(); + e.gc.drawImage(image, 0, 0); + + // Set text properties + e.gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); + e.gc.setFont(display.getSystemFont()); + + String text = "Advanced Trainings"; + Point textSize = e.gc.textExtent(text); + + // Draw text centered at the top of the image + int x = (bounds.width - textSize.x) / 2; + int y = 20; + + e.gc.drawText(text, x, y, true); + } + }); + + + } + @Override + public void dispose() { + image.dispose(); + super.dispose(); + } +} From 9a555aa08267a87d71a2f300dfa114b6859aff92 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Fri, 23 May 2025 12:31:57 +0200 Subject: [PATCH 03/11] Adding the spies --- target-platform/target-platform.target | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-platform/target-platform.target b/target-platform/target-platform.target index 2dec207b..a8b02976 100644 --- a/target-platform/target-platform.target +++ b/target-platform/target-platform.target @@ -11,6 +11,10 @@ + + + + From f8728b3435b0e2f6926657ea7d6cbd25d1ebb549 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Fri, 23 May 2025 12:32:25 +0200 Subject: [PATCH 04/11] Update to 2025-06 --- target-platform/target-platform.target | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-platform/target-platform.target b/target-platform/target-platform.target index a8b02976..73a0a062 100644 --- a/target-platform/target-platform.target +++ b/target-platform/target-platform.target @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + From 1b829864702ed2eb4eb3e767bb36c5af9354c5ec Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Mon, 16 Jun 2025 18:44:51 +0200 Subject: [PATCH 05/11] Update of Tycho and SWTBot example --- .github/workflows/maven.yml | 8 +++- .mvn/extensions.xml | 2 +- com.example.e4.swtbot.tests/.classpath | 7 +++ com.example.e4.swtbot.tests/.project | 45 +++++++++++++++++++ .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 9 ++++ .../.settings/org.eclipse.m2e.core.prefs | 4 ++ .../META-INF/MANIFEST.MF | 15 +++++++ com.example.e4.swtbot.tests/build.properties | 6 +++ .../e4/swtbottests/ExitHandlerTest.java | 45 +++++++++++++++++++ pom.xml | 22 ++++++--- target-platform/target-platform.target | 9 ++++ 12 files changed, 166 insertions(+), 8 deletions(-) create mode 100644 com.example.e4.swtbot.tests/.classpath create mode 100644 com.example.e4.swtbot.tests/.project create mode 100644 com.example.e4.swtbot.tests/.settings/org.eclipse.core.resources.prefs create mode 100644 com.example.e4.swtbot.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 com.example.e4.swtbot.tests/.settings/org.eclipse.m2e.core.prefs create mode 100644 com.example.e4.swtbot.tests/META-INF/MANIFEST.MF create mode 100644 com.example.e4.swtbot.tests/build.properties create mode 100644 com.example.e4.swtbot.tests/src/com/example/e4/swtbottests/ExitHandlerTest.java diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a8f6396d..07334bb7 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -7,7 +7,6 @@ on: push: branches: [ master ] pull_request: - branches: [ master ] jobs: build: @@ -27,6 +26,13 @@ jobs: uses: stCarolas/setup-maven@v4.5 with: maven-version: '3.9.7' + - name: Start Xvfb + run: | + sudo apt-get update + sudo apt-get install -y xvfb + Xvfb :99 -screen 0 1920x1080x24 & + export DISPLAY=:99 + echo "DISPLAY=:99" >> $GITHUB_ENV - name: Build with Maven run: mvn clean verify -ntp - uses: "marvinpinto/action-automatic-releases@latest" diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 7cb2ea01..7c08e987 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -2,6 +2,6 @@ org.eclipse.tycho tycho-build - 4.0.12 + 4.0.13 \ No newline at end of file diff --git a/com.example.e4.swtbot.tests/.classpath b/com.example.e4.swtbot.tests/.classpath new file mode 100644 index 00000000..375961e4 --- /dev/null +++ b/com.example.e4.swtbot.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.example.e4.swtbot.tests/.project b/com.example.e4.swtbot.tests/.project new file mode 100644 index 00000000..93d71d5e --- /dev/null +++ b/com.example.e4.swtbot.tests/.project @@ -0,0 +1,45 @@ + + + com.example.e4.swtbot.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + + + 1749802401051 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/com.example.e4.swtbot.tests/.settings/org.eclipse.core.resources.prefs b/com.example.e4.swtbot.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/com.example.e4.swtbot.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/com.example.e4.swtbot.tests/.settings/org.eclipse.jdt.core.prefs b/com.example.e4.swtbot.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..23fa13b1 --- /dev/null +++ b/com.example.e4.swtbot.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 +org.eclipse.jdt.core.compiler.compliance=21 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=21 diff --git a/com.example.e4.swtbot.tests/.settings/org.eclipse.m2e.core.prefs b/com.example.e4.swtbot.tests/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/com.example.e4.swtbot.tests/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/com.example.e4.swtbot.tests/META-INF/MANIFEST.MF b/com.example.e4.swtbot.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000..1ed32a33 --- /dev/null +++ b/com.example.e4.swtbot.tests/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Swtbottests +Bundle-SymbolicName: com.example.e4.swtbot.tests +Bundle-Version: 1.0.0.qualifier +Import-Package: org.junit.jupiter.api;version="5.12.2" +Bundle-Vendor: EXAMPLE +Require-Bundle: org.eclipse.swt, + org.eclipse.jface, + org.eclipse.swtbot.e4.finder;bundle-version="4.3.0", + org.eclipse.swtbot.swt.finder;bundle-version="4.3.0", + org.slf4j.api;bundle-version="1.7.30", + com.example.e4.rcp;bundle-version="1.0.0" +Automatic-Module-Name: com.example.e4.swtbottests +Bundle-RequiredExecutionEnvironment: JavaSE-21 diff --git a/com.example.e4.swtbot.tests/build.properties b/com.example.e4.swtbot.tests/build.properties new file mode 100644 index 00000000..6fd464a8 --- /dev/null +++ b/com.example.e4.swtbot.tests/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . +pom.model.property.tycho.surefire.useUIHarness = true +pom.model.property.tycho.surefire.useUIThread = true \ No newline at end of file diff --git a/com.example.e4.swtbot.tests/src/com/example/e4/swtbottests/ExitHandlerTest.java b/com.example.e4.swtbot.tests/src/com/example/e4/swtbottests/ExitHandlerTest.java new file mode 100644 index 00000000..9d52a482 --- /dev/null +++ b/com.example.e4.swtbot.tests/src/com/example/e4/swtbottests/ExitHandlerTest.java @@ -0,0 +1,45 @@ +package com.example.e4.swtbottests; + + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.eclipse.swtbot.swt.finder.SWTBot; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ExitHandlerTest { + + private static SWTBot bot; + + @BeforeEach + public void beforeClass() throws Exception { + // don't use SWTWorkbenchBot here which relies on Platform 3.x + bot = new SWTBot(); + } + + @Test + public void executeExit() { + SWTBotMenu fileMenu = bot.menu("File"); + assertNotNull(fileMenu); + SWTBotMenu exitMenu = fileMenu.menu("Quit"); + assertNotNull(exitMenu); + exitMenu.click(); + + SWTBotShell shell = bot.shell("Confirmation"); + SWTBot childBot = new SWTBot(shell.widget); + SWTBotButton button = childBot.button("Cancel"); + assertTrue(button.isEnabled()); + button.click(); + } + + + +// @AfterEach +// public void sleep() { +// bot.sleep(2000); +// } +} diff --git a/pom.xml b/pom.xml index 10bc8a8c..428a7c1c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ pom - 4.0.12 + 4.0.13 UTF-8 @@ -85,17 +85,28 @@ + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + org.eclipse.e4.ui.workbench.swt.E4Application + com.example.e4.rcp.product + + + - com.example.e4.rcp com.example.e4.feature - com.example.e4.product - --> + + com.example.e4.product com.vogella.swt.widgets com.vogella.tasks.ui com.example.e4.renderer.swt @@ -110,9 +121,8 @@ com.vogella.eclipse.css com.vogella.osgi.taskconsumer updatesite - \ No newline at end of file diff --git a/target-platform/target-platform.target b/target-platform/target-platform.target index 73a0a062..eb2c2e2e 100644 --- a/target-platform/target-platform.target +++ b/target-platform/target-platform.target @@ -11,14 +11,23 @@ + + + + + + + + From 3aed968554faf04acd5e46dcbb4445762a4c0651 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Sun, 6 Jul 2025 17:58:51 +0200 Subject: [PATCH 06/11] Adds Dark theme to application --- com.vogella.eclipse.css/css/dark.css | 68 ++++++++++++++++++++++++++++ com.vogella.eclipse.css/plugin.xml | 5 ++ 2 files changed, 73 insertions(+) create mode 100644 com.vogella.eclipse.css/css/dark.css diff --git a/com.vogella.eclipse.css/css/dark.css b/com.vogella.eclipse.css/css/dark.css new file mode 100644 index 00000000..82173363 --- /dev/null +++ b/com.vogella.eclipse.css/css/dark.css @@ -0,0 +1,68 @@ +#org-eclipse-ui-editorss { + swt-tab-height: 8px; +} + +.MPartStack { + font-family: 'Segoe UI', sans-serif; +} + +CTabFolder { + color: #bbbbbb; /* Inactive tab text */ + swt-tab-outline: #2a2a2a; /* Border color for selected tab */ + swt-outer-keyline-color: #3a3a3a; /* Border color for the tabs container */ + swt-unselected-tabs-color: #2e2e2e #252525 100% 100%; /* Background for unselected tabs */ + swt-selected-tab-fill: #3d3d3d; /* Background for selected tab */ + swt-unselected-hot-tab-color-background: #161616; /* Hovered tab background */ + swt-selected-tab-highlight: none; +} + +CTabFolder[style~='SWT.DOWN'][style~='SWT.BOTTOM'] { + swt-unselected-hot-tab-color-background: #161616; + swt-selected-tab-highlight: #316c9b; + swt-selected-highlight-top: false; +} + +CTabFolder.active { + swt-selected-tab-highlight: #316c9b; + swt-selected-highlight-top: false; +} + +CTabItem, +CTabItem CLabel { + background-color: #3d3d3d; + color: #999999; /* Inactive, unselected tab text */ +} + +CTabItem:selected, +CTabItem:selected CLabel { + color: #ffffff; /* Selected tab text */ +} + +.MPartStack.active > CTabItem, +.MPartStack.active > CTabItem CLabel { + background-color: #3d3d3d; + color: #cccccc; /* Active, unselected tab text */ +} + +.MPartStack.active > CTabItem:selected, +.MPartStack.active > CTabItem:selected CLabel { + color: #ffffff; /* Active, selected tab text */ +} + +.MPartStack.active.noFocus > CTabItem:selected { + color: #aaaaaa; /* Selected but no focus */ +} + +CTabFolder > Composite#ToolbarComposite { + background-color: #3d3d3d; +} + +CTabFolder.MArea CTabItem, +CTabFolder.MArea CTabItem CLabel { + background-color: #1e1e1e; /* Dark background fallback */ +} + +CTabItem.busy { + color: #888888; +} + diff --git a/com.vogella.eclipse.css/plugin.xml b/com.vogella.eclipse.css/plugin.xml index 33f15f35..43221efe 100644 --- a/com.vogella.eclipse.css/plugin.xml +++ b/com.vogella.eclipse.css/plugin.xml @@ -13,6 +13,11 @@ id="com.vogella.eclipse.css.rainbow" label="Rainbow"> + + From ae2939c42d924c83d9ae704c3fe98b1e8d93eb68 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Sun, 6 Jul 2025 18:08:21 +0200 Subject: [PATCH 07/11] Removes outdated features --- com.vogella.tasks.product/taskmanagement.product | 2 -- 1 file changed, 2 deletions(-) diff --git a/com.vogella.tasks.product/taskmanagement.product b/com.vogella.tasks.product/taskmanagement.product index 57d123c9..c64e535f 100644 --- a/com.vogella.tasks.product/taskmanagement.product +++ b/com.vogella.tasks.product/taskmanagement.product @@ -34,8 +34,6 @@ - - From bd9563923b6586c42fc70137324f927b4350371e Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Sun, 6 Jul 2025 18:09:14 +0200 Subject: [PATCH 08/11] Changes imageWithText to svg example --- com.vogella.swt.widgets/image/vogella.svg | 477 +++++++++--------- .../vogella/swt/widgets/ImageWithText.java | 7 +- 2 files changed, 251 insertions(+), 233 deletions(-) diff --git a/com.vogella.swt.widgets/image/vogella.svg b/com.vogella.swt.widgets/image/vogella.svg index c9797435..94bef741 100644 --- a/com.vogella.swt.widgets/image/vogella.svg +++ b/com.vogella.swt.widgets/image/vogella.svg @@ -11,11 +11,11 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.2" - width="17007.873" - height="2480.3149" + width="218.3" + height="74.849998" id="svg3087" inkscape:version="0.48.3.1 r9886" - sodipodi:docname="Footer.svg"> + sodipodi:docname="CL_Black.svg"> + fit-margin-bottom="0" /> + - - - + style="fill:#000000;fill-opacity:1" + id="g3046" + transform="matrix(0.35903722,0,0,0.35903722,7.1420749,3.3005516)"> + - - - - - - + style="fill:#000000;fill-opacity:1" + id="g3051" + transform="matrix(5.2741029,0,0,5.9924697,2.3895157,1.9510837)"> - + inkscape:connector-curvature="0" + style="fill:#000000;fill-opacity:1;stroke:none" + id="path4005-1" + d="m 15.586297,0.00133333 c 0.137192,-0.003 0.275658,0 0.413711,0 C 24.834343,0.00133333 32,6.3662633 32,14.223833 c 0,6.13871 -4.372629,11.3702 -10.49896,13.36428 l 1.067766,-5.66022 c 0.317473,-0.14663 0.584487,-0.32272 0.900073,-0.49111 0.231525,-0.13821 0.456623,-0.2799 0.676453,-0.43159 0.219837,-0.15169 0.429915,-0.31171 0.63732,-0.47624 0.207393,-0.16451 0.409549,-0.33427 0.603771,-0.51095 0.194203,-0.17668 0.384355,-0.36247 0.564628,-0.55064 0.180295,-0.18818 0.354311,-0.3814 0.519927,-0.58041 0.165616,-0.19901 0.319413,-0.40099 0.469606,-0.61017 0.150196,-0.2092 0.296435,-0.42621 0.430465,-0.6449 0.134026,-0.2187 0.257449,-0.44216 0.374565,-0.66971 0.117114,-0.22755 0.224788,-0.45877 0.324246,-0.6945 0.09946,-0.23573 0.192873,-0.47606 0.273929,-0.71932 0.08107,-0.24325 0.150521,-0.48903 0.212448,-0.73914 0.06191,-0.25013 0.114503,-0.50269 0.15654,-0.759 0.04202,-0.25632 0.07365,-0.51699 0.09504,-0.77884 0.02139,-0.26185 0.03353,-0.52204 0.03353,-0.78877 0,-5.9571797 -5.428055,-10.7946097 -12.125791,-10.7946097 -6.697716,0 -12.1313676,4.83743 -12.1313676,10.7946097 0,3.71665 2.1170569,6.9856 5.3333244,8.92442 1.4045562,0.88504 4.4144762,-5.54068 3.9077652,-5.68008 l -0.497553,0.15875 c 0.0452,-0.92557 -0.145309,-1.179 0.452813,-1.45847 0,0 -4.0996849,1.90429 -4.539472,1.23028 -0.3055672,-0.46831 3.902175,-3.4775 3.902175,-3.4775 0,0 -0.43892,-3.0544897 -3.3543029,-4.3555497 -0.025472,-0.36585 1.1183449,-0.35176 1.5317969,-0.34229 3.099464,0.0711 5.847652,2.41589 5.847652,2.41589 0,0 5.068235,-2.22577 5.640816,-1.72138 0.569725,0.50188 -3.969244,3.7354497 -3.969244,3.7354497 0.37827,0.3364 0.903239,0.79342 1.341708,1.15089 l -0.65967,0.47624 c 0.204774,0.4772 0.477871,0.68047 0.771479,1.21042 0.09248,0.1669 -0.471683,0.63181 -0.760303,0.83341 1.278224,0.12925 1.607682,-1.13304 2.057295,-1.57752 0.235359,-0.31027 0.620613,0.0306 0.676454,-0.38694 0.09491,-0.70956 0.05185,-1.05722 -0.07266,-1.23523 l 0.729328,0.09315 0.746561,0.09536 c -0.16485,0.12236 -0.404081,0.85916 -0.436057,1.26995 0.3895,0.0607 0.115119,0.0351 0.245978,0.0744 0.275665,0.0716 0.478325,0.19828 0.251573,0.49608 -0.294699,0.38702 -0.10514,1.18681 -0.486377,1.18561 l -0.273945,0.01 -0.832976,6.29025 -0.0055,0.0348 -0.916841,5.74457 c -0.0055,0.002 -0.01127,0.003 -0.0168,0.005 l -0.240379,1.61225 -0.430485,2.70361 c -0.464701,0.0259 -0.827044,-0.23781 -0.793832,-0.88302 l 0.692521,-5.04653 c 0.130383,-0.81803 0.20749,-1.39837 0.03217,-1.92043 0.144682,1.8206 -1.502751,3.77252 -2.379502,4.23359 -2.178599,0.85304 -9.4185227,0.78987 -14.1327806,-3.41797 0.8358541,-0.37072 3.1568211,-0.93145 4.3494126,-1.87516 -1.1585628,0.64444 -3.0643446,1.11678 -3.9301233,0.88797 C 1.6647967,21.430223 0,18.001723 0,14.223863 0,6.4890733 6.9428021,0.19606333 15.586312,0.00136333 z" /> + inkscape:connector-curvature="0" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path2995" + transform="matrix(0.85294123,0,0,0.38235296,1.7509106,8.419738)" + d="m 26.41305,10.26018 a 1.7270072,1.7270072 0 1 1 -3.454014,0 1.7270072,1.7270072 0 1 1 3.454014,0 z" /> - + + + + + + + + + + diff --git a/com.vogella.swt.widgets/src/com/vogella/swt/widgets/ImageWithText.java b/com.vogella.swt.widgets/src/com/vogella/swt/widgets/ImageWithText.java index 063c760a..55c3da14 100644 --- a/com.vogella.swt.widgets/src/com/vogella/swt/widgets/ImageWithText.java +++ b/com.vogella.swt.widgets/src/com/vogella/swt/widgets/ImageWithText.java @@ -17,16 +17,17 @@ public class ImageWithText extends Canvas { public ImageWithText(Composite parent, int style) { super(parent, style); Display display = parent.getDisplay(); - image = new Image(parent.getDisplay(), ImageWithText.class.getResourceAsStream("/image/vogella.svg")); + image = new Image(parent.getDisplay(), ImageWithText.class.getResourceAsStream("/image/vogella.svg")); // Add PaintListener to draw image and text this.addPaintListener(new PaintListener() { - public void paintControl(PaintEvent e) { + @Override + public void paintControl(PaintEvent e) { Rectangle bounds = image.getBounds(); e.gc.drawImage(image, 0, 0); // Set text properties - e.gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); + e.gc.setForeground(display.getSystemColor(SWT.COLOR_RED)); e.gc.setFont(display.getSystemFont()); String text = "Advanced Trainings"; From efad62b128fc7042968a980441ec19e55f91d1bc Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Sun, 6 Jul 2025 18:09:33 +0200 Subject: [PATCH 09/11] use Dark theme as default --- com.vogella.tasks.ui/plugin.xml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/com.vogella.tasks.ui/plugin.xml b/com.vogella.tasks.ui/plugin.xml index f1b683c0..7aada3ca 100644 --- a/com.vogella.tasks.ui/plugin.xml +++ b/com.vogella.tasks.ui/plugin.xml @@ -10,13 +10,29 @@ application="org.eclipse.e4.ui.workbench.swt.E4Application"> + value="to-do"> + value="com.vogella.eclipse.css.dark"> + + + + + + + + + + From d9329b0ebe6ece9a17e77b728de77d0158f3cc30 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Sun, 6 Jul 2025 18:09:56 +0200 Subject: [PATCH 10/11] Svg usage and some smaller changes --- com.vogella.tasks.ui/Application.e4xmi | 20 +++++++++----- com.vogella.tasks.ui/META-INF/MANIFEST.MF | 2 +- com.vogella.tasks.ui/images/playground.svg | 1 + com.vogella.tasks.ui/images/task-detail.svg | 1 + com.vogella.tasks.ui/images/task-overview.svg | 1 + .../tasks/ui/expressions/CheckSelection.java | 27 +++++++++++++++++++ 6 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 com.vogella.tasks.ui/images/playground.svg create mode 100644 com.vogella.tasks.ui/images/task-detail.svg create mode 100644 com.vogella.tasks.ui/images/task-overview.svg create mode 100644 com.vogella.tasks.ui/src/com/vogella/tasks/ui/expressions/CheckSelection.java diff --git a/com.vogella.tasks.ui/Application.e4xmi b/com.vogella.tasks.ui/Application.e4xmi index d28eed54..f42aba80 100644 --- a/com.vogella.tasks.ui/Application.e4xmi +++ b/com.vogella.tasks.ui/Application.e4xmi @@ -1,29 +1,26 @@ - + NoAutoCollapse - + - - - - + - + @@ -54,6 +51,15 @@ + + + + + + + + + diff --git a/com.vogella.tasks.ui/META-INF/MANIFEST.MF b/com.vogella.tasks.ui/META-INF/MANIFEST.MF index ef456d45..6e9c2c98 100644 --- a/com.vogella.tasks.ui/META-INF/MANIFEST.MF +++ b/com.vogella.tasks.ui/META-INF/MANIFEST.MF @@ -27,5 +27,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-21 Automatic-Module-Name: com.vogella.tasks.ui Import-Package: com.vogella.swt.widgets, jakarta.annotation, - jakarta.inject + jakarta.inject;version="[2.0.0,3.0.0)" Require-Capability: osgi.service;filter:="(objectClass=com.vogella.tasks.model.TaskService)" diff --git a/com.vogella.tasks.ui/images/playground.svg b/com.vogella.tasks.ui/images/playground.svg new file mode 100644 index 00000000..11bea1d1 --- /dev/null +++ b/com.vogella.tasks.ui/images/playground.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/com.vogella.tasks.ui/images/task-detail.svg b/com.vogella.tasks.ui/images/task-detail.svg new file mode 100644 index 00000000..48f26275 --- /dev/null +++ b/com.vogella.tasks.ui/images/task-detail.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/com.vogella.tasks.ui/images/task-overview.svg b/com.vogella.tasks.ui/images/task-overview.svg new file mode 100644 index 00000000..ae8ae68f --- /dev/null +++ b/com.vogella.tasks.ui/images/task-overview.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/com.vogella.tasks.ui/src/com/vogella/tasks/ui/expressions/CheckSelection.java b/com.vogella.tasks.ui/src/com/vogella/tasks/ui/expressions/CheckSelection.java new file mode 100644 index 00000000..fac84e04 --- /dev/null +++ b/com.vogella.tasks.ui/src/com/vogella/tasks/ui/expressions/CheckSelection.java @@ -0,0 +1,27 @@ +package com.vogella.tasks.ui.expressions; + +import org.eclipse.e4.core.di.annotations.Evaluate; +import org.eclipse.e4.core.di.annotations.Optional; + +import com.vogella.tasks.model.Task; + +import jakarta.inject.Named; + +import java.util.Collection; + +public class CheckSelection { + @Evaluate + public boolean evaluate(@Optional @Named("org.eclipse.ui.selection") Object o) { + if (o instanceof Task) { + return true; + } + if (o instanceof Collection) { + for (Object item : (Collection) o) { + if (item instanceof Task) { + return true; + } + } + } + return false; + } +} From d1fcd971122f7660f18564c59db4227d3345238c Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 8 Jul 2025 16:04:10 +0200 Subject: [PATCH 11/11] Include svg files into the build --- com.vogella.tasks.ui/build.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.vogella.tasks.ui/build.properties b/com.vogella.tasks.ui/build.properties index 19b960b8..0fabeedf 100644 --- a/com.vogella.tasks.ui/build.properties +++ b/com.vogella.tasks.ui/build.properties @@ -2,5 +2,6 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ - Application.e4xmi + Application.e4xmi,\ + images/ source.. = src/