Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [wtp-jst-dev] Need some support about Web Page Editor (continue)

The Web Page Editor (WPE) is supported by the WTP JSF Project.   This mailing list is for WTP developers only.
 
Please post your questions to the eclipse.webtools.jsf newsgroup (http://www.eclipse.org/newsportal/thread.php?group=eclipse.webtools.jsf) where it will be answered.
 
Regards,
Gerry Kessler
WTP JSF Tools Project
-----Original Message-----
From: huynh khai [mailto:huynhtankhai@xxxxxxxxx]
Sent: Tuesday, August 26, 2008 9:43 AM
To: wtp-jst-dev@xxxxxxxxxxx
Subject: [wtp-jst-dev] Need some support about Web Page Editor (continue)

Dear Kiril & WTP group,

Thank you for your respond!

I debug my code, and I detect that the state: "window.getPages()[0].getActiveEditor()" when I run with WPE, it return org.eclipse.jst.pagedesigner.editors.HTMLEditor object. So, I edit my code:

import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
……………..
HTMLEditor editor;
try{
            System.out.println("Trace 1: inner try block!"); //only for debug
            editor = (HTMLEditor) window.getPages()[0].getActiveEditor();
            System.out.println("Trace 2: …"); //only for debug
}
catch (Exception ex) {
            System.out.println("Exception: " + ex.toString());
}

But in console, I only receive:

Trace 1: inner try block!

It means the statement:  editor = (HTMLEditor) window.getPages()[0].getActiveEditor(); has error, but it also don't catch the exception (the print statement in catch block don't run).

===================

But please don't care my code!

Do you have any way to get the content of html file which I am design with WPE and the current position of cursor?

Can you give me a piece of code which satisfies my request?

Thanks you very much,
 
Best regards,
 
Khai Huynh

Back to the top