Skip to content
Snippets Groups Projects
Commit 3c05a9fc authored by Simon Barner's avatar Simon Barner
Browse files

- Since partClosed() is triggered when any IWorkBenchPart is closed, the...

- Since partClosed() is triggered when any IWorkBenchPart is closed, the current implementation erroneously removes the EditorActivationListener even if any other view but the "Model Elements" view is closed.
- Hence, use a different approach and in partActivated() check, if the LibraryView's TreeViewer control is disposed
parent 6a885cc8
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.dialogs.FilteredTree;
......@@ -58,7 +59,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author eder
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: BE8E3D97227DDE47F53B4B956DD07B7E
* @ConQAT.Rating YELLOW Hash: 32812CD7C455CF4BD58FB5653785E326
*/
public class LibraryView extends ViewPart {
......@@ -262,16 +263,14 @@ public class LibraryView extends ViewPart {
return;
}
Control control = viewer.getControl();
if(control == null || control.isDisposed()) {
return;
}
IEditorPart part = (IEditorPart)workbenchPart;
viewer.setInput(IPrototypeService.INSTANCE.getAllTopLevelPrototypesCategories());
switchWorkbenchEditor(part);
}
/** {@inheritDoc} */
@Override
public void partClosed(IWorkbenchPart part) {
getSite().getWorkbenchWindow().getPartService()
.removePartListener(editorActivationListener);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment