/*
 * @(#)ViewAsAction.java  1.0  2009-12-22
 * 
 * Copyright (c) 2009 Werner Randelshofer, Immensee, Switzerland.
 * All rights reserved.
 *
 * You may not use, copy or modify this file, except in compliance with the
 * license agreement you entered into with Werner Randelshofer.
 * For details see accompanying license terms.
 */

package ch.randelshofer.multishow;

import java.awt.event.ActionEvent;
import javax.activation.CommandInfo;
import javax.swing.AbstractAction;
import org.jhotdraw.app.View;

/**
 * ViewAsAction.
 *
 * @author Werner Randelshofer
 * @version 1.0 2009-12-22 Created.
 */
public class ViewAsAction extends AbstractAction {
private MultiShowView view;
private CommandInfo commandInfo;
    public ViewAsAction(MultiShowView v, CommandInfo commandInfo) {
        this.view=v;
        this.commandInfo=commandInfo;
    }

    public void actionPerformed(ActionEvent e) {
        view.execute(
        new Runnable() {
            public void run() {
            view.viewAs(view.getURI(), commandInfo);
            }
        });
    }

}
