01: /*******************************************************************************
02: * Copyright (c) 2000, 2004 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Common Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/cpl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.openwfe.gpe.policies;
11:
12: import org.eclipse.gef.commands.Command;
13: import org.eclipse.gef.editpolicies.ComponentEditPolicy;
14: import org.eclipse.gef.requests.GroupRequest;
15:
16: import org.openwfe.gpe.model.CompositeOrOneChild;
17: import org.openwfe.gpe.model.FlowElement;
18: import org.openwfe.gpe.model.commands.DeleteCommand;
19:
20: /**
21: * @author Daniel Lee
22: */
23: public class ActivityEditPolicy extends ComponentEditPolicy {
24:
25: /**
26: * @see ComponentEditPolicy#createDeleteCommand(org.eclipse.gef.requests.GroupRequest)
27: */
28: protected Command createDeleteCommand(GroupRequest deleteRequest) {
29: CompositeOrOneChild parent = (CompositeOrOneChild) (getHost()
30: .getParent().getModel());
31: DeleteCommand deleteCmd = new DeleteCommand();
32: deleteCmd.setParent(parent);
33: deleteCmd.setChild((FlowElement) (getHost().getModel()));
34: return deleteCmd;
35: }
36:
37: }
|