org.eclipse.platform.doc.isv/porting/3.1/faq.html
Parent Directory
|
Revision Log
Revision 1.13 - (view) (download) (as text)
| 1 : | johna | 1.1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 : | <html> | ||
| 3 : | |||
| 4 : | <head> | ||
| 5 : | tod | 1.9 | |
| 6 : | <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > | ||
| 7 : | tod | 1.8 | |
| 8 : | johna | 1.1 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| 9 : | <meta http-equiv="Content-Style-Type" content="text/css"> | ||
| 10 : | mvalenta | 1.10 | <link rel="STYLESHEET" href="../../book.css" charset="ISO-8859-1" type="text/css"> |
| 11 : | tod | 1.7 | <title>Eclipse 3.1 Plug-in Migration FAQ</title> |
| 12 : | johna | 1.1 | </head> |
| 13 : | |||
| 14 : | <body> | ||
| 15 : | |||
| 16 : | <h1>Eclipse 3.1 Plug-in Migration FAQ</h1> | ||
| 17 : | tod | 1.5 | <ol> |
| 18 : | <li><a href="#IPreferenceStore">IPreferenceStore has more explicit API</a></li> | ||
| 19 : | tod | 1.7 | <li><a href="#IWorkbenchWindow">IWorkbenchWindow#getShell() has more explicit API</a></li> |
| 20 : | tod | 1.5 | </ol> |
| 21 : | dmegert | 1.11 | <h2> <a name="IPreferenceStore"></a>IPreferenceStore has more explicit API</h2> |
| 22 : | <p>Although the behavior of the IPreferenceStore provided by <code>AbstractUIPlugin#getPreferenceStore() | ||
| 23 : | tod | 1.4 | </code>hasn't changed we have updated the specification of IPreferenceStore |
| 24 : | to explicitly define the behavior that we have provided.</p> | ||
| 25 : | <p><strong>Typing of PropertyChangeEvents</strong></p> | ||
| 26 : | <p>Any property change event from an IPreferenceStore must have an old and new | ||
| 27 : | value of the same type that is consistent with the setValue call that generated | ||
| 28 : | tod | 1.6 | it. </p> |
| 29 : | tod | 1.4 | <p>For instance if you call<code> IPreferenceStore#setValue(String name, long |
| 30 : | value) </code>the values in the PropertyChangeEvent generated from this method | ||
| 31 : | tod | 1.6 | will both be of type <code>java.lang.Long</code>.</p> |
| 32 : | tod | 1.4 | <p><strong>putValue</strong></p> |
| 33 : | johna | 1.13 | <p>Calls to <code>#putValue</code> will not generate a <code>PropertyChangedEvent</code>; |
| 34 : | Calls to the various <code>#setValue</code> methods will generate an event.</p> | ||
| 35 : | tod | 1.4 | <p><strong>Relationship between the OSGI Preference and an IPreferenceStore</strong></p> |
| 36 : | <p>The IPreferenceStore provided by <code>AbstractUIPlugin#getPreferenceStore()</code>is | ||
| 37 : | an instance of <code>ScopedPreferenceStore</code> which uses <code>org.osgi.service.prefs.Preferences</code> | ||
| 38 : | as a back end. <code>org.osgi.service.prefs.Preferences</code> propagates change | ||
| 39 : | events as Strings only. </p> | ||
| 40 : | <p>The <code>ScopedPreferenceStore</code> wrappers those OSGI events generated | ||
| 41 : | by <code>IPreferenceStore#setValue(String name, String value)</code> and one | ||
| 42 : | of it's own <code>PropertyChangeEvents</code> and forwards that event to it's | ||
| 43 : | listeners. For the other implementations of <code>IPreferenceStore#setValue</code> | ||
| 44 : | the <code>ScopedPreferenceStore</code> will create it's own events of the correct | ||
| 45 : | type and not propagate the events from the OSGI preferences.</p> | ||
| 46 : | tod | 1.7 | <p>Listeners to a <code>ScopedPreferenceStore</code> should be prepared for both |
| 47 : | typed and String values in thier change events as it is still possible to get | ||
| 48 : | an event via the OSGI preferences (during a preference import for instance). | ||
| 49 : | OSGI events are always of type <code>java.lang.String.</code></p> | ||
| 50 : | <h2><a name="IWorkbenchWindow"></a>IWorkbenchWindow#getShell() has more explict API</h2> | ||
| 51 : | <p>It has always been possible to get a null org.eclipse.swt.widgets.Shell from | ||
| 52 : | the existing IWorkbenchWindows in the Eclipse SDK. We now explictly define the | ||
| 53 : | conditions where this occurs, namely when the shell has not been created or | ||
| 54 : | when the IWorkbenchWindow has been closed.</p> | ||
| 55 : | tod | 1.8 | |
| 56 : | johna | 1.1 | |
| 57 : | </body> | ||
| 58 : | |||
| 59 : | </html> |
| help@eclipse.org | ViewVC Help |
| Powered by ViewVC 1.0.3 |
