blob: 05a17b461c0aa947fe657d82de19f14250fc47e0 [file] [log] [blame]
/*
* Copyright (c) 2008 Borland Software Corp.
*
* 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:
* Artem Tikhomirov (Borland) - initial API and implementation
*/
«IMPORT "http://www.eclipse.org/gmf/2008/Context"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
«EXTENSION Context»
«DEFINE New(List[FeatureContext] conditionAccessors) FOR List[FeatureContext]-»
«IF !isEmpty()-»
«IF withChildren().isEmpty()»«EXPAND newFeatureTracker
«ELSE
«IF !withoutChildren().isEmpty()»«EXPAND newFeatureTracker FOR withoutChildren()», «ENDIF
«EXPAND newAttachAdapter(conditionAccessors) FOREACH withChildren().filterEReference() SEPARATOR ","
«ENDIF
«ENDIF
«ENDDEFINE»
«DEFINE newFeatureTracker FOR List[FeatureContext]-»
new FeatureTracker(this, «EXPAND MetaModel::accessor FOREACH selector SEPARATOR ","»)«ENDDEFINE»
«REM»assumes !fc.children.isEmpty«ENDREM»
«DEFINE newAttachAdapter(List[FeatureContext] conditionAccessors) FOR FeatureContext
new AttachAdapterEXPAND MetaModel::accessor FOR selector», «IF conditionAccessors.contains(this)-»
new ChangeTracker() {
public void modelChanged(org.eclipse.emf.common.notify.Notification n) {
// FIXME enable/disable widget(s) -- HOWEVER, need access to Binding/Widget here, so can't share the template with e.g. Alex's ItemProviders
}
}, «ENDIF
«EXPAND New(conditionAccessors) FOR children.typeSelect(FeatureContext)»)«ENDDEFINE»