/** * Dispose services used in this part. * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#dispose() */ @Override public void dispose() { this.setUndoContext( new IUndoContext() { @Override public String getLabel() { return "Disposed undo context"; } @Override public boolean matches(IUndoContext context) { return false; } }); // Avoid disposing the shared UndoContext when this nestedEditor is dispose // Super.dispose() will try to dispose the IUndoContext super.dispose(); ISaveAndDirtyService saveAndDirtyService; try { saveAndDirtyService = servicesRegistry.getService(ISaveAndDirtyService.class); saveAndDirtyService.removeIsaveablePart(this); } catch (ServiceException e) { // the service can't be found. Maybe it is already disposed. // Do nothing } partNameSynchronizer = null; diagram = null; servicesRegistry = null; }
@Override public void doSetInput(IEditorInput input, boolean releaseEditorContents) throws CoreException { super.doSetInput(input, releaseEditorContents); if (getDiagram() != null && !DiagramVersioningUtils.isOfCurrentPapyrusVersion(getDiagram())) { new ReconcileHelper(getEditingDomain()).reconcileDiagram(getDiagram()); } }
@Override public void createPartControl(Composite parent) { IContextService contextService = (IContextService) getSite().getService(IContextService.class); // FIXME : before Eclipse Juno, this line was not necessary // see bug 367816 and bug 382218 contextService.activateContext( "org.eclipse.gmf.runtime.diagram.ui.diagramContext"); //$NON-NLS-1$ super.createPartControl(parent); }
@Override protected void stopListening() { super.stopListening(); }