/** * @see IModelStateListener#modelResourceMoved(IStructuredModel, * IStructuredModel) */ public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) { modelStateNotifier.removeModelStateListener(this); modelStateNotifier = newModel; updateResolver(modelStateNotifier); modelStateNotifier.addModelStateListener(this); }
/** * @see IModelStateListener#modelResourceMoved(IStructuredModel, * IStructuredModel) */ public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) { // if oldModel != newModel, bad things might happen with the adapter stateNotifier.removeModelStateListener(this); stateNotifier = newModel; updateResolver(stateNotifier); stateNotifier.addModelStateListener(this); }
/** * @see IModelStateListener#modelResourceMoved(IStructuredModel, * IStructuredModel) */ public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) { stateNotifier.removeModelStateListener(this); stateNotifier = newModel; updateResolver(stateNotifier); stateNotifier.addModelStateListener(this); }
final int length = event.getLength(); _model.addModelStateListener(new IModelStateListener() { public void modelAboutToBeChanged(IStructuredModel model) {
IDOMNode xmlNode = (IDOMNode) target; modelStateNotifier = xmlNode.getModel(); modelStateNotifier.addModelStateListener(getInternalModelStateListener());
IStructuredModel model = stateNotifier = xmlNode.getModel(); if(model.getBaseLocation() != null) { stateNotifier.addModelStateListener(this);
IStructuredModel model = xmlNode.getModel(); stateNotifier = xmlNode.getModel(); stateNotifier.addModelStateListener(getInternalModelStateListener());
private void setModel(IStructuredModel structuredModel) { if (fModel == structuredModel) return; if (fModel != null) { fModel.removeModelStateListener(fInternalModelStateListener); // IStructuredDocument structuredDocument = fModel.getStructuredDocument(); if (structuredDocument != null) { structuredDocument.removeDocumentListener(fInternalDocumentListener); structuredDocument.removeDocumentAboutToChangeListener(fInternalStructuredDocumentAboutToChange); structuredDocument.removeDocumentChangedListener(fInternalStructuredDocumentListener); } } fModel = structuredModel; if (fModel != null) { fModel.addModelStateListener(fInternalModelStateListener); // IStructuredDocument structuredDocument = fModel.getStructuredDocument(); if (structuredDocument != null) { structuredDocument.addDocumentListener(fInternalDocumentListener); structuredDocument.addDocumentAboutToChangeListener(fInternalStructuredDocumentAboutToChange); structuredDocument.addDocumentChangedListener(fInternalStructuredDocumentListener); } } } }
_model.addModelStateListener(_internalModelListener); if (_model.getUndoManager() != null) { _model.getUndoManager().connect(this);