use of org.eclipse.gef.Disposable in project tdi-studio-se by Talend.
the class AbstractTalendEditor method dispose.
@Override
public void dispose() {
ProcessorUtilities.editorClosed(this);
talendPaletteViewerProvider = null;
// achen modify to fix bug 0006107
// if (!getParent().isKeepPropertyLocked()) {
// JobResourceManager manager = JobResourceManager.getInstance();
// manager.removeProtection(this);
// for (JobResource r : protectedJobs.values()) {
// manager.deleteResource(r);
// }
// }
ComponentSettingsView viewer = (ComponentSettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ComponentSettingsView.ID);
if (viewer != null) {
viewer.cleanDisplay();
}
for (Iterator iterator = getSelectionActions().iterator(); iterator.hasNext(); ) {
String actionID = (String) iterator.next();
IAction action = getActionRegistry().getAction(actionID);
if (action != null) {
fActivationCodeTrigger.unregisterActionFromKeyActivation(action);
getActionRegistry().removeAction(action);
if (action instanceof Disposable) {
((Disposable) action).dispose();
}
}
}
fActivationCodeTrigger.uninstall();
fActivationCodeTrigger = null;
getSelectionActions().clear();
getGraphicalViewer().removeDropTargetListener(talendEditorDropTargetListener);
if (getGraphicalViewer().getContents() != null) {
getGraphicalViewer().getContents().deactivate();
getGraphicalViewer().getContents().removeNotify();
getGraphicalViewer().getRootEditPart().deactivate();
getGraphicalViewer().getRootEditPart().removeNotify();
}
getGraphicalViewer().setEditPartFactory(null);
getGraphicalViewer().setContextMenu(null);
getGraphicalViewer().setContents(null);
if (sharedKeyHandler != null) {
sharedKeyHandler.remove(KeyStroke.getPressed(SWT.F1, 0));
sharedKeyHandler.remove(KeyStroke.getPressed(SWT.DEL, 0));
}
// super.setInput(null);
// getGraphicalViewer().setContents(null);
// if (getGraphicalViewer().getControl() != null && !getGraphicalViewer().getControl().isDisposed()) {
// getGraphicalViewer().getControl().dispose();
// }
talendEditorDropTargetListener.setEditor(null);
talendEditorDropTargetListener = null;
// TalendScalableFreeformRootEditPart rootEditPart = (TalendScalableFreeformRootEditPart) getGraphicalViewer()
// .getRootEditPart();
// rootEditPart.setEditorInput(null);
// rootEditPart.deactivate();
super.dispose();
if (!getParent().isKeepPropertyLocked()) {
((Process) getProcess()).dispose();
}
// process = null;
parent = null;
getEditDomain().getCommandStack().dispose();
getEditDomain().setActiveTool(null);
getEditDomain().setPaletteRoot(null);
getEditDomain().setPaletteViewer(null);
getEditDomain().setCommandStack(null);
getEditDomain().setDefaultTool(null);
getSelectionSynchronizer().removeViewer(getGraphicalViewer());
getSite().setSelectionProvider(null);
}
Aggregations