Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Isnt this supported
Isnt this supported [message #462568] Fri, 14 October 2005 01: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 15:21 Go to previous messageGo to next message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 489
Registered: July 2009
Senior Member
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 17:16 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
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 23:49 Go to previous messageGo to next message
Peter is currently offline PeterFriend
Messages: 51
Registered: July 2009
Member
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] Mon, 17 October 2005 02:14 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
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 05:44 Go to previous messageGo to next message
Peter is currently offline PeterFriend
Messages: 51
Registered: July 2009
Member
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 08:11 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
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 14:59 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
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 08:09 Go to previous message
Peter is currently offline PeterFriend
Messages: 51
Registered: July 2009
Member
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: Sat Oct 31 08:26:29 GMT 2020

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

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

Back to the top