Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2023 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -13,6 +13,7 @@
package org.eclipse.wb.internal.core.model.description.helpers;

import org.eclipse.wb.internal.core.BundleResourceProvider;
import org.eclipse.wb.internal.core.DesignerPlugin;
import org.eclipse.wb.internal.core.EnvironmentUtils;
import org.eclipse.wb.internal.core.model.description.IToolkitProvider;
import org.eclipse.wb.internal.core.model.description.ToolkitDescription;
Expand Down Expand Up @@ -121,7 +122,15 @@ public static synchronized void validateComponentDescription(ResourceInfo resour
// Utils
//
////////////////////////////////////////////////////////////////////////////
public static final String[] ICON_EXTS = new String[]{".png", ".gif"};
public static final String[] ICON_EXTS;

static {
if (DesignerPlugin.isSvgSupported()) {
ICON_EXTS = new String[] { ".svg", ".png", ".gif" };
} else {
ICON_EXTS = new String[] { ".png", ".gif" };
}
}

/**
* @return the icon {@link ImageDescriptor} for given component.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.wb.internal.core.utils.ui.dialogs.image.pages.browse;

import org.eclipse.wb.internal.core.DesignerPlugin;
import org.eclipse.wb.internal.core.utils.ui.GridDataFactory;
import org.eclipse.wb.internal.core.utils.ui.GridLayoutFactory;
import org.eclipse.wb.internal.core.utils.ui.dialogs.image.AbstractImageDialog;
Expand Down Expand Up @@ -222,6 +223,9 @@ public static boolean isImageExtension(String extension) {
if (extension == null) {
return false;
}
if (DesignerPlugin.isSvgSupported() && extension.equalsIgnoreCase("svg")) {
return true;
}
return extension.equalsIgnoreCase("gif")
|| extension.equalsIgnoreCase("png")
|| extension.equalsIgnoreCase("jpg")
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.wb.dev/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-ManifestVersion: 2
Bundle-Name: Designer internal developers Plug-in
Bundle-SymbolicName: org.eclipse.wb.dev;singleton:=true
Bundle-Version: 1.0.100.qualifier
Bundle-Version: 1.0.200.qualifier
Bundle-Activator: org.eclipse.wb.internal.dev.Activator
Bundle-Vendor: Eclipse.org
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.31.100,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -114,12 +114,19 @@ private static boolean processResource(IResource resource) {
private static boolean isInterestingResource(IResource resource) {
if (resource instanceof IFile) {
String path = resource.getFullPath().toPortableString().toLowerCase();
return path.contains("/wbp-meta/")
&& (path.endsWith(".wbp-component.xml") || path.endsWith(".png") || path.endsWith(".gif"));
return path.contains("/wbp-meta/") && (isComponent(path) || isImage(path));
}
return false;
}

private static boolean isImage(String path) {
return path.endsWith(".svg") || path.endsWith(".png") || path.endsWith(".gif");
}

private static boolean isComponent(String path) {
return path.endsWith(".wbp-component.xml");
}

private static String getMetaDataCheckSum(IProject project) throws Exception {
MessageDigest algorithm = MessageDigest.getInstance("MD5");
// add files
Expand Down
10 changes: 10 additions & 0 deletions org.eclipse.wb.doc.user/html-src/whatsnew/v120.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,18 @@ a better integration into the table.
| image:images/1.20/PropertyTable_New.png[1.20 and newer]
|===

Palette contributions may now also use SVGs as icons. If both an SVG and a PNG
exist, the SVG file takes precedence if and only if SVGs are supported by the
current Eclipse version.

== Swing

- Added conversion support for `java.awt.Cursor`, `java.awt.Font` and `java.awt.ComponentOrientation` in the Customizer.

== SWT

- Support for SVGs as image data if using Eclipse 2025-06 or newer.

image:images/1.20/SVG_Support.png[Image Chooser with SVG selection]

What's new - xref:v119.adoc[*v1.19.0*]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package org.eclipse.wb.internal.swt.model.property.editor.image.plugin;

import org.eclipse.wb.core.editor.constants.CoreImages;
import org.eclipse.wb.internal.core.DesignerPlugin;
import org.eclipse.wb.internal.core.utils.ui.dialogs.image.pages.browse.model.IHasChildren;
import org.eclipse.wb.internal.core.utils.ui.dialogs.image.pages.browse.model.IImageContainer;
import org.eclipse.wb.internal.core.utils.ui.dialogs.image.pages.browse.model.IImageElement;
Expand All @@ -32,7 +33,16 @@
* @coverage swt.property.editor.plugin
*/
public class BundleImageContainer extends ImageContainer implements IHasChildren {
private static final String[] PATTERNS = {".gif", ".png", ".jpg", ".jpeg", ".bmp", ".ico"};
private static final String[] PATTERNS;

static {
if (DesignerPlugin.isSvgSupported()) {
PATTERNS = new String[] { ".svg", ".gif", ".png", ".jpg", ".jpeg", ".bmp", ".ico" };
} else {
PATTERNS = new String[] { ".gif", ".png", ".jpg", ".jpeg", ".bmp", ".ico" };
}
}

private final String m_name;
private final Bundle m_bundle;
private final String m_symbolicName;
Expand Down
Loading