Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2014-01-13 06:52:55 +0000
committerrschnekenbu2014-01-27 14:41:25 +0000
commit619fa9cb6b06a98157bd42e6a3f4113539be0a43 (patch)
treeb2234d05964507fdaf1b7549d930c187779362d5 /plugins
parentde7ed4f140c3b677ff5f64cc7b5a462223b69bfa (diff)
downloadorg.eclipse.papyrus-619fa9cb6b06a98157bd42e6a3f4113539be0a43.tar.gz
org.eclipse.papyrus-619fa9cb6b06a98157bd42e6a3f4113539be0a43.tar.xz
org.eclipse.papyrus-619fa9cb6b06a98157bd42e6a3f4113539be0a43.zip
424402: [Core] Runtime deployment of the element types shall be possible
https://bugs.eclipse.org/bugs/show_bug.cgi?id=424402 - fix some NPE in the palette service - Update the tests models - added some comments
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/invariantsemantictypeconfiguration/IConfigurableEditHelperAdvice.java7
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java8
3 files changed, 14 insertions, 4 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/invariantsemantictypeconfiguration/IConfigurableEditHelperAdvice.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/invariantsemantictypeconfiguration/IConfigurableEditHelperAdvice.java
index d44a3048094..49d7520334e 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/invariantsemantictypeconfiguration/IConfigurableEditHelperAdvice.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/invariantsemantictypeconfiguration/IConfigurableEditHelperAdvice.java
@@ -14,14 +14,15 @@ package org.eclipse.papyrus.infra.extendedtypes.invariantsemantictypeconfigurati
import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-
/**
- * @author RS211865
+ * Interface for all {@link IEditHelperAdvice} that are configured by an {@link InvariantRuleConfiguration}.
*/
public interface IConfigurableEditHelperAdvice<T extends InvariantRuleConfiguration> extends IEditHelperAdvice {
/**
- * @param ruleConfiguration
+ * Inits the edit helper advice with its given configuration
+ *
+ * @param ruleConfiguration the configuration of the edit helper advice
*/
void init(T ruleConfiguration);
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java b/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
index 7008e50ff8e..d278a9feb26 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
@@ -213,7 +213,8 @@ public class CreationMenuFactory {
if(eStructuralFeature instanceof EReference) {
EReference ref = (EReference)eStructuralFeature;
if(ref.isContainment()) {
- if(isSubClass(ref.getEType(), getElementType(currentCreationMenu.getElementTypeIdRef()).getEClass())) {
+ IElementType menuType = getElementType(currentCreationMenu.getElementTypeIdRef());
+ if(menuType!=null && isSubClass(ref.getEType(), menuType.getEClass())) {
possibleEFeatures.add(eStructuralFeature);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java
index 4a5af50263f..536c94a0515 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java
@@ -53,7 +53,11 @@ public class LocalPaletteProvider extends AbstractProvider implements IPalettePr
*/
@SuppressWarnings("unchecked")
public void contributeToPalette(IEditorPart editor, Object content, PaletteRoot root, Map predefinedEntries) {
+ if(contributions ==null) {
+ return;
+ }
parser = new XMLDefinitionPaletteParser(new XMLDefinitionPaletteFactory(root, predefinedEntries));
+
for(int i = 0; i < contributions.getLength(); i++) {
Node node = contributions.item(i);
if(PALETTE_DEFINITION.equals(node.getNodeName())) {
@@ -112,10 +116,14 @@ public class LocalPaletteProvider extends AbstractProvider implements IPalettePr
// the file should never be null in this implementation, but
// sub-classes could return null
if(inputStream == null) {
+ contributions = new EmptyNodeList();
throw new IOException("Impossible to load file: " + path);
} else {
Document document = documentBuilder.parse(inputStream);
contributions = document.getChildNodes();
+ if(contributions == null) {
+ contributions = new EmptyNodeList();
+ }
}
} catch (ParserConfigurationException e) {
Activator.log.error(e);

Back to the top