diff options
Diffstat (limited to 'plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src')
35 files changed, 1797 insertions, 1798 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/AbstractAdviceBindingFactory.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/AbstractAdviceBindingFactory.java index a2da2d22012..200be497ffd 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/AbstractAdviceBindingFactory.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/AbstractAdviceBindingFactory.java @@ -1,60 +1,60 @@ -/*****************************************************************************
- * Copyright (c) 2014 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl;
-
-import org.eclipse.gmf.runtime.emf.type.core.AdviceBindingInheritance;
-import org.eclipse.gmf.runtime.emf.type.core.IContainerDescriptor;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractAdviceBindingConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractMatcherConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.ContainerConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.ContainerConfigurationTypeRegistry;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.MatcherConfigurationTypeRegistry;
-
-public abstract class AbstractAdviceBindingFactory<T extends AbstractAdviceBindingConfiguration> extends AbstractAdviceFactory<T> {
-
- @Override
- protected String getTypeId(T adviceConfiguration) {
- return adviceConfiguration.getTarget().getIdentifier();
- }
-
- @Override
- protected IContainerDescriptor getContainerDescriptor(T adviceConfiguration) {
- ContainerConfiguration containerConfiguration = adviceConfiguration.getContainerConfiguration();
- if (containerConfiguration == null) {
- return null;
- }
- IContainerDescriptor containerDescriptor = ContainerConfigurationTypeRegistry.getInstance().getContainerDescriptor(containerConfiguration);
- return containerDescriptor;
- }
-
- @Override
- protected IElementMatcher getMatcher(T adviceConfiguration) {
- AbstractMatcherConfiguration matcherConfiguration = adviceConfiguration.getMatcherConfiguration();
- if (matcherConfiguration == null) {
- return null;
- }
- IElementMatcher matcher = MatcherConfigurationTypeRegistry.getInstance().getMatcher(matcherConfiguration);
- return matcher;
- }
-
- @Override
- protected AdviceBindingInheritance getInheritance(T adviceConfiguration) {
- return AdviceBindingInheritance.getAdviceBindingInheritance(adviceConfiguration.getInheritance().getName());
- }
-
- @Override
- protected String getId(T adviceConfiguration) {
- return adviceConfiguration.getIdentifier();
- }
-}
+/***************************************************************************** + * Copyright (c) 2014 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl; + +import org.eclipse.gmf.runtime.emf.type.core.AdviceBindingInheritance; +import org.eclipse.gmf.runtime.emf.type.core.IContainerDescriptor; +import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher; +import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractAdviceBindingConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractMatcherConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.ContainerConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.ContainerConfigurationTypeRegistry; +import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.MatcherConfigurationTypeRegistry; + +public abstract class AbstractAdviceBindingFactory<T extends AbstractAdviceBindingConfiguration> extends AbstractAdviceFactory<T> { + + @Override + protected String getTypeId(T adviceConfiguration) { + return adviceConfiguration.getTarget().getIdentifier(); + } + + @Override + protected IContainerDescriptor getContainerDescriptor(T adviceConfiguration) { + ContainerConfiguration containerConfiguration = adviceConfiguration.getContainerConfiguration(); + if (containerConfiguration == null) { + return null; + } + IContainerDescriptor containerDescriptor = ContainerConfigurationTypeRegistry.getInstance().getContainerDescriptor(containerConfiguration); + return containerDescriptor; + } + + @Override + protected IElementMatcher getMatcher(T adviceConfiguration) { + AbstractMatcherConfiguration matcherConfiguration = adviceConfiguration.getMatcherConfiguration(); + if (matcherConfiguration == null) { + return null; + } + IElementMatcher matcher = MatcherConfigurationTypeRegistry.getInstance().getMatcher(matcherConfiguration); + return matcher; + } + + @Override + protected AdviceBindingInheritance getInheritance(T adviceConfiguration) { + return AdviceBindingInheritance.getAdviceBindingInheritance(adviceConfiguration.getInheritance().getName()); + } + + @Override + protected String getId(T adviceConfiguration) { + return adviceConfiguration.getIdentifier(); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/AbstractEditHelperAdviceFactory.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/AbstractEditHelperAdviceFactory.java index 9aa560628a0..7df9c5612a8 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/AbstractEditHelperAdviceFactory.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/AbstractEditHelperAdviceFactory.java @@ -1,61 +1,61 @@ -/*****************************************************************************
- * Copyright (c) 2014 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl;
-
-import org.eclipse.gmf.runtime.emf.type.core.AdviceBindingInheritance;
-import org.eclipse.gmf.runtime.emf.type.core.IContainerDescriptor;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractEditHelperAdviceConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractMatcherConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.ContainerConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.SpecializationTypeConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.ContainerConfigurationTypeRegistry;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.MatcherConfigurationTypeRegistry;
-
-public abstract class AbstractEditHelperAdviceFactory<T extends AbstractEditHelperAdviceConfiguration> extends AbstractAdviceFactory<T> {
-
- @Override
- protected String getTypeId(T adviceConfiguration) {
- return adviceConfiguration.getTarget().getIdentifier();
- }
-
- @Override
- protected AdviceBindingInheritance getInheritance(T adviceConfiguration) {
- return AdviceBindingInheritance.ALL;
- }
-
- @Override
- protected IContainerDescriptor getContainerDescriptor(T adviceConfiguration) {
- ContainerConfiguration containerConfiguration = ((SpecializationTypeConfiguration) adviceConfiguration.eContainer()).getContainerConfiguration();
- if (containerConfiguration == null) {
- return null;
- }
- IContainerDescriptor containerDescriptor = ContainerConfigurationTypeRegistry.getInstance().getContainerDescriptor(containerConfiguration);
- return containerDescriptor;
- }
-
- @Override
- protected IElementMatcher getMatcher(T adviceConfiguration) {
- AbstractMatcherConfiguration matcherConfiguration = ((SpecializationTypeConfiguration) adviceConfiguration.eContainer()).getMatcherConfiguration();
- if (matcherConfiguration == null) {
- return null;
- }
- IElementMatcher matcher = MatcherConfigurationTypeRegistry.getInstance().getMatcher(matcherConfiguration);
- return matcher;
- }
-
- @Override
- protected String getId(T adviceConfiguration) {
- return adviceConfiguration.getTarget().getIdentifier();
- }
-}
+/***************************************************************************** + * Copyright (c) 2014 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl; + +import org.eclipse.gmf.runtime.emf.type.core.AdviceBindingInheritance; +import org.eclipse.gmf.runtime.emf.type.core.IContainerDescriptor; +import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher; +import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractEditHelperAdviceConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractMatcherConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.ContainerConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.SpecializationTypeConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.ContainerConfigurationTypeRegistry; +import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.MatcherConfigurationTypeRegistry; + +public abstract class AbstractEditHelperAdviceFactory<T extends AbstractEditHelperAdviceConfiguration> extends AbstractAdviceFactory<T> { + + @Override + protected String getTypeId(T adviceConfiguration) { + return adviceConfiguration.getTarget().getIdentifier(); + } + + @Override + protected AdviceBindingInheritance getInheritance(T adviceConfiguration) { + return AdviceBindingInheritance.ALL; + } + + @Override + protected IContainerDescriptor getContainerDescriptor(T adviceConfiguration) { + ContainerConfiguration containerConfiguration = ((SpecializationTypeConfiguration) adviceConfiguration.eContainer()).getContainerConfiguration(); + if (containerConfiguration == null) { + return null; + } + IContainerDescriptor containerDescriptor = ContainerConfigurationTypeRegistry.getInstance().getContainerDescriptor(containerConfiguration); + return containerDescriptor; + } + + @Override + protected IElementMatcher getMatcher(T adviceConfiguration) { + AbstractMatcherConfiguration matcherConfiguration = ((SpecializationTypeConfiguration) adviceConfiguration.eContainer()).getMatcherConfiguration(); + if (matcherConfiguration == null) { + return null; + } + IElementMatcher matcher = MatcherConfigurationTypeRegistry.getInstance().getMatcher(matcherConfiguration); + return matcher; + } + + @Override + protected String getId(T adviceConfiguration) { + return adviceConfiguration.getTarget().getIdentifier(); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultAdviceBindingFactory.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultAdviceBindingFactory.java index 5bb05848be9..c20d3697134 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultAdviceBindingFactory.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultAdviceBindingFactory.java @@ -1,33 +1,33 @@ -/*****************************************************************************
- * Copyright (c) 2014 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.AdviceBindingConfiguration;
-import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
-
-public class DefaultAdviceBindingFactory extends AbstractAdviceBindingFactory<AdviceBindingConfiguration> {
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl.AbstractAdviceFactory#getEditHelperAdvice(org.eclipse.papyrus.infra.elementtypesconfigurations.AdviceConfiguration)
- *
- * @param adviceConfiguration
- * @return
- */
- @Override
- protected IEditHelperAdvice getEditHelperAdvice(AdviceBindingConfiguration adviceConfiguration) {
- IEditHelperAdvice editHelperAdvice = ClassLoaderHelper.newInstance(adviceConfiguration.getEditHelperAdviceClassName(), IEditHelperAdvice.class);
- return editHelperAdvice;
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2014 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.papyrus.infra.elementtypesconfigurations.AdviceBindingConfiguration; +import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper; + +public class DefaultAdviceBindingFactory extends AbstractAdviceBindingFactory<AdviceBindingConfiguration> { + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl.AbstractAdviceFactory#getEditHelperAdvice(org.eclipse.papyrus.infra.elementtypesconfigurations.AdviceConfiguration) + * + * @param adviceConfiguration + * @return + */ + @Override + protected IEditHelperAdvice getEditHelperAdvice(AdviceBindingConfiguration adviceConfiguration) { + IEditHelperAdvice editHelperAdvice = ClassLoaderHelper.newInstance(adviceConfiguration.getEditHelperAdviceClassName(), IEditHelperAdvice.class); + return editHelperAdvice; + } + +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultEditHelperAdviceFactory.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultEditHelperAdviceFactory.java index 354f06205c5..12de4cd5365 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultEditHelperAdviceFactory.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultEditHelperAdviceFactory.java @@ -1,33 +1,33 @@ -/*****************************************************************************
- * Copyright (c) 2014 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.EditHelperAdviceConfiguration;
-import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
-
-public class DefaultEditHelperAdviceFactory extends AbstractEditHelperAdviceFactory<EditHelperAdviceConfiguration> {
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl.AbstractAdviceFactory#getEditHelperAdvice(org.eclipse.papyrus.infra.elementtypesconfigurations.AdviceConfiguration)
- *
- * @param adviceConfiguration
- * @return
- */
- @Override
- protected IEditHelperAdvice getEditHelperAdvice(EditHelperAdviceConfiguration adviceConfiguration) {
- IEditHelperAdvice editHelperAdvice = ClassLoaderHelper.newInstance(adviceConfiguration.getEditHelperAdviceClassName(), IEditHelperAdvice.class);
- return editHelperAdvice;
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2014 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.papyrus.infra.elementtypesconfigurations.EditHelperAdviceConfiguration; +import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper; + +public class DefaultEditHelperAdviceFactory extends AbstractEditHelperAdviceFactory<EditHelperAdviceConfiguration> { + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl.AbstractAdviceFactory#getEditHelperAdvice(org.eclipse.papyrus.infra.elementtypesconfigurations.AdviceConfiguration) + * + * @param adviceConfiguration + * @return + */ + @Override + protected IEditHelperAdvice getEditHelperAdvice(EditHelperAdviceConfiguration adviceConfiguration) { + IEditHelperAdvice editHelperAdvice = ClassLoaderHelper.newInstance(adviceConfiguration.getEditHelperAdviceClassName(), IEditHelperAdvice.class); + return editHelperAdvice; + } + +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultMatcherFactory.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultMatcherFactory.java index f5e26edc151..cdab0ed628b 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultMatcherFactory.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/DefaultMatcherFactory.java @@ -1,34 +1,34 @@ -/*****************************************************************************
- * Copyright (c) 2014 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl;
-
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.MatcherConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.factories.IMatcherFactory;
-import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
-
-public class DefaultMatcherFactory implements IMatcherFactory<MatcherConfiguration> {
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl.AbstractMatcherFactory#createElementMatcher(org.eclipse.papyrus.infra.elementtypesconfigurations.MatcherConfiguration)
- *
- * @param matcherConfiguration
- * @return
- */
- @Override
- public IElementMatcher createElementMatcher(MatcherConfiguration matcherConfiguration) {
- String matcherClassName = matcherConfiguration.getMatcherClassName();
- IElementMatcher matcher = ClassLoaderHelper.newInstance(matcherClassName, IElementMatcher.class);
- return matcher;
- }
-}
+/***************************************************************************** + * Copyright (c) 2014 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl; + +import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher; +import org.eclipse.papyrus.infra.elementtypesconfigurations.MatcherConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.factories.IMatcherFactory; +import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper; + +public class DefaultMatcherFactory implements IMatcherFactory<MatcherConfiguration> { + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl.AbstractMatcherFactory#createElementMatcher(org.eclipse.papyrus.infra.elementtypesconfigurations.MatcherConfiguration) + * + * @param matcherConfiguration + * @return + */ + @Override + public IElementMatcher createElementMatcher(MatcherConfiguration matcherConfiguration) { + String matcherClassName = matcherConfiguration.getMatcherClassName(); + IElementMatcher matcher = ClassLoaderHelper.newInstance(matcherClassName, IElementMatcher.class); + return matcher; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/SpecializationTypeFactory.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/SpecializationTypeFactory.java index 6f75c4d1f71..44c46c1b7af 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/SpecializationTypeFactory.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/factories/impl/SpecializationTypeFactory.java @@ -1,89 +1,89 @@ -/*****************************************************************************
- * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- * Christian W. Damus - bug 459174
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IAdviceBindingDescriptor;
-import org.eclipse.gmf.runtime.emf.type.core.IContainerDescriptor;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractEditHelperAdviceConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractMatcherConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.Activator;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.ContainerConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.SpecializationTypeConfiguration;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.impl.ConfiguredHintedSpecializationElementType;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.impl.NullEditHelperAdvice;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.AdviceConfigurationTypeRegistry;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.ContainerConfigurationTypeRegistry;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.MatcherConfigurationTypeRegistry;
-
-public class SpecializationTypeFactory extends AbstractElementTypeConfigurationFactory<SpecializationTypeConfiguration> {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IHintedType createElementType(SpecializationTypeConfiguration elementTypeConfiguration) {
- return new ConfiguredHintedSpecializationElementType(getID(elementTypeConfiguration), getIconURL(elementTypeConfiguration), getDisplayName(elementTypeConfiguration), getSpecializedID(elementTypeConfiguration),
- createElementMatcher(elementTypeConfiguration), createContainerDescriptor(elementTypeConfiguration), getEditHelperAdvice(elementTypeConfiguration), getSemanticHint(elementTypeConfiguration), elementTypeConfiguration);
- }
-
- protected IEditHelperAdvice getEditHelperAdvice(SpecializationTypeConfiguration elementTypeConfiguration) {
- AbstractEditHelperAdviceConfiguration editHelperAdviceConfiguration = elementTypeConfiguration.getEditHelperAdviceConfiguration();
- if (editHelperAdviceConfiguration == null) {
- return NullEditHelperAdvice.getInstance();
- }
- IAdviceBindingDescriptor editHelperAdviceDescriptor = AdviceConfigurationTypeRegistry.getInstance().getEditHelperAdviceDecriptor(editHelperAdviceConfiguration);
- return editHelperAdviceDescriptor.getEditHelperAdvice();
- }
-
- protected IContainerDescriptor createContainerDescriptor(SpecializationTypeConfiguration elementTypeConfiguration) {
- ContainerConfiguration containerConfiguration = elementTypeConfiguration.getContainerConfiguration();
- if (containerConfiguration == null) {
- return null;
- }
- IContainerDescriptor containerDescriptor = ContainerConfigurationTypeRegistry.getInstance().getContainerDescriptor(containerConfiguration);
- return containerDescriptor;
- }
-
- protected IElementType[] getSpecializedID(SpecializationTypeConfiguration elementTypeConfiguration) {
- // Specialized elementTypes
- List<IElementType> specializedTypes = new ArrayList<IElementType>((elementTypeConfiguration).getSpecializedTypesID().size());
- for (String specializedTypeId : (elementTypeConfiguration).getSpecializedTypesID()) {
- IElementType specializedType = ElementTypeRegistry.getInstance().getType(specializedTypeId);
- if (specializedType != null) {
- specializedTypes.add(specializedType);
- } else {
- Activator.log.info("Unable to add specialization \"" + getID(elementTypeConfiguration) + "\" to \"" + specializedTypeId + "\"");
- }
- }
- IElementType[] elementTypes = specializedTypes.toArray(new IElementType[] {});
- return elementTypes;
- }
-
- protected IElementMatcher createElementMatcher(SpecializationTypeConfiguration configuration) {
- AbstractMatcherConfiguration matcherConfiguration = configuration.getMatcherConfiguration();
- if (matcherConfiguration == null) {
- return null;
- }
- IElementMatcher matcher = MatcherConfigurationTypeRegistry.getInstance().getMatcher(matcherConfiguration);
- return matcher;
- }
-}
+/***************************************************************************** + * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. + * + * 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: + * CEA LIST - Initial API and implementation + * Christian W. Damus - bug 459174 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.factories.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; +import org.eclipse.gmf.runtime.emf.type.core.IAdviceBindingDescriptor; +import org.eclipse.gmf.runtime.emf.type.core.IContainerDescriptor; +import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.IHintedType; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractEditHelperAdviceConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.AbstractMatcherConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.Activator; +import org.eclipse.papyrus.infra.elementtypesconfigurations.ContainerConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.SpecializationTypeConfiguration; +import org.eclipse.papyrus.infra.elementtypesconfigurations.impl.ConfiguredHintedSpecializationElementType; +import org.eclipse.papyrus.infra.elementtypesconfigurations.impl.NullEditHelperAdvice; +import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.AdviceConfigurationTypeRegistry; +import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.ContainerConfigurationTypeRegistry; +import org.eclipse.papyrus.infra.elementtypesconfigurations.registries.MatcherConfigurationTypeRegistry; + +public class SpecializationTypeFactory extends AbstractElementTypeConfigurationFactory<SpecializationTypeConfiguration> { + + /** + * {@inheritDoc} + */ + @Override + public IHintedType createElementType(SpecializationTypeConfiguration elementTypeConfiguration) { + return new ConfiguredHintedSpecializationElementType(getID(elementTypeConfiguration), getIconURL(elementTypeConfiguration), getDisplayName(elementTypeConfiguration), getSpecializedID(elementTypeConfiguration), + createElementMatcher(elementTypeConfiguration), createContainerDescriptor(elementTypeConfiguration), getEditHelperAdvice(elementTypeConfiguration), getSemanticHint(elementTypeConfiguration), elementTypeConfiguration); + } + + protected IEditHelperAdvice getEditHelperAdvice(SpecializationTypeConfiguration elementTypeConfiguration) { + AbstractEditHelperAdviceConfiguration editHelperAdviceConfiguration = elementTypeConfiguration.getEditHelperAdviceConfiguration(); + if (editHelperAdviceConfiguration == null) { + return NullEditHelperAdvice.getInstance(); + } + IAdviceBindingDescriptor editHelperAdviceDescriptor = AdviceConfigurationTypeRegistry.getInstance().getEditHelperAdviceDecriptor(editHelperAdviceConfiguration); + return editHelperAdviceDescriptor.getEditHelperAdvice(); + } + + protected IContainerDescriptor createContainerDescriptor(SpecializationTypeConfiguration elementTypeConfiguration) { + ContainerConfiguration containerConfiguration = elementTypeConfiguration.getContainerConfiguration(); + if (containerConfiguration == null) { + return null; + } + IContainerDescriptor containerDescriptor = ContainerConfigurationTypeRegistry.getInstance().getContainerDescriptor(containerConfiguration); + return containerDescriptor; + } + + protected IElementType[] getSpecializedID(SpecializationTypeConfiguration elementTypeConfiguration) { + // Specialized elementTypes + List<IElementType> specializedTypes = new ArrayList<IElementType>((elementTypeConfiguration).getSpecializedTypesID().size()); + for (String specializedTypeId : (elementTypeConfiguration).getSpecializedTypesID()) { + IElementType specializedType = ElementTypeRegistry.getInstance().getType(specializedTypeId); + if (specializedType != null) { + specializedTypes.add(specializedType); + } else { + Activator.log.info("Unable to add specialization \"" + getID(elementTypeConfiguration) + "\" to \"" + specializedTypeId + "\""); + } + } + IElementType[] elementTypes = specializedTypes.toArray(new IElementType[] {}); + return elementTypes; + } + + protected IElementMatcher createElementMatcher(SpecializationTypeConfiguration configuration) { + AbstractMatcherConfiguration matcherConfiguration = configuration.getMatcherConfiguration(); + if (matcherConfiguration == null) { + return null; + } + IElementMatcher matcher = MatcherConfigurationTypeRegistry.getInstance().getMatcher(matcherConfiguration); + return matcher; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/AbstractNotifierEditHelper.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/AbstractNotifierEditHelper.java index 0accc3d25c2..3c18e5d84f5 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/AbstractNotifierEditHelper.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/AbstractNotifierEditHelper.java @@ -1,258 +1,258 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.IdentityCommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceApprovedEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceDisapprovedEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdvicePhase;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceRequestConfigurationEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperApprovedEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperDisapprovedEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperRequestConfigurationEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.ExecutableAdviceEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.ExecutableEditHelperEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IdentityAdviceEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IdentityEditHelperEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.UnexecutableAdviceEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.UnexecutableEditHelperEvent;
-
-/**
- * An override of the {@link AbstractEditHelper} to provide Notifications during edithelper execution.
- * The notifications provide EditHelper trace information for testing and debugging purpose.
- */
-public abstract class AbstractNotifierEditHelper extends AbstractEditHelper {
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#getEditCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param req
- * @return
- */
- @Override
- public ICommand getEditCommand(IEditCommandRequest req) {
- ElementTypesConfigurationsEventsChain eventsChain = new ElementTypesConfigurationsEventsChain(this, req);
- // Get the matching edit helper advice
- IEditHelperAdvice[] advice = getEditHelperAdvice(req);
- // Consult advisors to allow them to configure the request
- configureRequest(req, advice, eventsChain);
- // Consult advisors to allow them approve the request
- boolean approved = approveRequest(req, advice, eventsChain);
- if (!approved) {
- // Notify listeners
- if (Platform.inDebugMode()) {
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyChain(eventsChain);
- }
- return null;
- }
- ICommand result = getEditCommand(req, advice, eventsChain);
- if (result != null) {
- // Notify listeners
- if (Platform.inDebugMode()) {
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyChain(eventsChain);
- }
- return result.reduce();
- }
- // Notify listeners
- if (Platform.inDebugMode()) {
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyChain(eventsChain);
- }
- return result;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#getEditCommand(IEditCommandRequest, IEditHelperAdvice[])
- *
- * @param req
- * @param advice
- * @param eventsChain
- * @return
- */
- private ICommand getEditCommand(IEditCommandRequest req, IEditHelperAdvice[] advice, ElementTypesConfigurationsEventsChain eventsChain) {
- ICompositeCommand command = createCommand(req);
- // Get 'before' commands from matching element type
- // specializations
- if (advice != null) {
- for (int i = 0; i < advice.length; i++) {
- IEditHelperAdvice nextAdvice = advice[i];
- // Before commands
- ICommand beforeAdvice = nextAdvice.getBeforeEditCommand(req);
- if (beforeAdvice != null) {
- if (beforeAdvice.canExecute()) {
- if (Platform.inDebugMode()) {
- if (beforeAdvice.equals(IdentityCommand.INSTANCE)) {
- IdentityAdviceEvent event = new IdentityAdviceEvent(req, this, nextAdvice, advice, AdvicePhase.before);
- eventsChain.addBeforeAdvicesCommandsEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- } else {
- ExecutableAdviceEvent event = new ExecutableAdviceEvent(req, this, nextAdvice, beforeAdvice, advice, AdvicePhase.before);
- eventsChain.addBeforeAdvicesCommandsEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- }
- command.compose(beforeAdvice);
- } else {
- if (Platform.inDebugMode()) {
- UnexecutableAdviceEvent event = new UnexecutableAdviceEvent(req, this, nextAdvice, beforeAdvice, advice, AdvicePhase.before);
- eventsChain.addBeforeAdvicesCommandsEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- return beforeAdvice;
- }
- }
- }
- }
- // Check if the parameter has been set to ignore the default edit command.
- Object replaceParam = req.getParameter(IEditCommandRequest.REPLACE_DEFAULT_COMMAND);
- if (replaceParam != Boolean.TRUE) {
- // Get 'instead' command from this edit helper
- ICommand insteadCommand = getInsteadCommand(req);
- if (insteadCommand != null) {
- if (insteadCommand.canExecute()) {
- if (Platform.inDebugMode()) {
- if (insteadCommand.equals(IdentityCommand.INSTANCE)) {
- IdentityEditHelperEvent event = new IdentityEditHelperEvent(req, this);
- eventsChain.setEditHelperCommandEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- } else {
- ExecutableEditHelperEvent event = new ExecutableEditHelperEvent(req, this, insteadCommand);
- eventsChain.setEditHelperCommandEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- }
- command.compose(insteadCommand);
- } else {
- if (Platform.inDebugMode()) {
- UnexecutableEditHelperEvent event = new UnexecutableEditHelperEvent(req, this, insteadCommand);
- eventsChain.setEditHelperCommandEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- return insteadCommand;
- }
- }
- }
- // Get 'after' commands from matching element type
- // specializations
- if (advice != null) {
- for (int i = 0; i < advice.length; i++) {
- IEditHelperAdvice nextAdvice = advice[i];
- // After commands
- ICommand afterAdvice = nextAdvice.getAfterEditCommand(req);
- if (afterAdvice != null) {
- if (afterAdvice.canExecute()) {
- if (Platform.inDebugMode()) {
- if (afterAdvice.equals(IdentityCommand.INSTANCE)) {
- IdentityAdviceEvent event = new IdentityAdviceEvent(req, this, nextAdvice, advice, AdvicePhase.after);
- eventsChain.addBeforeAdvicesCommandsEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- } else {
- ExecutableAdviceEvent event = new ExecutableAdviceEvent(req, this, nextAdvice, afterAdvice, advice, AdvicePhase.after);
- eventsChain.addBeforeAdvicesCommandsEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- }
- command.compose(afterAdvice);
- } else {
- if (Platform.inDebugMode()) {
- UnexecutableAdviceEvent event = new UnexecutableAdviceEvent(req, this, nextAdvice, afterAdvice, advice, AdvicePhase.after);
- eventsChain.addBeforeAdvicesCommandsEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- return afterAdvice;
- }
- }
- }
- }
- return command.isEmpty() ? null : command;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#configureRequest(IEditCommandRequest, IEditHelperAdvice[])
- *
- * @param req
- * @param advice
- * @param eventsChain
- */
- private void configureRequest(IEditCommandRequest req, IEditHelperAdvice[] advice, ElementTypesConfigurationsEventsChain eventsChain) {
- if (advice != null) {
- for (int i = 0; i < advice.length; i++) {
- IEditHelperAdvice nextAdvice = advice[i];
- nextAdvice.configureRequest(req);
- if (Platform.inDebugMode()) {
- AdviceRequestConfigurationEvent event = new AdviceRequestConfigurationEvent(req, this, nextAdvice, advice);
- eventsChain.addAdviceRequestConfigurationEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- }
- }
- // All advice has configured the request. Now consult this edit helper.
- configureRequest(req);
- if (Platform.inDebugMode()) {
- EditHelperRequestConfigurationEvent event = new EditHelperRequestConfigurationEvent(req, this);
- eventsChain.setEditHelperRequestConfigurationEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#approveRequest(IEditCommandRequest, IEditHelperAdvice[])
- *
- * @param req
- * @param advice
- * @param eventsChain
- * @return
- */
- private boolean approveRequest(IEditCommandRequest req, IEditHelperAdvice[] advice, ElementTypesConfigurationsEventsChain eventsChain) {
- if (advice != null) {
- for (int i = 0; i < advice.length; i++) {
- IEditHelperAdvice nextAdvice = advice[i];
- boolean approved = nextAdvice.approveRequest(req);
- if (!approved) {
- if (Platform.inDebugMode()) {
- AdviceDisapprovedEvent event = new AdviceDisapprovedEvent(req, this, nextAdvice, advice);
- eventsChain.addAdviceApprovalEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- return false;
- } else {
- if (Platform.inDebugMode()) {
- AdviceApprovedEvent event = new AdviceApprovedEvent(req, this, nextAdvice, advice);
- eventsChain.addAdviceApprovalEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- }
- }
- }
- // All advice has approved the request. Now consult this edit helper.
- boolean approved = approveRequest(req);
- if (Platform.inDebugMode()) {
- if (!approved) {
- EditHelperDisapprovedEvent event = new EditHelperDisapprovedEvent(req, this);
- eventsChain.setEditHelperApprovalEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- } else {
- EditHelperApprovedEvent event = new EditHelperApprovedEvent(req, this);
- eventsChain.setEditHelperApprovalEvent(event);
- ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event);
- }
- }
- return approved;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand; +import org.eclipse.gmf.runtime.common.core.command.IdentityCommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceApprovedEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceDisapprovedEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdvicePhase; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceRequestConfigurationEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperApprovedEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperDisapprovedEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperRequestConfigurationEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.ExecutableAdviceEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.ExecutableEditHelperEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IdentityAdviceEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IdentityEditHelperEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.UnexecutableAdviceEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.UnexecutableEditHelperEvent; + +/** + * An override of the {@link AbstractEditHelper} to provide Notifications during edithelper execution. + * The notifications provide EditHelper trace information for testing and debugging purpose. + */ +public abstract class AbstractNotifierEditHelper extends AbstractEditHelper { + + /** + * + * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#getEditCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest) + * + * @param req + * @return + */ + @Override + public ICommand getEditCommand(IEditCommandRequest req) { + ElementTypesConfigurationsEventsChain eventsChain = new ElementTypesConfigurationsEventsChain(this, req); + // Get the matching edit helper advice + IEditHelperAdvice[] advice = getEditHelperAdvice(req); + // Consult advisors to allow them to configure the request + configureRequest(req, advice, eventsChain); + // Consult advisors to allow them approve the request + boolean approved = approveRequest(req, advice, eventsChain); + if (!approved) { + // Notify listeners + if (Platform.inDebugMode()) { + ElementTypesConfigurationsListenersRegistry.getInstance().notifyChain(eventsChain); + } + return null; + } + ICommand result = getEditCommand(req, advice, eventsChain); + if (result != null) { + // Notify listeners + if (Platform.inDebugMode()) { + ElementTypesConfigurationsListenersRegistry.getInstance().notifyChain(eventsChain); + } + return result.reduce(); + } + // Notify listeners + if (Platform.inDebugMode()) { + ElementTypesConfigurationsListenersRegistry.getInstance().notifyChain(eventsChain); + } + return result; + } + + /** + * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#getEditCommand(IEditCommandRequest, IEditHelperAdvice[]) + * + * @param req + * @param advice + * @param eventsChain + * @return + */ + private ICommand getEditCommand(IEditCommandRequest req, IEditHelperAdvice[] advice, ElementTypesConfigurationsEventsChain eventsChain) { + ICompositeCommand command = createCommand(req); + // Get 'before' commands from matching element type + // specializations + if (advice != null) { + for (int i = 0; i < advice.length; i++) { + IEditHelperAdvice nextAdvice = advice[i]; + // Before commands + ICommand beforeAdvice = nextAdvice.getBeforeEditCommand(req); + if (beforeAdvice != null) { + if (beforeAdvice.canExecute()) { + if (Platform.inDebugMode()) { + if (beforeAdvice.equals(IdentityCommand.INSTANCE)) { + IdentityAdviceEvent event = new IdentityAdviceEvent(req, this, nextAdvice, advice, AdvicePhase.before); + eventsChain.addBeforeAdvicesCommandsEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } else { + ExecutableAdviceEvent event = new ExecutableAdviceEvent(req, this, nextAdvice, beforeAdvice, advice, AdvicePhase.before); + eventsChain.addBeforeAdvicesCommandsEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + } + command.compose(beforeAdvice); + } else { + if (Platform.inDebugMode()) { + UnexecutableAdviceEvent event = new UnexecutableAdviceEvent(req, this, nextAdvice, beforeAdvice, advice, AdvicePhase.before); + eventsChain.addBeforeAdvicesCommandsEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + return beforeAdvice; + } + } + } + } + // Check if the parameter has been set to ignore the default edit command. + Object replaceParam = req.getParameter(IEditCommandRequest.REPLACE_DEFAULT_COMMAND); + if (replaceParam != Boolean.TRUE) { + // Get 'instead' command from this edit helper + ICommand insteadCommand = getInsteadCommand(req); + if (insteadCommand != null) { + if (insteadCommand.canExecute()) { + if (Platform.inDebugMode()) { + if (insteadCommand.equals(IdentityCommand.INSTANCE)) { + IdentityEditHelperEvent event = new IdentityEditHelperEvent(req, this); + eventsChain.setEditHelperCommandEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } else { + ExecutableEditHelperEvent event = new ExecutableEditHelperEvent(req, this, insteadCommand); + eventsChain.setEditHelperCommandEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + } + command.compose(insteadCommand); + } else { + if (Platform.inDebugMode()) { + UnexecutableEditHelperEvent event = new UnexecutableEditHelperEvent(req, this, insteadCommand); + eventsChain.setEditHelperCommandEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + return insteadCommand; + } + } + } + // Get 'after' commands from matching element type + // specializations + if (advice != null) { + for (int i = 0; i < advice.length; i++) { + IEditHelperAdvice nextAdvice = advice[i]; + // After commands + ICommand afterAdvice = nextAdvice.getAfterEditCommand(req); + if (afterAdvice != null) { + if (afterAdvice.canExecute()) { + if (Platform.inDebugMode()) { + if (afterAdvice.equals(IdentityCommand.INSTANCE)) { + IdentityAdviceEvent event = new IdentityAdviceEvent(req, this, nextAdvice, advice, AdvicePhase.after); + eventsChain.addBeforeAdvicesCommandsEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } else { + ExecutableAdviceEvent event = new ExecutableAdviceEvent(req, this, nextAdvice, afterAdvice, advice, AdvicePhase.after); + eventsChain.addBeforeAdvicesCommandsEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + } + command.compose(afterAdvice); + } else { + if (Platform.inDebugMode()) { + UnexecutableAdviceEvent event = new UnexecutableAdviceEvent(req, this, nextAdvice, afterAdvice, advice, AdvicePhase.after); + eventsChain.addBeforeAdvicesCommandsEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + return afterAdvice; + } + } + } + } + return command.isEmpty() ? null : command; + } + + /** + * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#configureRequest(IEditCommandRequest, IEditHelperAdvice[]) + * + * @param req + * @param advice + * @param eventsChain + */ + private void configureRequest(IEditCommandRequest req, IEditHelperAdvice[] advice, ElementTypesConfigurationsEventsChain eventsChain) { + if (advice != null) { + for (int i = 0; i < advice.length; i++) { + IEditHelperAdvice nextAdvice = advice[i]; + nextAdvice.configureRequest(req); + if (Platform.inDebugMode()) { + AdviceRequestConfigurationEvent event = new AdviceRequestConfigurationEvent(req, this, nextAdvice, advice); + eventsChain.addAdviceRequestConfigurationEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + } + } + // All advice has configured the request. Now consult this edit helper. + configureRequest(req); + if (Platform.inDebugMode()) { + EditHelperRequestConfigurationEvent event = new EditHelperRequestConfigurationEvent(req, this); + eventsChain.setEditHelperRequestConfigurationEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + } + + /** + * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper#approveRequest(IEditCommandRequest, IEditHelperAdvice[]) + * + * @param req + * @param advice + * @param eventsChain + * @return + */ + private boolean approveRequest(IEditCommandRequest req, IEditHelperAdvice[] advice, ElementTypesConfigurationsEventsChain eventsChain) { + if (advice != null) { + for (int i = 0; i < advice.length; i++) { + IEditHelperAdvice nextAdvice = advice[i]; + boolean approved = nextAdvice.approveRequest(req); + if (!approved) { + if (Platform.inDebugMode()) { + AdviceDisapprovedEvent event = new AdviceDisapprovedEvent(req, this, nextAdvice, advice); + eventsChain.addAdviceApprovalEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + return false; + } else { + if (Platform.inDebugMode()) { + AdviceApprovedEvent event = new AdviceApprovedEvent(req, this, nextAdvice, advice); + eventsChain.addAdviceApprovalEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + } + } + } + // All advice has approved the request. Now consult this edit helper. + boolean approved = approveRequest(req); + if (Platform.inDebugMode()) { + if (!approved) { + EditHelperDisapprovedEvent event = new EditHelperDisapprovedEvent(req, this); + eventsChain.setEditHelperApprovalEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } else { + EditHelperApprovedEvent event = new EditHelperApprovedEvent(req, this); + eventsChain.setEditHelperApprovalEvent(event); + ElementTypesConfigurationsListenersRegistry.getInstance().notifyEvent(event); + } + } + return approved; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/ElementTypesConfigurationsEventsChain.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/ElementTypesConfigurationsEventsChain.java index 3539d343be3..413b3fdf55f 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/ElementTypesConfigurationsEventsChain.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/ElementTypesConfigurationsEventsChain.java @@ -1,245 +1,245 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AbstractElementTypesConfigurationsEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceApprovedEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceDisapprovedEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceRequestConfigurationEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperApprovedEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperDisapprovedEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.ExecutableAdviceEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.ExecutableEditHelperEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IdentityAdviceEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IdentityEditHelperEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.UnexecutableAdviceEvent;
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.UnexecutableEditHelperEvent;
-
-public class ElementTypesConfigurationsEventsChain {
-
- /**
- * Timestamp of the creation of the chain
- */
- private long timestamp;
-
- /**
- * The {@link IEditHelper} that triggered the {@link ElementTypesConfigurationsEventsChain}
- */
- private IEditHelper editHelper;
-
- /**
- * The {@link IEditCommandRequest} that triggered the {@link ElementTypesConfigurationsEventsChain}
- */
- private IEditCommandRequest req;
-
- ElementTypesConfigurationsEventsChain(IEditHelper editHelper, IEditCommandRequest req) {
- timestamp = System.currentTimeMillis();
- this.editHelper = editHelper;
- this.req = req;
- }
-
- /**
- * The various categories of events that occur during the execution of the {@link IEditHelper}
- */
- private List<AbstractElementTypesConfigurationsEvent> adviceRequestConfigurationEvents = new ArrayList<AbstractElementTypesConfigurationsEvent>();
-
- private AbstractElementTypesConfigurationsEvent editHelperRequestConfigurationEvent = null;
-
- private List<AbstractElementTypesConfigurationsEvent> adviceApprovalEvents = new ArrayList<AbstractElementTypesConfigurationsEvent>();
-
- private AbstractElementTypesConfigurationsEvent editHelperApprovalEvent = null;
-
- private List<AbstractElementTypesConfigurationsEvent> beforeAdvicesCommandsEvents = new ArrayList<AbstractElementTypesConfigurationsEvent>();
-
- private List<AbstractElementTypesConfigurationsEvent> afterAdvicesCommandsEvents = new ArrayList<AbstractElementTypesConfigurationsEvent>();
-
- private AbstractElementTypesConfigurationsEvent editHelperCommandEvent = null;
-
- /**
- * @return the adviceApprovalEvents
- */
- public List<AbstractElementTypesConfigurationsEvent> getAdviceApprovalEvents() {
- return adviceApprovalEvents;
- }
-
- /**
- * Add a {@link AdviceDisapprovedEvent} or {@link AdviceApprovedEvent} event
- *
- * @param adviceApprovalEvent
- */
- public void addAdviceApprovalEvent(AbstractElementTypesConfigurationsEvent adviceApprovalEvent) {
- if(adviceApprovalEvent instanceof AdviceDisapprovedEvent || adviceApprovalEvent instanceof AdviceApprovedEvent) {
- adviceApprovalEvents.add(adviceApprovalEvent);
- }
- }
-
- /**
- * @return the editHelperAprrovalEvent
- */
- public AbstractElementTypesConfigurationsEvent getEditHelperApprovalEvent() {
- return editHelperApprovalEvent;
- }
-
- /**
- * @param editHelperAprrovalEvent
- * the editHelperAprrovalEvent to set
- */
- public void setEditHelperApprovalEvent(AbstractElementTypesConfigurationsEvent editHelperApprovalEvent) {
- if(editHelperApprovalEvent instanceof EditHelperDisapprovedEvent || editHelperApprovalEvent instanceof EditHelperApprovedEvent) {
- this.editHelperApprovalEvent = editHelperApprovalEvent;
- }
- }
-
- /**
- * @return the beforeAdvicesCommandsEvents
- */
- public List<AbstractElementTypesConfigurationsEvent> getBeforeAdvicesCommandsEvents() {
- return beforeAdvicesCommandsEvents;
- }
-
- /**
- * Add a {@link ExecutableAdviceEvent}, {@link UnexecutableAdviceEvent} or {@link IdentityAdviceEvent} event
- *
- * @param beforeAdvicesCommandsEvents
- * the beforeAdvicesCommandsEvents to set
- */
- public void addBeforeAdvicesCommandsEvent(AbstractElementTypesConfigurationsEvent beforeAdvicesCommandEvent) {
- if(beforeAdvicesCommandEvent instanceof ExecutableAdviceEvent || beforeAdvicesCommandEvent instanceof UnexecutableAdviceEvent || beforeAdvicesCommandEvent instanceof IdentityAdviceEvent) {
- beforeAdvicesCommandsEvents.add(beforeAdvicesCommandEvent);
- }
- }
-
- /**
- * @return the afterAdvicesCommandsEvents
- */
- public List<AbstractElementTypesConfigurationsEvent> getAfterAdvicesCommandsEvents() {
- return afterAdvicesCommandsEvents;
- }
-
- /**
- * Add a {@link ExecutableAdviceEvent}, {@link UnexecutableAdviceEvent} or {@link IdentityAdviceEvent} event
- *
- * @param afterAdvicesCommandEvent
- */
- public void addAfterAdvicesCommandsEvent(AbstractElementTypesConfigurationsEvent afterAdvicesCommandEvent) {
- if(afterAdvicesCommandEvent instanceof ExecutableAdviceEvent || afterAdvicesCommandEvent instanceof UnexecutableAdviceEvent || afterAdvicesCommandEvent instanceof IdentityAdviceEvent) {
- afterAdvicesCommandsEvents.add(afterAdvicesCommandEvent);
- }
- }
-
- /**
- * @return the editHelperCommandEvent
- */
- public AbstractElementTypesConfigurationsEvent getEditHelperCommandEvent() {
- return editHelperCommandEvent;
- }
-
- /**
- * @param editHelperCommandEvent
- * the editHelperCommandEvent to set ({@link ExecutableEditHelperEvent}, {@link UnexecutableEditHelperEvent} or
- * {@link IdentityEditHelperEvent})
- */
- public void setEditHelperCommandEvent(AbstractElementTypesConfigurationsEvent editHelperCommandEvent) {
- if(editHelperCommandEvent instanceof ExecutableEditHelperEvent || editHelperCommandEvent instanceof UnexecutableEditHelperEvent || editHelperCommandEvent instanceof IdentityEditHelperEvent) {
- this.editHelperCommandEvent = editHelperCommandEvent;
- }
- }
-
- /**
- * Returns all the events that occurred during the execution of the {@link IEditHelper} (i.e. all events categories)
- *
- * @return
- */
- public List<AbstractElementTypesConfigurationsEvent> getAllEvents() {
- List<AbstractElementTypesConfigurationsEvent> result = new ArrayList<AbstractElementTypesConfigurationsEvent>();
- if(!adviceRequestConfigurationEvents.isEmpty()) {
- result.addAll(adviceRequestConfigurationEvents);
- }
- if(editHelperRequestConfigurationEvent != null) {
- result.add(editHelperRequestConfigurationEvent);
- }
- if(!adviceApprovalEvents.isEmpty()) {
- result.addAll(adviceApprovalEvents);
- }
- if(editHelperApprovalEvent != null) {
- result.add(editHelperApprovalEvent);
- }
- if(!beforeAdvicesCommandsEvents.isEmpty()) {
- result.addAll(beforeAdvicesCommandsEvents);
- }
- if(editHelperCommandEvent != null) {
- result.add(editHelperCommandEvent);
- }
- if(!afterAdvicesCommandsEvents.isEmpty()) {
- result.addAll(afterAdvicesCommandsEvents);
- }
- return result;
- }
-
- /**
- * @return the timestamp creation of this {@link ElementTypesConfigurationsEventsChain}
- */
- public long getTimestamp() {
- return timestamp;
- }
-
- /**
- * @return the req
- */
- public IEditCommandRequest getRequest() {
- return req;
- }
-
- /**
- * The Simple Name of the class of the {@link IEditHelper} that triggered this {@link ElementTypesConfigurationsEventsChain}
- *
- * @return
- */
- public String getName() {
- return editHelper.getClass().getSimpleName();
- }
-
- /**
- * @return the adviceRequestConfigurationEvents
- */
- public List<AbstractElementTypesConfigurationsEvent> getAdviceRequestConfigurationEvents() {
- return adviceRequestConfigurationEvents;
- }
-
- /**
- * @param adviceConfigureEvent
- */
- public void addAdviceRequestConfigurationEvent(AdviceRequestConfigurationEvent adviceConfigureEvent) {
- adviceRequestConfigurationEvents.add(adviceConfigureEvent);
- }
-
- /**
- * @return the editHelperRequestConfigurationEvent
- */
- public AbstractElementTypesConfigurationsEvent getEditHelperRequestConfigurationEvent() {
- return editHelperRequestConfigurationEvent;
- }
-
- /**
- * @param editHelperRequestConfigurationEvent
- * the editHelperRequestConfigurationEvent to set
- */
- public void setEditHelperRequestConfigurationEvent(AbstractElementTypesConfigurationsEvent editHelperRequestConfigurationEvent) {
- this.editHelperRequestConfigurationEvent = editHelperRequestConfigurationEvent;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AbstractElementTypesConfigurationsEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceApprovedEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceDisapprovedEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.AdviceRequestConfigurationEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperApprovedEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.EditHelperDisapprovedEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.ExecutableAdviceEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.ExecutableEditHelperEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IdentityAdviceEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IdentityEditHelperEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.UnexecutableAdviceEvent; +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.UnexecutableEditHelperEvent; + +public class ElementTypesConfigurationsEventsChain { + + /** + * Timestamp of the creation of the chain + */ + private long timestamp; + + /** + * The {@link IEditHelper} that triggered the {@link ElementTypesConfigurationsEventsChain} + */ + private IEditHelper editHelper; + + /** + * The {@link IEditCommandRequest} that triggered the {@link ElementTypesConfigurationsEventsChain} + */ + private IEditCommandRequest req; + + ElementTypesConfigurationsEventsChain(IEditHelper editHelper, IEditCommandRequest req) { + timestamp = System.currentTimeMillis(); + this.editHelper = editHelper; + this.req = req; + } + + /** + * The various categories of events that occur during the execution of the {@link IEditHelper} + */ + private List<AbstractElementTypesConfigurationsEvent> adviceRequestConfigurationEvents = new ArrayList<AbstractElementTypesConfigurationsEvent>(); + + private AbstractElementTypesConfigurationsEvent editHelperRequestConfigurationEvent = null; + + private List<AbstractElementTypesConfigurationsEvent> adviceApprovalEvents = new ArrayList<AbstractElementTypesConfigurationsEvent>(); + + private AbstractElementTypesConfigurationsEvent editHelperApprovalEvent = null; + + private List<AbstractElementTypesConfigurationsEvent> beforeAdvicesCommandsEvents = new ArrayList<AbstractElementTypesConfigurationsEvent>(); + + private List<AbstractElementTypesConfigurationsEvent> afterAdvicesCommandsEvents = new ArrayList<AbstractElementTypesConfigurationsEvent>(); + + private AbstractElementTypesConfigurationsEvent editHelperCommandEvent = null; + + /** + * @return the adviceApprovalEvents + */ + public List<AbstractElementTypesConfigurationsEvent> getAdviceApprovalEvents() { + return adviceApprovalEvents; + } + + /** + * Add a {@link AdviceDisapprovedEvent} or {@link AdviceApprovedEvent} event + * + * @param adviceApprovalEvent + */ + public void addAdviceApprovalEvent(AbstractElementTypesConfigurationsEvent adviceApprovalEvent) { + if(adviceApprovalEvent instanceof AdviceDisapprovedEvent || adviceApprovalEvent instanceof AdviceApprovedEvent) { + adviceApprovalEvents.add(adviceApprovalEvent); + } + } + + /** + * @return the editHelperAprrovalEvent + */ + public AbstractElementTypesConfigurationsEvent getEditHelperApprovalEvent() { + return editHelperApprovalEvent; + } + + /** + * @param editHelperAprrovalEvent + * the editHelperAprrovalEvent to set + */ + public void setEditHelperApprovalEvent(AbstractElementTypesConfigurationsEvent editHelperApprovalEvent) { + if(editHelperApprovalEvent instanceof EditHelperDisapprovedEvent || editHelperApprovalEvent instanceof EditHelperApprovedEvent) { + this.editHelperApprovalEvent = editHelperApprovalEvent; + } + } + + /** + * @return the beforeAdvicesCommandsEvents + */ + public List<AbstractElementTypesConfigurationsEvent> getBeforeAdvicesCommandsEvents() { + return beforeAdvicesCommandsEvents; + } + + /** + * Add a {@link ExecutableAdviceEvent}, {@link UnexecutableAdviceEvent} or {@link IdentityAdviceEvent} event + * + * @param beforeAdvicesCommandsEvents + * the beforeAdvicesCommandsEvents to set + */ + public void addBeforeAdvicesCommandsEvent(AbstractElementTypesConfigurationsEvent beforeAdvicesCommandEvent) { + if(beforeAdvicesCommandEvent instanceof ExecutableAdviceEvent || beforeAdvicesCommandEvent instanceof UnexecutableAdviceEvent || beforeAdvicesCommandEvent instanceof IdentityAdviceEvent) { + beforeAdvicesCommandsEvents.add(beforeAdvicesCommandEvent); + } + } + + /** + * @return the afterAdvicesCommandsEvents + */ + public List<AbstractElementTypesConfigurationsEvent> getAfterAdvicesCommandsEvents() { + return afterAdvicesCommandsEvents; + } + + /** + * Add a {@link ExecutableAdviceEvent}, {@link UnexecutableAdviceEvent} or {@link IdentityAdviceEvent} event + * + * @param afterAdvicesCommandEvent + */ + public void addAfterAdvicesCommandsEvent(AbstractElementTypesConfigurationsEvent afterAdvicesCommandEvent) { + if(afterAdvicesCommandEvent instanceof ExecutableAdviceEvent || afterAdvicesCommandEvent instanceof UnexecutableAdviceEvent || afterAdvicesCommandEvent instanceof IdentityAdviceEvent) { + afterAdvicesCommandsEvents.add(afterAdvicesCommandEvent); + } + } + + /** + * @return the editHelperCommandEvent + */ + public AbstractElementTypesConfigurationsEvent getEditHelperCommandEvent() { + return editHelperCommandEvent; + } + + /** + * @param editHelperCommandEvent + * the editHelperCommandEvent to set ({@link ExecutableEditHelperEvent}, {@link UnexecutableEditHelperEvent} or + * {@link IdentityEditHelperEvent}) + */ + public void setEditHelperCommandEvent(AbstractElementTypesConfigurationsEvent editHelperCommandEvent) { + if(editHelperCommandEvent instanceof ExecutableEditHelperEvent || editHelperCommandEvent instanceof UnexecutableEditHelperEvent || editHelperCommandEvent instanceof IdentityEditHelperEvent) { + this.editHelperCommandEvent = editHelperCommandEvent; + } + } + + /** + * Returns all the events that occurred during the execution of the {@link IEditHelper} (i.e. all events categories) + * + * @return + */ + public List<AbstractElementTypesConfigurationsEvent> getAllEvents() { + List<AbstractElementTypesConfigurationsEvent> result = new ArrayList<AbstractElementTypesConfigurationsEvent>(); + if(!adviceRequestConfigurationEvents.isEmpty()) { + result.addAll(adviceRequestConfigurationEvents); + } + if(editHelperRequestConfigurationEvent != null) { + result.add(editHelperRequestConfigurationEvent); + } + if(!adviceApprovalEvents.isEmpty()) { + result.addAll(adviceApprovalEvents); + } + if(editHelperApprovalEvent != null) { + result.add(editHelperApprovalEvent); + } + if(!beforeAdvicesCommandsEvents.isEmpty()) { + result.addAll(beforeAdvicesCommandsEvents); + } + if(editHelperCommandEvent != null) { + result.add(editHelperCommandEvent); + } + if(!afterAdvicesCommandsEvents.isEmpty()) { + result.addAll(afterAdvicesCommandsEvents); + } + return result; + } + + /** + * @return the timestamp creation of this {@link ElementTypesConfigurationsEventsChain} + */ + public long getTimestamp() { + return timestamp; + } + + /** + * @return the req + */ + public IEditCommandRequest getRequest() { + return req; + } + + /** + * The Simple Name of the class of the {@link IEditHelper} that triggered this {@link ElementTypesConfigurationsEventsChain} + * + * @return + */ + public String getName() { + return editHelper.getClass().getSimpleName(); + } + + /** + * @return the adviceRequestConfigurationEvents + */ + public List<AbstractElementTypesConfigurationsEvent> getAdviceRequestConfigurationEvents() { + return adviceRequestConfigurationEvents; + } + + /** + * @param adviceConfigureEvent + */ + public void addAdviceRequestConfigurationEvent(AdviceRequestConfigurationEvent adviceConfigureEvent) { + adviceRequestConfigurationEvents.add(adviceConfigureEvent); + } + + /** + * @return the editHelperRequestConfigurationEvent + */ + public AbstractElementTypesConfigurationsEvent getEditHelperRequestConfigurationEvent() { + return editHelperRequestConfigurationEvent; + } + + /** + * @param editHelperRequestConfigurationEvent + * the editHelperRequestConfigurationEvent to set + */ + public void setEditHelperRequestConfigurationEvent(AbstractElementTypesConfigurationsEvent editHelperRequestConfigurationEvent) { + this.editHelperRequestConfigurationEvent = editHelperRequestConfigurationEvent; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/ElementTypesConfigurationsListenersRegistry.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/ElementTypesConfigurationsListenersRegistry.java index cfc9b4181d5..9606f9a38cc 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/ElementTypesConfigurationsListenersRegistry.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/ElementTypesConfigurationsListenersRegistry.java @@ -1,74 +1,74 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent;
-
-/**
- * Singleton used to register eventsChains listeners ({@link IElementTypesConfigurationsEventsChainListener})
- */
-public class ElementTypesConfigurationsListenersRegistry {
-
- private static Set<IElementTypesConfigurationsEventsChainListener> eventChainListeners = null;
-
- private static Set<IElementTypesConfigurationsEventsListener> eventListeners = null;
-
- private static ElementTypesConfigurationsListenersRegistry instance = null;
-
- private ElementTypesConfigurationsListenersRegistry() {
- }
-
- public static synchronized ElementTypesConfigurationsListenersRegistry getInstance() {
- if (instance == null) {
- instance = new ElementTypesConfigurationsListenersRegistry();
- init();
- }
- return instance;
- }
-
- public static void init() {
- eventChainListeners = new HashSet<IElementTypesConfigurationsEventsChainListener>();
- eventListeners = new HashSet<IElementTypesConfigurationsEventsListener>();
- }
-
- public void addEventChainListener(IElementTypesConfigurationsEventsChainListener listener) {
- eventChainListeners.add(listener);
- }
-
- public void removeEventChainListener(IElementTypesConfigurationsEventsChainListener listener) {
- eventChainListeners.remove(listener);
- }
-
- public void addEventListener(IElementTypesConfigurationsEventsListener listener) {
- eventListeners.add(listener);
- }
-
- public void removeEventChainListener(IElementTypesConfigurationsEventsListener listener) {
- eventListeners.remove(listener);
- }
-
- public void notifyChain(ElementTypesConfigurationsEventsChain chain) {
- for (IElementTypesConfigurationsEventsChainListener eventsChainListener : eventChainListeners) {
- eventsChainListener.notifyChain(chain);
- }
- }
-
- public void notifyEvent(IElementTypesConfigurationsEvent event) {
- for (IElementTypesConfigurationsEventsListener eventsListener : eventListeners) {
- eventsListener.notifyEvent(event);
- }
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent; + +/** + * Singleton used to register eventsChains listeners ({@link IElementTypesConfigurationsEventsChainListener}) + */ +public class ElementTypesConfigurationsListenersRegistry { + + private static Set<IElementTypesConfigurationsEventsChainListener> eventChainListeners = null; + + private static Set<IElementTypesConfigurationsEventsListener> eventListeners = null; + + private static ElementTypesConfigurationsListenersRegistry instance = null; + + private ElementTypesConfigurationsListenersRegistry() { + } + + public static synchronized ElementTypesConfigurationsListenersRegistry getInstance() { + if (instance == null) { + instance = new ElementTypesConfigurationsListenersRegistry(); + init(); + } + return instance; + } + + public static void init() { + eventChainListeners = new HashSet<IElementTypesConfigurationsEventsChainListener>(); + eventListeners = new HashSet<IElementTypesConfigurationsEventsListener>(); + } + + public void addEventChainListener(IElementTypesConfigurationsEventsChainListener listener) { + eventChainListeners.add(listener); + } + + public void removeEventChainListener(IElementTypesConfigurationsEventsChainListener listener) { + eventChainListeners.remove(listener); + } + + public void addEventListener(IElementTypesConfigurationsEventsListener listener) { + eventListeners.add(listener); + } + + public void removeEventChainListener(IElementTypesConfigurationsEventsListener listener) { + eventListeners.remove(listener); + } + + public void notifyChain(ElementTypesConfigurationsEventsChain chain) { + for (IElementTypesConfigurationsEventsChainListener eventsChainListener : eventChainListeners) { + eventsChainListener.notifyChain(chain); + } + } + + public void notifyEvent(IElementTypesConfigurationsEvent event) { + for (IElementTypesConfigurationsEventsListener eventsListener : eventListeners) { + eventsListener.notifyEvent(event); + } + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/IElementTypesConfigurationsEventsChainListener.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/IElementTypesConfigurationsEventsChainListener.java index 82b07534024..f5f5db57b93 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/IElementTypesConfigurationsEventsChainListener.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/IElementTypesConfigurationsEventsChainListener.java @@ -1,21 +1,21 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification;
-
-/**
- * Interface to implemented by listeners that want to be notified of {@link ElementTypesConfigurationsEventsChain}
- */
-public interface IElementTypesConfigurationsEventsChainListener {
-
- public void notifyChain(ElementTypesConfigurationsEventsChain chain);
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification; + +/** + * Interface to implemented by listeners that want to be notified of {@link ElementTypesConfigurationsEventsChain} + */ +public interface IElementTypesConfigurationsEventsChainListener { + + public void notifyChain(ElementTypesConfigurationsEventsChain chain); +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/IElementTypesConfigurationsEventsListener.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/IElementTypesConfigurationsEventsListener.java index b6b8a86a32f..d363b0935b3 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/IElementTypesConfigurationsEventsListener.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/IElementTypesConfigurationsEventsListener.java @@ -1,23 +1,23 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification;
-
-import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent;
-
-/**
- * Interface to implemented by listeners that want to be notified of {@link IElementTypesConfigurationsEvent}
- */
-public interface IElementTypesConfigurationsEventsListener {
-
- public void notifyEvent(IElementTypesConfigurationsEvent event);
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification; + +import org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent; + +/** + * Interface to implemented by listeners that want to be notified of {@link IElementTypesConfigurationsEvent} + */ +public interface IElementTypesConfigurationsEventsListener { + + public void notifyEvent(IElementTypesConfigurationsEvent event); +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractApprovedEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractApprovedEvent.java index e1706d33fee..54497eadf9d 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractApprovedEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractApprovedEvent.java @@ -1,33 +1,33 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public abstract class AbstractApprovedEvent extends AbstractElementTypesConfigurationsEvent {
-
- public AbstractApprovedEvent(IEditCommandRequest req, IEditHelper editHelper) {
- super(req, editHelper);
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType()
- *
- * @return
- */
- @Override
- public ElementTypesConfigurationsEventType getEventType() {
- return ElementTypesConfigurationsEventType.Approved;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public abstract class AbstractApprovedEvent extends AbstractElementTypesConfigurationsEvent { + + public AbstractApprovedEvent(IEditCommandRequest req, IEditHelper editHelper) { + super(req, editHelper); + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType() + * + * @return + */ + @Override + public ElementTypesConfigurationsEventType getEventType() { + return ElementTypesConfigurationsEventType.Approved; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractDisapprovedEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractDisapprovedEvent.java index ed63112afe6..c97e942ddbf 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractDisapprovedEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractDisapprovedEvent.java @@ -1,33 +1,33 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public abstract class AbstractDisapprovedEvent extends AbstractElementTypesConfigurationsEvent {
-
- public AbstractDisapprovedEvent(IEditCommandRequest req, IEditHelper editHelper) {
- super(req, editHelper);
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType()
- *
- * @return
- */
- @Override
- public ElementTypesConfigurationsEventType getEventType() {
- return ElementTypesConfigurationsEventType.Disapproved;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public abstract class AbstractDisapprovedEvent extends AbstractElementTypesConfigurationsEvent { + + public AbstractDisapprovedEvent(IEditCommandRequest req, IEditHelper editHelper) { + super(req, editHelper); + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType() + * + * @return + */ + @Override + public ElementTypesConfigurationsEventType getEventType() { + return ElementTypesConfigurationsEventType.Disapproved; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractElementTypesConfigurationsEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractElementTypesConfigurationsEvent.java index 82eed846254..97b2e37c735 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractElementTypesConfigurationsEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractElementTypesConfigurationsEvent.java @@ -1,75 +1,75 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public abstract class AbstractElementTypesConfigurationsEvent implements IElementTypesConfigurationsEvent {
-
- /**
- * Timestamp of the creation of this event
- */
- private long timestamp;
-
- /**
- * The {@link IEditCommandRequest} that triggered this {@link IElementTypesConfigurationsEvent}
- */
- private IEditCommandRequest request;
-
- private IEditHelper editHelper;
-
- public AbstractElementTypesConfigurationsEvent(IEditCommandRequest req, IEditHelper editHelper) {
- this();
- this.request = req;
- this.editHelper = editHelper;
- }
-
- /**
- * @return the {@link IEditCommandRequest} that triggered the event
- */
- public IEditCommandRequest getRequest() {
- return request;
- }
-
- /**
- * @return the {@link IEditHelper} that triggered the event
- */
- public IEditHelper getEditHelper() {
- return editHelper;
- }
-
- AbstractElementTypesConfigurationsEvent() {
- timestamp = System.currentTimeMillis();
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getTimestamp()
- *
- * @return
- */
- @Override
- public long getTimestamp() {
- return timestamp;
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventName()
- *
- * @return
- */
- @Override
- public String getEventName() {
- return this.getClass().getSimpleName();
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public abstract class AbstractElementTypesConfigurationsEvent implements IElementTypesConfigurationsEvent { + + /** + * Timestamp of the creation of this event + */ + private long timestamp; + + /** + * The {@link IEditCommandRequest} that triggered this {@link IElementTypesConfigurationsEvent} + */ + private IEditCommandRequest request; + + private IEditHelper editHelper; + + public AbstractElementTypesConfigurationsEvent(IEditCommandRequest req, IEditHelper editHelper) { + this(); + this.request = req; + this.editHelper = editHelper; + } + + /** + * @return the {@link IEditCommandRequest} that triggered the event + */ + public IEditCommandRequest getRequest() { + return request; + } + + /** + * @return the {@link IEditHelper} that triggered the event + */ + public IEditHelper getEditHelper() { + return editHelper; + } + + AbstractElementTypesConfigurationsEvent() { + timestamp = System.currentTimeMillis(); + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getTimestamp() + * + * @return + */ + @Override + public long getTimestamp() { + return timestamp; + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventName() + * + * @return + */ + @Override + public String getEventName() { + return this.getClass().getSimpleName(); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractExecutableEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractExecutableEvent.java index e3c2167ffe3..ff511f06d54 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractExecutableEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractExecutableEvent.java @@ -1,45 +1,45 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public abstract class AbstractExecutableEvent extends AbstractElementTypesConfigurationsEvent {
-
- private ICommand command;
-
-
- public AbstractExecutableEvent(IEditCommandRequest req, IEditHelper editHelper, ICommand command) {
- super(req, editHelper);
- this.command = command;
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType()
- *
- * @return
- */
- @Override
- public ElementTypesConfigurationsEventType getEventType() {
- return ElementTypesConfigurationsEventType.Executable;
- }
-
- /**
- * @return the command
- */
- public ICommand getCommand() {
- return command;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public abstract class AbstractExecutableEvent extends AbstractElementTypesConfigurationsEvent { + + private ICommand command; + + + public AbstractExecutableEvent(IEditCommandRequest req, IEditHelper editHelper, ICommand command) { + super(req, editHelper); + this.command = command; + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType() + * + * @return + */ + @Override + public ElementTypesConfigurationsEventType getEventType() { + return ElementTypesConfigurationsEventType.Executable; + } + + /** + * @return the command + */ + public ICommand getCommand() { + return command; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractIdentityEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractIdentityEvent.java index 99a6bdf7227..462db0338b6 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractIdentityEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractIdentityEvent.java @@ -1,33 +1,33 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public abstract class AbstractIdentityEvent extends AbstractElementTypesConfigurationsEvent {
-
- public AbstractIdentityEvent(IEditCommandRequest req, IEditHelper editHelper) {
- super(req, editHelper);
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType()
- *
- * @return
- */
- @Override
- public ElementTypesConfigurationsEventType getEventType() {
- return ElementTypesConfigurationsEventType.Identity;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public abstract class AbstractIdentityEvent extends AbstractElementTypesConfigurationsEvent { + + public AbstractIdentityEvent(IEditCommandRequest req, IEditHelper editHelper) { + super(req, editHelper); + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType() + * + * @return + */ + @Override + public ElementTypesConfigurationsEventType getEventType() { + return ElementTypesConfigurationsEventType.Identity; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractRequestConfigurationEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractRequestConfigurationEvent.java index d80e452fa80..f6996126c0b 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractRequestConfigurationEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractRequestConfigurationEvent.java @@ -1,33 +1,33 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public abstract class AbstractRequestConfigurationEvent extends AbstractElementTypesConfigurationsEvent {
-
- public AbstractRequestConfigurationEvent(IEditCommandRequest req, IEditHelper editHelper) {
- super(req, editHelper);
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType()
- *
- * @return
- */
- @Override
- public ElementTypesConfigurationsEventType getEventType() {
- return ElementTypesConfigurationsEventType.RequestConfiguration;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public abstract class AbstractRequestConfigurationEvent extends AbstractElementTypesConfigurationsEvent { + + public AbstractRequestConfigurationEvent(IEditCommandRequest req, IEditHelper editHelper) { + super(req, editHelper); + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType() + * + * @return + */ + @Override + public ElementTypesConfigurationsEventType getEventType() { + return ElementTypesConfigurationsEventType.RequestConfiguration; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractUnexecutableEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractUnexecutableEvent.java index eb87f2c41fe..64271bacfe8 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractUnexecutableEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AbstractUnexecutableEvent.java @@ -1,47 +1,47 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public abstract class AbstractUnexecutableEvent extends AbstractElementTypesConfigurationsEvent {
-
- public AbstractUnexecutableEvent(IEditCommandRequest req, IEditHelper editHelper, ICommand command) {
- super(req, editHelper);
- this.command = command;
- }
-
- /**
- * @return the command
- */
- public ICommand getCommand() {
- return command;
- }
-
- private ICommand command;
-
-
-
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType()
- *
- * @return
- */
- @Override
- public ElementTypesConfigurationsEventType getEventType() {
- return ElementTypesConfigurationsEventType.Unexecutable;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public abstract class AbstractUnexecutableEvent extends AbstractElementTypesConfigurationsEvent { + + public AbstractUnexecutableEvent(IEditCommandRequest req, IEditHelper editHelper, ICommand command) { + super(req, editHelper); + this.command = command; + } + + /** + * @return the command + */ + public ICommand getCommand() { + return command; + } + + private ICommand command; + + + + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IElementTypesConfigurationsEvent#getEventType() + * + * @return + */ + @Override + public ElementTypesConfigurationsEventType getEventType() { + return ElementTypesConfigurationsEventType.Unexecutable; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceApprovedEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceApprovedEvent.java index 3a5d6034c0b..dbb7cee41a2 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceApprovedEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceApprovedEvent.java @@ -1,46 +1,46 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class AdviceApprovedEvent extends AbstractApprovedEvent implements IAdviceEvent {
-
- private IEditHelperAdvice advice;
-
- private IEditHelperAdvice[] advices;
-
- public AdviceApprovedEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice nextAdvice, IEditHelperAdvice[] advices) {
- super(req, editHelper);
- this.advice = nextAdvice;
- this.advices = advices;
- }
-
- /**
- * @return the advice
- */
- @Override
- public IEditHelperAdvice getAdvice() {
- return advice;
- }
-
- /**
- * @return the advices
- */
- @Override
- public IEditHelperAdvice[] getAdvices() {
- return advices;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class AdviceApprovedEvent extends AbstractApprovedEvent implements IAdviceEvent { + + private IEditHelperAdvice advice; + + private IEditHelperAdvice[] advices; + + public AdviceApprovedEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice nextAdvice, IEditHelperAdvice[] advices) { + super(req, editHelper); + this.advice = nextAdvice; + this.advices = advices; + } + + /** + * @return the advice + */ + @Override + public IEditHelperAdvice getAdvice() { + return advice; + } + + /** + * @return the advices + */ + @Override + public IEditHelperAdvice[] getAdvices() { + return advices; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceDisapprovedEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceDisapprovedEvent.java index eca7af0b0ef..edc98e1cdbf 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceDisapprovedEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceDisapprovedEvent.java @@ -1,46 +1,46 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class AdviceDisapprovedEvent extends AbstractDisapprovedEvent implements IAdviceEvent {
-
- private IEditHelperAdvice advice;
-
- IEditHelperAdvice[] advices;
-
- /**
- * @return the advice
- */
- @Override
- public IEditHelperAdvice getAdvice() {
- return advice;
- }
-
- /**
- * @return the advices
- */
- @Override
- public IEditHelperAdvice[] getAdvices() {
- return advices;
- }
-
- public AdviceDisapprovedEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice nextAdvice, IEditHelperAdvice[] advices) {
- super(req, editHelper);
- this.advice = nextAdvice;
- this.advices = advices;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class AdviceDisapprovedEvent extends AbstractDisapprovedEvent implements IAdviceEvent { + + private IEditHelperAdvice advice; + + IEditHelperAdvice[] advices; + + /** + * @return the advice + */ + @Override + public IEditHelperAdvice getAdvice() { + return advice; + } + + /** + * @return the advices + */ + @Override + public IEditHelperAdvice[] getAdvices() { + return advices; + } + + public AdviceDisapprovedEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice nextAdvice, IEditHelperAdvice[] advices) { + super(req, editHelper); + this.advice = nextAdvice; + this.advices = advices; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdvicePhase.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdvicePhase.java index db639390ee3..b251d2863b0 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdvicePhase.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdvicePhase.java @@ -1,17 +1,17 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-public enum AdvicePhase {
- before, after
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +public enum AdvicePhase { + before, after +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceRequestConfigurationEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceRequestConfigurationEvent.java index 75aeb85d3b8..9cf18f699c7 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceRequestConfigurationEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/AdviceRequestConfigurationEvent.java @@ -1,50 +1,50 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class AdviceRequestConfigurationEvent extends AbstractRequestConfigurationEvent implements IAdviceEvent {
-
- private IEditHelperAdvice advice;
-
- private IEditHelperAdvice[] advices;
-
- public AdviceRequestConfigurationEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice advice, IEditHelperAdvice[] advices) {
- super(req, editHelper);
- this.advice = advice;
- this.advices = advices;
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IAdviceEvent#getAdvice()
- *
- * @return
- */
- @Override
- public IEditHelperAdvice getAdvice() {
- return advice;
- }
-
- /**
- * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IAdviceEvent#getAdvices()
- *
- * @return
- */
- @Override
- public IEditHelperAdvice[] getAdvices() {
- return advices;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class AdviceRequestConfigurationEvent extends AbstractRequestConfigurationEvent implements IAdviceEvent { + + private IEditHelperAdvice advice; + + private IEditHelperAdvice[] advices; + + public AdviceRequestConfigurationEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice advice, IEditHelperAdvice[] advices) { + super(req, editHelper); + this.advice = advice; + this.advices = advices; + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IAdviceEvent#getAdvice() + * + * @return + */ + @Override + public IEditHelperAdvice getAdvice() { + return advice; + } + + /** + * @see org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events.IAdviceEvent#getAdvices() + * + * @return + */ + @Override + public IEditHelperAdvice[] getAdvices() { + return advices; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperApprovedEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperApprovedEvent.java index d8e91200f6d..e49b485d8c6 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperApprovedEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperApprovedEvent.java @@ -1,23 +1,23 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class EditHelperApprovedEvent extends AbstractApprovedEvent {
-
- public EditHelperApprovedEvent(IEditCommandRequest req, IEditHelper editHelper) {
- super(req, editHelper);
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class EditHelperApprovedEvent extends AbstractApprovedEvent { + + public EditHelperApprovedEvent(IEditCommandRequest req, IEditHelper editHelper) { + super(req, editHelper); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperDisapprovedEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperDisapprovedEvent.java index 78df3cce678..149ee0c901d 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperDisapprovedEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperDisapprovedEvent.java @@ -1,23 +1,23 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class EditHelperDisapprovedEvent extends AbstractDisapprovedEvent {
-
- public EditHelperDisapprovedEvent(IEditCommandRequest req, IEditHelper editHelper) {
- super(req, editHelper);
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class EditHelperDisapprovedEvent extends AbstractDisapprovedEvent { + + public EditHelperDisapprovedEvent(IEditCommandRequest req, IEditHelper editHelper) { + super(req, editHelper); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperRequestConfigurationEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperRequestConfigurationEvent.java index e50f1cc99df..e6c66afc27d 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperRequestConfigurationEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/EditHelperRequestConfigurationEvent.java @@ -1,23 +1,23 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class EditHelperRequestConfigurationEvent extends AbstractRequestConfigurationEvent {
-
- public EditHelperRequestConfigurationEvent(IEditCommandRequest req, IEditHelper editHelper) {
- super(req, editHelper);
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class EditHelperRequestConfigurationEvent extends AbstractRequestConfigurationEvent { + + public EditHelperRequestConfigurationEvent(IEditCommandRequest req, IEditHelper editHelper) { + super(req, editHelper); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ElementTypesConfigurationsEventType.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ElementTypesConfigurationsEventType.java index b88f4117104..386fb4ddad4 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ElementTypesConfigurationsEventType.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ElementTypesConfigurationsEventType.java @@ -1,17 +1,17 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-public enum ElementTypesConfigurationsEventType {
- Disapproved, Unexecutable, Approved, Executable, Identity, RequestConfiguration
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +public enum ElementTypesConfigurationsEventType { + Disapproved, Unexecutable, Approved, Executable, Identity, RequestConfiguration +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ExecutableAdviceEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ExecutableAdviceEvent.java index 67beeb1f727..97a98903269 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ExecutableAdviceEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ExecutableAdviceEvent.java @@ -1,57 +1,57 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class ExecutableAdviceEvent extends AbstractExecutableEvent implements IAdviceEvent {
-
- private IEditHelperAdvice advice;
-
- private IEditHelperAdvice[] advices;
-
- private AdvicePhase advicePhase;
-
- public ExecutableAdviceEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice advice, ICommand command, IEditHelperAdvice[] advices, AdvicePhase advicePhase) {
- super(req, editHelper, command);
- this.advice = advice;
- this.advices = advices;
- this.advicePhase = advicePhase;
- }
-
- /**
- * @return the advice
- */
- @Override
- public IEditHelperAdvice getAdvice() {
- return advice;
- }
-
- /**
- * @return the advices
- */
- @Override
- public IEditHelperAdvice[] getAdvices() {
- return advices;
- }
-
- /**
- * @return the advicePhase
- */
- public AdvicePhase getAdvicePhase() {
- return advicePhase;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class ExecutableAdviceEvent extends AbstractExecutableEvent implements IAdviceEvent { + + private IEditHelperAdvice advice; + + private IEditHelperAdvice[] advices; + + private AdvicePhase advicePhase; + + public ExecutableAdviceEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice advice, ICommand command, IEditHelperAdvice[] advices, AdvicePhase advicePhase) { + super(req, editHelper, command); + this.advice = advice; + this.advices = advices; + this.advicePhase = advicePhase; + } + + /** + * @return the advice + */ + @Override + public IEditHelperAdvice getAdvice() { + return advice; + } + + /** + * @return the advices + */ + @Override + public IEditHelperAdvice[] getAdvices() { + return advices; + } + + /** + * @return the advicePhase + */ + public AdvicePhase getAdvicePhase() { + return advicePhase; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ExecutableEditHelperEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ExecutableEditHelperEvent.java index 6850f5c6c2f..f998e9145e3 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ExecutableEditHelperEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/ExecutableEditHelperEvent.java @@ -1,24 +1,24 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class ExecutableEditHelperEvent extends AbstractExecutableEvent {
-
- public ExecutableEditHelperEvent(IEditCommandRequest req, IEditHelper editHelper, ICommand command) {
- super(req, editHelper, command);
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class ExecutableEditHelperEvent extends AbstractExecutableEvent { + + public ExecutableEditHelperEvent(IEditCommandRequest req, IEditHelper editHelper, ICommand command) { + super(req, editHelper, command); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IAdviceEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IAdviceEvent.java index 0b5cd833bfe..58ef81a93da 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IAdviceEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IAdviceEvent.java @@ -1,28 +1,28 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-
-public interface IAdviceEvent extends IElementTypesConfigurationsEvent {
-
- /**
- * @return the advice
- */
- public IEditHelperAdvice getAdvice();
-
- /**
- * @return the advices
- */
- public IEditHelperAdvice[] getAdvices();
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; + +public interface IAdviceEvent extends IElementTypesConfigurationsEvent { + + /** + * @return the advice + */ + public IEditHelperAdvice getAdvice(); + + /** + * @return the advices + */ + public IEditHelperAdvice[] getAdvices(); +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IElementTypesConfigurationsEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IElementTypesConfigurationsEvent.java index 527e93f5a92..5d93ff9cb0d 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IElementTypesConfigurationsEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IElementTypesConfigurationsEvent.java @@ -1,29 +1,29 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public interface IElementTypesConfigurationsEvent {
-
- public long getTimestamp();
-
- public String getEventName();
-
- public ElementTypesConfigurationsEventType getEventType();
-
- public IEditCommandRequest getRequest();
-
- public IEditHelper getEditHelper();
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public interface IElementTypesConfigurationsEvent { + + public long getTimestamp(); + + public String getEventName(); + + public ElementTypesConfigurationsEventType getEventType(); + + public IEditCommandRequest getRequest(); + + public IEditHelper getEditHelper(); +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IdentityAdviceEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IdentityAdviceEvent.java index 7fab7c2b260..6acc4c14e4f 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IdentityAdviceEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IdentityAdviceEvent.java @@ -1,56 +1,56 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class IdentityAdviceEvent extends AbstractIdentityEvent implements IAdviceEvent {
-
- private IEditHelperAdvice advice;
-
- private IEditHelperAdvice[] advices;
-
- private AdvicePhase advicePhase;
-
- public IdentityAdviceEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice advice, IEditHelperAdvice[] advices, AdvicePhase advicePhase) {
- super(req, editHelper);
- this.advice = advice;
- this.advices = advices;
- this.advicePhase = advicePhase;
- }
-
- /**
- * @return the advice
- */
- @Override
- public IEditHelperAdvice getAdvice() {
- return advice;
- }
-
- /**
- * @return the advices
- */
- @Override
- public IEditHelperAdvice[] getAdvices() {
- return advices;
- }
-
- /**
- * @return the advicePhase
- */
- public AdvicePhase getAdvicePhase() {
- return advicePhase;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class IdentityAdviceEvent extends AbstractIdentityEvent implements IAdviceEvent { + + private IEditHelperAdvice advice; + + private IEditHelperAdvice[] advices; + + private AdvicePhase advicePhase; + + public IdentityAdviceEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice advice, IEditHelperAdvice[] advices, AdvicePhase advicePhase) { + super(req, editHelper); + this.advice = advice; + this.advices = advices; + this.advicePhase = advicePhase; + } + + /** + * @return the advice + */ + @Override + public IEditHelperAdvice getAdvice() { + return advice; + } + + /** + * @return the advices + */ + @Override + public IEditHelperAdvice[] getAdvices() { + return advices; + } + + /** + * @return the advicePhase + */ + public AdvicePhase getAdvicePhase() { + return advicePhase; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IdentityEditHelperEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IdentityEditHelperEvent.java index fe37084a3b4..60351c414ab 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IdentityEditHelperEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/IdentityEditHelperEvent.java @@ -1,24 +1,24 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class IdentityEditHelperEvent extends AbstractIdentityEvent {
-
-
- public IdentityEditHelperEvent(IEditCommandRequest req, IEditHelper editHelper) {
- super(req, editHelper);
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class IdentityEditHelperEvent extends AbstractIdentityEvent { + + + public IdentityEditHelperEvent(IEditCommandRequest req, IEditHelper editHelper) { + super(req, editHelper); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/UnexecutableAdviceEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/UnexecutableAdviceEvent.java index e6926a9c566..40ad5a889f7 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/UnexecutableAdviceEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/UnexecutableAdviceEvent.java @@ -1,57 +1,57 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class UnexecutableAdviceEvent extends AbstractUnexecutableEvent implements IAdviceEvent {
-
- private IEditHelperAdvice advice;
-
- private IEditHelperAdvice[] advices;
-
- private AdvicePhase advicePhase;
-
- public UnexecutableAdviceEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice advice, ICommand command, IEditHelperAdvice[] advices, AdvicePhase advicePhase) {
- super(req, editHelper, command);
- this.advice = advice;
- this.advices = advices;
- this.advicePhase = advicePhase;
- }
-
- /**
- * @return the advice
- */
- @Override
- public IEditHelperAdvice getAdvice() {
- return advice;
- }
-
- /**
- * @return the advices
- */
- @Override
- public IEditHelperAdvice[] getAdvices() {
- return advices;
- }
-
- /**
- * @return the advicePhase
- */
- public AdvicePhase getAdvicePhase() {
- return advicePhase;
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class UnexecutableAdviceEvent extends AbstractUnexecutableEvent implements IAdviceEvent { + + private IEditHelperAdvice advice; + + private IEditHelperAdvice[] advices; + + private AdvicePhase advicePhase; + + public UnexecutableAdviceEvent(IEditCommandRequest req, IEditHelper editHelper, IEditHelperAdvice advice, ICommand command, IEditHelperAdvice[] advices, AdvicePhase advicePhase) { + super(req, editHelper, command); + this.advice = advice; + this.advices = advices; + this.advicePhase = advicePhase; + } + + /** + * @return the advice + */ + @Override + public IEditHelperAdvice getAdvice() { + return advice; + } + + /** + * @return the advices + */ + @Override + public IEditHelperAdvice[] getAdvices() { + return advices; + } + + /** + * @return the advicePhase + */ + public AdvicePhase getAdvicePhase() { + return advicePhase; + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/UnexecutableEditHelperEvent.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/UnexecutableEditHelperEvent.java index 34c6cd2e729..466940b71c2 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/UnexecutableEditHelperEvent.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/notification/events/UnexecutableEditHelperEvent.java @@ -1,24 +1,24 @@ -/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-public class UnexecutableEditHelperEvent extends AbstractUnexecutableEvent {
-
- public UnexecutableEditHelperEvent(IEditCommandRequest req, IEditHelper editHelper, ICommand command) {
- super(req, editHelper, command);
- }
-}
+/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.elementtypesconfigurations.notification.events; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelper; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; + +public class UnexecutableEditHelperEvent extends AbstractUnexecutableEvent { + + public UnexecutableEditHelperEvent(IEditCommandRequest req, IEditHelper editHelper, ICommand command) { + super(req, editHelper, command); + } +} diff --git a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/registries/ElementTypeSetConfigurationRegistry.java b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/registries/ElementTypeSetConfigurationRegistry.java index 151fd772b4f..9b8027227e2 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/registries/ElementTypeSetConfigurationRegistry.java +++ b/plugins/infra/org.eclipse.papyrus.infra.elementtypesconfigurations/src/org/eclipse/papyrus/infra/elementtypesconfigurations/registries/ElementTypeSetConfigurationRegistry.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. + * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,8 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 459174 - * Christian W. Damus - bug 467207 + * Christian W. Damus - bugs 459174, 467207, 485220 * *****************************************************************************/ package org.eclipse.papyrus.infra.elementtypesconfigurations.registries; @@ -296,7 +295,7 @@ public class ElementTypeSetConfigurationRegistry { for (ElementTypeSetConfiguration elementTypeSetConfiguration : elementTypeSetConfigurations.get(contexId).values()) { TreeIterator<EObject> it = elementTypeSetConfiguration.eAllContents(); while (it.hasNext()) { - EObject element = (EObject) it.next(); + EObject element = it.next(); if (element instanceof AdviceConfiguration) { adviceToCheck.add((AdviceConfiguration) element); } @@ -308,7 +307,7 @@ public class ElementTypeSetConfigurationRegistry { for (ElementTypeSetConfiguration elementTypeSetConfiguration : registrableElementTypeSetConfiguration) { TreeIterator<EObject> it = elementTypeSetConfiguration.eAllContents(); while (it.hasNext()) { - EObject element = (EObject) it.next(); + EObject element = it.next(); if (element instanceof AdviceConfiguration) { adviceToCheck.add((AdviceConfiguration) element); @@ -404,7 +403,7 @@ public class ElementTypeSetConfigurationRegistry { for (ElementTypeSetConfiguration elementTypeSetConfiguration : elementTypeSetConfigurations.get(contextId).values()) { TreeIterator<EObject> it = elementTypeSetConfiguration.eAllContents(); while (it.hasNext()) { - EObject element = (EObject) it.next(); + EObject element = it.next(); if (element instanceof AdviceConfiguration) { advices.add((AdviceConfiguration) element); } @@ -449,9 +448,12 @@ public class ElementTypeSetConfigurationRegistry { Activator.log.debug("- ClientContext the model should be registreted to: " + clientContextId); Activator.log.debug("- id of the container bundle: " + contributorID); } - ElementTypeSetConfiguration set = getElementTypeSetConfiguration(modelPath, contributorID); - addElementTypeSetConfigurationToDefinitions(set, clientContextId, existingDefinitions); + ElementTypeSetConfiguration set = getElementTypeSetConfiguration(modelPath, contributorID); + if (set != null) { + // It will be null if the file was absent or malformed and so failed to load. + addElementTypeSetConfigurationToDefinitions(set, clientContextId, existingDefinitions); + } } return existingDefinitions; @@ -493,36 +495,33 @@ public class ElementTypeSetConfigurationRegistry { if (Platform.isFragment(bundle)) { ElementTypeSetConfiguration configuration = getElementTypeSetConfigurationInBundle(modelPath, bundleId); if (configuration == null) { - Activator.log.warn("Cannot find resource " + modelPath + " in bundle " + bundleId); + Activator.log.warn("Failed to load resource " + modelPath + " from bundle " + bundleId); } return configuration; } else { // this is a plugin. Search in sub fragments, then in the plugin - Bundle[] fragments = Platform.getFragments(bundle); - // no fragment, so the file should be in the plugin itself - if (fragments == null) { - return getElementTypeSetConfigurationInBundle(modelPath, bundleId); - } else { + ElementTypeSetConfiguration elementTypeSetConfiguration = null; - ElementTypeSetConfiguration elementTypeSetConfiguration = null; + Bundle[] fragments = Platform.getFragments(bundle); + if (fragments != null) { for (Bundle fragment : fragments) { elementTypeSetConfiguration = getElementTypeSetConfigurationInBundle(modelPath, fragment.getSymbolicName()); if (elementTypeSetConfiguration != null) { break; } } + } // else no fragments, so the file should be in the plugin, itself - if (elementTypeSetConfiguration == null) { - // not found in fragments. Look in the plugin itself - elementTypeSetConfiguration = getElementTypeSetConfigurationInBundle(modelPath, bundleId); - } - - if (elementTypeSetConfiguration == null) { - Activator.log.warn("Cannot find resource " + modelPath + " in bundle " + bundleId); - } + if (elementTypeSetConfiguration == null) { + // not found in fragments. Look in the plugin itself + elementTypeSetConfiguration = getElementTypeSetConfigurationInBundle(modelPath, bundleId); + } - return elementTypeSetConfiguration; + if (elementTypeSetConfiguration == null) { + Activator.log.warn("Failed to load resource " + modelPath + " from bundle " + bundleId); } + + return elementTypeSetConfiguration; } } |