Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Connections not showing up...
Connections not showing up... [message #201428] Mon, 31 October 2005 23:14 Go to next message
Eclipse UserFriend
Originally posted by: jjesselli.harmonia.com

Ahoy!

I've been battling with this for a while now. I just added a connection
tool to the palette. However, when I create the connections they do not
show up in the editor. They are, however, added to the model. I can tell
because the document is marked as dirty, and if I close and reopen they
appear correctly. (This is simply because they are added to the model
and then reparsed). One thing I noticed is that the new connections
never hit the editPart factory. Can you think of any reason why this
might happen? Any help would be greatly appreciated. Thanks!

-- Justin Jesselli



connection command snippets:

protected Command getConnectionCompleteCommand(CreateConnectionRequest
request) {

CreateConnectionCommand command = (CreateConnectionCommand)
request.getStartCommand();

Part trgPart = (Part)request.getTargetEditPart().getModel();
Structure structure = (Structure) trgPart.getParent();

command.setStructure( structure );
command.setTarget( trgPart );

return command;
}


protected Command getConnectionCreateCommand(CreateConnectionRequest
request) {
Part srcPart = (Part)request.getTargetEditPart().getModel();
Part connection = (Part)request.getNewObject();

CreateConnectionCommand command = new CreateConnectionCommand();
command.setConnection( connection );
command.setSource( srcPart );

request.setStartCommand( command );

return command;
}
Re: Connections not showing up... [message #201436 is a reply to message #201428] Tue, 01 November 2005 02:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zx.us.ibm.com

Do they show up on refresh{Source,Target}Connections on your editparts?
Put a break point there.

It could be that visuals aren't refreshed possibly.

Don't you love these problems :)?

Cheers,

~ Chris
Re: Connections not showing up... [message #201483 is a reply to message #201436] Tue, 01 November 2005 15:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jjesselli.harmonia.com

Chris Aniszczyk wrote:
> Do they show up on refresh{Source,Target}Connections on your editparts?
> Put a break point there.
>
> It could be that visuals aren't refreshed possibly.
>
> Don't you love these problems :)?
>
> Cheers,
>
> ~ Chris

No, unfortunately they do not show up. I forced the parent (the root
editpart) to refresh source/target connections. However, this didn't
have any noticeable effect. I really believe the issue is that an
editPart isn't being created in the first place, so the parent doesn't
even count it amongst the things that it needs to update. The strange
thing is that all other objects that I create from the palette work just
fine!

-- Justin
Re: Connections not showing up... [message #201556 is a reply to message #201483] Tue, 01 November 2005 23:29 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

Refreshing the root editpart's connections won't do anything. The source
and target editparts need to refresh their connections. Do this when your
node editparts are notified of the change in the model. See one of our
several examples if you want to look at the code.
ShapeEditPart#propertyChange() is one.

If you've set that up properly, maybe your
getModelSource/TargetConnections() is returning a stale list?

"Justin Jesselli" <jjesselli@harmonia.com> wrote in message
news:dk80qs$oo9$1@news.eclipse.org...
> Chris Aniszczyk wrote:
> > Do they show up on refresh{Source,Target}Connections on your editparts?
> > Put a break point there.
> >
> > It could be that visuals aren't refreshed possibly.
> >
> > Don't you love these problems :)?
> >
> > Cheers,
> >
> > ~ Chris
>
> No, unfortunately they do not show up. I forced the parent (the root
> editpart) to refresh source/target connections. However, this didn't
> have any noticeable effect. I really believe the issue is that an
> editPart isn't being created in the first place, so the parent doesn't
> even count it amongst the things that it needs to update. The strange
> thing is that all other objects that I create from the palette work just
> fine!
>
> -- Justin
Previous Topic:Please, give me an editor example
Next Topic:how do i add a page which is extended GraphicalEditorWithPalette ??
Goto Forum:
  


Current Time: Sat Aug 17 06:31:57 GMT 2024

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

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

Back to the top