Skip to content

Commit

Permalink
clean up jface and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael5601 committed Dec 6, 2024
1 parent a9e2963 commit 88ad734
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
7 changes: 1 addition & 6 deletions bundles/org.eclipse.jface/.classpath
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="libs/jsvg-1.6.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
Expand Down
2 changes: 0 additions & 2 deletions bundles/org.eclipse.jface/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ Import-Package: javax.xml.parsers,
org.w3c.dom,
org.xml.sax
Automatic-Module-Name: org.eclipse.jface
Bundle-ClassPath: libs/jsvg-1.6.1.jar,
.
3 changes: 1 addition & 2 deletions bundles/org.eclipse.jface/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ bin.includes = plugin.properties,\
.,\
META-INF/,\
icons/,\
.options,\
libs/jsvg-1.6.1.jar
.options
src.includes = about.html
source.. = src/
output.. = bin/
Expand Down
Binary file removed bundles/org.eclipse.jface/libs/jsvg-1.6.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageDataProvider;
import org.eclipse.swt.graphics.ImageFileNameProvider;
import org.eclipse.swt.graphics.SVGRasterizerServiceLoader;
import org.eclipse.swt.graphics.SVGRasterizerRegistry;
import org.eclipse.swt.graphics.SVGUtil;

/**
* An ImageDescriptor that gets its information from a URL. This class is not
Expand All @@ -61,10 +62,10 @@ public URLImageFileNameProvider(String url) {
public String getImagePath(int zoom) {
URL tempURL = getURL(url);
if (tempURL != null) {
ISVGRasterizer rasterizer = SVGRasterizerServiceLoader.getRasterizer();
ISVGRasterizer rasterizer = SVGRasterizerRegistry.getRasterizer();
if (rasterizer != null) {
try (InputStream in = getStream(tempURL)) {
if (rasterizer.isSVGFile(in)) {
if (SVGUtil.isSVGFile(in)) {
return getFilePath(tempURL, false);
}
} catch (IOException e) {
Expand Down Expand Up @@ -151,11 +152,11 @@ public ImageData getImageData(int zoom) {
private static ImageData getImageData(String url, int zoom) {
URL tempURL = getURL(url);
if (tempURL != null) {
ISVGRasterizer rasterizer = SVGRasterizerServiceLoader.getRasterizer();
ISVGRasterizer rasterizer = SVGRasterizerRegistry.getRasterizer();
if (rasterizer != null) {
try {
try (InputStream in = getStream(tempURL)) {
if (rasterizer.isSVGFile(in)) {
if (SVGUtil.isSVGFile(in)) {
return getImageData(tempURL, zoom);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public static Workbench getInstance() {
*/
public static int createAndRunWorkbench(final Display display, final WorkbenchAdvisor advisor) {
final int[] returnCode = new int[1];
SVGRasterizer.register();
SVGRasterizer.intializeSVGRasterizer();
Realm.runWithDefault(DisplayRealm.getRealm(display), () -> {
boolean showProgress = PrefUtil.getAPIPreferenceStore()
.getBoolean(IWorkbenchPreferenceConstants.SHOW_PROGRESS_ON_STARTUP);
Expand Down

0 comments on commit 88ad734

Please sign in to comment.