Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Unlik(Unlink PictogramElement to Business object)
Unlik [message #989276] Wed, 05 December 2012 13:26 Go to next message
Anatoliy Tischenko is currently offline Anatoliy Tischenko
Messages: 7
Registered: July 2012
Junior Member
I have one business object and I was linked two Pictogram Elements with it.
When I want to remove one of Pictogram elements I need to unlink it with business object. Because if don't unlink business object with pictogram then removed all pictograms which was linked with business object.
How I can unlik PictogramElement s with Business object.

Sorry for my English.

For Example:

public class AddFeature extends AbstractAddFeature {

public PictogramElement add(IAddContext context){
Object bo = getBusinessObject();
PictogramElement peFirst = getFirstPictogram();
PictogramElement peSecond = getSecondPictogram();
link(peFirst, bo);
link(peSecond, bo);
}// add
}// Add Feature

public class RemoveFeature implements IRemoveFeature{
void remove(IRemoveContext context){
Object bo = getBusinessObject();
PictogramElement peFirst = getFirstPictogram();
PictogramElement peSecond = getSecondPictogram();

/*In this part i want to delete peFirst*/
/*But first I need to UNLIK*/

//unlink code
/*Delete PictogramElement*/
Graphiti.getPeService().deletePictogramElement(peFirst);
}//void remove
}//RemoveFeature
Re: Unlik [message #989421 is a reply to message #989276] Thu, 06 December 2012 07:53 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1612
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Anatoliy,

the method AbstractFeature.link(PictogramElement, Object[]) (note the array
second parameter) will remove all currently linked domain objects and link
only the new ones passed into the method. Probably that's what you're
looking for.

Michael
Re: Unlik [message #990447 is a reply to message #989421] Wed, 12 December 2012 14:26 Go to previous message
Anatoliy Tischenko is currently offline Anatoliy Tischenko
Messages: 7
Registered: July 2012
Junior Member
Michael,

Thank you!
I'll try do like this.
Previous Topic:Regarding Graphiti 0.10.0 MileStone Fixes
Next Topic:DirectEditing in BoxRelativeAnchor
Goto Forum:
  


Current Time: Mon Oct 20 21:29:31 GMT 2014

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

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