Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » FormPage in Visual Editor problem
FormPage in Visual Editor problem [message #125576] Sun, 04 June 2006 22:09 Go to next message
Eclipse UserFriend
Originally posted by: andrey.batyuk.net

Greetings,

I've tried to edit FormPage subclass in Visual Editor:
public class PersonSummaryPage extends FormPage {

private FormToolkit formToolkit; // @jve:decl-index=0:visual-constraint=""

public PersonSummaryPage(String id, String title) {
super(id, title);
// TODO Auto-generated constructor stub
}

public PersonSummaryPage(FormEditor editor, String id, String title) {
super(editor, id, title);
// TODO Auto-generated constructor stub
}

protected void createFormContent(IManagedForm managedForm) {
FormToolkit toolkit = managedForm.getToolkit();
ScrolledForm form = managedForm.getForm();
form.setText("Empty FormPage");
Composite body = form.getBody();
toolkit.paintBordersFor(body);
}
}

On attempt to open this class in visual editor i get the following error
message in status bar:
java.lang.NoSuchMethodException(org.eclipse.ui.forms.editor. FormPage. <init>())

And the following error in .log:
java.lang.ArrayIndexOutOfBoundsException: -1
at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:5 14)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObjectF orURIFragmentRootSegment(ResourceImpl.java:642)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:692)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:671)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setValueFromId(XML Handler.java:2506)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XML Handler.java:2437)
at
org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAtt ribs(SAXXMIHandler.java:74)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFa ctory(XMLHandler.java:1927)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTy peName(XMLHandler.java:1831)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:1766)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1574)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:876)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:82)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:854)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:626)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.scanStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:179)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:179)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1089)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:895)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:249)
at
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.demandLoad(ProjectResourceSetImpl.java:83)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:264)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:390)
at
org.eclipse.jem.internal.util.emf.workbench.ProjectResourceS etImpl.getResource(ProjectResourceSetImpl.java:262)
at
org.eclipse.ve.internal.java.codegen.util.VEModelCacheUtilit y.doLoadFromCache(VEModelCacheUtility.java:103)
at
org.eclipse.ve.internal.java.codegen.core.VEModelInstance.cr eateComposition(VEModelInstance.java:100)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.reConnect(JavaSourceTranslator.java:1126)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.decodeDocument(JavaSourceTranslator.java:902)
at
org.eclipse.ve.internal.java.codegen.core.JavaSourceTranslat or.loadModel(JavaSourceTranslator.java:597)
at
org.eclipse.ve.internal.java.codegen.editorpart.JavaVisualEd itorPart$Setup.run(JavaVisualEditorPart.java:1978)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

