• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Swing & OSGi - Devoxx 09
 

Swing & OSGi - Devoxx 09

on

  • 5,717 views

At Devoxx 09, Xander Tamminga and I told the tale of the perils in using Swing in an OSGi-based application. The details can be found at http://lsd.luminis.nl/swing-and-osgi .

At Devoxx 09, Xander Tamminga and I told the tale of the perils in using Swing in an OSGi-based application. The details can be found at http://lsd.luminis.nl/swing-and-osgi .

Statistics

Views

Total Views
5,717
Views on SlideShare
2,949
Embed Views
2,768

Actions

Likes
1
Downloads
36
Comments
0

7 Embeds 2,768

http://lsd.luminis.eu 2096
http://lsd.luminis.nl 654
http://www.slideshare.net 10
http://translate.googleusercontent.com 5
http://cache.baidu.com 1
http://web.archive.org 1
http://www.verious.com 1
More...

Accessibility

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • You have a window with a table in it. The table is created before the window sets its look and feel; you need to restart the table-providing bundle before the table’s look and feel is correct.
  • Even worse: two menu’s with different look and feel’s in a single window.
  • A table gets put into a scrollpane _before_ this scrollpane is part of the AWT hierarchy; hence, a NPE. <br /> (The ColumnHeader only gets created when the scrollpane receives a &#x2018;notify&#x2019; from the window)
  • A table gets put into a scrollpane _before_ this scrollpane is part of the AWT hierarchy; hence, a NPE. <br /> (The ColumnHeader only gets created when the scrollpane receives a &#x2018;notify&#x2019; from the window)
  • How do we create an OSGi-aware Swing application anyway?
  • - Startlevels are about all bundles; besides, the NPE before cannot be solved by this.
  • We start out with an application with consisting of a host and nested children.
  • We use OSGi to resolve our services.
  • Host -> Childeren -> and their Childeren <br /> <br /> finally, all components can initialize themselves.
  • Since every component now uses the same service interface, we add some service properties to keep them separate; we could also use subclasses of ComponentProvider
  • The ComponentProvider is a very simple interfaces, which separates these three steps.
  • - Some dependency management mechanism makes this easier, since we rely on service resolution (the Apache Felix Dependency Manager has been used successfully in the past) <br /> - Application composition is determined at application start. <br /> - So, don&#x2019;t create your components on a framework thread

Swing & OSGi - Devoxx 09 Swing & OSGi - Devoxx 09 Presentation Transcript

  • Swing and OSGi - please play nice by Angelo van der Sijpt / Xander Tamminga
  • Has this ever happened to you? www.devoxx.com
  • Has this ever happened to you? www.devoxx.com
  • Has this ever happened to you? www.devoxx.com
  • Has this ever happened to you? www.devoxx.com
  • Has this ever happened to you? www.devoxx.com
  • Has this ever happened to you? www.devoxx.com
  • www.devoxx.com Swing & OSGi
  • Why’s that? Different design philosophies & assumptions OSGi is dynamic by definition Swing is built to be static www.devoxx.com
  • How to fix that? Startlevels Which may have more impact than desired May not even solve the problem All UI in a single bundle But we don’t want that! www.devoxx.com
  • How to really fix that? www.devoxx.com
  • How to really fix that? www.devoxx.com
  • How to really fix that? www.devoxx.com
  • How to really fix that? www.devoxx.com
  • The ComponentProvider www.devoxx.com
  • The ComponentProvider www.devoxx.com
  • Notes The problem gets worse with complexity Dependency management helps You give up flexibility at runtime Remember to use the EDT correctly www.devoxx.com
  • That’s it! See the Luminis LSD blog for details and code http://lsd.luminis.nl/swing-and-osgi www.devoxx.com