/**
* <copyright>
*
* Copyright (c) 2010 SAP AG
* 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:
* Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
*
* </copyright>
*
* $Id$
*/
package org.eclipse.bpmn2.presentation.actions;
import org.eclipse.bpmn2.presentation.Bpmn2Editor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorActionDelegate;
import org.eclipse.ui.IEditorPart;
/**
* @author Reiner Hille-Doering
*
*/
public class SaveAsXMIAction implements IEditorActionDelegate {
/**
*
*/
public SaveAsXMIAction() {
}
private Bpmn2Editor editor;
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
*/
//@Override
public void setActiveEditor(IAction action, IEditorPart targetEditor) {
if (targetEditor instanceof Bpmn2Editor) {
this.editor = (Bpmn2Editor) targetEditor;
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
//@Override
public void run(IAction action) {
if (editor != null) {
editor.saveAsXMI();
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
//@Override
public void selectionChanged(IAction action, ISelection selection) {
}
}