chrriis.dj.nativeswing.swtimpl
Interface NSComponent

All Known Implementing Classes:
JFlashPlayer, JHTMLEditor, JSyntaxHighlighter, JVLCPlayer, JWebBrowser, JWMediaPlayer, NSPanelComponent

public interface NSComponent

The interface that all Swing wrappers of native components should expose.

Author:
Christopher Deckers

Method Summary
 void disposeNativePeer()
          Explicitely dispose the native resources.
 void initializeNativePeer()
          Force the native peer to initialize.
 boolean isNativePeerDisposed()
          Indicate whether the native peer is disposed.
 boolean isNativePeerInitialized()
          Indicate whether the native peer initialization phase has happened.
 boolean isNativePeerValid()
          Indicate if the native peer is valid, which means initialized, not disposed, and with a communication channel alive.
 void runInSequence(Runnable runnable)
          Run a command in sequence with other method calls from this class.
 

Method Detail

initializeNativePeer

void initializeNativePeer()
Force the native peer to initialize. All method calls will then be synchronous instead of being queued waiting for the componant to be initialized. This call fails if the component is not in a component hierarchy with a Window ancestor.


disposeNativePeer

void disposeNativePeer()
Explicitely dispose the native resources. This is particularly useful if deferred destruction is used (cf native component options) and the component is not going to be used anymore.


isNativePeerDisposed

boolean isNativePeerDisposed()
Indicate whether the native peer is disposed.

Returns:
true if the native peer is disposed. This method returns false if the native peer is not initialized.

isNativePeerInitialized

boolean isNativePeerInitialized()
Indicate whether the native peer initialization phase has happened. This method returns true even if the native peer is disposed of if the creation of the peer failed.

Returns:
true if the native peer is initialized.

isNativePeerValid

boolean isNativePeerValid()
Indicate if the native peer is valid, which means initialized, not disposed, and with a communication channel alive.

Returns:
true if the native peer is valid.

runInSequence

void runInSequence(Runnable runnable)
Run a command in sequence with other method calls from this class. Calls are performed only when the native peer is initialized, and this method adds the command to the queue of calls in case it is not.

Parameters:
runnable - the command to run in sequence with other method calls.