View | Details | Raw Unified | Return to bug 246224 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (+15 lines)
Lines 50-55 Link Here
50
   <extension-point id="browserSupport" name="%ExtPoint.browserSupport" schema="schema/browserSupport.exsd"/>
50
   <extension-point id="browserSupport" name="%ExtPoint.browserSupport" schema="schema/browserSupport.exsd"/>
51
   <extension-point id="internalTweaklets" name="%ExtPoint.tweaklets" schema="schema/internalTweaklets.exsd"/>
51
   <extension-point id="internalTweaklets" name="%ExtPoint.tweaklets" schema="schema/internalTweaklets.exsd"/>
52
   <extension-point id="installationPages" name="%ExtPoint.installationPages" schema="schema/installationPages.exsd"/>
52
   <extension-point id="installationPages" name="%ExtPoint.installationPages" schema="schema/installationPages.exsd"/>
53
   <extension-point id="sharedImages" name="%ExtPoint.sharedImages" schema="schema/sharedImages.exsd"/>
53
   
54
   
54
   <extension
55
   <extension
55
         point="org.eclipse.ui.contexts">
56
         point="org.eclipse.ui.contexts">
Lines 2194-2197 Link Here
2194
         </variable>
2195
         </variable>
2195
      </sourceProvider>
2196
      </sourceProvider>
2196
   </extension>
2197
   </extension>
2198
   <extension
2199
         point="org.eclipse.ui.sharedImages">
2200
      <category
2201
            id="org.eclipse.ui">
2202
         <constant
2203
               name="IMG_ETOOL_PRINT_EDIT"
2204
               value="platform:/plugin/org.eclipse.ui/icons/full/etool16/print_edit.gif">
2205
         </constant>
2206
         <constant
2207
               name="IMG_ETOOL_SAVE_EDIT"
2208
               value="platform:/plugin/org.eclipse.ui/icons/full/etool16/save_edit.gif">
2209
         </constant>
2210
      </category>
2211
   </extension>
2197
</plugin>
2212
</plugin>
(-)plugin.properties (+1 lines)
Lines 57-62 Link Here
57
ExtPoint.statusHandlers = Status Handlers
57
ExtPoint.statusHandlers = Status Handlers
58
ExtPoint.installationPages = Installation Pages
58
ExtPoint.installationPages = Installation Pages
59
ExtPoint.tweaklets = Tweaklets (internal/experimental)
59
ExtPoint.tweaklets = Tweaklets (internal/experimental)
60
ExtPoint.sharedImages = Shared Images
60
61
61
Views.Category.Basic = General
62
Views.Category.Basic = General
62
Views.IntroAdapter = Welcome
63
Views.IntroAdapter = Welcome
(-)schema/sharedImages.exsd (+121 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appinfo>
6
         <meta.schema plugin="org.eclipse.ui" id="sharedImages" name="%sharedImages"/>
7
      </appinfo>
8
      <documentation>
9
         [Enter description of this extension point.]
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <appinfo>
16
            <meta.element />
17
         </appinfo>
18
      </annotation>
19
      <complexType>
20
         <sequence minOccurs="1" maxOccurs="unbounded">
21
            <element ref="category"/>
22
         </sequence>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appinfo>
43
                  <meta.attribute translatable="true"/>
44
               </appinfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49
50
   <element name="constant">
51
      <complexType>
52
         <attribute name="name" type="string" use="required">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
            </annotation>
58
         </attribute>
59
         <attribute name="value" type="string" use="required">
60
            <annotation>
61
               <documentation>
62
                  
63
               </documentation>
64
            </annotation>
65
         </attribute>
66
      </complexType>
67
   </element>
68
69
   <element name="category">
70
      <complexType>
71
         <sequence minOccurs="1" maxOccurs="unbounded">
72
            <element ref="constant"/>
73
         </sequence>
74
         <attribute name="id" type="string" use="required">
75
            <annotation>
76
               <documentation>
77
                  
78
               </documentation>
79
            </annotation>
80
         </attribute>
81
      </complexType>
82
   </element>
83
84
   <annotation>
85
      <appinfo>
86
         <meta.section type="since"/>
87
      </appinfo>
88
      <documentation>
89
         [Enter the first release in which this extension point appears.]
90
      </documentation>
91
   </annotation>
92
93
   <annotation>
94
      <appinfo>
95
         <meta.section type="examples"/>
96
      </appinfo>
97
      <documentation>
98
         [Enter extension point usage example here.]
99
      </documentation>
100
   </annotation>
101
102
   <annotation>
103
      <appinfo>
104
         <meta.section type="apiinfo"/>
105
      </appinfo>
106
      <documentation>
107
         [Enter API information here.]
108
      </documentation>
109
   </annotation>
110
111
   <annotation>
112
      <appinfo>
113
         <meta.section type="implementation"/>
114
      </appinfo>
115
      <documentation>
116
         [Enter information about supplied implementation of this extension point.]
117
      </documentation>
118
   </annotation>
119
120
121
</schema>
(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchImages.java (-1 / +30 lines)
Lines 15-20 Link Here
15
import java.util.Map;
15
import java.util.Map;
16
16
17
import org.eclipse.core.runtime.Assert;
17
import org.eclipse.core.runtime.Assert;
18
import org.eclipse.core.runtime.IConfigurationElement;
19
import org.eclipse.core.runtime.IExtension;
20
import org.eclipse.core.runtime.IExtensionPoint;
21
import org.eclipse.core.runtime.Platform;
18
import org.eclipse.jface.resource.ImageDescriptor;
22
import org.eclipse.jface.resource.ImageDescriptor;
19
import org.eclipse.jface.resource.ImageRegistry;
23
import org.eclipse.jface.resource.ImageRegistry;
20
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.SWT;
Lines 595-603 Link Here
595
        imageRegistry = new ImageRegistry();
599
        imageRegistry = new ImageRegistry();
596
        descriptors = new HashMap();
600
        descriptors = new HashMap();
597
        declareImages();
601
        declareImages();
602
        loadFromRegistry();
598
    }
603
    }
