Author: koen.aers(a)jboss.com
Date: 2010-12-08 16:57:33 -0500 (Wed, 08 Dec 2010)
New Revision: 27252
Added:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertyPageAdapterFactoryContentProvider.java
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertySectionBis.java
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/plugin.xml
Log:
initial property page for bpmn2 elements
Modified: trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/plugin.xml
===================================================================
--- trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/plugin.xml 2010-12-08
21:17:58 UTC (rev 27251)
+++ trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/plugin.xml 2010-12-08
21:57:33 UTC (rev 27252)
@@ -184,6 +184,15 @@
</propertyTabs>
</extension>
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs"
id="bpmnTabs">
+ <propertyTabs contributorId="org.eclipse.bpmn2.diagram">
+ <propertyTab
+ category="domain"
+ id="property.tab.bpmn"
+ label="BPMN"/>
+ </propertyTabs>
+ </extension>
+
<extension
point="org.eclipse.ui.views.properties.tabbed.propertySections"
id="propsections">
<?gmfgen generated="true"?>
<propertySections contributorId="org.eclipse.bpmn2.diagram">
@@ -210,7 +219,7 @@
<propertySection
id="property.section.domain"
tab="property.tab.domain"
-
class="org.jboss.tools.bpmn2.process.diagram.sheet.Bpmn2PropertySection">
+
class="org.jboss.tools.bpmn2.process.diagram.sheet.Bpmn2PropertySectionBis">
<input type="org.eclipse.gmf.runtime.notation.View"/>
<input type="org.eclipse.gef.EditPart"/>
<input
type="org.jboss.tools.bpmn2.process.diagram.navigator.Bpmn2AbstractNavigatorItem"/>
@@ -218,6 +227,19 @@
</propertySections>
</extension>
+ <extension
point="org.eclipse.ui.views.properties.tabbed.propertySections"
id="bpmnSection">
+ <propertySections contributorId="org.eclipse.bpmn2.diagram">
+ <propertySection
+ id="property.section.bpmn"
+ tab="property.tab.bpmn"
+
class="org.jboss.tools.bpmn2.process.diagram.sheet.Bpmn2PropertySectionBis">
+ <input type="org.eclipse.gmf.runtime.notation.View"/>
+ <input type="org.eclipse.gef.EditPart"/>
+ <input
type="org.jboss.tools.bpmn2.process.diagram.navigator.Bpmn2AbstractNavigatorItem"/>
+ </propertySection>
+ </propertySections>
+ </extension>
+
<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders"
id="view-provider">
<?gmfgen generated="true"?>
<viewProvider
class="org.jboss.tools.bpmn2.process.diagram.providers.Bpmn2ViewProvider">
Added:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertyPageAdapterFactoryContentProvider.java
===================================================================
---
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertyPageAdapterFactoryContentProvider.java
(rev 0)
+++
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertyPageAdapterFactoryContentProvider.java 2010-12-08
21:57:33 UTC (rev 27252)
@@ -0,0 +1,16 @@
+package org.jboss.tools.bpmn2.process.diagram.sheet;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+
+public class Bpmn2PropertyPageAdapterFactoryContentProvider extends
AdapterFactoryContentProvider {
+
+ public Bpmn2PropertyPageAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ public Object [] getElements(Object object) {
+ return new Object[] { object };
+ }
+
+}
Property changes on:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertyPageAdapterFactoryContentProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertySectionBis.java
===================================================================
---
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertySectionBis.java
(rev 0)
+++
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertySectionBis.java 2010-12-08
21:57:33 UTC (rev 27252)
@@ -0,0 +1,104 @@
+package org.jboss.tools.bpmn2.process.diagram.sheet;
+
+import org.eclipse.bpmn2.FlowElement;
+import org.eclipse.bpmn2.provider.Bpmn2ItemProviderAdapterFactory;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+public class Bpmn2PropertySectionBis extends AbstractPropertySection {
+
+ private EObject selectedObject = null;
+ private TreeViewer treeViewer;
+ private AdapterFactory adapterFactory = new Bpmn2ItemProviderAdapterFactory();
+
+ public void createControls(Composite parent, TabbedPropertySheetPage
tabbedPropertySheetPage) {
+ super.createControls(parent, tabbedPropertySheetPage);
+ final Composite composite = getWidgetFactory().createFlatFormComposite(parent);
+ createMasterArea(composite);
+ createDetailsArea(composite);
+ }
+
+ private void createMasterArea(Composite composite) {
+ Tree eventTree = getWidgetFactory().createTree(
+ composite, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL |
SWT.FULL_SELECTION);
+ eventTree.setLayoutData(createEventTreeLayoutData());
+ treeViewer = new TreeViewer(eventTree);
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ treeViewer.setFilters(new ViewerFilter[] { new RootFilter(), new FlowElementFilter()
});
+ }
+
+ private FormData createEventTreeLayoutData() {
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(20, 0);
+ data.top = new FormAttachment(0, 0);
+ data.bottom = new FormAttachment(100, 0);
+ return data;
+ }
+
+ private void createDetailsArea(Composite composite) {
+
+ }
+
+ public boolean shouldUseExtraSpace() {
+ return true;
+ }
+
+ public void setInput(IWorkbenchPart part, ISelection selection) {
+ super.setInput(part, selection);
+ selectedObject = unwrapSelection(selection);
+ treeViewer.setInput(selectedObject.eContainer());
+ }
+
+ private EObject unwrapSelection(ISelection selection) {
+ if (!(selection instanceof StructuredSelection)) {
+ return null;
+ }
+ Object object = ((StructuredSelection)selection).getFirstElement();
+ if (object == null || !(object instanceof EditPart)) {
+ return null;
+ }
+ object = ((EditPart)object).getModel();
+ if (object == null || !(object instanceof View)) {
+ return null;
+ }
+ return ((View)object).getElement();
+ }
+
+ class RootFilter extends ViewerFilter {
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (parentElement == selectedObject.eContainer() && element != selectedObject)
{
+ return false;
+ }
+ return true;
+ }
+ }
+
+ class FlowElementFilter extends ViewerFilter {
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (parentElement != selectedObject.eContainer() && element instanceof
FlowElement) {
+ return false;
+ }
+ return true;
+ }
+ }
+
+}
Property changes on:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/src-custom/org/jboss/tools/bpmn2/process/diagram/sheet/Bpmn2PropertySectionBis.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date