/** * @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); }
public void release() { super.release(); if (stateNotifier != null) { stateNotifier.removeModelStateListener(this); } stateNotifier = null; if (modelQueryAdapterImpl != null) { modelQueryAdapterImpl.release(); } }
/** * @see IModelStateListener#modelResourceMoved(IStructuredModel, * IStructuredModel) */ public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) { stateNotifier.removeModelStateListener(this); stateNotifier = newModel; updateResolver(stateNotifier); stateNotifier.addModelStateListener(this); }
public void release() { super.release(); if (modelStateNotifier != null) { modelStateNotifier.removeModelStateListener(internalModelStateListener); } modelStateNotifier = null; if (modelQueryAdapter != null) { modelQueryAdapter.release(); } }
public void release() { super.release(); if (stateNotifier != null) stateNotifier.removeModelStateListener(getInternalModelStateListener()); stateNotifier = null; if (modelQueryAdapterImpl != null) modelQueryAdapterImpl.release(); }
public void modelChanged(IStructuredModel model) { _model.removeModelStateListener(this); ISelection sel = SelectionHelper .convertToDesignerSelection(getGraphicViewer(), offset, length); if (sel != null) { getGraphicViewer().setSelection(sel); } }
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); } } } }
if (_model.getUndoManager() != null) _model.getUndoManager().disconnect(this); _model.removeModelStateListener(_internalModelListener);