Author: koen.aers(a)jboss.com
Date: 2010-12-14 18:42:27 -0500 (Tue, 14 Dec 2010)
New Revision: 27487
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src/org/jboss/tools/bpmn2/view/Bpmn2DefinitionsPageImpl.java
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src/org/jboss/tools/bpmn2/view/Bpmn2DetailsPageImpl.java
Log:
id should not be set when not required (doesn't seem to be supported in the model)
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src/org/jboss/tools/bpmn2/view/Bpmn2DefinitionsPageImpl.java
===================================================================
---
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src/org/jboss/tools/bpmn2/view/Bpmn2DefinitionsPageImpl.java 2010-12-14
23:07:41 UTC (rev 27486)
+++
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src/org/jboss/tools/bpmn2/view/Bpmn2DefinitionsPageImpl.java 2010-12-14
23:42:27 UTC (rev 27487)
@@ -321,7 +321,7 @@
if (eventType == Notification.ADD || eventType == Notification.SET) {
Object object = notification.getNewValue();
if (object instanceof EObject) {
- setIdIfNotSet((EObject)object);
+ setIdIfNeeded((EObject)object);
updateTreeSelection(object);
}
}
@@ -335,10 +335,10 @@
});
}
- protected void setIdIfNotSet(EObject obj) {
+ protected void setIdIfNeeded(EObject obj) {
if (obj.eClass() != null) {
EStructuralFeature idAttr = obj.eClass().getEIDAttribute();
- if (idAttr != null && !obj.eIsSet(idAttr)) {
+ if (idAttr != null && idAttr.isRequired() &&
!obj.eIsSet(idAttr)) {
CommandParameter commandParameter = new CommandParameter(obj, idAttr,
EcoreUtil.generateUUID(), CommandParameter.NO_INDEX);
Command command = editor.getEditingDomain().createCommand(SetCommand.class,
commandParameter);
editor.getEditingDomain().getCommandStack().execute(command);
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src/org/jboss/tools/bpmn2/view/Bpmn2DetailsPageImpl.java
===================================================================
---
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src/org/jboss/tools/bpmn2/view/Bpmn2DetailsPageImpl.java 2010-12-14
23:07:41 UTC (rev 27486)
+++
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src/org/jboss/tools/bpmn2/view/Bpmn2DetailsPageImpl.java 2010-12-14
23:42:27 UTC (rev 27487)
@@ -348,7 +348,7 @@
if (eventType == Notification.ADD || eventType == Notification.SET) {
Object object = notification.getNewValue();
if (object instanceof EObject) {
- setIdIfNotSet((EObject)object);
+ setIdIfNeeded((EObject)object);
updateTreeSelection(object);
}
}
@@ -362,10 +362,10 @@
});
}
- protected void setIdIfNotSet(EObject obj) {
+ protected void setIdIfNeeded(EObject obj) {
if (obj.eClass() != null) {
EStructuralFeature idAttr = obj.eClass().getEIDAttribute();
- if (idAttr != null && !obj.eIsSet(idAttr)) {
+ if (idAttr != null && idAttr.isRequired() &&
!obj.eIsSet(idAttr)) {
CommandParameter commandParameter = new CommandParameter(obj, idAttr,
EcoreUtil.generateUUID(), CommandParameter.NO_INDEX);
Command command = editor.getEditingDomain().createCommand(SetCommand.class,
commandParameter);
editor.getEditingDomain().getCommandStack().execute(command);
Show replies by date