public class VarModelListener extends AbstractModelChangeListener implements IModelReloadListener<Project>, IModelListener<Project>
de.uni_hildesheim.sse.model.varModel.Project listener, which
receives notifications about changes of the variability model and then forces
an update of the de.uni_hildesheim.sse.ui.XtextEditor instance
that is used to edit the corresponding document in which the variability
model is defined.
Note that receiving a change notification will also trigger updates of
other running editors via the
de.uni_hildesheim.sse.dslcore.ui.editors.ModelChangeNotifier.isListening, underlyingModel, xtextDocument, xtextEditor| Constructor and Description |
|---|
VarModelListener()
Constructs a variability model listener that updates a registered
de.uni_hildesheim.sse.ui.XtextEditor instance if the
underlying de.uni_hildesheim.sse.model.varModel.Project
instance, which is edited in the registered editor, changes. |
| Modifier and Type | Method and Description |
|---|---|
protected IModel |
getUnderlyingModel(java.net.URI modelFileUri,
boolean forceBuild)
Returns the
de.uni_hildesheim.sse.utils.modelManagement.IModel instance
(an IVML-, VIL-, or VTL-model) based on the URI of the org.eclipse.core.resources.IResource
(the document) currently in use by the editor that is registered to this listener. |
void |
notifyReloadFailed(Project model)
Is called to notify that
model was not successfully reloaded, e.g., due to syntactic or semantic
errors. |
void |
notifyReplaced(Project oldModel,
Project newModel)
Is called to notify that
oldModel is replaced by
newModel. |
protected boolean |
registerToUnderlyingModel(IModel underlyingModel)
Adds this listener to the underlying model in order to receive events
if this model changes.
|
void |
unregister()
Unregisters this listener from the underlying model in order to receive
no events about changes of the model anymore.
|
buildModel, isListening, register, setXtextDocument, updateRegisteredEditorpublic VarModelListener()
de.uni_hildesheim.sse.ui.XtextEditor instance if the
underlying de.uni_hildesheim.sse.model.varModel.Project
instance, which is edited in the registered editor, changes.public void notifyReplaced(Project oldModel, Project newModel)
IModelListeneroldModel is replaced by
newModel. The listener registrations for
oldModel will be adjusted accordingly.oldModel or newModel
during this method.notifyReplaced in interface IModelListener<Project>oldModel - the old model being replacednewModel - the new model (the replacement)public void notifyReloadFailed(Project model)
IModelReloadListenermodel was not successfully reloaded, e.g., due to syntactic or semantic
errors. Please note that successful reloads are notified through IModelListener.notifyReloadFailed in interface IModelReloadListener<Project>model - the model that was not updatedpublic void unregister()
AbstractModelChangeListenerunregister in class AbstractModelChangeListenerprotected boolean registerToUnderlyingModel(IModel underlyingModel)
AbstractModelChangeListenerregisterToUnderlyingModel in class AbstractModelChangeListenerunderlyingModel - the de.uni_hildesheim.sse.utils.modelManagement.IModel
to which this listener must be registeredtrue if the registration of this listener to the given mode was successful,
false otherwiseprotected IModel getUnderlyingModel(java.net.URI modelFileUri, boolean forceBuild)
AbstractModelChangeListenerde.uni_hildesheim.sse.utils.modelManagement.IModel instance
(an IVML-, VIL-, or VTL-model) based on the URI of the org.eclipse.core.resources.IResource
(the document) currently in use by the editor that is registered to this listener.
Note that this method will be called internally to retrieve the underlying model.getUnderlyingModel in class AbstractModelChangeListenermodelFileUri - the java.net.URI of the org.eclipse.core.resources.IResource
(the document) currently in use by the editor that is registered to this listener.forceBuild - true if the model should be build if it cannot resolved. false
if no build should be forced.de.uni_hildesheim.sse.utils.modelManagement.IModel
(an IVML-, VIL-, or VTL-model) which is currently edited in the registered editor
of this listener.Copyright © 2009 - 2018 SSE. All Rights Reserved.