Unterschiede
Hier werden die Unterschiede zwischen der gewählten und der aktuellen Version gezeigt.
eclipse-rcp:activatecontext 2008/11/05 15:29 | eclipse-rcp:activatecontext 2020/01/22 20:59 aktuell | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | [[eclipse-rcp|Java - Eclipse-RCP]]\\ | ||
====== Context aktivieren, eigenen ====== | ====== Context aktivieren, eigenen ====== | ||
- | Im Beispiel beim Erhalt des Focus ein eigener Context gesetzt. Beim Verlust des Focus wird der Context wieder entfernt.\\ | + | //org.eclipse.ui.contexts//\\ |
+ | Im Beispiel wird beim Erhalt des Focus ein eigener Context gesetzt. Beim Verlust des Focus wird der Context wieder entfernt.\\ | ||
+ | \\ | ||
+ | <html> | ||
+ | <script type="text/javascript"><!-- | ||
+ | google_ad_client="pub-9681858985507948"; | ||
+ | google_ad_width = 468; | ||
+ | google_ad_height = 60; | ||
+ | google_ad_format = "468x60_as"; | ||
+ | google_ad_type = "text"; | ||
+ | google_ad_channel = ""; | ||
+ | google_color_border = "cccccc"; | ||
+ | google_color_bg = "FFFFFF"; | ||
+ | google_color_link = "1d2d8c"; | ||
+ | google_color_text = "000000"; | ||
+ | google_color_url = "1d2d8c"; | ||
+ | //--> | ||
+ | </script> | ||
+ | <script type="text/javascript" | ||
+ | src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> | ||
+ | </script> | ||
+ | </html> | ||
+ | \\ | ||
<code java> | <code java> | ||
addFocusListener(new FocusListener() { | addFocusListener(new FocusListener() { | ||
Zeile 9: | Zeile 32: | ||
public void focusGained(FocusEvent e) { | public void focusGained(FocusEvent e) { | ||
service = (IContextService)PlatformUIActivator.getDefault().getWorkbench().getService(IContextService.class); | service = (IContextService)PlatformUIActivator.getDefault().getWorkbench().getService(IContextService.class); | ||
- | context = service.activateContext("de.dpag.tip.platform.ui.table.context"); | + | context = service.activateContext("com.sowas.javawiki.context"); |
- | System.out.println("table.context activated"); | + | System.out.println("context activated"); |
} | } | ||
Zeile 16: | Zeile 39: | ||
public void focusLost(FocusEvent e) { | public void focusLost(FocusEvent e) { | ||
service.deactivateContext(context); | service.deactivateContext(context); | ||
- | System.out.println("table.context deactivated"); | + | System.out.println("context deactivated"); |
} | } | ||
}); | }); | ||
</code> | </code> |