What could be the cause of this?
Re: FormPage in Visual Editor problem [message #125616 is a reply to message #125576] Mon, 05 June 2006 15:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What version of VE, GEF, EMF, and Eclipse are you using?

Thanks,
Rich
Re: FormPage in Visual Editor problem [message #125628 is a reply to message #125616] Mon, 05 June 2006 15:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

I took a closer look. It is a current restriction. FormPage can't be
subclassed because it doesn't have a default constructor (one that takes
no arguments). You can open an enhancement against VE to be able to
handle this.

Rich Kulp wrote:
> What version of VE, GEF, EMF, and Eclipse are you using?
>
> Thanks,
> Rich

--
Thanks,
Rich Kulp
Re: FormPage in Visual Editor problem [message #125641 is a reply to message #125628] Mon, 05 June 2006 15:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andrey.batyuk.net

Will do.
But what if i make a subclass of FormPage with default constructor, and
then subclass it? Will it work? (Sorry for newbie question, i'm not yet
familiar with VE)
Re: FormPage in Visual Editor problem [message #125667 is a reply to message #125641] Mon, 05 June 2006 20:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

No, i tried that. That won't work either because FormPage expects a
FormEditor to be set on it. The problem is there is no FormEditor set on
it and so it thows NullPointerExceptions whenever you try to anything
with the FormPage.

Andrey Batyuk wrote:
> Will do.
> But what if i make a subclass of FormPage with default constructor, and
> then subclass it? Will it work? (Sorry for newbie question, i'm not yet
> familiar with VE)
>

--
Thanks,
Rich Kulp
Re: FormPage in Visual Editor problem [message #125690 is a reply to message #125667] Mon, 05 June 2006 20:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andrey.batyuk.net

Rich Kulp wrote:

> No, i tried that. That won't work either because FormPage expects a
> FormEditor to be set on it. The problem is there is no FormEditor set on
> it and so it thows NullPointerExceptions whenever you try to anything
> with the FormPage.

Ok, but how do i design form pages in designer then? Create a form, design
it and copy source to form page?
Or any other workaround?
Re: FormPage in Visual Editor problem [message #125703 is a reply to message #125690] Mon, 05 June 2006 22:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

I don't know. I've never created a FormPage. I don't know what is
expected. There isn't any examples in the base Eclipse on what a
FormPage implementation looks like.

Andrey Batyuk wrote:
> Rich Kulp wrote:
>
>> No, i tried that. That won't work either because FormPage expects a
>> FormEditor to be set on it. The problem is there is no FormEditor set
>> on it and so it thows NullPointerExceptions whenever you try to
>> anything with the FormPage.
>
>
> Ok, but how do i design form pages in designer then? Create a form,
> design it and copy source to form page?
> Or any other workaround?
>

--
Thanks,
Rich Kulp
Re: FormPage in Visual Editor problem [message #125716 is a reply to message #125690] Tue, 06 June 2006 04:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

Andrey Batyuk wrote:

>> No, i tried that. That won't work either because FormPage expects a
>> FormEditor to be set on it. The problem is there is no FormEditor set
>> on it and so it thows NullPointerExceptions whenever you try to
>> anything with the FormPage.
>
>
> Ok, but how do i design form pages in designer then? Create a form,
> design it and copy source to form page?

Check this:

http://www.instantiations.com/windowbuilderpro/docs/introduc tion/new_and_noteworthy_300.html

> Or any other workaround?

In theory you can just design Composite and place it manually on
FormPage.

--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Re: FormPage in Visual Editor problem [message #125729 is a reply to message #125716] Tue, 06 June 2006 09:01 Go to previous message
Eclipse UserFriend
Originally posted by: andrey.batyuk.net

Konstantin Scheglov wrote:
> Check this:
>
http://www.instantiations.com/windowbuilderpro/docs/introduc tion/new_and_noteworthy_300.html
Not sure if i can afford it.
>> Or any other workaround?

> In theory you can just design Composite and place it manually on
> FormPage.
Thanks. I've tried it already - works fine. Thanks a lot!
Re: FormPage in Visual Editor problem [message #613014 is a reply to message #125576] Mon, 05 June 2006 15:09 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What version of VE, GEF, EMF, and Eclipse are you using?

Thanks,
Rich
Re: FormPage in Visual Editor problem [message #613016 is a reply to message #125616] Mon, 05 June 2006 15:19 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

I took a closer look. It is a current restriction. FormPage can't be
subclassed because it doesn't have a default constructor (one that takes
no arguments). You can open an enhancement against VE to be able to
handle this.

Rich Kulp wrote:
> What version of VE, GEF, EMF, and Eclipse are you using?
>
> Thanks,
> Rich

--
Thanks,
Rich Kulp
Re: FormPage in Visual Editor problem [message #613017 is a reply to message #125628] Mon, 05 June 2006 15:52 Go to previous message
Eclipse UserFriend
Originally posted by: andrey.batyuk.net

Will do.
But what if i make a subclass of FormPage with default constructor, and
then subclass it? Will it work? (Sorry for newbie question, i'm not yet
familiar with VE)
Re: FormPage in Visual Editor problem [message #613020 is a reply to message #125641] Mon, 05 June 2006 20:21 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

No, i tried that. That won't work either because FormPage expects a
FormEditor to be set on it. The problem is there is no FormEditor set on
it and so it thows NullPointerExceptions whenever you try to anything
with the FormPage.

Andrey Batyuk wrote:
> Will do.
> But what if i make a subclass of FormPage with default constructor, and
> then subclass it? Will it work? (Sorry for newbie question, i'm not yet
> familiar with VE)
>

--
Thanks,
Rich Kulp
Re: FormPage in Visual Editor problem [message #613022 is a reply to message #125667] Mon, 05 June 2006 20:25 Go to previous message
Eclipse UserFriend
Originally posted by: andrey.batyuk.net

Rich Kulp wrote:

> No, i tried that. That won't work either because FormPage expects a
> FormEditor to be set on it. The problem is there is no FormEditor set on
> it and so it thows NullPointerExceptions whenever you try to anything
> with the FormPage.

Ok, but how do i design form pages in designer then? Create a form, design
it and copy source to form page?
Or any other workaround?
Re: FormPage in Visual Editor problem [message #613024 is a reply to message #125690] Mon, 05 June 2006 22:46 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

I don't know. I've never created a FormPage. I don't know what is
expected. There isn't any examples in the base Eclipse on what a
FormPage implementation looks like.

Andrey Batyuk wrote:
> Rich Kulp wrote:
>
>> No, i tried that. That won't work either because FormPage expects a
>> FormEditor to be set on it. The problem is there is no FormEditor set
>> on it and so it thows NullPointerExceptions whenever you try to
>> anything with the FormPage.
>
>
> Ok, but how do i design form pages in designer then? Create a form,
> design it and copy source to form page?
> Or any other workaround?
>

--
Thanks,
Rich Kulp
Re: FormPage in Visual Editor problem [message #613025 is a reply to message #125690] Tue, 06 June 2006 04:30 Go to previous message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
Andrey Batyuk wrote:

>> No, i tried that. That won't work either because FormPage expects a
>> FormEditor to be set on it. The problem is there is no FormEditor set
>> on it and so it thows NullPointerExceptions whenever you try to
>> anything with the FormPage.
>
>
> Ok, but how do i design form pages in designer then? Create a form,
> design it and copy source to form page?

Check this:

http://www.instantiations.com/windowbuilderpro/docs/introduc tion/new_and_noteworthy_300.html

> Or any other workaround?

In theory you can just design Composite and place it manually on
FormPage.

--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)


Konstantin Scheglov,
Google, Inc.
Re: FormPage in Visual Editor problem [message #613028 is a reply to message #125716] Tue, 06 June 2006 09:01 Go to previous message
Eclipse UserFriend
Originally posted by: andrey.batyuk.net

Konstantin Scheglov wrote:
> Check this:
>
http://www.instantiations.com/windowbuilderpro/docs/introduc tion/new_and_noteworthy_300.html
Not sure if i can afford it.
>> Or any other workaround?

> In theory you can just design Composite and place it manually on
> FormPage.
Thanks. I've tried it already - works fine. Thanks a lot!
Previous Topic:FormPage in Visual Editor problem
Next Topic:How to putt image file using VE?
Goto Forum:
  


Current Time: Thu Apr 25 04:23:38 GMT 2024

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

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

Back to the top