/******************************************************************************* * Copyright (c) 2012 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * VMware, Inc. - initial API and implementation *******************************************************************************/ package org.springframework.ide.eclipse.config.graph.policies; import org.eclipse.draw2d.Label; import org.eclipse.gef.editpolicies.DirectEditPolicy; import org.eclipse.gef.requests.DirectEditRequest; import org.springframework.ide.eclipse.config.graph.figures.SubgraphFigure; /** * StructuredActivityDirectEditPolicy * @author Leo Dos Santos * @author Christian Dupuis */ public class StructuredActivityDirectEditPolicy extends ActivityDirectEditPolicy { /** * @see DirectEditPolicy#showCurrentEditValue(org.eclipse.gef.requests.DirectEditRequest) */ @Override protected void showCurrentEditValue(DirectEditRequest request) { String value = (String) request.getCellEditor().getValue(); ((Label) ((SubgraphFigure) getHostFigure()).getHeader()).setText(value); ((Label) ((SubgraphFigure) getHostFigure()).getFooter()).setText("/" + value);//$NON-NLS-1$ // hack to prevent async layout from placing the cell editor twice. getHostFigure().getUpdateManager().performUpdate(); } }