1 /*******************************************************************************
\r
2 * Copyright (c) 2007- VTT Technical Research Centre of Finland.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * which accompanies this distribution, and is available at
\r
6 * http://www.eclipse.org/legal/epl-v10.html
\r
9 * VTT Technical Research Centre of Finland - initial API and implementation
\r
10 *******************************************************************************/
\r
11 package org.simantics.proconf.g3d.base;
\r
13 import org.eclipse.ui.IPartListener;
\r
14 import org.eclipse.ui.IWorkbenchPart;
\r
17 * IPartListener that allows editor to load its content after the editorPart is activated.
\r
19 * This is crucial with 3D graphics, which does not work if the editor part is activated
\r
20 * after the data has been loaded.
\r
22 * @author Marko Luukkainen <marko.luukkainen@vtt.fi>
\r
25 public abstract class EditorLoader implements IPartListener {
\r
27 boolean opened = false;
\r
28 boolean activated = false;
\r
30 public void partOpened(IWorkbenchPart part) {
\r
31 if (part.equals(getWorkbechPart())) {
\r
36 public void partActivated(IWorkbenchPart part) {
\r
37 if (part.equals(getWorkbechPart())) {
\r
38 if (opened & !activated) {
\r
45 public void partBroughtToTop(IWorkbenchPart part) {}
\r
47 public void partClosed(IWorkbenchPart part) {}
\r
49 public void partDeactivated(IWorkbenchPart part) {}
\r
52 * Returns the IWorkbenchPart of the editor
\r
55 public abstract IWorkbenchPart getWorkbechPart();
\r
58 * Starts the content loading process
\r
60 public abstract void load();
\r