Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Brodt2014-06-30 15:21:53 -0400
committerBob Brodt2014-06-30 15:21:53 -0400
commit032e0cbdb4f6c61b438de6d071cc057e246c5c50 (patch)
treea7856bdb5a8aadd29a01312d9937c2602d1048b8
parent5db52a6e95172aff7b1a996144c96d5e3896ad2f (diff)
downloadorg.eclipse.bpmn2-modeler-032e0cbdb4f6c61b438de6d071cc057e246c5c50.tar.gz
org.eclipse.bpmn2-modeler-032e0cbdb4f6c61b438de6d071cc057e246c5c50.tar.xz
org.eclipse.bpmn2-modeler-032e0cbdb4f6c61b438de6d071cc057e246c5c50.zip
Data Items tab has gone missing, more bug fixes
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java1
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java20
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java38
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java3
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml2
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java2
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java8
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java6
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsDetailComposite.java36
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java9
10 files changed, 72 insertions, 53 deletions
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java
index cc4460f0..e249ff96 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/Bpmn2ModelerFactory.java
@@ -141,6 +141,7 @@ public class Bpmn2ModelerFactory extends Bpmn2FactoryImpl {
String className = eClass.getName();
if (!className.equals(Bpmn2Package.eINSTANCE.getDocumentRoot().getName()) &&
rt.getModelDescriptor().getEPackage() != Bpmn2Package.eINSTANCE &&
+ rt.getModelDescriptor().getEPackage() != null &&
rt.getModelDescriptor().getEPackage().getEClassifier(className) != null ) {
EClass clazz = (EClass) rt.getModelDescriptor().getEPackage().getEClassifier(className);
object = rt.getModelDescriptor().getEFactory().create(clazz);
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java
index b0fd58ad..59468767 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java
@@ -20,6 +20,7 @@ import java.util.Map.Entry;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.di.BpmnDiPackage;
import org.eclipse.bpmn2.modeler.core.features.IBpmn2CreateFeature;
+import org.eclipse.bpmn2.modeler.core.model.ModelDecorator;
import org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor;
import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime;
import org.eclipse.emf.common.util.EList;
@@ -156,20 +157,11 @@ public class ModelEnablements {
* @return the EClass instance or null if not found.
*/
private EClass getEClass(String className) {
- // try the runtime package first
- EClass eClass = (EClass)targetRuntime.getModelDescriptor().getEPackage().getEClassifier(className);
- // then all BPMN2 packages
- if (eClass==null)
- eClass = (EClass)Bpmn2Package.eINSTANCE.getEClassifier(className);
- if (eClass==null)
- eClass = (EClass)BpmnDiPackage.eINSTANCE.getEClassifier(className);
-
- // TODO: do we need these?
-// if (eClass==null)
-// eClass = (EClass)DcPackage.eINSTANCE.getEClassifier(className);
-// if (eClass==null)
-// eClass = (EClass)DiPackage.eINSTANCE.getEClassifier(className);
- return eClass;
+ EClassifier eClassifier = ModelDecorator.findEClassifier(
+ targetRuntime.getModelDescriptor().getEPackage(), className);
+ if (eClassifier instanceof EClass)
+ return (EClass) eClassifier;
+ return null;
}
private void setEnabledSingle(EClass eClass, boolean enabled) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
index 1a4d5be8..9c147208 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ShapeStyle.java
@@ -732,18 +732,20 @@ public class ShapeStyle extends BaseRuntimeExtensionDescriptor {
ModelExtensionDescriptor med = TargetRuntime.getDefaultRuntime().getModelExtensionDescriptor(element);
ModelDecorator md = med.getModelDecorator();
EStructuralFeature styleFeature = md.getEStructuralFeature(element, STYLE_OBJECT);
- ShapeStyle ss = getShapeStyle(element);
- style = (EObject)adapter.getFeatureDescriptor(styleFeature).getValue();
- if (style==null) {
- // this object does not have a <style> extension element yet so create one
- // and initialize it from the User Preference store
- style = med.createObject((EClass)styleFeature.getEType());
- setShapeStyle(element, style, ss);
- // add it to the BaseElement extension values
- InsertionAdapter.add(element, styleFeature, style);
- }
- else {
- setShapeStyle(element, style, ss);
+ if (styleFeature!=null) {
+ ShapeStyle ss = getShapeStyle(element);
+ style = (EObject)adapter.getFeatureDescriptor(styleFeature).getValue();
+ if (style==null) {
+ // this object does not have a <style> extension element yet so create one
+ // and initialize it from the User Preference store
+ style = med.createObject((EClass)styleFeature.getEType());
+ setShapeStyle(element, style, ss);
+ // add it to the BaseElement extension values
+ InsertionAdapter.add(element, styleFeature, style);
+ }
+ else {
+ setShapeStyle(element, style, ss);
+ }
}
}
catch (Exception e) {
@@ -759,9 +761,10 @@ public class ShapeStyle extends BaseRuntimeExtensionDescriptor {
ModelExtensionDescriptor med = TargetRuntime.getDefaultRuntime().getModelExtensionDescriptor(element);
ModelDecorator md = med.getModelDecorator();
EStructuralFeature styleFeature = md.getEStructuralFeature(element, STYLE_OBJECT);
- ExtendedPropertiesAdapter adapter = ExtendedPropertiesAdapter.adapt(element);
-
- style = (EObject)adapter.getFeatureDescriptor(styleFeature).getValue();
+ if (styleFeature!=null) {
+ ExtendedPropertiesAdapter adapter = ExtendedPropertiesAdapter.adapt(element);
+ style = (EObject)adapter.getFeatureDescriptor(styleFeature).getValue();
+ }
}
catch (Exception e) {
// ignore exceptions - the BaseElement doesn't have a <style> extension element
@@ -821,7 +824,8 @@ public class ShapeStyle extends BaseRuntimeExtensionDescriptor {
public static ShapeStyle getShapeStyle(BaseElement element) {
Bpmn2Preferences preferences = Bpmn2Preferences.getInstance(element);
- ShapeStyle ss = preferences.getShapeStyle(element); // this makes a copy of the value in Preference Store
+ ShapeStyle ss = preferences.getShapeStyle(element);
+ ss = new ShapeStyle(ss); // makes a copy of the value in Preference Store
EObject style = getStyleObject(element);
if (style!=null) {
@@ -927,7 +931,7 @@ public class ShapeStyle extends BaseRuntimeExtensionDescriptor {
if (element==null)
return false;
Bpmn2Preferences preferences = Bpmn2Preferences.getInstance(element);
- ShapeStyle ssDefault = preferences.getShapeStyle(element); // this makes a copy of the value in Preference Store
+ ShapeStyle ssDefault = preferences.getShapeStyle(element);
ShapeStyle ssElement = getShapeStyle(element);
String defaultString = ssDefault.toString();
String elementString = ssElement.toString();
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java
index 9f7bf74b..d7c2f9de 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/ModelDescriptor.java
@@ -47,6 +47,9 @@ public class ModelDescriptor extends BaseRuntimeExtensionDescriptor {
}
}
catch (Exception e1) {
+ }
+
+ if (getEPackage()==null) {
// The plugin does not define its own EPackage, but we still need one
// to be able to create model objects.
ModelDescriptor defaultModelDescriptor = TargetRuntime.getDefaultRuntime().getModelDescriptor();
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml b/plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml
index 7bf3bbdd..c464d701 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/plugin.xml
@@ -661,7 +661,7 @@
id="org.eclipse.bpmn2.modeler.dataitems.tab"
afterTab="org.eclipse.bpmn2.modeler.description.tab"
class="org.eclipse.bpmn2.modeler.ui.property.diagrams.DataItemsPropertySection"
- type="org.eclipse.bpmn2.di.BPMNDiagram org.eclipse.bpmn2.Process"
+ type="org.eclipse.bpmn2.di.BPMNDiagram org.eclipse.bpmn2.Process org.eclipse.bpmn2.Participant"
label="%propertyTab.label.50">
</propertyTab>
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
index f3967fb3..e8af3b4f 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java
@@ -577,6 +577,8 @@ public class BPMN2Editor extends DiagramEditor implements IPreferenceChangeListe
public boolean isDirty() {
if (!editable)
return false;
+ if (getEditorInput()==null)
+ return false;
return super.isDirty();
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java
index 3029f2dc..4d821074 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java
@@ -166,8 +166,11 @@ public class DescriptionPropertySection extends DefaultPropertySection implement
final BaseElement element = (BaseElement) be;
EObject style = ShapeStyle.getStyleObject(element);
- if (style==null)
+ if (style==null) {
style = ShapeStyle.createStyleObject(element);
+ if (style==null)
+ return;
+ }
final EObject styleObject = style;
Composite container = createSectionComposite(this, Messages.DescriptionPropertySection_Appearance_Label);
@@ -206,12 +209,13 @@ public class DescriptionPropertySection extends DefaultPropertySection implement
@Override
public void widgetSelected(SelectionEvent e) {
Bpmn2Preferences preferences = Bpmn2Preferences.getInstance(element);
- final ShapeStyle ss = preferences.getShapeStyle(element); // this makes a copy of the value in Preference Store
+ final ShapeStyle ss = preferences.getShapeStyle(element);
TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain();
domain.getCommandStack().execute(new RecordingCommand(domain) {
@Override
protected void doExecute() {
ShapeStyle.setShapeStyle(element, styleObject, ss);
+ setBusinessObject(element);
}
});
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java
index bb91dcca..212a1351 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/StyleChangeAdapter.java
@@ -16,6 +16,8 @@ package org.eclipse.bpmn2.modeler.ui.property;
import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.ChoreographyActivity;
import org.eclipse.bpmn2.ExtensionAttributeValue;
+import org.eclipse.bpmn2.Lane;
+import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.modeler.core.adapters.IExtensionValueAdapter;
import org.eclipse.bpmn2.modeler.core.features.GraphitiConstants;
import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences;
@@ -97,7 +99,9 @@ public class StyleChangeAdapter extends AdapterImpl implements IExtensionValueAd
ShapeStyle ss = ShapeStyle.getShapeStyle(businessObject);
GraphicsAlgorithm ga = null;
- if (businessObject instanceof ChoreographyActivity) {
+ if (businessObject instanceof ChoreographyActivity
+ || businessObject instanceof Lane
+ || businessObject instanceof Participant) {
ga = pictogramElement.getGraphicsAlgorithm();
}
else if (pictogramElement instanceof ContainerShape && ((ContainerShape)pictogramElement).getChildren().size()>0) {
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsDetailComposite.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsDetailComposite.java
index a700a35b..7496ca73 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsDetailComposite.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsDetailComposite.java
@@ -13,16 +13,13 @@
package org.eclipse.bpmn2.modeler.ui.property.diagrams;
-import org.eclipse.bpmn2.BaseElement;
-import org.eclipse.bpmn2.Collaboration;
+import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.Process;
-import org.eclipse.bpmn2.di.BPMNDiagram;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractPropertiesProvider;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil;
-import org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -74,17 +71,28 @@ public class DataItemsDetailComposite extends DefaultDetailComposite {
}
return null;
}
- BPMNDiagram bpmnDiagram = ((BPMN2Editor)getDiagramEditor()).getBpmnDiagram();
- BaseElement bpmnElement = bpmnDiagram.getPlane().getBpmnElement();
- if (bpmnElement != object) {
- // This Process is embedded in a Participant, and is not the top-level diagram
- // only display variables table for the selected Process, not all Processes
- if (propertySection!=null) {
- EObject bo = BusinessObjectUtil.getBusinessObjectForSelection(propertySection.getSelection());
- if (bo!=object)
- return null;
- }
+
+ // The Data Items list enables for BPMNDiagrams (show Data Items for all contained Processes)
+ // Processes (show Data Items only for the selected Process) and Participants (show Data Items
+ // only for the referenced Process).
+ EObject selected = null;
+ if (propertySection!=null) {
+ selected = BusinessObjectUtil.getBusinessObjectForSelection(propertySection.getSelection());
+ }
+
+ if (selected instanceof Process) {
+ if (selected == object)
+ return super.bindList(object, feature, listItemClass);
+ return null;
}
+
+ if (selected instanceof Participant) {
+ selected = ((Participant)selected).getProcessRef();
+ if (selected == object)
+ return super.bindList(object, feature, listItemClass);
+ return null;
+ }
+
return super.bindList(object, feature, listItemClass);
}
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
index 667edd5f..90dc4285 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
@@ -10,14 +10,15 @@
*******************************************************************************/
package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
+import org.eclipse.bpmn2.di.BPMNDiagram;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.bpmn2.Process;
public class DataItemsPropertySection extends DefaultPropertySection {
@@ -36,11 +37,11 @@ public class DataItemsPropertySection extends DefaultPropertySection {
}
return false;
}
-
+
@Override
public EObject getBusinessObjectForSelection(ISelection selection) {
EObject be = super.getBusinessObjectForSelection(selection);
- if (be instanceof Process)
+ if (be instanceof Participant || be instanceof Process || be instanceof BPMNDiagram)
return ModelUtil.getDefinitions(be);
return null;
}

Back to the top