is there a way to repaint the connections of an editpart after a command has been executed?
i want to drag a connection between two nodes, but the source end of the connection should be delegated to a child. it's already working except that the connection source is attached to the parent and not the child until i drag some another node onto the diagram. then, the connections are showed properly. i want to repaint the connections automatically. how can i achieve this?
my custom editpolicy:
public class GoalItemSemanticEditPolicyOverride extends
GoalItemSemanticEditPolicy {
protected Command getCompleteCreateRelationshipCommand(
CreateRelationshipRequest req) {
super.getCompleteCreateRelationshipCommand(req);
if (XkaosElementTypes.GoalRefinementGoals_4013 == req.getElementType()) {
return getGEFWrapper(new GoalRefinementsCreateCommandOverride(req,
req.getSource(), req.getTarget()));
}
return null;
}
my custom command:
public class GoalRefinementsCreateCommandOverride extends
GoalRefinementGoalsCreateCommand {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
IAdaptable info) throws ExecutionException {
if (!canExecute()) {
throw new ExecutionException(
"Invalid arguments in create link command"); //$NON-NLS-1$
}
if (getUncastedSource() != null && getUncastedTarget() != null) {
}
if(getUncastedSource() instanceof Goal && getUncastedTarget() instanceof Goal){
GoalRefinement gr = XkaosFactory.eINSTANCE.createGoalRefinement();
((Goal )getUncastedSource()).getRefinements().add(gr);
gr.getGoals().add((Goal) getUncastedTarget());
//TODO repaint root
}
if(getUncastedSource() instanceof Goal && getUncastedTarget() instanceof DomProperty){
GoalRefinement gr = XkaosFactory.eINSTANCE.createGoalRefinement();
((Goal )getUncastedSource()).getRefinements().add(gr);
gr.getDomproperties().add((DomProperty) getUncastedTarget());
}
}
return CommandResult.newOKCommandResult();
}