Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Problems migrating to 0.6
Problems migrating to 0.6 [message #989586] Thu, 06 December 2012 21:01 Go to next message
Eyck Jentzsch is currently offline Eyck JentzschFriend
Messages: 21
Registered: August 2012
Junior Member
Hi,
I tried to migrate my plugin(s) from 0.5.2 to 0.6.0 but ran into problems.
I changed the constructor of the Editor class (extending SapphireEditorForXml) from
    public MyEditor(){
        super( MyPlugin.PLUGIN_ID);
        setRootModelElementType( IMy.TYPE );
        setEditorDefinitionPath( MyPlugin.PLUGIN_ID+"/"+resourcePath+"/main.page" );
    }

to
    public MyEditor(){
        super(IMy.TYPE,
            DefinitionLoader
                .context( MyEditor.class.getClassLoader() )
                .sdef( "a.b.c.MyEditor" )
                .page( "main.page" )
        );
    }

Running this i just get a ClassCastException:
java.lang.ClassCastException: org.eclipse.sapphire.ui.def.internal.SapphireCustomPartDef cannot be cast to org.eclipse.sapphire.ui.def.FormDef
	at org.eclipse.sapphire.ui.FormPart.initChildParts(FormPart.java:121)
	at org.eclipse.sapphire.ui.FormPart.init(FormPart.java:42)
	at org.eclipse.sapphire.ui.SapphirePart.init(SapphirePart.java:179)
	at org.eclipse.sapphire.ui.SapphirePart.create(SapphirePart.java:1206)
	at org.eclipse.sapphire.ui.FormPart.initChildParts(FormPart.java:126)


So it seems I missed something in the migration process. Does anybody have an idea?

BTW, the migration guide says in section 'FormEditorPage' 'context( getClass().getClassLoader() )' to be called in the constructor but there you cannot call getClass() as the object just gets constructed....

Best regards

-Eyck
Re: Problems migrating to 0.6 [message #989744 is a reply to message #989586] Fri, 07 December 2012 13:45 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Nothing obvious jumps out at me just by looking at the top of the stack trace. This will need a deeper investigation. Could you post the full stack trace and a snippet of your sdef around the custom part. I need to see what the custom part is contained by.

Quote:
BTW, the migration guide says in section 'FormEditorPage' 'context( getClass().getClassLoader() )' to be called in the constructor but there you cannot call getClass() as the object just gets constructed....


The migration for FormEditorPage is correct. Perhaps you meant to reference migration for SapphireEditorForXml instead, which is indeed incorrect as you've described. I have opened a bug and updated the documentation.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=396042

- Konstantin
Re: Problems migrating to 0.6 [message #989842 is a reply to message #989744] Sat, 08 December 2012 10:26 Go to previous message
Eyck Jentzsch is currently offline Eyck JentzschFriend
Messages: 21
Registered: August 2012
Junior Member
Hi Konstantin,
you are right, I meant the SapphireEditorForXml.
I will post the stuff later as I currently switched back to 0.5.3 and need to finish a few things first.
Cheers

-Eyck
Previous Topic:Collecting Error/Warning messages produced by a Node Factory
Next Topic:Calling all Sapphire adopters
Goto Forum:
  


Current Time: Thu Apr 25 17:25:44 GMT 2024

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

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

Back to the top