org.eclipse.platform.doc.isv/porting/3.1/faq.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (download) (as text) (annotate)
Thu Oct 4 19:41:36 2007 UTC (2 years, 1 month ago) by johna
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +0 -0 lines
FILE REMOVED
Remove oldest porting guide (keep three per release)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>

<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." >

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="STYLESHEET" href="../../book.css" charset="ISO-8859-1" type="text/css">
<title>Eclipse 3.1 Plug-in Migration FAQ</title>
</head>

<body>

<h1>Eclipse 3.1 Plug-in Migration FAQ</h1>
<ol>
  <li><a href="#IPreferenceStore">IPreferenceStore has more explicit API</a></li>
  <li><a href="#IWorkbenchWindow">IWorkbenchWindow#getShell() has more explicit API</a></li>
</ol>
<h2> <a name="IPreferenceStore"></a>IPreferenceStore has more explicit API</h2>
<p>Although the behavior of the IPreferenceStore provided by <code>AbstractUIPlugin#getPreferenceStore() 
  </code>hasn't changed we have updated the specification of IPreferenceStore 
  to explicitly define the behavior that we have provided.</p>
<p><strong>Typing of PropertyChangeEvents</strong></p>
<p>Any property change event from an IPreferenceStore must have an old and new 
  value of the same type that is consistent with the setValue call that generated 
  it. </p>
<p>For instance if you call<code> IPreferenceStore#setValue(String name, long 
  value) </code>the values in the PropertyChangeEvent generated from this method 
  will both be of type <code>java.lang.Long</code>.</p>
<p><strong>putValue</strong></p>
<p>Calls to <code>#putValue</code> will not generate a <code>PropertyChangedEvent</code>; 
  Calls to the various <code>#setValue</code> methods will generate an event.</p>
<p><strong>Relationship between the OSGI Preference and an IPreferenceStore</strong></p>
<p>The IPreferenceStore provided by <code>AbstractUIPlugin#getPreferenceStore()</code>is 
  an instance of <code>ScopedPreferenceStore</code> which uses <code>org.osgi.service.prefs.Preferences</code> 
  as a back end. <code>org.osgi.service.prefs.Preferences</code> propagates change 
  events as Strings only. </p>
<p>The <code>ScopedPreferenceStore</code> wrappers those OSGI events generated 
  by <code>IPreferenceStore#setValue(String name, String value)</code> and one 
  of it's own <code>PropertyChangeEvents</code> and forwards that event to it's 
  listeners. For the other implementations of <code>IPreferenceStore#setValue</code> 
  the <code>ScopedPreferenceStore</code> will create it's own events of the correct 
  type and not propagate the events from the OSGI preferences.</p>
<p>Listeners to a <code>ScopedPreferenceStore</code> should be prepared for both 
  typed and String values in thier change events as it is still possible to get 
  an event via the OSGI preferences (during a preference import for instance). 
  OSGI events are always of type <code>java.lang.String.</code></p>
<h2><a name="IWorkbenchWindow"></a>IWorkbenchWindow#getShell() has more explict API</h2>
<p>It has always been possible to get a null org.eclipse.swt.widgets.Shell from 
  the existing IWorkbenchWindows in the Eclipse SDK. We now explictly define the 
  conditions where this occurs, namely when the shell has not been created or 
  when the IWorkbenchWindow has been closed.</p>


</body>

</html>