package org.insightech.er.editor.view.action.translation;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.PlatformUI;
import org.insightech.er.ResourceString;
import org.insightech.er.editor.ERDiagramEditor;
import org.insightech.er.editor.controller.command.common.ChangeSettingsCommand;
import org.insightech.er.editor.model.ERDiagram;
import org.insightech.er.editor.model.settings.Settings;
import org.insightech.er.editor.view.action.AbstractBaseAction;
import org.insightech.er.editor.view.dialog.translation.TranslationManageDialog;
public class TranslationManageAction extends AbstractBaseAction {
public static final String ID = TranslationManageAction.class.getName();
public TranslationManageAction(ERDiagramEditor editor) {
super(ID, ResourceString
.getResourceString("action.title.manage.translation"), editor);
}
/**
* {@inheritDoc}
*/
@Override
public void execute(Event event) {
ERDiagram diagram = this.getDiagram();
Settings settings = (Settings) diagram.getDiagramContents()
.getSettings().clone();
TranslationManageDialog dialog = new TranslationManageDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell(),
settings, diagram);
if (dialog.open() == IDialogConstants.OK_ID) {
ChangeSettingsCommand command = new ChangeSettingsCommand(diagram,
settings);
this.execute(command);
}
}
}