Problem in Saving file - GEF

79 views
Skip to first unread message

vrushali babar

unread,
Aug 10, 2012, 1:48:24 AM8/10/12
to eclipse-pune
Hi,

I have created a sample editor with flyout palette which can add radion button control to the editor. I could drag and drop the radio button from palatte to editor but can not save the file.
Error while saving -

java.io.NotSerializableException: org.eclipse.ui.views.properties.TextPropertyDescriptor
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)

I have implemented an abstract class with interfaces IPropertySource, Cloneable and Serializable.

Please advise me on this. Stuck since long.

Thanks in advance,
Vrushali.

Andrew Wynham

unread,
Aug 14, 2012, 9:14:40 AM8/14/12
to eclipse-...@googlegroups.com
You must have a reference to TextPropertyDescriptor somewhere.  Either re-factor your code so that what is being saved doesn't reference it or mark your field as "transient".

-Drew


--
===================================================
Visit us at:
http://groups.google.com/group/eclipse-pune-dev/
===================================================

Ashish Singh

unread,
Aug 14, 2012, 10:05:24 PM8/14/12
to eclipse-...@googlegroups.com
Hi Vrushali,
You should not be serializing UI classes when to save editor. Looks like you are writing editor for a declarative UI,you should be serializing your editor model (i will suggest xml) like below
<Shell xmlns="http://www.eclipse.org/xwt/presentation"
    xmlns:x="http://www.eclipse.org/xwt">
    <Shell.layout>
       <FillLayout/>
    </Shell.layout>
    <Button text="Hello, world!">
    </Button>
</Shell>
Check  http://wiki.eclipse.org/E4/XWT  and they have editor http://wiki.eclipse.org/E4/XWTDesigner .

-ashish
Reply all
Reply to author
Forward
0 new messages