01: /*******************************************************************************
02: * Copyright (c) 2003, 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.draw2d.Label;
13:
14: import org.eclipse.gef.commands.Command;
15: import org.eclipse.gef.editpolicies.DirectEditPolicy;
16: import org.eclipse.gef.requests.DirectEditRequest;
17:
18: /**
19: * EditPolicy for the direct editing of FlowElement names.
20: * @author Daniel Lee
21: */
22: public class ActivityDirectEditPolicy extends DirectEditPolicy {
23:
24: /**
25: * @see DirectEditPolicy#getDirectEditCommand(org.eclipse.gef.requests.DirectEditRequest)
26: */
27: protected Command getDirectEditCommand(DirectEditRequest request) {
28: return null;
29: }
30:
31: /**
32: * @see DirectEditPolicy#showCurrentEditValue(org.eclipse.gef.requests.DirectEditRequest)
33: */
34: protected void showCurrentEditValue(DirectEditRequest request) {
35: String value = (String) request.getCellEditor().getValue();
36: ((Label) getHostFigure()).setText(value);
37: }
38:
39: }
|