Skip to content

Commit

Permalink
Integration Build for Eclipse 4.31
Browse files Browse the repository at this point in the history
- Remove slf4j from target as this doesn't supress the log message in this version
- SplashHandler workaround not needed
- Themes update
  • Loading branch information
Phillipus committed Feb 15, 2024
1 parent 55fd5eb commit feb12b6
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 69 deletions.
14 changes: 8 additions & 6 deletions com.archimatetool.editor.product/archi.target
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
<target name="Archi">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2023-12"/>
<unit id="org.eclipse.sdk.ide" version="4.30.0.I20231201-0110"/>
<unit id="org.eclipse.emf.compare.feature.group" version="3.3.23.202311200811"/>
<unit id="org.eclipse.jgit.feature.group" version="6.8.0.202311291450-r"/>
<unit id="org.eclipse.jgit.ssh.apache.feature.group" version="6.8.0.202311291450-r"/>
<repository location="https://download.eclipse.org/eclipse/updates/4.31-I-builds"/>
<unit id="org.eclipse.sdk.ide" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2024-03"/>
<unit id="org.eclipse.emf.compare.feature.group" version="0.0.0"/>
<unit id="org.eclipse.jgit.feature.group" version="0.0.0"/>
<unit id="org.eclipse.jgit.ssh.apache.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/orbit/simrel/maven-osgi/release/4.30.0"/>
<unit id="slf4j.api" version="1.7.36"/>
<unit id="org.mockito.mockito-core" version="5.7.0"/>
</location>
</locations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,18 @@
}
.MPart FormHeading > CLabel {
background-color: #505f70;
color: #E98787;
}

.MPartFormHeaderCLabelError {
color:'#org-eclipse-ui-workbench-FORM_HEADING_ERROR_COLOR';
}
.MPartFormHeaderCLabelWarning {
color:'#org-eclipse-ui-workbench-FORM_HEADING_WARNING_COLOR';
}
.MPartFormHeaderCLabelInfo {
color:'#org-eclipse-ui-workbench-FORM_HEADING_INFO_COLOR';
}

/* ------------------------------------------------------------- */

#org-eclipse-jdt-ui-SourceView StyledText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ IEclipsePreferences#org-eclipse-ui-workbench:org-eclipse-ui-themes { /* pseudo a
'org.eclipse.ui.workbench.INFORMATION_FOREGROUND=238,238,238'
'org.eclipse.ui.workbench.HOVER_BACKGROUND=52,57,61'
'org.eclipse.ui.workbench.HOVER_FOREGROUND=238,238,238'
'org.eclipse.ui.workbench.FORM_HEADING_ERROR_COLOR=255,110,110'
'org.eclipse.ui.workbench.FORM_HEADING_WARNING_COLOR=255,200,0'
'org.eclipse.ui.workbench.FORM_HEADING_INFO_COLOR=170,170,170'
'ERROR_COLOR=247,68,117'
'HYPERLINK_COLOR=111,197,238'
'INCOMING_COLOR=31,179,235'
Expand All @@ -73,4 +76,3 @@ IEclipsePreferences#org-eclipse-ui-workbench:org-eclipse-ui-themes { /* pseudo a
'org.eclipse.jface.REVISION_NEWEST_COLOR=75,44,3'
'org.eclipse.jface.REVISION_OLDEST_COLOR=154,113,61'
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
padding: 0px;
color: '#org-eclipse-ui-workbench-INACTIVE_TAB_TEXT_COLOR';
swt-draw-custom-tab-content-background: true;
swt-unselected-hot-tab-color-background:'#org-eclipse-ui-workbench-ACTIVE_TAB_BG_START';
}

.MPartStack.active {
Expand All @@ -54,6 +55,14 @@ CTabFolder.MArea {
padding: 0px;
}

CTabFolder {
swt-selected-tab-highlight: none;
}

CTabFolder.active {
swt-selected-tab-highlight: rgb(103,145,230);
swt-selected-highlight-top: false;
}

.MPartStack.active.noFocus > CTabItem:selected {
color: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_TEXT_COLOR';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,12 @@

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.Transform;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.splash.AbstractSplashHandler;

import com.archimatetool.editor.utils.PlatformUtils;

/**
* Splash Handler
*/
Expand All @@ -31,9 +25,6 @@ public SplashHandler() {
public void init(Shell shell) {
super.init(shell);

// Check for Mac bug
checkMacBackgroundImageInverted(shell);

shell.setBackgroundMode(SWT.INHERIT_FORCE);

String version = Messages.SplashHandler_0 + " " + ArchiPlugin.INSTANCE.getVersion(); //$NON-NLS-1$
Expand All @@ -47,55 +38,5 @@ public void init(Shell shell) {
e.gc.setForeground(new Color(35, 35, 140));
e.gc.drawString(version, 19, 166, true);
});
}

/**
* macOS Sonoma 14 flips background images on Control#setBackgroundImage
* See https://github.com/eclipse-platform/eclipse.platform.swt/issues/772
*/
private void checkMacBackgroundImageInverted(Shell shell) {
// This was partially fixed for Eclipse 4.30 in org.eclipse.ui.internal.Workbench but that only checks for macOS 14
// So that fix won't work on macOS 15 and greater.
// https://github.com/eclipse-platform/eclipse.platform.ui/pull/1355/commits/884bb26a23374c5c1def95ca70b7abc74f395382
// However, there is a better macOS version check in Eclipse 4.31.
// So we'll compare with macOS 15.
// TODO: remove this if and when we target Eclipse 4.31 or greater
if(PlatformUtils.isMac() && PlatformUtils.compareOSVersion("15.0") >= 0) { //$NON-NLS-1$
// Flip the image
shell.setBackgroundImage(flipImage(shell.getDisplay(), shell.getBackgroundImage()));

// We are now responsible for disposing the new image
shell.addDisposeListener(e -> {
shell.getBackgroundImage().dispose();
});
}
}

/**
* From https://github.com/knime/knime-product/commit/095c88e22ba6d84e22a480f50734141836098169
*/
private Image flipImage(Display display, Image srcImage) {
Rectangle bounds = srcImage.getBounds();
Image newImage = new Image(display, bounds.width, bounds.height);

GC gc = new GC(newImage);
gc.setAdvanced(true);
gc.setAntialias(SWT.ON);
gc.setInterpolation(SWT.HIGH);

Transform transform = new Transform(display);
// flip down
transform.setElements(1, 0, 0, -1, 0, 0);
// move up
transform.translate(0, -bounds.height);
gc.setTransform(transform);

gc.drawImage(srcImage, 0, 0, bounds.width, bounds.height,
0, 0, bounds.width, bounds.height);

gc.dispose();
transform.dispose();

return newImage;
}
}
}
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
</properties>

<repositories>
<repository>
<id>Eclipse I-build</id>
<layout>p2</layout>
<url>https://download.eclipse.org/eclipse/updates/4.31-I-builds</url>
</repository>
<repository>
<id>Eclipse</id>
<layout>p2</layout>
<url>https://download.eclipse.org/releases/2023-12</url>
<url>https://download.eclipse.org/releases/2024-03</url>
</repository>
</repositories>

Expand Down

0 comments on commit feb12b6

Please sign in to comment.