[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Please Help!!!

Hi all,

I have tried what Gunay said, but it doesn't work. This is the code for the getConnectionCreateCommand and getConnectionCompleteCommand methods:

   protected Command getConnectionCompleteCommand(
			CreateConnectionRequest request) {
		
		ModelObject model = (ModelObject) getHost().getModel();
		
		if(model==null){
			return null;
		}
		else{
			ConnectionCommand command = (ConnectionCommand) request
			.getStartCommand();
			command.setTarget(getJCLECSubpart());
			ConnectionAnchor ctor = getJCLECEditPart().getTargetConnectionAnchor(
					request);
			if (ctor == null)
				return null;
			command.setTargetTerminal(getJCLECEditPart()
					.mapConnectionAnchorToTerminal(ctor));
			return command;
		}
	}

protected Command getConnectionCreateCommand(CreateConnectionRequest request) {

ModelObject model = (ModelObject) getHost().getModel();


if(model == null){
return null;
}
else{
ConnectionCommand command = new ConnectionCommand();
command.setConnection(new Arrow());
command.setSource(getJCLECSubpart());
ConnectionAnchor ctor = getJCLECEditPart().getSourceConnectionAnchor(
request);
command.setSourceTerminal(getJCLECEditPart()
.mapConnectionAnchorToTerminal(ctor));
request.setStartCommand(command);
return command;
}
}



Why it doesn't work? Please, help me. Thankyou very much.

  --Jose