1 /*******************************************************************************
\r
2 * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.
\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.actions;
\r
13 import org.eclipse.jface.action.IToolBarManager;
\r
14 import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;
\r
15 import org.simantics.proconf.g3d.input.InputProvider;
\r
20 * Context / selection dependent action that requires user's interaction
\r
22 * @author Marko Luukkainen
\r
25 public abstract class InteractiveAction extends ContextAction {
\r
26 protected InputProvider input;
\r
28 public InteractiveAction(ThreeDimensionalEditorBase parent) {
\r
30 input = parent.getInputProvider();
\r
33 public abstract void update() ;
\r
36 * Activates the action
\r
38 public abstract void activate();
\r
41 * Deactivates / ends the action
\r
43 public abstract void deactivate();
\r
46 * Activates the action in the viewer. Normally there's no need to override this method.
\r
48 public final void run() {
\r
49 parent.setCurrentAction(this);
\r
53 * This method is used to end the action, call this from <code>update()</code>.
\r
57 parent.setCurrentAction(parent.getDefaultAction());
\r
60 public void fillToolBar(IToolBarManager manager) {
\r