Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2016-03-16 14:49:43 +0000
committerMickael ADAM2016-09-01 09:55:09 +0000
commit75ecec82c71fc8aa66cca8eb69e9af6826d1fdfb (patch)
tree590f763976234be004160837806de13410011579 /plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra
parent54b12e645d111ca4f66fef2c512ac53ecfbfc0eb (diff)
downloadorg.eclipse.papyrus-75ecec82c71fc8aa66cca8eb69e9af6826d1fdfb.tar.gz
org.eclipse.papyrus-75ecec82c71fc8aa66cca8eb69e9af6826d1fdfb.tar.xz
org.eclipse.papyrus-75ecec82c71fc8aa66cca8eb69e9af6826d1fdfb.zip
Bug 482669 - [Palette] New Palette configuration models shall be
editable with an advance UI https://bugs.eclipse.org/bugs/show_bug.cgi?id=482669 Patch set 27: - rebase & maj dependency version Patch set 25: - Fix dependency version Patch set 24: - update version to 3.0.0 or 2.1 - take into account of new elemntType version (no more Ids) - refactor ProdileWSModelIndexer to use URI Patch set 23: - rebase - remove CustomElmtTypeFactory Patch set 20: - Fix missing id in manual created advices Patch set 17: - Fix bugs from NiF review patch set 16: - Fix a bug of drag a stereotype then a metaclass => NPE patch set 16: - fix ProfileWorkspaceModelIndex - add shouldIndex(IFile file) to IndexHandler patch set 15: - fix a build.properties Patch set 14: - some minors fixes Patch set 13: - Finalize properties view for actions - implements validators. - Adds plugins to oep.customization.feature Patch set 12: - implement properties view for SetValue Advice, SetStereotype and Runtime advice. - new Explorer dialog(Stereotype, Profile, GenericElement) -... Patch set 11: - final implementation of apply stereotype action properties view - fix feedback from NIF previous review. - fix enable button of generic multipleValueEditor - Styled text for stereotype explorer - add profile explorer - add stereotype attribute explorer - many fixes Patch set 10: - Move created plugin in customization feature Patch set 9: -Fix pom dependencies Patch set 8: - implementation of property view for StereotypesToAplly of Action. - create a Icon Value editor instead of IconDescriptor - Create stereotype selection dialog which display all available stereotype - Create Profile workspace indexer Patch set X: - create StringWithClear Editor - rename property plugin - remove assistant and newChild implementation for palette - use of icon 12*12 from oep.infr.widget Patch set 5: - Fix pom file Patch set 4: - inlude all changes from palette customization branch Patch set 3: - Adds clear filter button for icon explorer. - Adds some newChild management requirement. Patch set 2: - Gets all declared advice kind in add actions. - Adds icon+description to AdviceKindExtensionPoint. - Adds createAdviceBindingConfiguration to AbstractAdviceBindingFactory. - Gets default actions EMF properties view when no View defined in ctx - Manage action buttons enable. Patch set 1: - Adds actions management - Adds properties View for adviceConfiguration - Adds ctrl+clic to create old local palette Conflicts: plugins/uml/properties/org.eclipse.papyrus.uml.properties/META-INF/MANIFEST.MF Change-Id: I1f5caeb9eb411df2886f29ae02d807bb69b79be2 Signed-off-by: Mickael ADAM <mickael.adam@ALL4TEC.net>
Diffstat (limited to 'plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra')
-rw-r--r--plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/extensionpoints/IAdviceKindExtensionPoint.java12
-rw-r--r--plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/AbstractAdviceBindingFactory.java138
-rw-r--r--plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/DefaultAdviceBindingFactory.java75
3 files changed, 122 insertions, 103 deletions
diff --git a/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/extensionpoints/IAdviceKindExtensionPoint.java b/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/extensionpoints/IAdviceKindExtensionPoint.java
index 1def9adfa2c..0711207ad38 100644
--- a/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/extensionpoints/IAdviceKindExtensionPoint.java
+++ b/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/extensionpoints/IAdviceKindExtensionPoint.java
@@ -8,6 +8,7 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Add icon and description
*
*****************************************************************************/
package org.eclipse.papyrus.infra.types.core.extensionpoints;
@@ -17,9 +18,14 @@ import org.eclipse.papyrus.infra.types.core.Activator;
public interface IAdviceKindExtensionPoint {
/** ID of the extension point */
- public final static String EXTENSION_POINT_ID = Activator.PLUGIN_ID + ".adviceConfigurationKind";
+ public final static String EXTENSION_POINT_ID = Activator.PLUGIN_ID + ".adviceConfigurationKind";//$NON-NLS-1$
- public static final String FACTORY_CLASS = "factoryClass";
+ public static final String FACTORY_CLASS = "factoryClass";//$NON-NLS-1$
+
+ public static final String CONFIGURATION_CLASS = "configurationClass";//$NON-NLS-1$
+
+ public static final String DESCRIPTION = "description";//$NON-NLS-1$
+
+ public static final String ICON = "icon";//$NON-NLS-1$
- public static final String CONFIGURATION_CLASS = "configurationClass";
}
diff --git a/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/AbstractAdviceBindingFactory.java b/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/AbstractAdviceBindingFactory.java
index 2d39c7686c0..676a4674ed4 100644
--- a/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/AbstractAdviceBindingFactory.java
+++ b/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/AbstractAdviceBindingFactory.java
@@ -1,66 +1,72 @@
-/*****************************************************************************
- * 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.types.core.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.types.AbstractAdviceBindingConfiguration;
-import org.eclipse.papyrus.infra.types.AbstractMatcherConfiguration;
-import org.eclipse.papyrus.infra.types.ContainerConfiguration;
-import org.eclipse.papyrus.infra.types.core.registries.ContainerConfigurationTypeRegistry;
-import org.eclipse.papyrus.infra.types.core.registries.MatcherConfigurationTypeRegistry;
-
-public abstract class AbstractAdviceBindingFactory<T extends AbstractAdviceBindingConfiguration> extends AbstractAdviceFactory<T> {
-
- private final String ALL_TYPE_ID = "*";
-
- @Override
- protected String getTypeId(T adviceConfiguration) {
- if (adviceConfiguration.getTarget() != null) {
- return adviceConfiguration.getTarget().getIdentifier();
- } else {
- return ALL_TYPE_ID;
- }
- }
-
- @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
+ * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Add createAdviceBindingConfiguration method
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.types.core.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.types.AbstractAdviceBindingConfiguration;
+import org.eclipse.papyrus.infra.types.AbstractMatcherConfiguration;
+import org.eclipse.papyrus.infra.types.ContainerConfiguration;
+import org.eclipse.papyrus.infra.types.core.registries.ContainerConfigurationTypeRegistry;
+import org.eclipse.papyrus.infra.types.core.registries.MatcherConfigurationTypeRegistry;
+
+public abstract class AbstractAdviceBindingFactory<T extends AbstractAdviceBindingConfiguration> extends AbstractAdviceFactory<T> {
+
+ private final String ALL_TYPE_ID = "*";
+
+ @Override
+ protected String getTypeId(T adviceConfiguration) {
+ if (adviceConfiguration.getTarget() != null) {
+ return adviceConfiguration.getTarget().getIdentifier();
+ } else {
+ return ALL_TYPE_ID;
+ }
+ }
+
+ @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();
+ }
+
+ /**
+ * @return an instance of the defined advice binding configuration
+ */
+ abstract public AbstractAdviceBindingConfiguration createAdviceBindingConfiguration();
+}
diff --git a/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/DefaultAdviceBindingFactory.java b/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/DefaultAdviceBindingFactory.java
index 36a8af3bf9d..576cbb4d3e3 100644
--- a/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/DefaultAdviceBindingFactory.java
+++ b/plugins/infra/types/org.eclipse.papyrus.infra.types.core/src/org/eclipse/papyrus/infra/types/core/factories/impl/DefaultAdviceBindingFactory.java
@@ -1,34 +1,41 @@
-/*****************************************************************************
- * 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.types.core.factories.impl;
-
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
-import org.eclipse.papyrus.infra.types.AdviceBindingConfiguration;
-
-public class DefaultAdviceBindingFactory extends AbstractAdviceBindingFactory<AdviceBindingConfiguration> {
-
- /**
- *
- * @see org.eclipse.papyrus.infra.types.core.factories.impl.AbstractAdviceFactory#getEditHelperAdvice(org.eclipse.papyrus.infra.types.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
+ * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - add createAdviceBindingConfiguration method
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.types.core.factories.impl;
+
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
+import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
+import org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration;
+import org.eclipse.papyrus.infra.types.AdviceBindingConfiguration;
+import org.eclipse.papyrus.infra.types.ElementTypesConfigurationsFactory;
+
+public class DefaultAdviceBindingFactory extends AbstractAdviceBindingFactory<AdviceBindingConfiguration> {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected IEditHelperAdvice getEditHelperAdvice(final AdviceBindingConfiguration adviceConfiguration) {
+ IEditHelperAdvice editHelperAdvice = ClassLoaderHelper.newInstance(adviceConfiguration.getEditHelperAdviceClassName(), IEditHelperAdvice.class);
+ return editHelperAdvice;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AbstractAdviceBindingConfiguration createAdviceBindingConfiguration() {
+ return ElementTypesConfigurationsFactory.eINSTANCE.createAdviceBindingConfiguration();
+ }
+
+}

Back to the top