Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » creating editors with gmf, nothing is drawn in the diagram
creating editors with gmf, nothing is drawn in the diagram [message #665882] Sun, 17 April 2011 20:53 Go to next message
Robin  randst is currently offline Robin randstFriend
Messages: 7
Registered: April 2011
Junior Member
hi,
i've got a problem, i generated two editors by using the gmf-dashboard.
The first one works fine, but if i use the second one, something does
not work, this is very confusing for me. I tryed it a lot of time from
the beginning, but the same failure appears every time. If i want to
create a new node from palette or diagram nothing happens, i also
started the editor in debug mode and discovered that the
createNodeFigure-methods are not called, there should be a notiyfication
fired and this notification should trigger all needed actions to create
and display the node in the diagram, it seems to me that this is not
done. Has anybody an idea about solving this problem or does anybody
know where my faults are located during the creation-steps? If someone
has a hint, please send me an answer.

kind regards Robin
Re: creating editors with gmf, nothing is drawn in the diagram [message #666063 is a reply to message #665882] Mon, 18 April 2011 20:21 Go to previous messageGo to next message
Robin  randst is currently offline Robin randstFriend
Messages: 7
Registered: April 2011
Junior Member
Maybe somebody has an idea how to force, that the methods are called or
the notification is fired, please help me it's important, i tried to
find a way by myself, i wrote mails to all people i know, who working on
editor creation (with gmf), i also met people, but no one knows whats
wrong or how to solve this problem. I'm happy about every hint, my
previous post is from April 15th 2011, ceate new from palette or diagram
....
http://www.eclipse.org/forums/index.php?t=tree&th=207783 &S=691c192d8ff941f3270cc0514e731d2b

but this was to bad to understand, i think. So i started a new.

KIND REGARDS robin
THX for every HELP/HINT

Am 17.04.2011 22:53, schrieb Robin Brandstädter:
> hi,
> i've got a problem, i generated two editors by using the gmf-dashboard.
> The first one works fine, but if i use the second one, something does
> not work, this is very confusing for me. I tryed it a lot of time from
> the beginning, but the same failure appears every time. If i want to
> create a new node from palette or diagram nothing happens, i also
> started the editor in debug mode and discovered that the
> createNodeFigure-methods are not called, there should be a notiyfication
> fired and this notification should trigger all needed actions to create
> and display the node in the diagram, it seems to me that this is not
> done. Has anybody an idea about solving this problem or does anybody
> know where my faults are located during the creation-steps? If someone
> has a hint, please send me an answer.
>
> kind regards Robin
Re: creating editors with gmf, nothing is drawn in the diagram [message #666142 is a reply to message #666063] Tue, 19 April 2011 10:08 Go to previous messageGo to next message
Robin  randst is currently offline Robin randstFriend
Messages: 7
Registered: April 2011
Junior Member
Hi again,
i found something new !
The Problem is in every CreateCommand doExecuteWithResult in edit.commands.
I.E. if i want to create a new State so StateCreateCommand has the

protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
IAdaptable info) throws ExecutionException {
State newElement = SeftFactory.eINSTANCE.createState();

Seft owner = (Seft) getElementToEdit();
owner.getStates().add(newElement); // *1

doConfigure(newElement, monitor, info);

((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}





*1 : if i inspect this line the information is: An exception occurred:
java.lang.UnsupportedOperationException

But if i just inspect owner.getStates() befor and open the data (list)
and than go on, everything works and the symbol is drawn, otherwise (the
usual case is that) this Exception forces a rollback and an
ExecutionException.
So does ANYBODY know how to fix this or what is worng here, its very
confusing for me.

Kind regards Robin.


Am 18.04.2011 22:21, schrieb Robin Brandstädter:
>
> Maybe somebody has an idea how to force, that the methods are called or
> the notification is fired, please help me it's important, i tried to
> find a way by myself, i wrote mails to all people i know, who working on
> editor creation (with gmf), i also met people, but no one knows whats
> wrong or how to solve this problem. I'm happy about every hint, my
> previous post is from April 15th 2011, ceate new from palette or diagram
> ...
> http://www.eclipse.org/forums/index.php?t=tree&th=207783 &S=691c192d8ff941f3270cc0514e731d2b
>
> but this was to bad to understand, i think. So i started a new.
>
> KIND REGARDS robin
> THX for every HELP/HINT
>
> Am 17.04.2011 22:53, schrieb Robin Brandstädter:
>> hi,
>> i've got a problem, i generated two editors by using the gmf-dashboard.
>> The first one works fine, but if i use the second one, something does
>> not work, this is very confusing for me. I tryed it a lot of time from
>> the beginning, but the same failure appears every time. If i want to
>> create a new node from palette or diagram nothing happens, i also
>> started the editor in debug mode and discovered that the
>> createNodeFigure-methods are not called, there should be a notiyfication
>> fired and this notification should trigger all needed actions to create
>> and display the node in the diagram, it seems to me that this is not
>> done. Has anybody an idea about solving this problem or does anybody
>> know where my faults are located during the creation-steps? If someone
>> has a hint, please send me an answer.
>>
>> kind regards Robin
>
Re: creating editors with gmf, nothing is drawn in the diagram [message #666160 is a reply to message #666142] Tue, 19 April 2011 11:25 Go to previous message
Robin  randst is currently offline Robin randstFriend
Messages: 7
Registered: April 2011
Junior Member
hi i got the solution by my self. just surround the line with a
try-catch-block now it is working.

protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
IAdaptable info) throws ExecutionException {
State newElement = SeftFactory.eINSTANCE.createState();

Seft owner = (Seft) getElementToEdit();
try{
owner.getStates().add(newElement);
}catch (UnsupportedOperationException e) {
// TODO: handle exception
}

doConfigure(newElement, monitor, info);

((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
Am 19.04.2011 12:08, schrieb Robin Brandstädter:
> Hi again,
> i found something new !
> The Problem is in every CreateCommand doExecuteWithResult in edit.commands.
> I.E. if i want to create a new State so StateCreateCommand has the
>
> protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
> IAdaptable info) throws ExecutionException {
> State newElement = SeftFactory.eINSTANCE.createState();
>
> Seft owner = (Seft) getElementToEdit();
> owner.getStates().add(newElement); // *1
>
> doConfigure(newElement, monitor, info);
>
> ((CreateElementRequest) getRequest()).setNewElement(newElement);
> return CommandResult.newOKCommandResult(newElement);
> }
>
>
>
>
>
> *1 : if i inspect this line the information is: An exception occurred:
> java.lang.UnsupportedOperationException
>
> But if i just inspect owner.getStates() befor and open the data (list)
> and than go on, everything works and the symbol is drawn, otherwise (the
> usual case is that) this Exception forces a rollback and an
> ExecutionException.
> So does ANYBODY know how to fix this or what is worng here, its very
> confusing for me.
>
> Kind regards Robin.
>
>
> Am 18.04.2011 22:21, schrieb Robin Brandstädter:
>>
>> Maybe somebody has an idea how to force, that the methods are called or
>> the notification is fired, please help me it's important, i tried to
>> find a way by myself, i wrote mails to all people i know, who working on
>> editor creation (with gmf), i also met people, but no one knows whats
>> wrong or how to solve this problem. I'm happy about every hint, my
>> previous post is from April 15th 2011, ceate new from palette or diagram
>> ...
>> http://www.eclipse.org/forums/index.php?t=tree&th=207783 &S=691c192d8ff941f3270cc0514e731d2b
>>
>>
>> but this was to bad to understand, i think. So i started a new.
>>
>> KIND REGARDS robin
>> THX for every HELP/HINT
>>
>> Am 17.04.2011 22:53, schrieb Robin Brandstädter:
>>> hi,
>>> i've got a problem, i generated two editors by using the gmf-dashboard.
>>> The first one works fine, but if i use the second one, something does
>>> not work, this is very confusing for me. I tryed it a lot of time from
>>> the beginning, but the same failure appears every time. If i want to
>>> create a new node from palette or diagram nothing happens, i also
>>> started the editor in debug mode and discovered that the
>>> createNodeFigure-methods are not called, there should be a notiyfication
>>> fired and this notification should trigger all needed actions to create
>>> and display the node in the diagram, it seems to me that this is not
>>> done. Has anybody an idea about solving this problem or does anybody
>>> know where my faults are located during the creation-steps? If someone
>>> has a hint, please send me an answer.
>>>
>>> kind regards Robin
>>
>
Previous Topic:How to modify a position attribute in real time?
Next Topic:centered labels in ellipse figure
Goto Forum:
  


Current Time: Wed Apr 24 22:23:11 GMT 2024

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

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

Back to the top