Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Adding another Source tab(How can I add another Source tab?)
Adding another Source tab [message #964576] Tue, 30 October 2012 12:27 Go to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
Hi,

I need to add another tab source to the Editor, it's possible? If yes, how?

Tks!
Re: Adding another Source tab [message #964797 is a reply to message #964576] Tue, 30 October 2012 16:05 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Yes, it is possible.
I don't have access to source code right now, look into one of the databinding plugin.xml files.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #965192 is a reply to message #964797] Tue, 30 October 2012 23:42 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 856
Registered: July 2009
Location: Boston, MA
Senior Member
As Konstantin suggested, you should look at how the Data Binding tab is contributed by the WB data binding plugins. You can add as many new tabs as you want.
Re: Adding another Source tab [message #965667 is a reply to message #965192] Wed, 31 October 2012 08:18 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
Ok,

I'm looking to Data Binding....

but what I want is add a source tab with another language(PHP, C,...) that is a translate of java... I know that I need to see AST and do all the treatment..

is possible do that?
Re: Adding another Source tab [message #965741 is a reply to message #965667] Wed, 31 October 2012 09:24 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 856
Registered: July 2009
Location: Boston, MA
Senior Member
The new tab that you add can be for any purpose you like. The data binding plugins are just an example of how to add a new tab. What you put into the tab is entirely up to you.
Re: Adding another Source tab [message #965748 is a reply to message #965741] Wed, 31 October 2012 09:27 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
Ok,

but I'm having problems because WB Editor extend Java Editor, and my new tab needs another Editor...

I still looking the sources and trying to do it work...

thks!
Re: Adding another Source tab [message #965877 is a reply to message #965748] Wed, 31 October 2012 11:23 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Well, as you can see, you cannot use WB Editor as is, because it is actually for Java.
Or for XML.
Or... for something else, but you will need as much of work as done for XML.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #967035 is a reply to message #965877] Thu, 01 November 2012 08:38 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
I have a question...

When I'm using WB Editor, I'm editing a *.java File...ok? If I want create another File *.c, or any other....Can I work with this two Files??

Because WB needs the *.java, and to do what I want I need another File..
Re: Adding another Source tab [message #967392 is a reply to message #967035] Thu, 01 November 2012 14:32 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Yes, as long as you still use Java file, you can use WB Editor.
It should be possible to add additional editors as pages.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #967398 is a reply to message #967392] Thu, 01 November 2012 14:36 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
I try to open another Editor in a page, but I don't have success....

There is any example?? Or idea?
Re: Adding another Source tab [message #967403 is a reply to message #967398] Thu, 01 November 2012 14:40 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
No, sorry.
I never did this before.
We have some internal discussion about adding *.properties editor at some point, but this never was done.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #967475 is a reply to message #967403] Thu, 01 November 2012 15:56 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
Ok!

To use another editor, I need to "re-write" a part of WB..... =/

Re: Adding another Source tab [message #967649 is a reply to message #967475] Thu, 01 November 2012 19:03 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 856
Registered: July 2009
Location: Boston, MA
Senior Member
The Eclipse manifest.mf / plugin.xml file editor is a good example of an editor that edits multiple files at once.
Re: Adding another Source tab [message #972184 is a reply to message #967649] Mon, 05 November 2012 07:28 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
hmm ok!

I have access to the source code of this editor?
Re: Adding another Source tab [message #974077 is a reply to message #972184] Tue, 06 November 2012 16:07 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 856
Registered: July 2009
Location: Boston, MA
Senior Member
Of course! You have access to all the source of Eclipse itself.
Re: Adding another Source tab [message #976472 is a reply to message #974077] Thu, 08 November 2012 10:59 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
I'm looking the source code of XWT, and I have a question:

I'm implementing a editor to me, so I need to create my own Info class...I see the XmlObjectInfo class, and to link this it's using the *.wbp-component.xml of java.lang.Object

If I create the same *.wbp-component.xml, it will override the WB XML??

Re: Adding another Source tab [message #976496 is a reply to message #976472] Thu, 08 November 2012 11:20 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
I not quite understand you, but will try to give you some information.

Do you want to replace Info class for Object?
I don't see how this can be useful.

org.eclipse.wb.internal.core.xml.model.description.ComponentDescriptionHelper loads component descriptions.
org.eclipse.wb.internal.core.model.description.helpers.DescriptionHelper.addDescriptionResources(LinkedList<ClassResourceInfo>, ILoadingContext, Class<?>) is used to find *.wbp-component.xml files to process. It looks for me that *.wbp-component.xml file from plugin with same toolkit id will be loaded first. And if there are several of them (never planned for this), then one of them will be loaded, we cannot know which one.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #976515 is a reply to message #976496] Thu, 08 November 2012 11:42 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
I'll try to explain better...


I need to link objects to my Object Info, ok?
I do that with *.wb-component.xml file, right?

I see that when using XWT from WB, the unique place there have a link for XmlObjectInfo is in the /org.eclipse.wb.core/wbp-meta/java/lang/Object.wbp-component.xml

So I suposed that there is the way, to all objects have a link to XmlObjectInfo...and I need to do something like that...

For example, if I want to use a SashForm, they need the SashFormInfo...but need also my XptoObjectInfo...

Did I make myself clear?

Re: Adding another Source tab [message #976528 is a reply to message #976515] Thu, 08 November 2012 11:51 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
You link Info class to toolkit class using element "model" for Java or "x-model" to XML in *.wbp-component.xml
So, if you want to support some new component just create new *.wbp-component.xml file.

You cannot have two Info classes for same component in same toolkit.
SashFormInfo in XWT extends XmlObjectInfo, you cannot change this inheritance declaratively (using *.wbp-component.xml file).


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #976539 is a reply to message #976528] Thu, 08 November 2012 12:03 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
So, to be more easy I'll explain what I'm doing...

I have a programming language that I want to do a WB like the XWT..

So, after a lot of questions and ours answers I have a conclusion that I need to do:
- create all Info classes;
- create a parser to my own language;
- create the editor, and the pages;
- use extension point to add the components in toolkit;

I'm in the right way? I know that I have lot of work....but there is the way, yeah?
Re: Adding another Source tab [message #976575 is a reply to message #976539] Thu, 08 November 2012 12:37 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Yes, if you have your own language, not based on Java (obviously) and XML, you need to clone most org.eclipse.wb.core.xml for editor with pages and something like JavaInfo or XmlObjectInfo, but for your language. You you will decide to follow XML editor, you will also copy and tweak org.eclipse.wb.internal.core.xml.editor.palette.PaletteManager, which in case of XML reads palette from plugin.xml palette extensions. But you don't have to do it exactly same way - it is done in WB only because we have many extension plugins to support additional libraries, such as Ext GWT, new layouts for Swing, etc. Same for reading palette commands from projects - if you don't need it, don't copy it from XML.

From WB core you can use as little as org.eclipse.wb.internal.core.editor.DesignComposite for property, palette viewer and GEF.

Actually I'm going to create new Designer for new language too, and will refactor WB core in the next days to extract Java from WB Core into WB Core Java.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #981475 is a reply to message #976575] Mon, 12 November 2012 07:50 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
Thanks Konstantin and Eric!

Now I'm starting to see what I need to tweak...! Thanks a lot...
Re: Adding another Source tab [message #981523 is a reply to message #981475] Mon, 12 November 2012 08:39 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
I need to create all the Properties Editors? because I need to create my own Info class, and some Properties class use Info and don't accept my Info class...
it's right?
Re: Adding another Source tab [message #981673 is a reply to message #981523] Mon, 12 November 2012 10:55 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Yes, some PropertyEditor implementations work with just Property and its setValue() method.
And some editors want GenericProperty and use setExpression().
So, you can use first editors, but not second ones.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #988205 is a reply to message #981673] Wed, 28 November 2012 14:32 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
HI,

Konstantin...I'm doing all the things that I need, but now I have a problem...

I want to use the FillLayout, but that is a final class...so I can't create MyFillLayout class.

Because I want to create the wbp-component.xml for this class to define my own Info class..

Do you understand what is my problem??
Re: Adding another Source tab [message #988215 is a reply to message #988205] Wed, 28 November 2012 16:10 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
No, sorry, I don't understand.
Why do you want to subclass org.eclipse.swt.layout.FillLayout?
I was under impression that you are working on an editor for some new toolkit.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #988311 is a reply to message #988215] Thu, 29 November 2012 06:19 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
I just want to include the FillLayout, because I need this Layout. I need a Layout that when the user include a new component, the component use all area from container...

I'll create another toolkit, but I need some components that already exists. I don't want to rewrite all Layouts... now I was more clear? You understand?

Thks for help me....

Re: Adding another Source tab [message #988389 is a reply to message #988311] Thu, 29 November 2012 12:28 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
Well, it is not possible to make final class not final again.
So, your will need to make your own Layout or may be just copy implementation under new name.


Konstantin Scheglov,
Google, Inc.
Re: Adding another Source tab [message #988392 is a reply to message #988389] Thu, 29 November 2012 12:30 Go to previous message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
Ok,

I try to do this, but FillLayout use FillData...and I don't have access to this class.. =[
Previous Topic:Window Builder Custom Toolkit
Next Topic:Custom FormToolkit
Goto Forum:
  


Current Time: Thu Aug 21 12:23:29 EDT 2014

Powered by FUDForum. Page generated in 0.08058 seconds