Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-03-03 17:04:46 +0000
committerCamille Letavernier2014-03-03 17:04:46 +0000
commit928030220ebf333020a828bc5ba753d99dc8d76c (patch)
tree09d707356c5410a9a633307af190bb47926a0e64 /plugins/sysml
parentc68cb9ac8a2a3762c337cc9899d955a7664d256a (diff)
downloadorg.eclipse.papyrus-928030220ebf333020a828bc5ba753d99dc8d76c.tar.gz
org.eclipse.papyrus-928030220ebf333020a828bc5ba753d99dc8d76c.tar.xz
org.eclipse.papyrus-928030220ebf333020a828bc5ba753d99dc8d76c.zip
429295: [SysML BDD] Cannot add associations in bdd diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429295 - Fix remaining API usage to match changes from previous commit
Diffstat (limited to 'plugins/sysml')
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java38
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/CreateUmlElementDialog.java38
2 files changed, 40 insertions, 36 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java
index 12e62905ac5..02c0fb82c23 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* 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
@@ -28,9 +28,11 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -40,7 +42,7 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.sysml.diagram.blockdefinition.messages.Messages;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -93,7 +95,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param parent
* the parent
* @param domain
@@ -129,7 +131,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Sets the forbidden names.
- *
+ *
* @param forbiddenNames
* the new forbidden names
*/
@@ -139,7 +141,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Creates the dialog area.
- *
+ *
* @param parent
* the parent
* @return the control
@@ -164,7 +166,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Creates the name section and put it at the top of the composite.
- *
+ *
* @param parent
* the composite parent
*/
@@ -194,7 +196,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Returns the default name for the new Element.
- *
+ *
* @return the default name
* the default name for the new Element
*/
@@ -205,7 +207,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
int max = 0;
do {
- ArrayList<?> allInterface = Util.getInstancesFilteredByType(pack, Interface.class, null);
+ List<Interface> allInterface = ElementUtil.getInstancesFilteredByType(pack, Interface.class, null);
for(Object object : allInterface) {
String name = NamedElementUtil.getName((NamedElement)object);
if(name != null && name.startsWith(type)) {
@@ -234,7 +236,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Tests if the proposed name is not forbidden
- *
+ *
* @param name
* a name
* @return
@@ -249,7 +251,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Returns the command to create the new element which the chosen name.
- *
+ *
* @return the command
* the command to create the new element which the chosen name
*/
@@ -274,7 +276,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Compute result.
- *
+ *
* @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
*/
@Override
@@ -286,7 +288,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Set the value to {@link #name} and {@link #parentContainer}.
- *
+ *
* @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
*/
@Override
@@ -303,7 +305,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Returns a command corresponding to this request.
- *
+ *
* @param request
* a request
* @return the command
@@ -332,7 +334,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param domain
* the domain
* @param label
@@ -351,7 +353,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Do execute with result.
- *
+ *
* @param monitor
* the monitor
* @param info
@@ -376,7 +378,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* This command allows to create a new element when its parent is not yet created when the command is build
- *
+ *
* We need a such command, because {@link CreateRelationshipCommand#getCommandResult()} return <code>null</code> when the command has not been
* executed.
*/
@@ -387,7 +389,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param domain
* the domain
* @param label
@@ -404,7 +406,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Do execute with result.
- *
+ *
* @param monitor
* the monitor
* @param info
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/CreateUmlElementDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/CreateUmlElementDialog.java
index 280be778ecf..090a09899a8 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/CreateUmlElementDialog.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/CreateUmlElementDialog.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -28,9 +28,11 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -40,7 +42,7 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.sysml.diagram.internalblock.messages.Messages;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -90,7 +92,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param parent
* the parent
* @param domain
@@ -126,7 +128,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Sets the forbidden names.
- *
+ *
* @param forbiddenNames
* the new forbidden names
*/
@@ -136,7 +138,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Creates the dialog area.
- *
+ *
* @param parent
* the parent
* @return the control
@@ -161,7 +163,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Creates the name section and put it at the top of the composite.
- *
+ *
* @param parent
* the composite parent
*/
@@ -191,7 +193,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Returns the default name for the new Element.
- *
+ *
* @return the default name
* the default name for the new Element
*/
@@ -202,7 +204,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
int max = 0;
do {
- ArrayList<?> allInterface = Util.getInstancesFilteredByType(pack, Interface.class, null);
+ List<Interface> allInterface = ElementUtil.getInstancesFilteredByType(pack, Interface.class, null);
for(Object object : allInterface) {
String name = NamedElementUtil.getName((NamedElement)object);
if(name != null && name.startsWith(type)) {
@@ -231,7 +233,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Tests if the proposed name is not forbidden
- *
+ *
* @param name
* a name
* @return
@@ -246,7 +248,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Returns the command to create the new element which the chosen name.
- *
+ *
* @return the command
* the command to create the new element which the chosen name
*/
@@ -271,7 +273,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Compute result.
- *
+ *
* @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
*/
@Override
@@ -283,7 +285,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Set the value to {@link #name} and {@link #parentContainer}.
- *
+ *
* @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
*/
@Override
@@ -300,7 +302,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Returns a command corresponding to this request.
- *
+ *
* @param request
* a request
* @return the command
@@ -329,7 +331,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param domain
* the domain
* @param label
@@ -348,7 +350,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Do execute with result.
- *
+ *
* @param monitor
* the monitor
* @param info
@@ -373,7 +375,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* This command allows to create a new element when its parent is not yet created when the command is build
- *
+ *
* We need a such command, because {@link CreateRelationshipCommand#getCommandResult()} return <code>null</code> when the command has not been
* executed.
*/
@@ -384,7 +386,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param domain
* the domain
* @param label
@@ -401,7 +403,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Do execute with result.
- *
+ *
* @param monitor
* the monitor
* @param info

Back to the top