|
Lines 30-35
Link Here
|
| 30 |
import org.eclipse.jface.resource.ImageDescriptor; |
30 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 31 |
import org.eclipse.jface.resource.ImageRegistry; |
31 |
import org.eclipse.jface.resource.ImageRegistry; |
| 32 |
import org.eclipse.rap.ui.internal.preferences.SessionScope; |
32 |
import org.eclipse.rap.ui.internal.preferences.SessionScope; |
|
|
33 |
import org.eclipse.rwt.RWT; |
| 33 |
import org.eclipse.swt.SWT; |
34 |
import org.eclipse.swt.SWT; |
| 34 |
import org.eclipse.swt.SWTError; |
35 |
import org.eclipse.swt.SWTError; |
| 35 |
import org.eclipse.swt.widgets.Display; |
36 |
import org.eclipse.swt.widgets.Display; |
|
Lines 133-143
Link Here
|
| 133 |
*/ |
134 |
*/ |
| 134 |
private ScopedPreferenceStore preferenceStore; |
135 |
private ScopedPreferenceStore preferenceStore; |
| 135 |
|
136 |
|
| 136 |
/** |
137 |
// RAP [bm]: replaced with session-specific one |
| 137 |
* The registry for all graphic images; <code>null</code> if not yet |
138 |
// /** |
| 138 |
* initialized. |
139 |
// * The registry for all graphic images; <code>null</code> if not yet |
| 139 |
*/ |
140 |
// * initialized. |
| 140 |
private ImageRegistry imageRegistry = null; |
141 |
// */ |
|
|
142 |
// private ImageRegistry imageRegistry = null; |
| 141 |
|
143 |
|
| 142 |
/** |
144 |
/** |
| 143 |
* The bundle listener used for kicking off refreshPluginActions(). |
145 |
* The bundle listener used for kicking off refreshPluginActions(). |
|
Lines 255-265
Link Here
|
| 255 |
* @return the image registry |
257 |
* @return the image registry |
| 256 |
*/ |
258 |
*/ |
| 257 |
public ImageRegistry getImageRegistry() { |
259 |
public ImageRegistry getImageRegistry() { |
| 258 |
if (imageRegistry == null) { |
260 |
// RAP [bm]: needs session scope |
| 259 |
imageRegistry = createImageRegistry(); |
261 |
// if (imageRegistry == null) { |
| 260 |
initializeImageRegistry(imageRegistry); |
262 |
// imageRegistry = createImageRegistry(); |
|
|
263 |
// initializeImageRegistry(imageRegistry); |
| 264 |
// } |
| 265 |
// return imageRegistry; |
| 266 |
String IMAGE_REGISTRY = AbstractUIPlugin.class.getName() + ".imageRegistry"; |
| 267 |
ImageRegistry imageRegistry = ( ImageRegistry )RWT.getSessionStore().getAttribute( IMAGE_REGISTRY ); |
| 268 |
if( imageRegistry == null ) { |
| 269 |
imageRegistry = createImageRegistry(); |
| 270 |
initializeImageRegistry( imageRegistry ); |
| 271 |
RWT.getSessionStore().setAttribute( IMAGE_REGISTRY, imageRegistry ); |
| 261 |
} |
272 |
} |
| 262 |
return imageRegistry; |
273 |
return imageRegistry; |
|
|
274 |
// RAPEND: [bm] |
| 263 |
} |
275 |
} |
| 264 |
|
276 |
|
| 265 |
/** |
277 |
/** |
|
Lines 639-647
Link Here
|
| 639 |
saveDialogSettings(); |
651 |
saveDialogSettings(); |
| 640 |
savePreferenceStore(); |
652 |
savePreferenceStore(); |
| 641 |
preferenceStore = null; |
653 |
preferenceStore = null; |
| 642 |
if (imageRegistry != null) |
654 |
// RAP [bm]: replaced by session scoped one |
| 643 |
imageRegistry.dispose(); |
655 |
// if (imageRegistry != null) |
| 644 |
imageRegistry = null; |
656 |
// imageRegistry.dispose(); |
|
|
657 |
// imageRegistry = null; |
| 658 |
// RAPEND: [bm] |
| 645 |
} finally { |
659 |
} finally { |
| 646 |
super.stop(context); |
660 |
super.stop(context); |
| 647 |
} |
661 |
} |