Skip to main content
summaryrefslogtreecommitdiffstats
blob: 2e15fbfd81b2ab20bbc815dc35f158d916fb259a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.wb.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
      <appInfo>
         <meta.schema plugin="org.eclipse.wb.core" id="classLoaderInitializers" name="Initializer for classes from project ClassLoader"/>
      </appInfo>
      <documentation>
         In RCP we use ResourceManager to load images from plugin, using code like this: ResourceManager.getPluginImage(bundleName, path). When we parse code, we can use special ExpressionEvaluator to load image. However when we use this code at design time (for example use some Composite), Platform.getBundle(bundleName) will return null, because plugin is not really loaded. To solve this problem, we have in ResourceManager following code:

 /**
  * Provider for plugin resources, used by WindowBuilder at design time.
  */
 public interface PluginResourceProvider {
  URL getEntry(String symbolicName, String path);
 }
 /**
  * Instance of {@link PluginResourceProvider}, used by WindowBuilder at design time.
  */
 private static PluginResourceProvider m_designTimePluginResourceProvider = null;
 
  // try design time provider
  if (m_designTimePluginResourceProvider != null) {
   return m_designTimePluginResourceProvider.getEntry(symbolicName, path);
  }


So, we need some special way to initialize field m_designTimePluginResourceProvider and this extension point is used to initialize ClassLoader - load ResourceManager and initialize this field.
      </documentation>
   </annotation>

   <element name="extension">
      <annotation>
         <appInfo>
            <meta.element />
         </appInfo>
      </annotation>
      <complexType>
         <sequence minOccurs="1" maxOccurs="unbounded">
            <element ref="initializer"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="initializer">
      <complexType>
         <attribute name="toolkit" type="string" use="required">
            <annotation>
               <documentation>
                  
               </documentation>
               <appInfo>
                  <meta.attribute kind="identifier" basedOn="org.eclipse.wb.core.toolkits/toolkit/@id"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn=":org.eclipse.wb.internal.core.utils.reflect.IClassLoadingListener"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appInfo>
         <meta.section type="since"/>
      </appInfo>
      <documentation>
         1.0
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="examples"/>
      </appInfo>
      <documentation>
         [Enter extension point usage example here.]
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="apiinfo"/>
      </appInfo>
      <documentation>
         [Enter API information here.]
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="implementation"/>
      </appInfo>
      <documentation>
         [Enter information about supplied implementation of this extension point.]
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="copyright"/>
      </appInfo>
      <documentation>
         Copyright (c) 2013 Google, Inc.&lt;br&gt;
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which accompanies
this distribution, and is available at &lt;a 
href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
      </documentation>
   </annotation>


</schema>

Back to the top