Skip to content

Commit

Permalink
Merge branch 'master' into issue-671
Browse files Browse the repository at this point in the history
  • Loading branch information
vogella authored Jun 14, 2023
2 parents 549a829 + f1d2746 commit c62b44e
Show file tree
Hide file tree
Showing 32 changed files with 78 additions and 90 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
name: Verify ${{ matrix.config.name }} with Java-${{ matrix.java }}
steps:
- name: checkout swt
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: 'eclipse.platform.swt'
fetch-depth: 0 # required for jgit timestamp provider to work
- name: checkout swt.binaries
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: eclipse.platform.swt.binaries
repository: 'eclipse-platform/eclipse.platform.swt.binaries'
Expand All @@ -53,6 +53,10 @@ jobs:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.2
- name: Build swt.binaries fragments with Maven
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
with:
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt.tools.base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt.tools.spies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ String[] getClassNames() {
String name = entry.getName();
if (name.startsWith(pkgZipPath) && name.indexOf('/', pkgZipPath.length() + 1) == -1 && name.endsWith(".class")) {
String className = name.substring(pkgZipPath.length() + 1, name.length() - 6);
className.replace('/', '.');
className= className.replace('/', '.');
classes.add(className);
}
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt.tools/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.swt.tools; singleton:=true
Bundle-Version: 3.110.0.qualifier
Bundle-Version: 3.110.100.qualifier
Bundle-ManifestVersion: 2
Export-Package: org.eclipse.swt.tools.internal; x-internal:=true
Bundle-ActivationPolicy: lazy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -946,17 +946,27 @@ public void setSelectorEnum(String selectorEnumName) {
}

Document getDocument(String xmlPath) {
try {
InputStream is = null;
if (xmlPath.indexOf(File.separatorChar) == -1) is = getClass().getResourceAsStream(xmlPath);
if (is == null) is = new BufferedInputStream(new FileInputStream(xmlPath));
if (is != null) return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(is));
try (InputStream is = createInputStream(xmlPath)) {
if (is != null) {
return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(is));
}
} catch (Exception e) {
// e.printStackTrace();
//ignored
}
return null;
}

private InputStream createInputStream(String xmlPath) throws FileNotFoundException {
InputStream is = null;
if (xmlPath.indexOf(File.separatorChar) == -1) {
is = getClass().getResourceAsStream(xmlPath); // null if noresource is found
}
if (is == null) {
is = new BufferedInputStream(new FileInputStream(xmlPath));
}
return is;
}

