Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2f3bdb1051a97c756f9c242b0a8532d77ec0cfe4 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.rap.ui" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
      <appInfo>
         <meta.schema plugin="org.eclipse.rap.ui" id="settingstores" name="Setting Stores"/>
      </appInfo>
      <documentation>
         This extension point allows developers to contribute additional &lt;code&gt;SettingStore&lt;/code&gt; instances.
&lt;p&gt;
An &lt;code&gt;SettingStore&lt;/code&gt; provides persistent storage for settings (key value pairs of Strings), which are then available beyond the scope of a single session. An &lt;code&gt;SettingStoreFactory&lt;/code&gt; is responsible for creating a particular kind of &lt;code&gt;SettingStore&lt;/code&gt;.
&lt;p&gt;
Developers that want to implement their own setting store must provide a setting store factory and register it with the framework using this extension point.
&lt;p&gt;
Note that at runtime only &lt;b&gt;one&lt;/b&gt; (out of all available) factories will be used to create new &lt;code&gt;SettingStore&lt;/code&gt; instances. Which factory is used can be controlled in two ways:
&lt;ul&gt;
&lt;li&gt;In a normal RAP deployment you can specify the factory to be used by placing the following property in the OSGi config.ini file: &lt;code&gt;org.eclipse.rap.rwt.settingStoreFactory=&lt;i&gt;id&lt;/i&gt;&lt;/code&gt; where &lt;i&gt;id&lt;/i&gt; identifies a particular factory element. Example:
&lt;pre&gt;
org.eclipse.rap.rwt.settingStoreFactory=file
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;In RWT-only deployment you can specify the factory to be used in the application configuration:
&lt;pre&gt;
public class SimpleConfiguration implements ApplicationConfiguration {

  public void configure( Application application ) {
    ...
    application.setSettingStoreFactory( new FileSettingStoreFactory() );
    ...
  }

}
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;If nothing is specified, the class &lt;code&gt;WorkbenchFileSettingStoreFactory&lt;/code&gt; will be used in a regular RAP deployment. In an RWT only deployment the class &lt;code&gt;FileSettingStoreFactory&lt;/code&gt; will be used instead.&lt;/li&gt;
&lt;/ul&gt;
      </documentation>
   </annotation>

   <element name="extension">
      <annotation>
         <appInfo>
            <meta.element />
         </appInfo>
      </annotation>
      <complexType>
         <sequence minOccurs="0" maxOccurs="unbounded">
            <element ref="factory"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  a fully qualified identifier of the target extension point
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  an optional identifier of the extension instance
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  an optional name of the extension instance
               </documentation>
               <appInfo>
                  <meta.attribute translatable="true"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="factory">
      <annotation>
         <appInfo>
            <meta.element labelAttribute="id"/>
         </appInfo>
         <documentation>
            This element is used to define setting store factories. If more than one of these elements exist with the same &lt;code&gt;id&lt;/code&gt;, only the last declared element (in order of reading the registry) is considered valid.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  the unique identifier of this factory
               </documentation>
            </annotation>
         </attribute>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  a fully qualified name of the class implementing the &lt;code&gt;org.eclipse.rap.rwt.service.SettingStoreFactory&lt;/code&gt; interface.
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn=":org.eclipse.rap.rwt.service.SettingStoreFactory"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

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

   <annotation>
      <appInfo>
         <meta.section type="examples"/>
      </appInfo>
      <documentation>
&lt;pre&gt;
&lt;extension
    point=&quot;org.eclipse.rap.ui.settingstores&quot;&gt;
  &lt;factory
      class=&quot;org.eclipse.rap.ui.internal.preferences.WorkbenchFileSettingStoreFactory&quot;
      id=&quot;file&quot;&gt;
  &lt;/factory&gt;
  &lt;factory
      class=&quot;org.eclipse.rap.rwt.service.FileSettingStoreFactory&quot;
      id=&quot;rwtfile&quot;&gt;
  &lt;/factory&gt;
&lt;/extension&gt;
&lt;/pre&gt;
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="apiInfo"/>
      </appInfo>
      <documentation>
         To obtain a setting store use &lt;code&gt;RWT.getSettingStore()&lt;/code&gt;. This will use the configured &lt;code&gt;org.eclipse.rap.rwt.service.SettingStoreFactory&lt;/code&gt; to generate and return an appropriate &lt;code&gt;org.eclipse.rap.rwt.service.SettingStore&lt;/code&gt; instance for this session.
&lt;p&gt;
Developers wishing to provide their own setting store must implement &lt;code&gt;SettingStore&lt;/code&gt; and &lt;code&gt;SettingStoreFactory&lt;/code&gt; and contribute their factory using this extension point.
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="implementation"/>
      </appInfo>
      <documentation>
         RAP provides the following default implementations:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;WorkbenchFileSettingStoreFactory&lt;/code&gt;, &lt;code&gt;FileSettingStoreFactory&lt;/code&gt; and &lt;code&gt;FileSettingStore&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="copyright"/>
      </appInfo>
      <documentation>
         Copyright (c) 2008, 2013 EclipseSource and others.&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