Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Isnt this supported
Isnt this supported [message #462568] Thu, 13 October 2005 21:22 Go to next message
Eclipse UserFriend
Originally posted by: harison.hotmail.com

Hi All,

What is the corresponding Widget in SWT for JEditorPane in Swing.

If there is allready a built application(HTML editor app in) in
JEditorPane in Swing, how can we accomodate it to SWT.

Thanks
Re: Isnt this supported [message #462603 is a reply to message #462568] Fri, 14 October 2005 11:21 Go to previous messageGo to next message
Eclipse UserFriend
No, there currently is no SWT control that is directly equivalent to
JEditorPane. You'll have to do something more complicated like a GEF
editor if you want to create an HTML editor, or handle the painting of
your editor yourself onto an SWT canvas.

- Jeff

Harison wrote:
> Hi All,
>
> What is the corresponding Widget in SWT for JEditorPane in Swing.
>
> If there is allready a built application(HTML editor app in) in
> JEditorPane in Swing, how can we accomodate it to SWT.
>
> Thanks
>
Re: Isnt this supported [message #462604 is a reply to message #462568] Fri, 14 October 2005 13:16 Go to previous messageGo to next message
Eclipse UserFriend
If all you need is stylized text editing, then you can use org.eclipse.swt.custom.StyledText (don't hold me to the class name, it's something like that). I saw an HTML editor for SWT somewhere, you'll have to Google it. I do remember that it's commercial though. And, obviously if all you need is HTML displaying, then you should use the Browser widget.
Re: Isnt this supported [message #462652 is a reply to message #462604] Sun, 16 October 2005 19:49 Go to previous messageGo to next message
Eclipse UserFriend
Hi All,

Thanks for the answers, I got the point that there is no JeditorPane kind
of widget in SWT, but my second question is, If there is allready a
application built in JEditorPane in Swing, how can we incooperate into a
SWT application.

for e.g How can we set that application as one page of the SWT Multipage
Editor without popping up seperately.

Thanks,
Peter
Re: Isnt this supported [message #462656 is a reply to message #462652] Sun, 16 October 2005 22:14 Go to previous messageGo to next message
Eclipse UserFriend
You can add Swing components to SWT composites using the org.eclipse.swt.awt.SWT_AWT class and calling the getFrame(Composite) method.
Re: Isnt this supported [message #462658 is a reply to message #462656] Mon, 17 October 2005 01:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

There is no method called getFrame() in the SWT_AWT class.
Are you refering to the new_Frame( ) method.?

Thanks,
Re: Isnt this supported [message #462662 is a reply to message #462658] Mon, 17 October 2005 04:11 Go to previous messageGo to next message
Eclipse UserFriend
Look at (URL may wrap)
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet135.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
for an example how to use SWT_AWT. Be aware of threading issues.

Hope that helps

Stefan

P.S.: If you don't need to change font in the editor you could use
StyledText component.
Peter wrote:
> Hi,
>
> There is no method called getFrame() in the SWT_AWT class.
> Are you refering to the new_Frame( ) method.?
>
> Thanks,
>
>
Re: Isnt this supported [message #462705 is a reply to message #462658] Mon, 17 October 2005 10:59 Go to previous messageGo to next message
Eclipse UserFriend
My mistake. :-) I didn't have the API open at the time and was working from memory. There're only two methods in the class so I assumed that it wouldn't be hard to figure out what I was saying (as you demonstrated).
Re: Isnt this supported [message #462722 is a reply to message #462705] Tue, 18 October 2005 04:09 Go to previous message
Eclipse UserFriend
Hi,
If I allready have a application(which extends JFrame as follows

public class ExistingAPP extends JFrame implements WindowListener

and then when I try to use the java.awt.Frame xxx=
SWT_AWT.new_Frame(xxxxx);

it gives the following error

Exception in thread "main" java.lang.IllegalArgumentException: adding a
window to a container
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at com.hexidec.ekit.CoolClass.main(CoolClass.java:61)


How to overcome this problem without changing the JFrame class.

waiting for a quick reply.

Thanks,
Previous Topic:Disable automatic search in Tables
Next Topic:Treeviewer and Editing Objects (Newbie)
Goto Forum:
  


Current Time: Wed Jul 16 07:58:27 EDT 2025

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

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

Back to the top