/******************************************************************************* * 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.actions; import org.eclipse.jface.action.IToolBarManager; import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase; import org.simantics.proconf.g3d.input.InputProvider; /** * Context / selection dependent action that requires user's interaction * * @author Marko Luukkainen * */ public abstract class InteractiveAction extends ContextAction { protected InputProvider input; public InteractiveAction(ThreeDimensionalEditorBase parent) { super(parent); input = parent.getInputProvider(); } public abstract void update() ; /** * Activates the action */ public abstract void activate(); /** * Deactivates / ends the action */ public abstract void deactivate(); /** * Activates the action in the viewer. Normally there's no need to override this method. */ public final void run() { parent.setCurrentAction(this); } /** * This method is used to end the action, call this from update(). * */ public void end() { parent.setCurrentAction(parent.getDefaultAction()); } public void fillToolBar(IToolBarManager manager) { } }