diff options
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TimeConstraintHelperAdvice.java')
-rw-r--r-- | plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TimeConstraintHelperAdvice.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TimeConstraintHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TimeConstraintHelperAdvice.java index 62c10191316..0a82a1ac49a 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TimeConstraintHelperAdvice.java +++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/TimeConstraintHelperAdvice.java @@ -1,14 +1,14 @@ /***************************************************************************** * 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 * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * + * * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation * *****************************************************************************/ @@ -36,7 +36,8 @@ import org.eclipse.uml2.uml.OccurrenceSpecification; import org.eclipse.uml2.uml.TimeConstraint; /** - * This advice add automatically the constrained element (occurrence specification) for a time constraint + * This advice add automatically the constrained element (occurrence specification) for a time constraint + * * @since 3.0 */ public class TimeConstraintHelperAdvice extends AbstractEditHelperAdvice { @@ -48,14 +49,15 @@ public class TimeConstraintHelperAdvice extends AbstractEditHelperAdvice { protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) { return new ConfigureElementCommand(request) { + @Override protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { - NamedElement element = (NamedElement)request.getElementToConfigure(); + NamedElement element = (NamedElement) request.getElementToConfigure(); - TimeConstraint newElement = (TimeConstraint)request.getElementToConfigure(); + TimeConstraint newElement = (TimeConstraint) request.getElementToConfigure(); // assign the occurrence specification Object paramOccurrence = getRequest().getParameter(SequenceRequestConstant.NEAREST_OCCURRENCE_SPECIFICATION); - List<OccurrenceSpecification> occList =getAsOccSpecList(paramOccurrence); + List<OccurrenceSpecification> occList = getAsOccSpecList(paramOccurrence); if (!occList.isEmpty()) { for (OccurrenceSpecification occurrence : occList) { if (occurrence instanceof MessageOccurrenceSpecification) { @@ -74,7 +76,7 @@ public class TimeConstraintHelperAdvice extends AbstractEditHelperAdvice { } }; } - + /** * Get the object safely casted as a list of OccurrenceSpecification * @@ -85,7 +87,7 @@ public class TimeConstraintHelperAdvice extends AbstractEditHelperAdvice { if (occurrenceSpecificationList instanceof List<?>) { List<?> list = (List<?>) occurrenceSpecificationList; if (!list.isEmpty()) { - List<OccurrenceSpecification> newList = new ArrayList<OccurrenceSpecification>(list.size()); + List<OccurrenceSpecification> newList = new ArrayList<>(list.size()); for (Object elt : list) { if (elt instanceof OccurrenceSpecification) { newList.add((OccurrenceSpecification) elt); @@ -96,4 +98,5 @@ public class TimeConstraintHelperAdvice extends AbstractEditHelperAdvice { } return Collections.emptyList(); } + } |