/*
 * Created on Oct 6, 2003
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package APStudio;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.CreationFactory;
import org.eclipse.gef.tools.ConnectionCreationTool;

import APStudio.models.InheritanceConnector;
import APStudio.models.commands.ConnectionCommand;

/**
 * @author Gong Jun
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class IConnectionCreationTool extends ConnectionCreationTool {

	public IConnectionCreationTool() {
		setUnloadWhenFinished(false);
	}


	public IConnectionCreationTool(CreationFactory factory) {
		setFactory(factory);
		setUnloadWhenFinished(false);
	}
	
	protected Command getCommand() {
		if (getTargetEditPart() == null)
			return null;
		ConnectionCommand cmd = (ConnectionCommand)getTargetEditPart().getCommand(getTargetRequest());
		cmd.setConnector(new InheritanceConnector());
		return cmd; 
	}

}
