Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » browser widget between windows and linux
browser widget between windows and linux [message #244283] Mon, 24 May 2004 11:03 Go to next message
Eclipse UserFriend
Originally posted by: debianuser.debianuser.de

Hello,
I am trying to use the latest browser widget (M9) to offer a html
preview function to my editor (extends MultiPageEditorPart)

under windows , no problem is noticed but under linux the preview part
only shows when the maximize or minimize icon is pressed and only with
the default url, any ideas what I am doing wrong??


My relevant code looks like that:
protected void pageChange(int newPageIndex)
{
super.pageChange(newPageIndex);
text = vEditor.getDocumentProvider().getDocument(
vEditor.getEditorInput()).get();

showPreview(newPageIndex);
}
private void showPreview(int newPageIndex)
{
if (newPageIndex == 1)
{

try
{
File file = File.createTempFile("temp", ".html");
OutputStream stream = new FileOutputStream(file);
PrintWriter writer = new PrintWriter(stream);

writer.println(text);
writer.flush();
stream.close();

if (tmpFiles == null)
{
tmpFiles = new Vector();
}

tmpFiles.add(file.getAbsolutePath());
if (VelocityPlugin.isBrowserSupported)
{
//
browser.setUrl("file:///" + file.getAbsolutePath());

browser.setText(text);

browser.refresh();
browser.redraw();
browser.getParent().redraw();

}

}
catch (Exception e)
{
MyPlugin.log(e);
}
}
}

protected void createControl(Composite parent, int style)
{
if (MyPlugin.isBrowserSupported)
{

browser = new Browser(parent, SWT.NONE);
// browser.setLayoutData(new
GridData(GridData.FILL_BOTH));
browser.setUrl("http://eclipse.org");
browser.redraw();
int index = addPage(browser);
setPageText(index, "Preview");
}
}
Re: browser widget between windows and linux [message #244936 is a reply to message #244283] Tue, 25 May 2004 11:24 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Try removing the line
browser.refresh()

Also, the extra browser.redraw / parent.redraw should not be necessary.
If it still does not work, please open a bug report against SWT (Platform
/ SWT) and try attaching a sample that reproduces the problem. Also, in
the future, you can try asking Browser / SWT questions on the SWT
newsgroup.

Chris
Re: browser widget between windows and linux [message #244965 is a reply to message #244936] Tue, 25 May 2004 12:17 Go to previous message
Eclipse UserFriend
Originally posted by: debianuser.debianuser.de

thank you Chris for the response,

I have removed the calls but the only thing that changed is that the
html text is shown but only if the maximize or minimize icon is pressed

regards


Christophe Cornu wrote:
> Hi,
>
> Try removing the line
> browser.refresh()
>
> Also, the extra browser.redraw / parent.redraw should not be necessary.
> If it still does not work, please open a bug report against SWT (Platform
> / SWT) and try attaching a sample that reproduces the problem. Also, in
> the future, you can try asking Browser / SWT questions on the SWT
> newsgroup.
>
> Chris
>
>
>
Previous Topic:Strange runtime error in workbench
Next Topic:Profiling: recommendation
Goto Forum:
  


Current Time: Mon May 12 22:02:38 EDT 2025

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

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

Back to the top