Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Brodt2015-02-16 14:21:22 -0500
committerBob Brodt2015-02-16 14:21:22 -0500
commit8613433707f40d3f0f0e95bbad286d1224f97fcb (patch)
tree41ec484689c006c6535171625b63c39a566b624f
parentcd5b0748ce7b67aa285484d26f822f9e2afcb5c7 (diff)
downloadorg.eclipse.bpmn2-modeler-8613433707f40d3f0f0e95bbad286d1224f97fcb.tar.gz
org.eclipse.bpmn2-modeler-8613433707f40d3f0f0e95bbad286d1224f97fcb.tar.xz
org.eclipse.bpmn2-modeler-8613433707f40d3f0f0e95bbad286d1224f97fcb.zip
https://bugzilla.redhat.com/show_bug.cgi?id=1188909 - Interface Details
Implementation Attribute should be validated by Java package naming rule in BPMN2 Diagram Editor. Don't use the same property section for both Process and Interface.
-rw-r--r--org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java5
-rw-r--r--org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties1
-rw-r--r--org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml16
-rw-r--r--org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java1
-rw-r--r--org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java127
-rw-r--r--org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacesPropertySection.java125
-rw-r--r--org.eclipse.bpmn2.modeler.ui/plugin.xml8
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/InterfacePropertiesAdapter.java2
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java259
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacesPropertySection.java301
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/Messages.java1
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/messages.properties1
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java20
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java2
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java9
-rw-r--r--org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java12
16 files changed, 497 insertions, 393 deletions
diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java
index b99fd36e..d2174f7d 100644
--- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java
+++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java
@@ -1035,6 +1035,11 @@ public class ModelUtil {
return super.equals(object);
}
+ @Override
+ public String toString() {
+ URI uri = this.eProxyURI();
+ return uri.toString();
+ }
};
value = SyntaxCheckerUtils.toXMLString(value);
de.eSetClass(EcorePackage.eINSTANCE.getEObject());
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
index a98bc740..dac4f9cd 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.properties
@@ -23,6 +23,7 @@ runtime.name = JBoss jBPM Business Process Engine
propertyTab.label.General = General
propertyTab.label.Process = Process
propertyTab.label.Interfaces = Interfaces
+propertyTab.label.Interface = Interface
propertyTab.label.Definitions = Definitions
propertyTab.label.DataItems = Data Items
propertyTab.label.CustomTask = Custom Task
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml
index 91a724e1..4876bf50 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml
@@ -41,18 +41,26 @@
</propertyTab>
<propertyTab
- id="bpmn2.jbpm.interface.tab"
- replaceTab="org.eclipse.bpmn2.modeler.interface.tab"
+ id="bpmn2.jbpm.interfaces.tab"
+ replaceTab="org.eclipse.bpmn2.modeler.interfaces.tab"
afterTab="org.eclipse.bpmn2.modeler.process.diagram.tab"
- class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmInterfacePropertySection"
+ class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmInterfacesPropertySection"
type="org.eclipse.bpmn2.di.BPMNDiagram"
label="%propertyTab.label.Interfaces">
</propertyTab>
<propertyTab
+ id="bpmn2.jbpm.interface.details.tab"
+ replaceTab="org.eclipse.bpmn2.modeler.interface.details.tab"
+ afterTab="org.eclipse.bpmn2.modeler.process.diagram.tab"
+ class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmInterfacePropertySection"
+ label="%propertyTab.label.Interface">
+ </propertyTab>
+
+ <propertyTab
id="bpmn2.jbpm.definitions.tab"
replaceTab="org.eclipse.bpmn2.modeler.definitions.tab"
- afterTab="org.eclipse.bpmn2.modeler.interface.tab"
+ afterTab="org.eclipse.bpmn2.modeler.interfaces.tab"
class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmDefinitionsPropertySection"
type="org.eclipse.bpmn2.di.BPMNDiagram"
label="%propertyTab.label.Definitions">
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java
index 13b6a0e9..d1112f0f 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfaceDetailComposite.java
@@ -14,7 +14,6 @@ import org.eclipse.bpmn2.Interface;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
import org.eclipse.bpmn2.modeler.ui.property.data.InterfaceDetailComposite;
-import org.eclipse.bpmn2.modeler.ui.property.editors.SchemaObjectEditor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.swt.widgets.Composite;
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java
index e123f2de..9de14d0e 100644
--- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacePropertySection.java
@@ -1,120 +1,29 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012, 2013 Red Hat, Inc.
- * All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ * Copyright (c) 2011, 2012 Red Hat, Inc.
+ * All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ *******************************************************************************/
package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
-import org.eclipse.bpmn2.Definitions;
-import org.eclipse.bpmn2.Interface;
-import org.eclipse.bpmn2.modeler.core.Activator;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+
import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmInterfaceImportDialog;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
-import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil.ImportHandler;
import org.eclipse.bpmn2.modeler.ui.property.data.InterfacePropertySection;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
public class JbpmInterfacePropertySection extends InterfacePropertySection {
- public JbpmInterfacePropertySection() {
- super();
- }
-
- @Override
- protected AbstractDetailComposite createSectionRoot() {
- return new JbpmInterfaceSectionRoot(this);
- }
-
- public class JbpmInterfaceSectionRoot extends InterfaceSectionRoot {
-
- public JbpmInterfaceSectionRoot(Composite parent, int style) {
- super(parent, style);
- }
-
- public JbpmInterfaceSectionRoot(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public void createBindings(EObject be) {
- definedInterfacesTable = new JbpmDefinedInterfaceListComposite(this);
- definedInterfacesTable.bindList(be);
- }
-
- }
-
- private class JbpmDefinedInterfaceListComposite extends DefinedInterfaceListComposite {
-
- public JbpmDefinedInterfaceListComposite(Composite parent) {
- super(parent);
- }
-
- @Override
- public void bindList(EObject theobject) {
- // TODO: push this up to super
- // this also requires that the JbpmImportDialog is moved to the core plugin
- // also JbpmModelUtil.ImportHandler
- super.bindList(theobject);
- ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/20/import.png"); //$NON-NLS-1$
- Action importAction = new Action(Messages.JbpmInterfacePropertySection_Import_Action, id) {
- @Override
- public void run() {
- super.run();
- editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
- @Override
- protected void doExecute() {
- EObject newItem = importListItem(businessObject, feature);
- if (newItem != null) {
- final EList<EObject> list = (EList<EObject>) businessObject.eGet(feature);
- tableViewer.setInput(list);
- tableViewer.setSelection(new StructuredSelection(newItem));
- //showDetails(true);
- }
- }
- });
- }
- };
- tableToolBarManager.insert(1, new ActionContributionItem(importAction));
- tableToolBarManager.update(true);
- }
-
- protected EObject importListItem(EObject object, EStructuralFeature feature) {
- final JbpmInterfaceImportDialog dialog = new JbpmInterfaceImportDialog();
- dialog.open();
- final IType selectedType = dialog.getIType();
- final Definitions definitions = ModelUtil.getDefinitions(object);
- if (selectedType == null || definitions==null) {
- return null;
- }
-
- // add this IType to the list of <import> extension elements
- JbpmModelUtil.addImport(selectedType, object, false, dialog.isCreateVariables());
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmInterfaceDetailComposite(this);
+ }
- ImportHandler importer = new ImportHandler();
- importer.setCreateVariables( dialog.isCreateVariables() );
-
- final Interface iface = importer.createInterface(definitions, null, selectedType, dialog.getIMethods());
- EList<EObject> list = (EList<EObject>) object.eGet(feature);
- list.add(iface);
- return iface;
- }
- }
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmInterfaceDetailComposite(parent, style);
+ }
}
diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacesPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacesPropertySection.java
new file mode 100644
index 00000000..6159c4fb
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmInterfacesPropertySection.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012, 2013 Red Hat, Inc.
+ * All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property;
+
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.modeler.core.Activator;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmInterfaceImportDialog;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil;
+import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.util.JbpmModelUtil.ImportHandler;
+import org.eclipse.bpmn2.modeler.ui.property.data.InterfacesPropertySection;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+public class JbpmInterfacesPropertySection extends InterfacesPropertySection {
+
+ public JbpmInterfacesPropertySection() {
+ super();
+ }
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new JbpmInterfacesSectionRoot(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new JbpmInterfacesSectionRoot(parent,style);
+ }
+
+ public class JbpmInterfacesSectionRoot extends InterfacesSectionRoot {
+
+ public JbpmInterfacesSectionRoot(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public JbpmInterfacesSectionRoot(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ definedInterfacesTable = new JbpmDefinedInterfaceListComposite(this);
+ definedInterfacesTable.bindList(be);
+ }
+
+ }
+
+ private class JbpmDefinedInterfaceListComposite extends DefinedInterfaceListComposite {
+
+ public JbpmDefinedInterfaceListComposite(Composite parent) {
+ super(parent);
+ }
+
+ @Override
+ public void bindList(EObject theobject) {
+ // TODO: push this up to super
+ // this also requires that the JbpmImportDialog is moved to the core plugin
+ // also JbpmModelUtil.ImportHandler
+ super.bindList(theobject);
+ ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/20/import.png"); //$NON-NLS-1$
+ Action importAction = new Action(Messages.JbpmInterfacePropertySection_Import_Action, id) {
+ @Override
+ public void run() {
+ super.run();
+ editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
+ @Override
+ protected void doExecute() {
+ EObject newItem = importListItem(businessObject, feature);
+ if (newItem != null) {
+ final EList<EObject> list = (EList<EObject>) businessObject.eGet(feature);
+ tableViewer.setInput(list);
+ tableViewer.setSelection(new StructuredSelection(newItem));
+ //showDetails(true);
+ }
+ }
+ });
+ }
+ };
+ tableToolBarManager.insert(1, new ActionContributionItem(importAction));
+ tableToolBarManager.update(true);
+ }
+
+ protected EObject importListItem(EObject object, EStructuralFeature feature) {
+ final JbpmInterfaceImportDialog dialog = new JbpmInterfaceImportDialog();
+ dialog.open();
+ final IType selectedType = dialog.getIType();
+ final Definitions definitions = ModelUtil.getDefinitions(object);
+ if (selectedType == null || definitions==null) {
+ return null;
+ }
+
+ // add this IType to the list of <import> extension elements
+ JbpmModelUtil.addImport(selectedType, object, false, dialog.isCreateVariables());
+
+ ImportHandler importer = new ImportHandler();
+ importer.setCreateVariables( dialog.isCreateVariables() );
+
+ final Interface iface = importer.createInterface(definitions, null, selectedType, dialog.getIMethods());
+ EList<EObject> list = (EList<EObject>) object.eGet(feature);
+ list.add(iface);
+ return iface;
+ }
+ }
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/plugin.xml b/org.eclipse.bpmn2.modeler.ui/plugin.xml
index d1a4803c..331366fb 100644
--- a/org.eclipse.bpmn2.modeler.ui/plugin.xml
+++ b/org.eclipse.bpmn2.modeler.ui/plugin.xml
@@ -191,7 +191,7 @@
<propertyTab
id="org.eclipse.bpmn2.modeler.definitions.tab"
- afterTab="org.eclipse.bpmn2.modeler.interface.tab"
+ afterTab="org.eclipse.bpmn2.modeler.interfaces.tab"
class="org.eclipse.bpmn2.modeler.ui.property.diagrams.DefinitionsPropertySection"
type="org.eclipse.bpmn2.di.BPMNDiagram org.eclipse.bpmn2.Process"
label="%propertyTab.label.1">
@@ -553,9 +553,9 @@
</propertyTab>
<propertyTab
- id="org.eclipse.bpmn2.modeler.interface.tab"
+ id="org.eclipse.bpmn2.modeler.interfaces.tab"
afterTab="org.eclipse.bpmn2.modeler.process.diagram.tab"
- class="org.eclipse.bpmn2.modeler.ui.property.data.InterfacePropertySection"
+ class="org.eclipse.bpmn2.modeler.ui.property.data.InterfacesPropertySection"
type="org.eclipse.bpmn2.di.BPMNDiagram org.eclipse.bpmn2.Process org.eclipse.bpmn2.Participant"
label="%propertyTab.label.41">
</propertyTab>
@@ -563,7 +563,7 @@
<propertyTab
id="org.eclipse.bpmn2.modeler.interface.details.tab"
afterTab="org.eclipse.bpmn2.modeler.process.diagram.tab"
- class="org.eclipse.bpmn2.modeler.ui.property.data.InterfacePropertySection"
+ class="org.eclipse.bpmn2.modeler.ui.property.data.InterfacesPropertySection"
type="org.eclipse.bpmn2.Interface"
label="%propertyTab.label.42">
</propertyTab>
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/InterfacePropertiesAdapter.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/InterfacePropertiesAdapter.java
index 25b8ac69..f1863006 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/InterfacePropertiesAdapter.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/InterfacePropertiesAdapter.java
@@ -147,7 +147,7 @@ public class InterfacePropertiesAdapter extends ExtendedPropertiesAdapter<Interf
Object value = object.eGet(feature);
if (value!=null) {
if (ModelUtil.isStringWrapper(value))
- return value;
+ return value.toString();
return getDisplayName(context);
}
return ModelUtil.createStringWrapper(""); //$NON-NLS-1$
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java
index c099b777..57b8b848 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacePropertySection.java
@@ -11,48 +11,25 @@
package org.eclipse.bpmn2.modeler.ui.property.data;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.bpmn2.BaseElement;
import org.eclipse.bpmn2.Bpmn2Package;
-import org.eclipse.bpmn2.CallableElement;
-import org.eclipse.bpmn2.Collaboration;
-import org.eclipse.bpmn2.Definitions;
import org.eclipse.bpmn2.Interface;
-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.AbstractDetailComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
-import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
-import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
-import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.dialogs.ListDialog;
public class InterfacePropertySection extends DefaultPropertySection {
@Override
protected AbstractDetailComposite createSectionRoot() {
- return new InterfaceSectionRoot(this);
+ return new InterfaceDetailComposite(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new InterfaceDetailComposite(parent, style);
}
public InterfacePropertySection() {
@@ -73,232 +50,10 @@ public class InterfacePropertySection extends DefaultPropertySection {
@Override
public EObject getBusinessObjectForSelection(ISelection selection) {
EObject bo = super.getBusinessObjectForSelection(selection);
- if (bo instanceof BPMNDiagram) {
- BaseElement be = ((BPMNDiagram)bo).getPlane().getBpmnElement();
- if (be instanceof Collaboration)
- return be;
- if (be instanceof Process)
- return be;
- } else if (bo instanceof CallableElement) {
- return bo;
- }
- else if (bo instanceof Interface) {
+ if (bo instanceof Interface) {
return bo;
}
return null;
}
-
- public class InterfaceSectionRoot extends InterfaceDetailComposite {
-
- protected DefinedInterfaceListComposite definedInterfacesTable;
- protected ProvidedInterfaceListComposite providedInterfacesTable;
-
- /**
- * @param parent
- * @param style
- */
- public InterfaceSectionRoot(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @param section
- */
- public InterfaceSectionRoot(AbstractBpmn2PropertySection section) {
- super(section);
- }
-
- @Override
- public void cleanBindings() {
- super.cleanBindings();
- definedInterfacesTable = null;
- providedInterfacesTable = null;
- }
-
- @Override
- public void createBindings(EObject be) {
- if (be instanceof Interface) {
- super.createBindings(be);
- }
- else {
- definedInterfacesTable = new DefinedInterfaceListComposite(this);
- definedInterfacesTable.bindList(be);
-
- if (be instanceof Participant) {
- providedInterfacesTable = new ProvidedInterfaceListComposite(this);
- providedInterfacesTable.bindList(be, getFeature(be, "interfaceRefs")); //$NON-NLS-1$
- }
- else if (be instanceof CallableElement) {
- CallableElement ce = (CallableElement)be;
- providedInterfacesTable = new ProvidedInterfaceListComposite(this);
- providedInterfacesTable.bindList(be, getFeature(be, "supportedInterfaceRefs")); //$NON-NLS-1$
- }
- }
- }
- }
-
- public class DefinedInterfaceListComposite extends DefaultListComposite {
-
- /**
- * @param section
- * @param style
- */
- public DefinedInterfaceListComposite(Composite parent) {
- super(parent, DELETE_STYLE);
- }
-
- @Override
- public EClass getListItemClass(EObject object, EStructuralFeature feature) {
- return listItemClass = Bpmn2Package.eINSTANCE.getInterface();
- }
-
- public void bindList(EObject theobject) {
- Definitions defs = ModelUtil.getDefinitions(theobject);
- super.bindList(defs, Bpmn2Package.eINSTANCE.getDefinitions_RootElements());
- }
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- Interface iface = Bpmn2ModelerFactory.create(object.eResource(), Interface.class);
-
- EList<EObject> list = (EList<EObject>)object.eGet(feature);
- list.add(iface);
- return iface;
- }
-
- @Override
- public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
- if (columnProvider==null) {
- columnProvider = new ListCompositeColumnProvider(this);
- TableColumn tc = new TableColumn(object, Bpmn2Package.eINSTANCE.getInterface_Name());
- columnProvider.add(tc);
- tc.setEditable(false);
-
- tc = new TableColumn(object,Bpmn2Package.eINSTANCE.getInterface_ImplementationRef());
- columnProvider.add(tc).setHeaderText("Implementation"); //$NON-NLS-1$
- tc.setEditable(false);
- }
- return columnProvider;
- }
- }
-
- public static class ProvidedInterfaceListComposite extends DefaultListComposite {
-
- /**
- * @param section
- * @param style
- */
- public ProvidedInterfaceListComposite(Composite parent) {
- // only allow details editing in DefinedInterfacesTable
- super(parent, AbstractListComposite.READ_ONLY_STYLE);
- }
-
- public void bindList(final EObject theobject, final EStructuralFeature thefeature) {
- super.bindList(theobject, thefeature);
- if (theobject instanceof Participant)
- setTitle(Messages.InterfacePropertySection_Participant_Title);
- else if (theobject instanceof CallableElement)
- setTitle(Messages.InterfacePropertySection_Process_Title);
- }
-
- @Override
- protected EObject addListItem(EObject object, EStructuralFeature feature) {
- Definitions defs = ModelUtil.getDefinitions(object);
- final List<Interface>items = new ArrayList<Interface>();
- for (EObject o : defs.getRootElements()) {
- if (o instanceof Interface) {
- if (object instanceof Participant) {
- Participant participant = (Participant)object;
- if (!participant.getInterfaceRefs().contains(o))
- items.add((Interface)o);
- } else if (object instanceof CallableElement) {
- CallableElement callableElement = (CallableElement)object;
- if (!callableElement.getSupportedInterfaceRefs().contains(o))
- items.add((Interface)o);
- }
- }
- }
- Interface iface = null;
- ListDialog dialog = new ListDialog(getShell());
- if (items.size()>1) {
- dialog.setContentProvider(new IStructuredContentProvider() {
-
- @Override
- public void dispose() {
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- @Override
- public Object[] getElements(Object inputElement) {
- return items.toArray();
- }
-
- });
- dialog.setLabelProvider(new ILabelProvider() {
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- @Override
- public void removeListener(ILabelProviderListener listener) {
- }
-
- @Override
- public Image getImage(Object element) {
- return null;
- }
-
- @Override
- public String getText(Object element) {
- return ModelUtil.getName((BaseElement)element);
- }
-
- });
- dialog.setTitle(Messages.InterfacePropertySection_Interfaces_Title);
- dialog.setMessage(Messages.InterfacePropertySection_Interfaces_Message);
- dialog.setAddCancelButton(true);
- dialog.setHelpAvailable(false);
- dialog.setInput(new Object());
-
- if (dialog.open() == Window.OK) {
- iface = (Interface)dialog.getResult()[0];
- }
- }
- else if (items.size()==1) {
- iface = items.get(0);
- }
- else {
- MessageDialog.openInformation(getShell(), Messages.InterfacePropertySection_No_Interfaces_Error_Title,
- Messages.InterfacePropertySection_No_Interfaces_Error_Message
- );
- }
-
- if (iface!=null) {
- if (object instanceof Participant) {
- Participant participant = (Participant)object;
- participant.getInterfaceRefs().add(iface);
- } else if (object instanceof CallableElement) {
- CallableElement callableElement = (CallableElement)object;
- callableElement.getSupportedInterfaceRefs().add(iface);
- }
- }
-
- return iface;
- }
- }
-
}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacesPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacesPropertySection.java
new file mode 100644
index 00000000..69c2a991
--- /dev/null
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/InterfacesPropertySection.java
@@ -0,0 +1,301 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Red Hat, Inc.
+ * All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpmn2.modeler.ui.property.data;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.bpmn2.BaseElement;
+import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.CallableElement;
+import org.eclipse.bpmn2.Collaboration;
+import org.eclipse.bpmn2.Definitions;
+import org.eclipse.bpmn2.Interface;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultListComposite;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultPropertySection;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.ListCompositeColumnProvider;
+import org.eclipse.bpmn2.modeler.core.merrimac.clad.TableColumn;
+import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
+import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.dialogs.ListDialog;
+
+public class InterfacesPropertySection extends DefaultPropertySection {
+
+ @Override
+ protected AbstractDetailComposite createSectionRoot() {
+ return new InterfacesSectionRoot(this);
+ }
+
+ @Override
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new InterfacesSectionRoot(parent,style);
+ }
+
+ public InterfacesPropertySection() {
+ super();
+ }
+
+ @Override
+ public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
+ if (super.appliesTo(part, selection)) {
+ if (isModelObjectEnabled(Bpmn2Package.eINSTANCE.getInterface())) {
+ EObject bo = getBusinessObjectForSelection(selection);
+ return bo!=null;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public EObject getBusinessObjectForSelection(ISelection selection) {
+ EObject bo = super.getBusinessObjectForSelection(selection);
+ if (
+ bo instanceof CallableElement || // includes Process
+ bo instanceof Collaboration // includes Choreography
+ ) {
+ return bo;
+ }
+
+ return null;
+ }
+
+ public class InterfacesSectionRoot extends DefaultDetailComposite {
+
+ protected DefinedInterfaceListComposite definedInterfacesTable;
+ protected ProvidedInterfaceListComposite providedInterfacesTable;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public InterfacesSectionRoot(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param section
+ */
+ public InterfacesSectionRoot(AbstractBpmn2PropertySection section) {
+ super(section);
+ }
+
+ @Override
+ public void cleanBindings() {
+ super.cleanBindings();
+ definedInterfacesTable = null;
+ providedInterfacesTable = null;
+ }
+
+ @Override
+ public void createBindings(EObject be) {
+ if (be instanceof Interface) {
+ super.createBindings(be);
+ }
+ else {
+ definedInterfacesTable = new DefinedInterfaceListComposite(this);
+ definedInterfacesTable.bindList(be);
+ definedInterfacesTable.setTitle(Messages.InterfacePropertySection_Interfaces_Title);
+
+ if (be instanceof Participant) {
+ providedInterfacesTable = new ProvidedInterfaceListComposite(this);
+ providedInterfacesTable.bindList(be, getFeature(be, "interfaceRefs")); //$NON-NLS-1$
+ }
+ else if (be instanceof CallableElement) {
+ CallableElement ce = (CallableElement)be;
+ providedInterfacesTable = new ProvidedInterfaceListComposite(this);
+ providedInterfacesTable.bindList(be, getFeature(be, "supportedInterfaceRefs")); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ public class DefinedInterfaceListComposite extends DefaultListComposite {
+
+ /**
+ * @param parent
+ */
+ public DefinedInterfaceListComposite(Composite parent) {
+ super(parent, DEFAULT_STYLE);
+ }
+
+ @Override
+ public EClass getListItemClass(EObject object, EStructuralFeature feature) {
+ return listItemClass = Bpmn2Package.eINSTANCE.getInterface();
+ }
+
+ public void bindList(EObject theobject) {
+ Definitions defs = ModelUtil.getDefinitions(theobject);
+ super.bindList(defs, Bpmn2Package.eINSTANCE.getDefinitions_RootElements());
+ }
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ Interface iface = Bpmn2ModelerFactory.create(object.eResource(), Interface.class);
+
+ EList<EObject> list = (EList<EObject>)object.eGet(feature);
+ list.add(iface);
+ return iface;
+ }
+
+ @Override
+ public ListCompositeColumnProvider getColumnProvider(EObject object, EStructuralFeature feature) {
+ if (columnProvider==null) {
+ columnProvider = new ListCompositeColumnProvider(this);
+ TableColumn tc = new TableColumn(object, Bpmn2Package.eINSTANCE.getInterface_Name());
+ columnProvider.add(tc);
+ tc.setEditable(false);
+
+ tc = new TableColumn(object,Bpmn2Package.eINSTANCE.getInterface_ImplementationRef());
+ columnProvider.add(tc).setHeaderText(Messages.InterfacePropertySection_Implementation_Header);
+ tc.setEditable(false);
+ }
+ return columnProvider;
+ }
+ }
+
+ public static class ProvidedInterfaceListComposite extends DefaultListComposite {
+
+ /**
+ * @param parent
+ */
+ public ProvidedInterfaceListComposite(Composite parent) {
+ // only allow details editing in DefinedInterfacesTable
+ super(parent, AbstractListComposite.READ_ONLY_STYLE);
+ }
+
+ public void bindList(final EObject theobject, final EStructuralFeature thefeature) {
+ super.bindList(theobject, thefeature);
+ if (theobject instanceof Participant)
+ setTitle(Messages.InterfacePropertySection_Participant_Title);
+ else if (theobject instanceof CallableElement)
+ setTitle(Messages.InterfacePropertySection_Process_Title);
+ }
+
+ @Override
+ protected EObject addListItem(EObject object, EStructuralFeature feature) {
+ Definitions defs = ModelUtil.getDefinitions(object);
+ final List<Interface>items = new ArrayList<Interface>();
+ for (EObject o : defs.getRootElements()) {
+ if (o instanceof Interface) {
+ if (object instanceof Participant) {
+ Participant participant = (Participant)object;
+ if (!participant.getInterfaceRefs().contains(o))
+ items.add((Interface)o);
+ } else if (object instanceof CallableElement) {
+ CallableElement callableElement = (CallableElement)object;
+ if (!callableElement.getSupportedInterfaceRefs().contains(o))
+ items.add((Interface)o);
+ }
+ }
+ }
+ Interface iface = null;
+ ListDialog dialog = new ListDialog(getShell());
+ if (items.size()>1) {
+ dialog.setContentProvider(new IStructuredContentProvider() {
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return items.toArray();
+ }
+
+ });
+ dialog.setLabelProvider(new ILabelProvider() {
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ return ModelUtil.getName((BaseElement)element);
+ }
+
+ });
+ dialog.setTitle(Messages.InterfacePropertySection_Interfaces_Title);
+ dialog.setMessage(Messages.InterfacePropertySection_Interfaces_Message);
+ dialog.setAddCancelButton(true);
+ dialog.setHelpAvailable(false);
+ dialog.setInput(new Object());
+
+ if (dialog.open() == Window.OK) {
+ iface = (Interface)dialog.getResult()[0];
+ }
+ }
+ else if (items.size()==1) {
+ iface = items.get(0);
+ }
+ else {
+ MessageDialog.openInformation(getShell(), Messages.InterfacePropertySection_No_Interfaces_Error_Title,
+ Messages.InterfacePropertySection_No_Interfaces_Error_Message
+ );
+ }
+
+ if (iface!=null) {
+ if (object instanceof Participant) {
+ Participant participant = (Participant)object;
+ participant.getInterfaceRefs().add(iface);
+ } else if (object instanceof CallableElement) {
+ CallableElement callableElement = (CallableElement)object;
+ callableElement.getSupportedInterfaceRefs().add(iface);
+ }
+ }
+
+ return iface;
+ }
+ }
+
+}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/Messages.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/Messages.java
index 48147e53..6e23a085 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/Messages.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/Messages.java
@@ -6,6 +6,7 @@ public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.bpmn2.modeler.ui.property.data.messages"; //$NON-NLS-1$
public static String DataAssignmentDetailComposite_From_Title;
public static String DataAssignmentDetailComposite_To_Title;
+ public static String InterfacePropertySection_Implementation_Header;
public static String InterfacePropertySection_Interfaces_Message;
public static String InterfacePropertySection_Interfaces_Title;
public static String InterfacePropertySection_No_Interfaces_Error_Message;
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/messages.properties b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/messages.properties
index 889b815a..2e6ef9bf 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/messages.properties
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/data/messages.properties
@@ -2,6 +2,7 @@ DataAssignmentDetailComposite_From_Title=To Expression
DataAssignmentDetailComposite_To_Title=From Expression
InterfacePropertySection_Interfaces_Message=Select the Interface provided by this Process
InterfacePropertySection_Interfaces_Title=Interfaces
+InterfacePropertySection_Implementation_Header=Implementation
InterfacePropertySection_No_Interfaces_Error_Message=There are no new Interfaces to add.\nPlease create a new Interface in the \"Defined Interfaces\" first.
InterfacePropertySection_No_Interfaces_Error_Title=No Defined Interfaces
InterfacePropertySection_Participant_Title=Interfaces Provided by Participant
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
index 49b9323c..83481853 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DataItemsPropertySection.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.bpmn2.modeler.ui.property.diagrams;
+import org.eclipse.bpmn2.Participant;
+import org.eclipse.bpmn2.Process;
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;
+import org.eclipse.swt.widgets.Composite;
public class DataItemsPropertySection extends DefaultPropertySection {
@@ -30,18 +30,18 @@ public class DataItemsPropertySection extends DefaultPropertySection {
}
@Override
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- if (super.appliesTo(part, selection)) {
- return getBusinessObjectForSelection(selection) != null;
- }
- return false;
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new DataItemsDetailComposite(parent,style);
}
-
+
@Override
public EObject getBusinessObjectForSelection(ISelection selection) {
EObject be = super.getBusinessObjectForSelection(selection);
- if (be instanceof Process || ModelUtil.getDiagramType(be)==Bpmn2DiagramType.PROCESS)
+ if (be instanceof Participant)
+ be = ((Participant)be).getProcessRef();
+ if (be instanceof Process) {
return ModelUtil.getDefinitions(be);
+ }
return null;
}
}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java
index e27f228d..beb517d8 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantDetailComposite.java
@@ -24,7 +24,7 @@ import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractPropertiesProvider;
import org.eclipse.bpmn2.modeler.core.merrimac.clad.DefaultDetailComposite;
import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.IntObjectEditor;
import org.eclipse.bpmn2.modeler.core.utils.ErrorUtils;
-import org.eclipse.bpmn2.modeler.ui.property.data.InterfacePropertySection.ProvidedInterfaceListComposite;
+import org.eclipse.bpmn2.modeler.ui.property.data.InterfacesPropertySection.ProvidedInterfaceListComposite;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java
index 6e76897a..5d1c95f1 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ParticipantPropertySection.java
@@ -12,9 +12,7 @@ package org.eclipse.bpmn2.modeler.ui.property.diagrams;
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.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
public class ParticipantPropertySection extends DefaultPropertySection {
@@ -27,8 +25,7 @@ public class ParticipantPropertySection extends DefaultPropertySection {
}
@Override
- public EObject getBusinessObjectForSelection(ISelection selection) {
- EObject be = super.getBusinessObjectForSelection(selection);
- return be;
+ public AbstractDetailComposite createSectionRoot(Composite parent, int style) {
+ return new ParticipantDetailComposite(parent,style);
}
}
diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
index 9dfeb998..43e2e2bf 100644
--- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
+++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/EventDefinitionsListComposite.java
@@ -289,11 +289,13 @@ public class EventDefinitionsListComposite extends DefaultListComposite {
}
}
else if (event instanceof ThrowEvent) {
- text += getTextValue(link.eContainer());
- text += " -> ";
- LinkEventDefinition target = link.getTarget();
- text += getTextValue(target.eContainer());
- return text;
+ if (link.getTarget()!=null) {
+ text += getTextValue(link.eContainer());
+ text += " -> ";
+ LinkEventDefinition target = link.getTarget();
+ text += getTextValue(target.eContainer());
+ return text;
+ }
}
}
if (element instanceof MessageEventDefinition) {

Back to the top