599
    
604
    
600
    /**
605
	private static void loadFromRegistry() {
606
		IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui.sharedImages"); //$NON-NLS-1$
607
		IExtension[] extensions = extensionPoint.getExtensions();
608
		for (int i = 0; i < extensions.length; i++) {
609
			IConfigurationElement[] categories = extensions[i].getConfigurationElements();
610
			for (int j = 0; j < categories.length; j++) {
611
				if(categories[j].getName().equals("category")) { //$NON-NLS-1$
612
					String categoryId = categories[j].getAttribute("id"); //$NON-NLS-1$
613
					IConfigurationElement[] constants = categories[j].getChildren();
614
					for (int k = 0; k < constants.length; k++) {
615
						String name = constants[k].getAttribute("name"); //$NON-NLS-1$
616
						try {
617
							URL url = new URL(constants[k].getAttribute("value")); //$NON-NLS-1$
618
					        ImageDescriptor desc = ImageDescriptor.createFromURL(url);
619
					        declareImage("org.eclipse.ui.sharedImages/images/"+categoryId+'/'+name, desc, true); //$NON-NLS-1$
620
						} catch (Exception e) {
621
							// log here...
622
						}
623
					}
624
				}
625
			}
626
		}
627
	}
628
629
	/**
601
     * Disposes and clears the workbench images.
630
     * Disposes and clears the workbench images.
602
     * Called when the workbench is shutting down.
631
     * Called when the workbench is shutting down.
603
     *
632
     *
(-)Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java (-3 / +7 lines)
Lines 32-37 Link Here
32
import org.eclipse.jface.action.ToolBarManager;
32
import org.eclipse.jface.action.ToolBarManager;
33
import org.eclipse.jface.resource.ImageDescriptor;
33
import org.eclipse.jface.resource.ImageDescriptor;
34
import org.eclipse.ui.IWorkbenchActionConstants;
34
import org.eclipse.ui.IWorkbenchActionConstants;
35
import org.eclipse.ui.PlatformUI;
35
import org.eclipse.ui.commands.ICommandImageService;
36
import org.eclipse.ui.commands.ICommandImageService;
36
import org.eclipse.ui.internal.WorkbenchWindow;
37
import org.eclipse.ui.internal.WorkbenchWindow;
37
import org.eclipse.ui.internal.provisional.presentations.IActionBarPresentationFactory;
38
import org.eclipse.ui.internal.provisional.presentations.IActionBarPresentationFactory;
Lines 419-429 Link Here
419
				.getContributor().getName();
420
				.getContributor().getName();
420
421
421
		String iconPath = getIconPath(element);
422
		String iconPath = getIconPath(element);
423
		ImageDescriptor descriptor = null;
422
		if (iconPath != null) {
424
		if (iconPath != null) {
423
			return AbstractUIPlugin.imageDescriptorFromPlugin(
425
			if(iconPath.startsWith("org.eclipse.ui.sharedImages/images/")) //$NON-NLS-1$
424
					extendingPluginId, iconPath);
426
				descriptor = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(iconPath);
427
			else
428
				descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(extendingPluginId, iconPath);
425
		}
429
		}
426
		return null;
430
		return descriptor;
427
	}
431
	}
428
432
429
	static ImageDescriptor getDisabledIconDescriptor(
433
	static ImageDescriptor getDisabledIconDescriptor(

Return to bug 246224