Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-03-03 16:35:22 +0000
committerCamille Letavernier2014-03-03 16:35:22 +0000
commitc68cb9ac8a2a3762c337cc9899d955a7664d256a (patch)
treed2c45330d78df2dbddc711782c357ac19fe0d0e7 /plugins/uml/diagram
parentd7123b35d48b16f97b33555552de840e3c07285f (diff)
downloadorg.eclipse.papyrus-c68cb9ac8a2a3762c337cc9899d955a7664d256a.tar.gz
org.eclipse.papyrus-c68cb9ac8a2a3762c337cc9899d955a7664d256a.tar.xz
org.eclipse.papyrus-c68cb9ac8a2a3762c337cc9899d955a7664d256a.zip
429295: [SysML BDD] Cannot add associations in bdd diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429295 - Fix API usage to match changes from previous commit
Diffstat (limited to 'plugins/uml/diagram')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/CreateUmlElementDialog.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.java18
2 files changed, 35 insertions, 21 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/CreateUmlElementDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/CreateUmlElementDialog.java
index 64ad8b5426d..18eadc2e809 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/CreateUmlElementDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/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
@@ -29,9 +29,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,8 +42,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
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.uml.diagram.common.util.Util;
import org.eclipse.papyrus.uml.diagram.composite.custom.messages.Messages;
+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;
@@ -95,7 +97,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param parent
* the parent
* @param domain
@@ -131,7 +133,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Sets the forbidden names.
- *
+ *
* @param forbiddenNames
* the new forbidden names
*/
@@ -141,7 +143,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Creates the dialog area.
- *
+ *
* @param parent
* the parent
* @return the control
@@ -166,7 +168,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Creates the name section and put it at the top of the composite.
- *
+ *
* @param parent
* the composite parent
*/
@@ -196,7 +198,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
*/
@@ -207,7 +209,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)) {
@@ -236,7 +238,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Tests if the proposed name is not forbidden
- *
+ *
* @param name
* a name
* @return
@@ -251,7 +253,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
*/
@@ -276,7 +278,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Compute result.
- *
+ *
* @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
*/
@Override
@@ -288,7 +290,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Set the value to {@link #name} and {@link #parentContainer}.
- *
+ *
* @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
*/
@Override
@@ -305,7 +307,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Returns a command corresponding to this request.
- *
+ *
* @param request
* a request
* @return the command
@@ -334,7 +336,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param domain
* the domain
* @param label
@@ -353,7 +355,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Do execute with result.
- *
+ *
* @param monitor
* the monitor
* @param info
@@ -378,7 +380,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.
*/
@@ -389,7 +391,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Constructor.
- *
+ *
* @param domain
* the domain
* @param label
@@ -406,7 +408,7 @@ public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
/**
* Do execute with result.
- *
+ *
* @param monitor
* the monitor
* @param info
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.java
index d686969e2f1..94cfcc340e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.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
@@ -59,6 +59,7 @@ import org.eclipse.papyrus.uml.diagram.composite.custom.messages.Messages;
import org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.SelectionEvent;
@@ -241,7 +242,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* This method fills the map {@link #requiredInterfacesMappedWithUsage}
*/
protected void buildRequiredInterfaces() {
- List<?> allUsage = Util.getInstancesFilteredByType(this.model, Usage.class, null);
+ List<Usage> allUsage = ElementUtil.getInstancesFilteredByType(this.model, Usage.class, null);
List<Classifier> classifiers = new ArrayList<Classifier>();
classifiers.add((Classifier)this.port.getType());
@@ -274,7 +275,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* This method fills the map {@link #providedInterfacesMappedWithRealization}
*/
protected void buildProvidedInterfaces() {
- List<?> allRealization = Util.getInstancesFilteredByType(this.model, Realization.class, null);
+ List<Realization> allRealization = ElementUtil.getInstancesFilteredByType(this.model, Realization.class, null);
List<Classifier> classifiers = new ArrayList<Classifier>();
classifiers.add((Classifier)this.port.getType());
@@ -318,6 +319,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
*
* @return
*/
+ @Override
public Object[] getElements() {
List<Object> tmp = new ArrayList<Object>();
tmp.addAll(getAllAvailableInterfaces(model));
@@ -340,6 +342,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
*
* @return
*/
+ @Override
public Object[] getElements() {
List<Object> tmp = new ArrayList<Object>();
tmp.addAll(getAllAvailableInterfaces(model));
@@ -587,6 +590,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
*
* @param e
*/
+ @Override
public void widgetSelected(SelectionEvent e) {
CreateUmlElementDialog dialog = new CreateUmlElementDialog(getShell(), domain, newElementLabelProvider, new CustomContentProvider(), model, UMLElementTypes.INTERFACE);
dialog.setTitle(Messages.InterfaceManagerDialog_CreateANewInterface);
@@ -617,6 +621,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
*
* @param e
*/
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}
@@ -640,6 +645,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* @param selection
* @return
*/
+ @Override
public IStatus validate(Object[] selection) {
IStatus status = new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, Messages.NoSelectionFound);
@@ -734,6 +740,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*
*/
+ @Override
public void dispose() {
}
@@ -745,6 +752,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* @param oldInput
* @param newInput
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
@@ -756,6 +764,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* @param inputElement
* @return
*/
+ @Override
public Object[] getElements(Object inputElement) {
if(inputElement instanceof List<?>) {
return ((List<?>)inputElement).toArray();
@@ -770,6 +779,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* @param parentElement
* @return
*/
+ @Override
public Object[] getChildren(Object parentElement) {
List<Object> children = new ArrayList<Object>();
List<?> tmp = null;
@@ -801,6 +811,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* @param element
* @return
*/
+ @Override
public Object getParent(Object element) {
if(element == model) {
return model;
@@ -817,6 +828,7 @@ public class InterfaceManagerDialog extends SelectionDialog {
* @param element
* @return
*/
+ @Override
public boolean hasChildren(Object element) {
return getChildren(element).length != 0;
}

Back to the top