blob: 6dbf890850649d220bc7a44c38282eec1a29180b [file] [log] [blame]
/*
* Copyright (c) 2007, 2010 Borland Software Corporation and others
*
* 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:
* Alexander Shatalin (Borland) - initial API and implementation
* Artem Tikhomirov moved from xpt::diagram::editpolicies to diagram::editpolicies API location
* [281014] pass semantic hints right from the CEP
*/
«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
«DEFINE Main FOR gmfgen::GenDiagram
«EXPAND xpt::Common::copyright FOR editorGen
package «editPoliciesPackageName»;
«EXPAND xpt::Common::generatedClassComment»
public class «canonicalEditPolicyClassName» extends org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy {
«REM»
Perhaps, we need to supply implementation of refreshOnActivate() identical to that in CanonicalConnectionEditPolicy,
if we observe troubles like in the bug 114992. Although I suspect the fact we do no check for EP being active when creating
a connection implies we don't need this method.
«ENDREM»
«EXPAND impl::diagram::update::CanonicalUpdate::body-»
«EXPAND refreshSemanticMethod-»
«EXPAND refreshLinks-»
«EXPAND impl::diagram::update::domain2notation::DomainToNotationClass-»
«EXPAND additions-»
}
«ENDDEFINE»
«DEFINE refreshSemanticMethod FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::generatedMemberComment»
protected void refreshSemantic() {
if (resolveSemanticElement() == null) {
return;
}
«EXPAND CodeStyle::newGenericInstance('createdViews', 'java.util.LinkedList', 'org.eclipse.core.runtime.IAdaptable')»();
«EXPAND impl::diagram::update::CanonicalUpdate::refreshSemanticChildren('createdViews', editorGen.diagramUpdater)-»
«IF links->notEmpty()-»
«EXPAND CodeStyle::G('java.util.Collection', 'org.eclipse.core.runtime.IAdaptable')» createdConnectionViews = refreshConnections();
«ENDIF-»
«EXPAND impl::diagram::update::CanonicalUpdate::executeLayoutCommand('createdViews')-»
«IF links->notEmpty()-»
createdViews.addAll(createdConnectionViews);
«ENDIF-»
makeViewsImmutable(createdViews);
}
«ENDDEFINE»
«DEFINE refreshLinks FOR gmfgen::GenDiagram-»
«IF links->notEmpty()-»
«EXPAND refreshConnectionsMethod-»
«EXPAND impl::diagram::update::CanonicalUpdate::refreshConnectionsAuxMethods-»
«ENDIF-»
«ENDDEFINE»
«DEFINE refreshConnectionsMethod FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::generatedMemberComment»
private «EXPAND CodeStyle::G('java.util.Collection', 'org.eclipse.core.runtime.IAdaptable')» refreshConnections() {
«EXPAND impl::diagram::update::CanonicalUpdate::refreshConnectionsBody-»
}
«ENDDEFINE»
«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»