Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » is docShell.setZoom not supported by XULRunner?
is docShell.setZoom not supported by XULRunner? [message #488727] Tue, 29 September 2009 23:13 Go to next message
Ryan  is currently offline Ryan Friend
Messages: 3
Registered: September 2009
Junior Member
Hi,

browser = new Browser(shell, SWT.MOZILLA);
nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser();
nsIInterfaceRequestor requestor = (nsIInterfaceRequestor)webBrowser.queryInterface(nsIInterfac eRequestor.NS_IINTERFACEREQUESTOR_IID);
nsIDocShell docShell = (nsIDocShell)requestor.getInterface(nsIDocShell.NS_IDOCSHELL _IID);
docShell.setZoom(1.0f);

returns an error

org.mozilla.xpcom.XPCOMException: The function "zoom" returned an error condition (0x80004001)
at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Na tive Method)
at org.mozilla.xpcom.internal.XPCOMJavaProxy.invoke(XPCOMJavaPr oxy.java:143)
at $Proxy21.setZoom(Unknown Source)


Des this mean XULRunner doesn't support setZoom ??

javadoc says

Set/Get the document scale factor. When setting this attribute, a NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations not supporting zoom

Using XULRunner 1.9.1.3 on windows 32 bit

Cheers,

Ryan
Re: is docShell.setZoom not supported by XULRunner? [message #488868 is a reply to message #488727] Wed, 30 September 2009 14:37 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Ryan,

0x80004001 is NS_ERROR_NOT_IMPLEMENTED. Once you have the nsIDocShell you
need to do:

nsIContentViewer contentView = docShell.getContentViewer();
nsIMarkupDocumentViewer docView =
(nsIMarkupDocumentViewer)contentView.queryInterface(nsIMarku pDocumentViewer.
NS_IMARKUPDOCUMENTVIEWER_IID);
docView.setFullZoom(2);

This has been asked before, so I'll probably make a permanent snippet for
it. Also, since it's functionality you're interested in, you may want to CC
yourself to https://bugs.eclipse.org/bugs/show_bug.cgi?id=160620 in case it
becomes API in the future.

Grant


"Ryan" <ryan_swt@itheroes.com.au> wrote in message
news:h9u4a8$l0u$1@build.eclipse.org...
> Hi,
>
> browser = new Browser(shell, SWT.MOZILLA);
> nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser();
> nsIInterfaceRequestor requestor =
(nsIInterfaceRequestor)webBrowser.queryInterface(nsIInterfac
eRequestor.NS_IINTERFACEREQUESTOR_IID);
> nsIDocShell docShell =
(nsIDocShell)requestor.getInterface(nsIDocShell.NS_IDOCSHELL _IID);
> docShell.setZoom(1.0f);
>
> returns an error
>
> org.mozilla.xpcom.XPCOMException: The function "zoom" returned an error
condition (0x80004001)
> at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Na tive
Method)
> at org.mozilla.xpcom.internal.XPCOMJavaProxy.invoke(XPCOMJavaPr
oxy.java:143)
> at $Proxy21.setZoom(Unknown Source)
>
>
> Des this mean XULRunner doesn't support setZoom ??
>
> javadoc says
>
> Set/Get the document scale factor. When setting this attribute, a
NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations not
supporting zoom
>
> Using XULRunner 1.9.1.3 on windows 32 bit
>
> Cheers,
>
> Ryan
Previous Topic:SWT Slider does not work on RHEL4
Next Topic:column content alignment
Goto Forum:
  


Current Time: Fri Apr 26 11:05:17 GMT 2024

Powered by FUDForum. Page generated in 0.03671 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top