Bug 335696 - Provide helper method for embedding in AWT/Swing (Mac only for the moment). r=bsmeberg
git-svn-id: svn://10.0.0.236/trunk@216856 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -40,16 +40,24 @@ import java.io.File;
|
||||
|
||||
public interface IMozilla {
|
||||
|
||||
/**
|
||||
* Initialize the Mozilla object with the given XULRunner path. All
|
||||
* subsequent Mozilla method invocations be done against the given XULRunner
|
||||
* version.
|
||||
*
|
||||
* @param aLibXULDirectory path of XULRunner build to use
|
||||
*
|
||||
* @throws XPCOMInitializationException if failure occurred during
|
||||
* initialization
|
||||
*/
|
||||
void initialize(File aLibXULDirectory) throws XPCOMInitializationException;
|
||||
/**
|
||||
* Initialize the Mozilla object with the given XULRunner path. All
|
||||
* subsequent Mozilla method invocations be done against the given XULRunner
|
||||
* version.
|
||||
*
|
||||
* @param aLibXULDirectory path of XULRunner build to use
|
||||
*
|
||||
* @throws XPCOMInitializationException if failure occurred during
|
||||
* initialization
|
||||
*/
|
||||
void initialize(File aLibXULDirectory) throws XPCOMInitializationException;
|
||||
|
||||
/**
|
||||
* Return the native window handle for an AWT component.
|
||||
*
|
||||
* @param widget An AWT component (such as Canvas, Frame) that is backed by
|
||||
* a real native window.
|
||||
* @return the pointer to the native window (platform specific)
|
||||
*/
|
||||
long getNativeHandleFromAWT(Object widget);
|
||||
}
|
||||
|
||||
@@ -1026,4 +1026,13 @@ public class Mozilla implements IMozilla, IGRE, IXPCOM, IXPCOMError {
|
||||
return iid;
|
||||
}
|
||||
|
||||
public long getNativeHandleFromAWT(Object widget) {
|
||||
try {
|
||||
return mozilla.getNativeHandleFromAWT(widget);
|
||||
} catch (NullPointerException e) {
|
||||
throw new XPCOMInitializationException("Must call " +
|
||||
"Mozilla.getInstance().initialize() before using this method", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user