Skip to content

Commit b5154e1

Browse files
committed
Support svg-images in more Editors
- Support SVG icons as custom Extension-Element icons - Support SVG images as About-dialog image of products - Support SVG images as Windows image of products and use the SVG-format in extension-point schema examples.
1 parent bdaf432 commit b5154e1

File tree

7 files changed

+9
-13
lines changed

7 files changed

+9
-13
lines changed

ui/org.eclipse.pde.spy.core/schema/spyPart.exsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ It is also strongly recommended that you keep the key sequences short. One or t
144144
<extension point="org.eclipse.tools.spy.core.spyPart">
145145
<spyPart
146146
description="Context Spy to understand what is behind the scene of injection"
147-
icon="icons/annotation_obj.png"
147+
icon="icons/annotation_obj.svg"
148148
name="Context spy"
149149
part="org.eclipse.tools.spy.context.ContextSpyPart"
150150
shortcut="M2+M3+F10">

ui/org.eclipse.pde.ui/schema/newExtension.exsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ interface.
316316
<wizard
317317
availableAsShortcut="true"
318318
name="Simple Java Editor Extension"
319-
icon="icons/java_edit.png"
319+
icon="icons/java_edit.svg"
320320
category="generic"
321321
class="com.example.xyz.SimpleJavaEditorExtension"
322322
id="com.example.xyz.simple">

ui/org.eclipse.pde.ui/schema/pluginContent.exsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ interface and is expected to extend <code>org.eclipse.jface.wizard.Wizard&
212212
<extension point="org.eclipse.pde.ui.pluginContent">
213213
<wizard
214214
name="Example Plug-in Content Generator"
215-
icon="icons/content_wizard.png"
215+
icon="icons/content_wizard.svg"
216216
class="com.example.xyz.ContentGeneratorWizard"
217217
id="com.example.xyz.ExampleContentGenerator">
218218
<description>

ui/org.eclipse.pde.ui/schema/targetLocationProvisioners.exsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The following is an example of the extension point:
143143
point="org.eclipse.pde.ui.targetLocationProvisioners">
144144
<locationProvider
145145
class="org.eclipse.example.exampleTargetWizard"
146-
icon="icons/obj16/exampleTargetLocation.png"
146+
icon="icons/obj16/exampleTargetLocation.svg"
147147
id="org.eclipse.example.exampleTargetProvisioner"
148148
name="%targetLocationProvider.example.name"
149149
<description>

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsSection.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.Hashtable;
2626
import java.util.Iterator;
2727
import java.util.List;
28+
import java.util.Locale;
2829
import java.util.Set;
2930
import java.util.TreeSet;
3031

@@ -151,7 +152,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis
151152
"commandId", "property", "activityId", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
152153
"attribute", "value"}; //$NON-NLS-1$ //$NON-NLS-2$
153154

154-
private static final String[] VALID_IMAGE_TYPES = {"png", "bmp", "ico", "gif", "jpg", "tiff"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
155+
private static final Set<String> VALID_IMAGE_TYPES = Set.of("svg", "png", "bmp", "ico", "gif", "jpg", "tiff"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
155156
private static final String MENU_NEW_ID = "NewMenu"; //$NON-NLS-1$
156157

157158
class ExtensionContentProvider implements ITreeContentProvider {
@@ -975,15 +976,8 @@ static Image getCustomImage(IPluginElement element) {
975976
if (ext == null) {
976977
return null;
977978
}
978-
boolean valid = false;
979-
// ensure the resource is an image
980-
for (String imageType : VALID_IMAGE_TYPES) {
981-
if (ext.equalsIgnoreCase(imageType)) {
982-
valid = true;
983-
break;
984-
}
985-
}
986979
// if the resource is an image, get the image, otherwise return null
980+
boolean valid = VALID_IMAGE_TYPES.contains(ext.toLowerCase(Locale.ROOT));
987981
return valid ? getImageFromPlugin(element, iconPath) : null;
988982
}
989983
}

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/AboutSection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ private void handleBrowse() {
147147
FileExtensionsFilter filter = new FileExtensionsFilter();
148148
filter.addFileExtension("gif"); //$NON-NLS-1$
149149
filter.addFileExtension("png"); //$NON-NLS-1$
150+
filter.addFileExtension("svg"); //$NON-NLS-1$
150151
dialog.addFilter(filter);
151152
dialog.setInput(PDEPlugin.getWorkspace().getRoot());
152153

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/WindowImagesSection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private void handleBrowse(FormEntry entry) {
173173
FileExtensionsFilter filter = new FileExtensionsFilter();
174174
filter.addFileExtension("gif"); //$NON-NLS-1$
175175
filter.addFileExtension("png"); //$NON-NLS-1$
176+
filter.addFileExtension("svg"); //$NON-NLS-1$
176177
dialog.addFilter(filter);
177178
dialog.setInput(PDEPlugin.getWorkspace().getRoot());
178179

0 commit comments

Comments
 (0)