public String[] getExtraAttributeNames(Node node) {
String name = node.getNodeName();
if (name.equals("method")) {
Expand Down
4 changes: 2 additions & 2 deletions bundles/org.eclipse.swt.tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.tools</artifactId>
<version>3.110.0-SNAPSHOT</version>
<version>3.110.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,29 @@
* <p>How the concepts are mapped to HTML:</p>
* <ul>
* <li>The global {@link StyledText} properties (for example {@link StyledText#getBackground()}
* are written in a wrapping {@code <div>}.</p>
* are written in a wrapping {@code <div>} or {@code <span>} (for line fragments).</p>
* <li>The line specific properties (for example {@link StyledText#getLineBackground(int)}
* are written the {@code <p>} elements.</li>
* are written the {@code <p>} elements - if the copied range contains more then a line fragment.</li>
* <li>The {@link StyleRange} properties inside the line are written the {@code <span>} elements.</li>
* </ul>
*/
class HTMLWriter extends StyledTextWriterBase {
private String tag;
private boolean multiline;

public HTMLWriter(StyledText styledText, int start, int length) {
public HTMLWriter(StyledText styledText, int start, int length, StyledTextContent content) {
super(styledText, start, length);
String text = content.getTextRange(start, length);
multiline = text.contains("\n");
tag = multiline ? "div" : "span";
writeHeader();
}

@Override
public void close() {
if (!isClosed()) {
write("</div>");
write("</div>");
write("</"+ tag+">");
write("</"+ tag+">");
super.close();
}
}
Expand Down Expand Up @@ -81,11 +86,11 @@ void writeHeader() {
appendStyle(innerDivStyle, "direction:rtl;");
}

write("<div style='" + outerDivStyle + "'>");
write("<"+ tag+" style='" + outerDivStyle + "'>");
if (language == null || language.isEmpty()) {
write("<div style='" + innerDivStyle + "'>");
write("<"+ tag+" style='" + innerDivStyle + "'>");
} else {
write("<div lang='" + language + "' style='" + innerDivStyle + "'>");
write("<"+ tag+" lang='" + language + "' style='" + innerDivStyle + "'>");
}
}

Expand Down Expand Up @@ -116,6 +121,9 @@ String writeLineStart(Color lineBackground, int indent, int verticalIndent, int
appendStyle(paragraphStyle, "margin:", verticalIndent, " 0 0 0;");
}

if (!multiline) {
return "";
}
if (paragraphStyle.length() == 0) {
write("<p>");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8629,7 +8629,7 @@ void setClipboardContent(int start, int length, int clipboardType) throws SWTErr
String rtfText = getPlatformDelimitedText(rtfWriter);

HTMLTransfer htmlTransfer = HTMLTransfer.getInstance();
HTMLWriter htmlWriter = new HTMLWriter(this, start, length);
HTMLWriter htmlWriter = new HTMLWriter(this, start, length, content);
String htmlText = getPlatformDelimitedText(htmlWriter);

data = new Object[]{rtfText, htmlText, plainText};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,8 @@ void OleCreate(GUID appClsid, GUID fileClsid, char[] fileName, File file) {
OLE.error(OLE.ERROR_CANNOT_OPEN_FILE, result);
}
IStream stream = new IStream(address[0]);
try {
try (FileInputStream fileInput = new FileInputStream(file)){
// Copy over data in file to named stream
FileInputStream fileInput = new FileInputStream(file);
int increment = 1024*4;
byte[] buffer = new byte[increment];
int count = 0;
Expand All @@ -387,7 +386,6 @@ void OleCreate(GUID appClsid, GUID fileClsid, char[] fileName, File file) {
OLE.error(OLE.ERROR_CANNOT_OPEN_FILE, result);
}
}
fileInput.close();
stream.Commit(COM.STGC_DEFAULT);
stream.Release();
} catch (IOException err) {
Expand Down Expand Up @@ -1202,8 +1200,7 @@ private boolean saveFromContents(long address, File file) {
IStream tempContents = new IStream(address);
tempContents.AddRef();

try {
FileOutputStream writer = new FileOutputStream(file);
try (FileOutputStream writer = new FileOutputStream(file)){

int increment = 1024 * 4;
long pv = OS.CoTaskMemAlloc(increment);
Expand All @@ -1216,9 +1213,6 @@ private boolean saveFromContents(long address, File file) {
success = true;
}
OS.CoTaskMemFree(pv);

writer.close();

} catch (IOException err) {
}

Expand Down Expand Up @@ -1250,11 +1244,8 @@ private boolean saveFromOle10Native(long address, File file) {
OS.CoTaskMemFree(pv);

// open the file and write data into it
try {
FileOutputStream writer = new FileOutputStream(file);
try (FileOutputStream writer = new FileOutputStream(file)){
writer.write(buffer); // Note: if file does not exist, this will create the file
writer.close();

success = true;
} catch (IOException err) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class Library {
/**
* SWT Minor version number (must be in the range 0..999)
*/
static int MINOR_VERSION = 960;
static int MINOR_VERSION = 962;

/**
* SWT revision number (must be >= 0)
*/
static int REVISION = 6;
static int REVISION = 2;

/**
* The JAVA and SWT versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
#*******************************************************************************

maj_ver=4
min_ver=960
rev=6
comma_ver=4,960,6,0
min_ver=962
rev=2
comma_ver=4,962,2,0
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt/Eclipse SWT/common/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version 4.960
version 4.962
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,10 @@ public ImageData[] load(InputStream stream) {
*/
public ImageData[] load(String filename) {
if (filename == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
InputStream stream = null;
try {
stream = new FileInputStream(filename);
try (InputStream stream = new FileInputStream(filename)) {
return load(stream);
} catch (IOException e) {
SWT.error(SWT.ERROR_IO, e);
} finally {
try {
if (stream != null) stream.close();
} catch (IOException e) {
// Ignore error
}
}
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.swt; singleton:=true
Bundle-Version: 3.124.0.qualifier
Bundle-Version: 3.124.100.qualifier
Bundle-ManifestVersion: 2
Bundle-Localization: plugin
DynamicImport-Package: org.eclipse.swt.accessibility2
Expand Down
6 changes: 3 additions & 3 deletions bundles/org.eclipse.swt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
<parent>
<artifactId>eclipse.platform.swt</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt</artifactId>
<version>3.124.0-SNAPSHOT</version>
<version>3.124.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<properties>
<!--
forceContextQualifier gets updated during build input process using
ant script <SWT source repo>/bundles/org.eclipse.swt/buildInternal.xml
-->
<forceContextQualifier>v20230523-1044</forceContextQualifier>
<forceContextQualifier>v20230613-0847</forceContextQualifier>
<sonar.sources>Eclipse SWT Accessibility/cocoa,Eclipse SWT Accessibility/common,Eclipse SWT Accessibility/gtk,Eclipse SWT Accessibility/win32,Eclipse SWT AWT/cocoa,Eclipse SWT AWT/common,Eclipse SWT AWT/gtk,Eclipse SWT AWT/win32,Eclipse SWT Browser/cocoa,Eclipse SWT Browser/common,Eclipse SWT Browser/gtk,Eclipse SWT Browser/win32,Eclipse SWT Custom Widgets/common,Eclipse SWT Drag and Drop/cocoa,Eclipse SWT Drag and Drop/common,Eclipse SWT Drag and Drop/gtk,Eclipse SWT Drag and Drop/win32,Eclipse SWT OLE Win32/win32,Eclipse SWT OpenGL/cocoa,Eclipse SWT OpenGL/common,Eclipse SWT OpenGL/glx,Eclipse SWT OpenGL/gtk,Eclipse SWT OpenGL/win32,Eclipse SWT PI/cairo,Eclipse SWT PI/cocoa,Eclipse SWT PI/common,Eclipse SWT PI/gtk,Eclipse SWT PI/win32,Eclipse SWT Printing/cocoa,Eclipse SWT Printing/common,Eclipse SWT Printing/gtk,Eclipse SWT Printing/win32,Eclipse SWT Program/cocoa,Eclipse SWT Program/common,Eclipse SWT Program/gtk,Eclipse SWT Program/win32,Eclipse SWT WebKit/cocoa,Eclipse SWT WebKit/gtk,Eclipse SWT/cairo,Eclipse SWT/cocoa,Eclipse SWT/common,Eclipse SWT/emulated/bidi,Eclipse SWT/emulated/coolbar,Eclipse SWT/emulated/expand,Eclipse SWT/emulated/taskbar,Eclipse SWT/emulated/tooltip,Eclipse SWT/gtk,Eclipse SWT/win32</sonar.sources>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipsecbi/fedora-gtk3-mutter:37-gtk3.24@sha256:d9549b458baff5d9e288076770c0bb21c75dbdc1ec09bcf569e60c8b1be2699e
FROM eclipsecbi/fedora-gtk3-mutter:38-gtk3.24@sha256:2dc9af3bf52e81ba819184de83f1755e5edef6f3b06a8e3dd824c9a29d0dcc4a

# Back to root for install
USER 0
Expand Down
2 changes: 1 addition & 1 deletion examples/org.eclipse.swt.examples.browser.demos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/org.eclipse.swt.examples.launcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/org.eclipse.swt.examples.ole.win32/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/org.eclipse.swt.examples.views/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/org.eclipse.swt.examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.28.0-SNAPSHOT</version>
<version>4.29.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
Loading

0 comments on commit c62b44e

Please sign in to comment.