| /* |
| * Copyright (c) 2005, 2018 IBM Corporation, CEA, and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * IBM - initial API and implementation |
| * Kenn Hussey (CEA) - 327039 |
| * Kenn Hussey - 535301 |
| * |
| */ |
| package org.eclipse.uml2.examples.uml.ui.actions; |
| |
| import org.eclipse.emf.common.command.UnexecutableCommand; |
| import org.eclipse.jface.action.IAction; |
| import org.eclipse.uml2.common.edit.command.ChangeCommand; |
| import org.eclipse.uml2.examples.uml.ui.UMLExamplesUIPlugin; |
| import org.eclipse.uml2.uml.Model; |
| |
| public class GenerateUMLPrimitiveTypesAction |
| extends GenerateModelAction { |
| |
| @Override |
| public void run(IAction action) { |
| |
| if (command != UnexecutableCommand.INSTANCE) { |
| final Model model = (Model) collection.iterator().next(); |
| |
| editingDomain.getCommandStack().execute( |
| new ChangeCommand(editingDomain, new Runnable() { |
| |
| public void run() { |
| generateOwnedPrimitiveType(model, "Boolean"); //$NON-NLS-1$ |
| generateOwnedPrimitiveType(model, "Integer"); //$NON-NLS-1$ |
| generateOwnedPrimitiveType(model, "String"); //$NON-NLS-1$ |
| generateOwnedPrimitiveType(model, "UnlimitedNatural"); //$NON-NLS-1$ |
| generateOwnedPrimitiveType(model, "Real"); //$NON-NLS-1$ |
| } |
| }, UMLExamplesUIPlugin.INSTANCE.getString( |
| "_UI_GenerateUMLPrimitiveTypesActionCommand_label", //$NON-NLS-1$ |
| new Object[]{getLabelProvider().getText(model)}))); |
| } |
| } |
| |
| } |