opening multiple windows with Mozilla Embedding
[email protected] Wed, 14 May 2008 09:16:54 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <eaa47ead-4b6d-4d83-8c5c-6997c3c7f63a__36773.0373902761$1210782287$gmane$org@a1g2000hsb.googlegroups.com> |
Hi, Am trying to open a Browser window using Mozilla Interfaces. I
could achieve opening one window. But now I want to open Multiple
windows ( Child windows). tags may also Do.
Below is the code that I used to open a window.
mozilla.initEmbedding(grePath, grePath, locProvider);
serviceManager = mozilla.getServiceManager();
appStartup = (nsIAppStartup)
serviceManager.getServiceByContractID( "@mozilla.org/toolkit/app-
startup;1",nsIAppStartup.NS_IAPPSTARTUP_IID);
windowCreator = (nsIWindowCreator)
appStartup.queryInterface(nsIWindowCreator.NS_IWINDOWCREATOR_IID);
windowWatcher = (nsIWindowWatcher)
serviceManager.getServiceByContractID("@mozilla.org/embedcomp/window-
watcher;1", nsIWindowWatcher.NS_IWINDOWWATCHER_IID);
windowWatcher.setWindowCreator(windowCreator);
domWindow = windowWatcher.openWindow(null, url,"mywindow",
"resizable,centerscreen", null);
windowWatcher.setActiveWindow(thinClient_popup_Window);
nsIDOMWindowInternal winint = (nsIDOMWindowInternal)
thinClient_popup_Window.queryInterface(nsIDOMWindowInternal.NS_IDOMWINDOWINTERNAL_IID);
winint.setInnerHeight(950);
winint.setInnerWidth(1260);
appStartup.run();
at this point the Window opens, but I am not able to open another
window after this,
Am really stuck how to proceed further.
I am actually running a socket. every request to the socket will
replace the URL in this window.
servSock = (nsIServerSocket)
serviceManager.getServiceByContractID("@mozilla.org/network/server-
socket;1",nsIServerSocket.NS_ISERVERSOCKET_IID);
transService = (nsISocketTransportService)
serviceManager.getServiceByContractID("@mozilla.org/network/socket-
transport-service;1",
nsISocketTransportService.NS_ISOCKETTRANSPORTSERVICE_IID);
sockTrans = transService.createTransport(null, 0,"localhost", 7055,
null);
servSock.init(7055, false, -1);
listener = new SockListener(servSock, sockTrans,
serviceManager,thinClient_popup_Window);
servSock.asyncListen(listener);
Now am in need of opening multiple windows....
Any help will be appreciated. Thanks in Advance.