X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FEditorLoader.java;fp=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FEditorLoader.java;h=0000000000000000000000000000000000000000;hb=6b6fcff5d6c326feef07ccf8401f97911778fffe;hp=0e759cc74da1f7457771fba047c4793b223a830a;hpb=504c111db40d78f4913badddd126b283b5504dbb;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/proconf/g3d/base/EditorLoader.java b/org.simantics.g3d/src/org/simantics/proconf/g3d/base/EditorLoader.java deleted file mode 100644 index 0e759cc7..00000000 --- a/org.simantics.g3d/src/org/simantics/proconf/g3d/base/EditorLoader.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007- VTT Technical Research Centre of Finland. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.proconf.g3d.base; - -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPart; - -/** - * IPartListener that allows editor to load its content after the editorPart is activated. - * - * This is crucial with 3D graphics, which does not work if the editor part is activated - * after the data has been loaded. - * - * @author Marko Luukkainen - * - */ -public abstract class EditorLoader implements IPartListener { - - boolean opened = false; - boolean activated = false; - - public void partOpened(IWorkbenchPart part) { - if (part.equals(getWorkbechPart())) { - opened = true; - } - } - - public void partActivated(IWorkbenchPart part) { - if (part.equals(getWorkbechPart())) { - if (opened & !activated) { - activated = true; - load(); - } - } - } - - public void partBroughtToTop(IWorkbenchPart part) {} - - public void partClosed(IWorkbenchPart part) {} - - public void partDeactivated(IWorkbenchPart part) {} - - /** - * Returns the IWorkbenchPart of the editor - * @return - */ - public abstract IWorkbenchPart getWorkbechPart(); - - /** - * Starts the content loading process - */ - public abstract void load(); -}