Implement FormEditor for own XML format / Java model [message #1002770] |
Sat, 19 January 2013 06:08  |
Eclipse User |
|
|
|
Hi,
I'm looking for a complete example about how to implement a Form based editor for my own XML format and corresponding Java model within an Eclipse plugin.
Following some examples on the net I keep getting an empty page.
I would like to end up with a multitabbed editor (like plugin.xml editor) containing at least on GUI page and a textual representation of the XML file I opened. Could you point me to a complete example.
I'm using the Juno release to build my plugin.
Thank you in advance,
Johan
|
|
|
Re: Implement FormEditor for own XML format / Java model [message #1003638 is a reply to message #1002770] |
Mon, 21 January 2013 12:06   |
Eclipse User |
|
|
|
There are articles and examples found online. I couldn't tell you why you end up getting an empty page.
The PDE code is all open source so you can examine how we implement the forms API. Most of the PDE editors have extra framework code that you wouldn't need, but it does give you a working example. Note that PDE has a lot of form editors, Plug-in, Schema, Product, Target, Context Help, Table of Contents, Category, Update Site, Feature, etc.
|
|
|
|
Re: Implement FormEditor for own XML format / Java model [message #1053643 is a reply to message #1003645] |
Tue, 07 May 2013 02:18  |
Eclipse User |
|
|
|
Hi Johan,
if you are looking to implement form based editor in eclipse then you will have to extend your editor class to FormEditor and for the tab like plugin.xml, you will have to create separate classes for each and each one should extend the FormPage.
In your editor class, override the addPage() just like:
@Override
protected void addPages() {
firstPage();
secondPage();
.....
.....
}
and above each page should have definition like:
private void firstPage() {
//add 'first' page
firstFormObj = new FirstPage(this, "FirstPage","FirstTab");
try {
addPage(firstFormObj);
} catch (PartInitException e) {
e.printStackTrace();
}
}
In above code, FirstPage is class related to First tab,
now, In class FirstPage, extend it from FormPage class and override the "createFormContent(IManagedForm managedForm)" method. Within this method you can define UI of your first tab.
This is too late for you.. but hope this will help to others.
Regards,
Akhil
|
|
|
Powered by
FUDForum. Page generated in 0.04607 seconds