Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [patch2 = patch1 + moving properties tab]] RE: [bpel-dev] separating core andview functionality inBPELEditor (was: RE: Our Dom Facading Knowlegde)

Hi Vitaly,

I reviewed the patch. It looks good to me, and since the "MultiTab-DomFacad
e" branch is a development branch anyway, I committed it to that branch.

Cheers
Simon

Simon Moser, M.Eng.


                                                                          
 Websphere Integration       Mail:           IBM Deutschland Entwicklung  
 Developer Development       smoser@xxxxxx.  GmbH                         
 Team Lead BPEL Editor       com             Vorsitzender des             
 Dept. 4722, Bldg.           Phone:          Aufsichtsrats: Martin Jetter 
 71032-01, Room 086          +49-7031-16-43  Geschäftsführung: Herbert    
 Websphere Solutions and     04              Kircher                      
 Services                    Fax:            Sitz der Gesellschaft:       
 IBM Deutschland             +49-7031-16-48  Böblingen                    
 Entwicklung GmbH            90              Registergericht: Amtsgericht 
 Schönaicherstr. 220, D –                    Stuttgart, HRB 243294        
 71032 Boeblingen                                                         
                                                                          








                                                                           
             "Tishkov, Vitaly                                              
             V"                                                            
             <vitaly.v.tishkov                                          To 
             @intel.com>               "BPEL Designer project developer    
             Sent by:                  discussions."                       
             bpel-dev-bounces@         <bpel-dev@xxxxxxxxxxx>              
             eclipse.org                                                cc 
                                       <bpel-dev-bounces@xxxxxxxxxxx>      
                                                                   Subject 
             06/05/2007 07:06          [patch2 = patch1 + moving           
             PM                        properties tab]] RE: [bpel-dev]     
                                       separating      core andview        
                                       functionality inBPELEditor  (was:   
             Please respond to         RE: Our Dom     Facading Knowlegde) 
              "BPEL Designer                                               
             project developer                                             
               discussions."                                               
             <bpel-dev@eclipse                                             
                   .org>                                                   
                                                                           
                                                                           




Hi there,

The second patch contains the first one and also moves properties tab
related code from BPELEditor.java to BPELMultipageEditorPart.java.

This patch also fixes the problem with the "Properties are not available"
message instead of contents at the properties tab.


I have a question about the following method in BPELEditor:

protected String getPaletteAdditionsContributorId() {
             if (contributorID == null) {
                         ProcessExtension extension = (ProcessExtension)
getExtensionMap().get(getProcess());
                         if (extension.isSpecCompliant()) {
                                     contributorID =
IBPELUIConstants.BPEL_SPEC_COMPLIANT_EDITOR_ID;
                         } else {
                                     contributorID =
getEditorSite().getId();
                         }
                         return contributorID;
             }
}


Can anyone please explain me in a few words what
BPEL_SPEC_COMPLIANT_EDITOR_ID and BPEL_EDITOR_ID are?

Thanks,
             Vitaly.



>-----Original Message-----
>From: bpel-dev-bounces@xxxxxxxxxxx [mailto:bpel-dev-bounces@xxxxxxxxxxx]
On
>Behalf Of Tishkov, Vitaly V
>Sent: Tuesday, June 05, 2007 4:46 PM
>To: BPEL Designer project developer discussions.
>Cc: bpel-dev-bounces@xxxxxxxxxxx
>Subject: [patch1 - moving Outline View] RE: [bpel-dev] separating core
andview
>functionality inBPELEditor (was: RE: Our Dom Facading Knowlegde)
>
>Hi Simon,
>
>Please find the first patch attached.
>Outline view related code is moved from BPELEditor.java to
>BPELMultipageEditorPart.java.
>
>Please let me know if it looks OK.
>
>Thanks,
>            Vitaly.
>
>>-----Original Message-----
>>From: Tishkov, Vitaly V
>>Sent: Thursday, May 31, 2007 9:34 PM
>>To: 'BPEL Designer project developer discussions.'
>>Cc: bpel-dev-bounces@xxxxxxxxxxx
>>Subject: RE: [bpel-dev] separating core and view functionality
inBPELEditor
>>(was: RE: Our Dom Facading Knowlegde)
>>
>>Hi Simon,
>>
>>Yeah, I will :)
>>Thanks for revising the list and creating the branch.
>>
>>Thanks,
>>           Vitaly.
>>
>>
>>
>>>-----Original Message-----
>>>From: bpel-dev-bounces@xxxxxxxxxxx [mailto:bpel-dev-bounces@xxxxxxxxxxx]
On
>>>Behalf Of Simon D Moser
>>>Sent: Thursday, May 31, 2007 6:06 PM
>>>To: BPEL Designer project developer discussions.
>>>Cc: bpel-dev-bounces@xxxxxxxxxxx
>>>Subject: Re: [bpel-dev] separating core and view functionality
inBPELEditor
>>>(was: RE: Our Dom Facading Knowlegde)
>>>
>>>Hey Vitaly,
>>>
>>>I browsed through the list also and I think this is a good start. Why
don't
>>>you go ahead and start creating a patch for this based on our new fancy
"
>>>MultiTab-DomFacade" branch ?
>>>
>>>Cheers
>>>Simon
>>>
>>>Simon Moser, M.Eng.
>>>
>>>
>>>
>>> Websphere Integration       Mail:           IBM Deutschland Entwicklung
>>> Developer Development       smoser@xxxxxx.  GmbH
>>> Team Lead BPEL Editor       com             Vorsitzender des
>>> Dept. 4722, Bldg.           Phone:          Aufsichtsrats: Martin
Jetter
>>> 71032-01, Room 086          +49-7031-16-43  Geschäftsführung: Herbert
>>> Websphere Solutions and     04              Kircher
>>> Services                    Fax:            Sitz der Gesellschaft:
>>> IBM Deutschland             +49-7031-16-48  Böblingen
>>> Entwicklung GmbH            90              Registergericht:
Amtsgericht
>>> Schönaicherstr. 220, D –                    Stuttgart, HRB 243294
>>> 71032 Boeblingen
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>             "Tishkov, Vitaly
>>>             V"
>>>             <vitaly.v.tishkov
To
>>>             @intel.com>               Simon D Moser/Germany/IBM@IBMDE,
>>>             Sent by:                  "BPEL Designer project developer
>>>             bpel-dev-bounces@         discussions."
>>>             eclipse.org               <bpel-dev@xxxxxxxxxxx>
>>>
cc
>>>                                       Michael
Illiger2/Germany/IBM@IBMDE
>>>             05/30/2007 03:28
Subject
>>>             PM                        [bpel-dev] separating core and
view
>>>                                       functionality in BPELEditor
(was:
>>>                                       RE: Our Dom Facading Knowlegde)
>>>             Please respond to
>>>              "BPEL Designer
>>>             project developer
>>>               discussions."
>>>             <bpel-dev@eclipse
>>>                   .org>
>>>
>>>
>>>
>>>
>>>
>>>
>>>Hello,
>>>
>>>I tried to separate the "core" and "view" functionality of BPELEditor.
The
>>>"core" functionality is for model loading, "common" events handling
(like
>>>outline page selections, etc.), while "view" functionality is a set of
>>>fields/methods specific to displaying/editing graphical representation
of
>>>BPEL files.
>>>
>>>Please flick through the list below and let me know if there are big
>>>mistakes there. I'm sure that the list will have to be revised during
>>>refactoring itself but I need to understand if I'm generally correct
before
>>>starting any code changes. (Simon and I think that this will be done in
a
>>>separate branch though).
>>>
>>>"V" before a field/method name means that it's from "view" functionality
>>>and should stay in BPELEditor.
>>>"C" means that this is from core functionality and should be moved out
of
>>>BPELEditor. Most of it will appear in BPELMultiPageEditorPart (it's a
>>>sub-class of org.eclipse.ui.part.MultiPageEditorPart which is designed
for
>>>creating multi-tab editors; see
>>>http://dev.eclipse.org/mhonarc/lists/bpel-dev/msg00417.html for some
more
>>>details).
>>>
>>>Thanks,
>>>             Vitaly.
>>>
>>>C org.eclipse.bpel.ui.BPELEditor.process
>>>C org.eclipse.bpel.ui.BPELEditor.editModelClient
>>>C org.eclipse.bpel.ui.BPELEditor.modelListenerAdapter
>>>С org.eclipse.bpel.ui.BPELEditor.editorAdapter
>>>V org.eclipse.bpel.ui.BPELEditor.transferBuffer
>>>C org.eclipse.bpel.ui.BPELEditor.extensionsResource
>>>C org.eclipse.bpel.ui.BPELEditor.extensionMap
>>>C org.eclipse.bpel.ui.BPELEditor.modelAutoUndoRecorder
>>>C org.eclipse.bpel.ui.BPELEditor.fileChangeListener
>>>C org.eclipse.bpel.ui.BPELEditor.outlinePage
>>>C org.eclipse.bpel.ui.BPELEditor.keyHandler
>>>C org.eclipse.bpel.ui.BPELEditor.selectionChangeListener
>>>C org.eclipse.bpel.ui.BPELEditor.traySelectionChangeListener
>>>V org.eclipse.bpel.ui.BPELEditor.lastSelectedEditPart
>>>V org.eclipse.bpel.ui.BPELEditor.adaptingSelectionProvider
>>>V org.eclipse.bpel.ui.BPELEditor.weakMultiViewerSelectionProvider
>>>V org.eclipse.bpel.ui.BPELEditor.filteredEditPartSelectionProvider
>>>V org.eclipse.bpel.ui.BPELEditor.dropTarget
>>>V org.eclipse.bpel.ui.BPELEditor.dropTargetListener
>>>V org.eclipse.bpel.ui.BPELEditor.postBuildRefactoringListener
>>>V org.eclipse.bpel.ui.BPELEditor.switchEntry
>>>V org.eclipse.bpel.ui.BPELEditor.flowEntry
>>>V org.eclipse.bpel.ui.BPELEditor.sequenceEntry
>>>V org.eclipse.bpel.ui.BPELEditor.controlCategory
>>>V org.eclipse.bpel.ui.BPELEditor.appendNewActions
>>>V org.eclipse.bpel.ui.BPELEditor.insertNewActions
>>>V org.eclipse.bpel.ui.BPELEditor.changeTypeActions
>>>C org.eclipse.bpel.ui.BPELEditor.currentPropertySheetPage
>>>? org.eclipse.bpel.ui.BPELEditor.contributorID
>>>C org.eclipse.bpel.ui.BPELEditor.commandFramework
>>>V org.eclipse.bpel.ui.BPELEditor.BPELEditor()
>>>V org.eclipse.bpel.ui.BPELEditor.BPELEditorAdapter
>>>V org.eclipse.bpel.ui.BPELEditor.getBPELEditor(ResourceSet)
>>>C org.eclipse.bpel.ui.BPELEditor.getEditModelClient()
>>>C org.eclipse.bpel.ui.BPELEditor.getResourceSet()
>>>C org.eclipse.bpel.ui.BPELEditor.getResource()
>>>C org.eclipse.bpel.ui.BPELEditor.getModelAutoUndoRecorder()
>>>V org.eclipse.bpel.ui.BPELEditor.getTransferBuffer()
>>>V org.eclipse.bpel.ui.BPELEditor.getAppendNewActions()
>>>V org.eclipse.bpel.ui.BPELEditor.getInsertNewActions()
>>>V org.eclipse.bpel.ui.BPELEditor.getChangeTypeActions()
>>>C org.eclipse.bpel.ui.BPELEditor.OutlinePage
>>>V org.eclipse.bpel.ui.BPELEditor.configureGraphicalViewer()
>>>V
org.eclipse.bpel.ui.BPELEditor.createBPELPaletteEntries(PaletteContainer)
>>>V
>>>org.eclipse.bpel.ui.BPELEditor.createTopControlPaletteEntries(PaletteRoot)

>>>C org.eclipse.bpel.ui.BPELEditor.dispose()
>>>C org.eclipse.bpel.ui.BPELEditor.doRevertToSaved(IProgressMonitor)
>>>C org.eclipse.bpel.ui.BPELEditor.doSave(IProgressMonitor)
>>>C org.eclipse.bpel.ui.BPELEditor.isSaveAsAllowed()
>>>C org.eclipse.bpel.ui.BPELEditor.doSaveAs()
>>>C org.eclipse.bpel.ui.BPELEditor.performSaveAs()
>>>V org.eclipse.bpel.ui.BPELEditor.createPaletteRoot()
>>>C org.eclipse.bpel.ui.BPELEditor.gotoMarker(IMarker)
>>>C org.eclipse.bpel.ui.BPELEditor.gotoMarker(IMarker, EObject)
>>>C org.eclipse.bpel.ui.BPELEditor.showPropertiesView()
>>>C org.eclipse.bpel.ui.BPELEditor.isDirty()
>>>C org.eclipse.bpel.ui.BPELEditor.getExtensionMap()
>>>V org.eclipse.bpel.ui.BPELEditor.initializeGraphicalViewer()
>>>V org.eclipse.bpel.ui.BPELEditor.arrangeEditParts(GraphicalViewer)
>>>C org.eclipse.bpel.ui.BPELEditor.initializeFileChangeListener()
>>>C org.eclipse.bpel.ui.BPELEditor.commandStackChanged(EventObject)
>>>C org.eclipse.bpel.ui.BPELEditor.getKeyHandler()
>>>C org.eclipse.bpel.ui.BPELEditor.getEditorKeyHandler()
>>>C org.eclipse.bpel.ui.BPELEditor.getAdapter(Class)
>>>C org.eclipse.bpel.ui.BPELEditor.createBPELTabbedPropertySheetPage()
>>>C org.eclipse.bpel.ui.BPELEditor.replaceSelectionAction(ActionRegistry,
>>>IAction)
>>>C org.eclipse.bpel.ui.BPELEditor.createActions()
>>>V org.eclipse.bpel.ui.BPELEditor.createPaletteDependentActions()
>>>V org.eclipse.bpel.ui.BPELEditor.makeSelectionActionBPELOnlyEP(IAction)
>>>V org.eclipse.bpel.ui.BPELEditor.makeSelectionActionBPELOnly(IAction)
>>>C org.eclipse.bpel.ui.BPELEditor.getProcess()
>>>V org.eclipse.bpel.ui.BPELEditor.getCommandStack()
>>>V org.eclipse.bpel.ui.BPELEditor.setAutoFlowLayout(boolean)
>>>V org.eclipse.bpel.ui.BPELEditor.getAutoFlowLayout()
>>>V
>>>org.eclipse.bpel.ui.BPELEditor.createBottomControlPaletteEntries(PaletteConta

>i
>>n
>>>er)
>>>
>>>V org.eclipse.bpel.ui.BPELEditor.createGraphicalViewer(Composite)
>>>V org.eclipse.bpel.ui.BPELEditor.hookGraphicalViewer()
>>>V org.eclipse.bpel.ui.BPELEditor.setGraphicalViewer(GraphicalViewer)
>>>V org.eclipse.bpel.ui.BPELEditor.createPaletteViewer(Composite)
>>>V org.eclipse.bpel.ui.BPELEditor.refreshGraphicalViewer()
>>>V org.eclipse.bpel.ui.BPELEditor.selectModelObject(Object)
>>>V org.eclipse.bpel.ui.BPELEditor.getSelection()
>>>V org.eclipse.bpel.ui.BPELEditor.getAdaptingSelectionProvider()
>>>V org.eclipse.bpel.ui.BPELEditor.getMultiViewerSelectionProvider()
>>>V org.eclipse.bpel.ui.BPELEditor.getFilteredEditPartSelectionProvider()
>>>V org.eclipse.bpel.ui.BPELEditor.getGraphicalViewer()
>>>V org.eclipse.bpel.ui.BPELEditor.refreshHoverHelp(EObject)
>>>V org.eclipse.bpel.ui.BPELEditor.initializeRefactoringListeners()
>>>V org.eclipse.bpel.ui.BPELEditor.createPartControl(Composite)
>>>C org.eclipse.bpel.ui.BPELEditor.getFileInput()
>>>C org.eclipse.bpel.ui.BPELEditor.init(IEditorSite, IEditorInput)
>>>C org.eclipse.bpel.ui.BPELEditor.loadModel()
>>>C org.eclipse.bpel.ui.BPELEditor.loadModelWithoutEditModel()
>>>C org.eclipse.bpel.ui.BPELEditor.getCommandFramework()
>>>V org.eclipse.bpel.ui.BPELEditor.getActionRegistry()
>>>V org.eclipse.bpel.ui.BPELEditor.initializeTrayViewer()
>>>V org.eclipse.bpel.ui.BPELEditor.registerViewer(EditPartViewer)
>>>C org.eclipse.bpel.ui.BPELEditor.modelDeleted(ResourceInfo)
>>>C org.eclipse.bpel.ui.BPELEditor.modelDirtyStateChanged(ResourceInfo)
>>>C org.eclipse.bpel.ui.BPELEditor.modelLocationChanged(ResourceInfo,
IFile)
>>>C org.eclipse.bpel.ui.BPELEditor.modelReloaded(ResourceInfo)
>>>C org.eclipse.bpel.ui.BPELEditor.updateInputFile(IPath)
>>>C org.eclipse.bpel.ui.BPELEditor.updateTitle()
>>>C org.eclipse.bpel.ui.BPELEditor.removeUnusedExtensions()
>>>C org.eclipse.bpel.ui.BPELEditor.getArtifactsDefinition()
>>>V org.eclipse.bpel.ui.BPELEditor.getPaletteAdditionsContributorId()
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Simon D Moser [mailto:SMOSER@xxxxxxxxxx]
>>>>Sent: Wednesday, May 30, 2007 3:51 PM
>>>>To: BPEL Designer project developer discussions.
>>>>Cc: Tishkov, Vitaly V; Michael Illiger2
>>>>Subject: RE: Our Dom Facading Knowlegde
>>>>
>>>>Hi Vitaly,
>>>>
>>>>first I moved the discussion to the list - not even sure why this was
>>>>started in private ;-)
>>>>
>>>>>OK, let's start from there.
>>>>
>>>>>In the future I see the following 3 easy steps of 'binding' source
view
>>>>(structuredTextEditor) and the DOM model:
>>>>>            1) create DOM model;
>>>>>            2) initialize the source view;
>>>>>            3) set the source view model to the DOM model created
above.
>>>>>At the moment StructuredTextEditor doesn't allow changing it's model
(the
>>>>only method that changes the value of the fStructuredModel field is
>>>>>deprecated private setModel(). So, we'll probably have to extend
>>>>StructuredTextEditor for our needs.
>>>>
>>>>I am OK with the approach. However, the thing is that we probably must
use
>>>>StructuredSourceEditor or StructuredXMLEditor or something.
>>>>
>>>>> Yes, your assumption is correct. Sorry for being not clear.
>>>>> I'll send my proposal for separating "core" and "view" in another
>>>message
>>>>
>>>>Ok, cool. I'm waiting for that one then.
>>>>
>>>>>OK, I see.
>>>>>It seems to me that we'll need a branch for our work, am I correct?
>>>>
>>>>Generally yes. I would think that a branch is the better solution here.
>>>Let
>>>>me find out how to create one (we can apply the source tab patch on the
>>>>branch right away).
>>>>Michal, do you know how this works by any chance?
>>>
>>>-- cut --
>>>_______________________________________________
>>>bpel-dev mailing list
>>>bpel-dev@xxxxxxxxxxx
>>>https://dev.eclipse.org/mailman/listinfo/bpel-dev
(See attached file: patch2-moving-outline-view-and-properties-tab.txt)
_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev
### Eclipse Workspace Patch 1.0
#P org.eclipse.bpel.ui
Index: src/org/eclipse/bpel/ui/BPELEditor.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELEditor.java,v
retrieving revision 1.16
diff -u -r1.16 BPELEditor.java
--- src/org/eclipse/bpel/ui/BPELEditor.java	16 May 2007 16:15:09 -0000	1.16
+++ src/org/eclipse/bpel/ui/BPELEditor.java	5 Jun 2007 16:59:43 -0000
@@ -108,6 +108,7 @@
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
 import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.DefaultEditDomain;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPartViewer;
 import org.eclipse.gef.GraphicalViewer;
@@ -125,7 +126,6 @@
 import org.eclipse.gef.ui.actions.SelectionAction;
 import org.eclipse.gef.ui.actions.ZoomInAction;
 import org.eclipse.gef.ui.actions.ZoomOutAction;
-import org.eclipse.gef.ui.parts.ContentOutlinePage;
 import org.eclipse.gef.ui.parts.TreeViewer;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
@@ -155,14 +155,12 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.ActionFactory;
 import org.eclipse.ui.dialogs.SaveAsDialog;
-import org.eclipse.ui.ide.IGotoMarker;
 import org.eclipse.ui.internal.views.properties.tabbed.view.Tab;
 import org.eclipse.ui.internal.views.properties.tabbed.view.TabDescriptor;
 import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyViewer;
 import org.eclipse.ui.part.FileEditorInput;
 import org.eclipse.ui.part.IPageSite;
 import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
 import org.eclipse.ui.views.properties.IPropertySheetPage;
 import org.eclipse.ui.views.properties.tabbed.ISection;
 import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
@@ -174,7 +172,7 @@
 /**
  * BPELEditor is the Eclipse editor part for editing BPEL files.
  */
-public class BPELEditor extends GraphicalEditorWithPaletteAndTray implements IEditModelListener, IGotoMarker {
+public class BPELEditor extends GraphicalEditorWithPaletteAndTray implements IEditModelListener/*, IGotoMarker */{
 
 	// The process that we are editing
 	private Process process;
@@ -198,8 +196,6 @@
 	// reacts to changes on the BPEL file (e.g. move, rename)
 	private IFileChangeListener fileChangeListener;
 	
-	private OutlinePage outlinePage;
-	
 	// Cached key handler used by both the graphical editor and outline view
 	private KeyHandler keyHandler;	
 	
@@ -233,8 +229,6 @@
 	protected Set insertNewActions;
 	protected Set changeTypeActions;
 	
-	// The current property sheet page
-	protected BPELTabbedPropertySheetPage currentPropertySheetPage;
 	protected String contributorID;
 	
 	protected ICommandFramework commandFramework;
@@ -270,6 +264,11 @@
 	    return null;
 	}
 
+	//increasing visibility
+	public DefaultEditDomain getEditDomain() {
+		return super.getEditDomain();
+	}
+	
 	public BPELEditModelClient getEditModelClient() {	return editModelClient; }
 	
 	public ResourceSet getResourceSet() {
@@ -284,125 +283,6 @@
 	public Set getInsertNewActions() { return insertNewActions; }
 	public Set getChangeTypeActions() { return changeTypeActions; }
 	
-	class OutlinePage extends ContentOutlinePage {
-		private PageBook pageBook;
-		private Control outline;
-		private Canvas overview;
-		private IAction showOutlineAction, showOverviewAction;
-		static final int ID_OUTLINE  = 0;
-		static final int ID_OVERVIEW = 1;
-		private Thumbnail thumbnail;
-
-		public OutlinePage(EditPartViewer viewer) {
-			super(viewer);
-		}
-
-		// increase visibility.
-		public EditPartViewer getViewer() {
-			return super.getViewer();
-		}
-
-		private void configureOutlineViewer() {
-			getViewer().setEditDomain(getEditDomain());
-			getViewer().setEditPartFactory(new OutlineTreePartFactory());
-			registerViewer(getViewer());
-			ContextMenuProvider provider = new ProcessContextMenuProvider(getViewer(), getActionRegistry());
-			getViewer().setContextMenu(provider);
-			getSite().registerContextMenu("org.eclipse.bpel.outline.contextmenu", //$NON-NLS-1$
-				provider, 
-				getSite().getSelectionProvider());
-			getViewer().setKeyHandler(getKeyHandler());
-			// TODO: Drag and drop support goes here
-			// getViewer().addDropTargetListener(new BPELTemplateTransferDropTargetListener(getViewer()));
-			IToolBarManager tbm = getSite().getActionBars().getToolBarManager();
-			showOutlineAction = new Action() {
-				public void run() {
-					showPage(ID_OUTLINE);
-				}
-                
-                public String getToolTipText() {
-                    return Messages.OutlinePage_showOutlineView;
-                }
-			};
-			showOutlineAction.setImageDescriptor(BPELUIPlugin.getPlugin().getImageDescriptor(IBPELUIConstants.ICON_OUTLINE_16)); 
-			tbm.add(showOutlineAction);
-			showOverviewAction = new Action() {
-				public void run() {
-					showPage(ID_OVERVIEW);
-				}
-                
-                public String getToolTipText() {
-                    return Messages.OutlinePage_showOverviewView;
-                }
-			};
-			showOverviewAction.setImageDescriptor(BPELUIPlugin.getPlugin().getImageDescriptor(IBPELUIConstants.ICON_OVERVIEW_16)); 	
-			tbm.add(showOverviewAction);
-			showPage(ID_OUTLINE);
-		}
-
-		public Control getControl() {
-			return pageBook;
-		}
-
-		public void createControl(Composite parent) {
-			pageBook = new PageBook(parent, SWT.NONE);
-			outline = getViewer().createControl(pageBook);
-			overview = new Canvas(pageBook, SWT.NONE);
-			pageBook.showPage(outline);
-			configureOutlineViewer();
-			// TODO: Add to the adapting selection provider
-			//getSelectionSynchronizer().addViewer(getViewer());
-			getViewer().setContents(process);
-		}
-
-		private void initializeOverview() {
-			LightweightSystem lws = new LightweightSystem(overview);
-			RootEditPart rep = getGraphicalViewer().getRootEditPart();
-			if (rep instanceof GraphicalBPELRootEditPart) {
-				GraphicalBPELRootEditPart root = (GraphicalBPELRootEditPart)rep;
-				thumbnail = new ScrollableThumbnail((Viewport)root.getFigure());
-				thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
-				lws.setContents(thumbnail);
-			}
-		}
-
-		private void showPage(int id) {
-			if (id == ID_OUTLINE) {
-				showOutlineAction.setChecked(true);
-				showOverviewAction.setChecked(false);
-				pageBook.showPage(outline);
-				if (thumbnail != null)
-					thumbnail.setVisible(false);
-			} else if (id == ID_OVERVIEW) {
-				initializeOverview();
-				showOutlineAction.setChecked(false);
-				showOverviewAction.setChecked(true);
-				pageBook.showPage(overview);
-				thumbnail.setVisible(true);
-			}
-		}
-
-		public void dispose() {
-			super.dispose();
-		}
-		
-		public void init(IPageSite pageSite) {
-			super.init(pageSite);
-			ActionRegistry registry = getActionRegistry();
-			IActionBars bars = pageSite.getActionBars();
-			String id = ActionFactory.UNDO.getId();
-			bars.setGlobalActionHandler(id, registry.getAction(id));
-			id = ActionFactory.REDO.getId();
-			bars.setGlobalActionHandler(id, registry.getAction(id));
-			id = ActionFactory.DELETE.getId();
-			bars.setGlobalActionHandler(id, registry.getAction(id));
-			id = ActionFactory.REVERT.getId();
-			bars.setGlobalActionHandler(id, registry.getAction(id));
-			bars.updateActionBars();
-		}
-
-	}
-
 	/**
 	 * @see org.eclipse.gef.ui.parts.GraphicalEditor#configureGraphicalViewer()
 	 */
@@ -580,9 +460,7 @@
 		if (getPaletteViewer() != null) {
 			getPaletteViewer().setContents(null);
 		}
-		if (outlinePage != null && outlinePage.getViewer() != null) {
-			outlinePage.getViewer().setContents(null);
-		}
+		
 		lastSelectedEditPart = null;
 
 		super.dispose();
@@ -627,7 +505,6 @@
 //		if (extensionMap != null) extensionMap.clear();
 //		extensionMap = null;
 		modelAutoUndoRecorder = null;
-		outlinePage = null;
 
 		if (getSelectionActions() != null) {
 			getSelectionActions().clear();
@@ -832,180 +709,6 @@
 		return paletteRoot;
 	}
 	
-	public void gotoMarker(IMarker marker) {
-		
-		// One such mechanism is to use the href of the model object
-		// generated by the validator or whatever ...
-		
-		String href = null;
-		try {
-			href = (String) marker.getAttribute( "address.model" );
-		} catch (CoreException ex) {
-			BPELUIPlugin.log(ex);
-		}		
-		
-		// lookup by object href in the model.
-		EObject modelObject = null;
-		
-		if (href != null) {
-			try {
-				modelObject = getResource().getEObject( href );
-			} catch (Throwable t) {
-				BPELUIPlugin.log(t);
-			}
-		}
-		
-		if (modelObject == null) {
-			return;
-		}
-		
-		gotoMarker ( marker, modelObject );
-	}
-	
-	
-	/**
-	 * Figure out which object needs to be selected for this marker.
-	 * 
-	 * @param marker the marker
-	 * @param modelObject the model object on which the marker is generated.
-	 */
-	
-	void gotoMarker ( IMarker marker, EObject modelObject ) {
-		
-		// TODO: is this bogus now that we have AdaptingSelectionProvider?
-				
-		
-		// The closest parent which has an edit part in the graph view.
-		//
-		// The following do not have viewers in the graph view:
-		//  1) Variables, PartnerLinks, Correlation Sets
-		// If it's any of those, then we have to reveal the closest container
-		// and then select the model object and show the properties.
-
-		GraphicalViewer graphViewer = getGraphicalViewer();
-		EObject refObj = null;
-		
-		EditPart editPart = null;
-		if ( modelObject instanceof Variable ||
-		     modelObject instanceof PartnerLink ||
-		     modelObject instanceof CorrelationSet ) {
-			
-			refObj = ModelHelper.getContainingScope(modelObject);
-			editPart = (EditPart)graphViewer.getEditPartRegistry().get(refObj);
-			if (editPart != null) {
-				graphViewer.reveal(editPart);
-			}			
-			selectModelObject(modelObject);
-			
-		} else if (modelObject instanceof Activity) {
-			
-			// activity objects are on the graphical viewer
-			refObj = modelObject;
-			editPart = (EditPart)graphViewer.getEditPartRegistry().get(refObj);
-			
-			if (editPart != null) {
-				graphViewer.reveal(editPart);
-			}
-			
-			selectModelObject(modelObject);
-			
-			
-		} else {
-				
-			refObj = modelObject;
-			while (refObj != null && !(refObj instanceof Activity) ) {
-				refObj = refObj.eContainer();
-			}
-			
-			// select process by default.
-			if (refObj == null) {
-				refObj = ModelHelper.getProcess( modelObject ) ;
-			}
-			
-			modelObject = refObj;
-			
-			editPart = (EditPart)graphViewer.getEditPartRegistry().get(modelObject);
-			
-			if (editPart != null) {
-				graphViewer.reveal(editPart);
-			}
-			
-			selectModelObject(modelObject);
-		}
-						
-		// If possible, try to display the marker in a property section.
-		BPELTabbedPropertySheetPage propertySheetPage = currentPropertySheetPage;
-		if (propertySheetPage == null) {
-			return;
-			// if currentPropertySheetPage is null it means that the properties
-			// page hasn't shown yet. Since we only want to show it if we have
-			// markers for it we create a new BPELTabbedPropertySheetPage. This
-			// new one should only be used to select which tab and section to show.
-			// TODO: this doesn't work
-			//propertySheetPage = createBPELTabbedPropertySheetPage();
-		}
-		
-		TabbedPropertyViewer viewer = propertySheetPage.getTabbedPropertyViewer();
-		
-		int j = 0;
-		while (true) { // while we don't get an exception...
-			TabDescriptor descriptor = null;
-			try {
-				descriptor = (TabDescriptor)viewer.getElementAt(j++);
-			} catch (IndexOutOfBoundsException iobe) {
-				break;
-			}
-			
-			if (descriptor == null) {
-				break; // no more descriptors
-			}
-			
-			Tab tab = descriptor.createTab();
-			ISection[] sections = tab.getSections();
-			for (int i = 0; i < sections.length; i++) {
-			
-				if (BPELPropertySection.class.isInstance( sections[i]) == false) {
-					continue;
-				}
-				
-				BPELPropertySection section = (BPELPropertySection)sections[i];
-
-				// HACK: we have to fake the initialization of this section in order to
-				// make isValidMarker work. This section should not be used as a normal section.
-				section.createControls(new Composite(getSite().getShell(), 0), propertySheetPage);
-				section.setInput(this, new StructuredSelection(modelObject));
-
-				if (section.isValidMarker (marker) ) {
-					
-					// the first section that handles this kind of marker wins
-					showPropertiesView();
-					// get real viewer, Tab and ISection objects since we are probably using fake ones
-					viewer = currentPropertySheetPage.getTabbedPropertyViewer();
-					viewer.setSelection(new StructuredSelection(descriptor));
-					tab = currentPropertySheetPage.getCurrentTab();
-					section = (BPELPropertySection)tab.getSectionAtIndex(i);
-					section.gotoMarker(marker);
-					return; // ignore other sections and tabs
-					
-				}
-			}					
-		}
-	}
-	
-	
-
-	
-	
-	protected void showPropertiesView() {
-		IWorkbench workbench = PlatformUI.getWorkbench();
-		IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
-		try {
-			page.showView(IBPELUIConstants.PROPERTY_VIEW_ID);
-		} catch (PartInitException e) {
-			BPELUIPlugin.log(e);
-		}
-	}
-	
 	/**
 	 * @see org.eclipse.ui.IEditorPart#isDirty()
 	 */
@@ -1211,33 +914,12 @@
 	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class)
 	 */
 	public Object getAdapter(Class type) {
-		if (type == IContentOutlinePage.class) {
-			if (outlinePage == null) {
-				outlinePage = new OutlinePage(new TreeViewer());
-			}
-			return outlinePage;
-		}
-		if (type == IPropertySheetPage.class) {
-			// We can't cache this object because the properties framework needs a new instance
-			// every time it calls this method. 
-			currentPropertySheetPage = createBPELTabbedPropertySheetPage();
-			return currentPropertySheetPage;
-		}
 //		if (type == ZoomManager.class)
 //			return ((ScalableFreeformRootEditPart) getGraphicalViewer().getRootEditPart())
 //				.getZoomManager();
 		return super.getAdapter(type);
 	}
 	
-	protected BPELTabbedPropertySheetPage createBPELTabbedPropertySheetPage() {
-		return new BPELTabbedPropertySheetPage(new ITabbedPropertySheetPageContributor() {
-		    public String getContributorId() {
-		    	// same as the palette one
-		    	return getPaletteAdditionsContributorId();
-		    }
-        }, this);
-	}
-
 	protected void replaceSelectionAction(ActionRegistry registry, IAction action) {
 		IAction oldAction = registry.getAction(action.getId());
 		if (oldAction != null) {
@@ -1943,7 +1625,8 @@
 	 * to start using the new mode.
 	 */
 	protected String getPaletteAdditionsContributorId() {
-		if (contributorID == null) {
+		return IBPELUIConstants.BPEL_EDITOR_ID;
+		/*if (contributorID == null) {
 	    	ProcessExtension extension = (ProcessExtension) getExtensionMap().get(getProcess());
 	    	if (extension.isSpecCompliant()) {
 	    		contributorID = IBPELUIConstants.BPEL_SPEC_COMPLIANT_EDITOR_ID;
@@ -1951,6 +1634,6 @@
 	    		contributorID = getEditorSite().getId();
 	    	}
 		}
-		return contributorID;
+		return contributorID;*/
 	}
 }
\ No newline at end of file
Index: src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Attic/BPELMultipageEditorPart.java,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 BPELMultipageEditorPart.java
--- src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java	31 May 2007 13:47:10 -0000	1.1.2.1
+++ src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java	5 Jun 2007 16:59:43 -0000
@@ -12,29 +12,213 @@
 
 package org.eclipse.bpel.ui;
 
+import org.eclipse.bpel.model.Activity;
+import org.eclipse.bpel.model.CorrelationSet;
 import org.eclipse.bpel.model.ExtensibleElement;
+import org.eclipse.bpel.model.PartnerLink;
+import org.eclipse.bpel.model.Variable;
+import org.eclipse.bpel.ui.editparts.util.OutlineTreePartFactory;
+import org.eclipse.bpel.ui.properties.BPELPropertySection;
 import org.eclipse.bpel.ui.uiextensionmodel.StartNode;
+import org.eclipse.bpel.ui.util.ModelHelper;
 
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LightweightSystem;
+import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.parts.ScrollableThumbnail;
+import org.eclipse.draw2d.parts.Thumbnail;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.RootEditPart;
+import org.eclipse.gef.editparts.ZoomManager;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.parts.ContentOutlinePage;
+import org.eclipse.gef.ui.parts.TreeViewer;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.ui.internal.views.properties.tabbed.view.Tab;
+import org.eclipse.ui.internal.views.properties.tabbed.view.TabDescriptor;
+import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyViewer;
+import org.eclipse.ui.part.IPageSite;
 import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.tabbed.ISection;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
 import org.eclipse.wst.sse.ui.StructuredTextEditor;
 
+
 import org.w3c.dom.Element;
 
-public class BPELMultipageEditorPart extends MultiPageEditorPart {
+public class BPELMultipageEditorPart extends MultiPageEditorPart 
+										implements IGotoMarker {
+
+	class OutlinePage extends ContentOutlinePage {
+		private PageBook pageBook;
+		private Control outline;
+		private Canvas overview;
+		private IAction showOutlineAction, showOverviewAction;
+		static final int ID_OUTLINE  = 0;
+		static final int ID_OVERVIEW = 1;
+		private Thumbnail thumbnail;
+
+		public OutlinePage(EditPartViewer viewer) {
+			super(viewer);
+		}
+
+		// increase visibility.
+		public EditPartViewer getViewer() {
+			return super.getViewer();
+		}
+
+		private void configureOutlineViewer() {
+			getViewer().setEditDomain(fDesignViewer.getEditDomain());
+			getViewer().setEditPartFactory(new OutlineTreePartFactory());
+
+			fDesignViewer.registerViewer(getViewer());
+
+			//FIXME should we add the same for src tab?
+			ContextMenuProvider provider = new ProcessContextMenuProvider(getViewer(), fDesignViewer.getActionRegistry());
+
+			getViewer().setContextMenu(provider);
+			getSite().registerContextMenu("org.eclipse.bpel.outline.contextmenu", //$NON-NLS-1$
+				provider, 
+				getSite().getSelectionProvider());
+			getViewer().setKeyHandler(fDesignViewer.getKeyHandler());
+			// TODO: Drag and drop support goes here
+			// getViewer().addDropTargetListener(new BPELTemplateTransferDropTargetListener(getViewer()));
+			IToolBarManager tbm = getSite().getActionBars().getToolBarManager();
+			showOutlineAction = new Action() {
+				public void run() {
+					showPage(ID_OUTLINE);
+				}
+                
+                public String getToolTipText() {
+                    return Messages.OutlinePage_showOutlineView;
+                }
+			};
+			showOutlineAction.setImageDescriptor(BPELUIPlugin.getPlugin().getImageDescriptor(IBPELUIConstants.ICON_OUTLINE_16)); 
+			tbm.add(showOutlineAction);
+			showOverviewAction = new Action() {
+				public void run() {
+					showPage(ID_OVERVIEW);
+				}
+                
+                public String getToolTipText() {
+                    return Messages.OutlinePage_showOverviewView;
+                }
+			};
+			showOverviewAction.setImageDescriptor(BPELUIPlugin.getPlugin().getImageDescriptor(IBPELUIConstants.ICON_OVERVIEW_16)); 	
+			tbm.add(showOverviewAction);
+			showPage(ID_OUTLINE);
+		}
+
+		public Control getControl() {
+			return pageBook;
+		}
+
+		public void createControl(Composite parent) {
+			pageBook = new PageBook(parent, SWT.NONE);
+			outline = getViewer().createControl(pageBook);
+			overview = new Canvas(pageBook, SWT.NONE);
+			pageBook.showPage(outline);
+			configureOutlineViewer();
+			// TODO: Add to the adapting selection provider
+			//getSelectionSynchronizer().addViewer(getViewer());
+
+			//FIXME move process to this class
+			getViewer().setContents(fDesignViewer.getProcess());
+		}
+
+		private void initializeOverview() {
+			LightweightSystem lws = new LightweightSystem(overview);
+			RootEditPart rep = fDesignViewer.getGraphicalViewer().getRootEditPart();
+			if (rep instanceof GraphicalBPELRootEditPart) {
+				GraphicalBPELRootEditPart root = (GraphicalBPELRootEditPart)rep;
+				thumbnail = new ScrollableThumbnail((Viewport)root.getFigure());
+				thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
+				lws.setContents(thumbnail);
+			}
+		}
+
+		private void showPage(int id) {
+			if (id == ID_OUTLINE) {
+				showOutlineAction.setChecked(true);
+				showOverviewAction.setChecked(false);
+				pageBook.showPage(outline);
+				if (thumbnail != null)
+					thumbnail.setVisible(false);
+			} else if (id == ID_OVERVIEW) {
+				initializeOverview();
+				showOutlineAction.setChecked(false);
+				showOverviewAction.setChecked(true);
+				pageBook.showPage(overview);
+				thumbnail.setVisible(true);
+			}
+		}
+
+		public void dispose() {
+			super.dispose();
+		}
+		
+		public void init(IPageSite pageSite) {
+			super.init(pageSite);
+			//should ActionRegistry be here too? 
+			ActionRegistry registry = fDesignViewer.getActionRegistry();
+			IActionBars bars = pageSite.getActionBars();
+			String id = ActionFactory.UNDO.getId();
+			bars.setGlobalActionHandler(id, registry.getAction(id));
+			id = ActionFactory.REDO.getId();
+			bars.setGlobalActionHandler(id, registry.getAction(id));
+			id = ActionFactory.DELETE.getId();
+			bars.setGlobalActionHandler(id, registry.getAction(id));
+			id = ActionFactory.REVERT.getId();
+			bars.setGlobalActionHandler(id, registry.getAction(id));
+			bars.updateActionBars();
+		}
+	}
 
+	
 	private StructuredTextEditor fTextEditor = null;
 	private BPELEditor fDesignViewer = null;
 	
+	private OutlinePage outlinePage;
+	protected BPELTabbedPropertySheetPage currentPropertySheetPage;
+	
 	private static int DESIGN_PAGE_INDEX = 0;
 	private static int SOURCE_PAGE_INDEX = 1;
 	
@@ -142,6 +326,15 @@
 	}
 
 
+	public void dispose() {
+		if (outlinePage != null && outlinePage.getViewer() != null) {
+			outlinePage.getViewer().setContents(null);
+		}
+		outlinePage = null;
+		fDesignViewer.dispose();
+		fTextEditor.dispose();
+	}
+	
 	/**
 	 * @see org.eclipse.ui.IEditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
 	 */
@@ -159,10 +352,203 @@
 		//saveAs is not allowed; do nothing
 	}
 	
+	protected BPELTabbedPropertySheetPage createBPELTabbedPropertySheetPage() {
+		//FIXME should the BPELTabbedPropertySheetPage has BPELMultiPageEditorPart as the 2nd argument?
+		return new BPELTabbedPropertySheetPage(new ITabbedPropertySheetPageContributor() {
+		    public String getContributorId() {
+		    	// same as the palette one
+		    	//return fDesignViewer.getPaletteAdditionsContributorId();
+		    	return IBPELUIConstants.BPEL_EDITOR_ID;
+		    }
+        }, fDesignViewer);
+	}
+
+	
+	public Object getAdapter(Class type) {
+		if (type == IContentOutlinePage.class) {
+			if (outlinePage == null) {
+				outlinePage = new OutlinePage(new TreeViewer());
+			}
+			return outlinePage;
+		}
+
+		if (type == IPropertySheetPage.class) {
+			// We can't cache this object because the properties framework needs a new instance
+			// every time it calls this method. 
+			currentPropertySheetPage = createBPELTabbedPropertySheetPage();
+			return currentPropertySheetPage;
+		}
+
+	    return super.getAdapter(type);
+	  }
+
 	StructuredTextEditor getTextEditor() {
 		return fTextEditor;
 	}
 	
+	public void gotoMarker(IMarker marker) {
+		
+		// One such mechanism is to use the href of the model object
+		// generated by the validator or whatever ...
+		
+		String href = null;
+		try {
+			href = (String) marker.getAttribute( "address.model" );
+		} catch (CoreException ex) {
+			BPELUIPlugin.log(ex);
+		}		
+		
+		// lookup by object href in the model.
+		EObject modelObject = null;
+		
+		if (href != null) {
+			try {
+				modelObject = fDesignViewer.getResource().getEObject( href );
+			} catch (Throwable t) {
+				BPELUIPlugin.log(t);
+			}
+		}
+		
+		if (modelObject == null) {
+			return;
+		}
+		
+		gotoMarker ( marker, modelObject );
+	}
+
+	
+	void gotoMarker ( IMarker marker, EObject modelObject ) {
+		
+		// TODO: is this bogus now that we have AdaptingSelectionProvider?
+				
+		
+		// The closest parent which has an edit part in the graph view.
+		//
+		// The following do not have viewers in the graph view:
+		//  1) Variables, PartnerLinks, Correlation Sets
+		// If it's any of those, then we have to reveal the closest container
+		// and then select the model object and show the properties.
+
+		GraphicalViewer graphViewer = fDesignViewer.getGraphicalViewer();
+		EObject refObj = null;
+		
+		EditPart editPart = null;
+		if ( modelObject instanceof Variable ||
+		     modelObject instanceof PartnerLink ||
+		     modelObject instanceof CorrelationSet ) {
+			
+			refObj = ModelHelper.getContainingScope(modelObject);
+			editPart = (EditPart)graphViewer.getEditPartRegistry().get(refObj);
+			if (editPart != null) {
+				graphViewer.reveal(editPart);
+			}			
+			fDesignViewer.selectModelObject(modelObject);
+			
+		} else if (modelObject instanceof Activity) {
+			
+			// activity objects are on the graphical viewer
+			refObj = modelObject;
+			editPart = (EditPart)graphViewer.getEditPartRegistry().get(refObj);
+			
+			if (editPart != null) {
+				graphViewer.reveal(editPart);
+			}
+			
+			fDesignViewer.selectModelObject(modelObject);
+			
+			
+		} else {
+				
+			refObj = modelObject;
+			while (refObj != null && !(refObj instanceof Activity) ) {
+				refObj = refObj.eContainer();
+			}
+			
+			// select process by default.
+			if (refObj == null) {
+				refObj = ModelHelper.getProcess( modelObject ) ;
+			}
+			
+			modelObject = refObj;
+			
+			editPart = (EditPart)graphViewer.getEditPartRegistry().get(modelObject);
+			
+			if (editPart != null) {
+				graphViewer.reveal(editPart);
+			}
+			
+			fDesignViewer.selectModelObject(modelObject);
+		}
+						
+		// If possible, try to display the marker in a property section.
+		BPELTabbedPropertySheetPage propertySheetPage = currentPropertySheetPage;
+		if (propertySheetPage == null) {
+			return;
+			// if currentPropertySheetPage is null it means that the properties
+			// page hasn't shown yet. Since we only want to show it if we have
+			// markers for it we create a new BPELTabbedPropertySheetPage. This
+			// new one should only be used to select which tab and section to show.
+			// TODO: this doesn't work
+			//propertySheetPage = createBPELTabbedPropertySheetPage();
+		}
+		
+		TabbedPropertyViewer viewer = propertySheetPage.getTabbedPropertyViewer();
+		
+		int j = 0;
+		while (true) { // while we don't get an exception...
+			TabDescriptor descriptor = null;
+			try {
+				descriptor = (TabDescriptor)viewer.getElementAt(j++);
+			} catch (IndexOutOfBoundsException iobe) {
+				break;
+			}
+			
+			if (descriptor == null) {
+				break; // no more descriptors
+			}
+			
+			Tab tab = descriptor.createTab();
+			ISection[] sections = tab.getSections();
+			for (int i = 0; i < sections.length; i++) {
+			
+				if (BPELPropertySection.class.isInstance( sections[i]) == false) {
+					continue;
+				}
+				
+				BPELPropertySection section = (BPELPropertySection)sections[i];
+
+				// HACK: we have to fake the initialization of this section in order to
+				// make isValidMarker work. This section should not be used as a normal section.
+				section.createControls(new Composite(getSite().getShell(), 0), propertySheetPage);
+				section.setInput(this, new StructuredSelection(modelObject));
+
+				if (section.isValidMarker (marker) ) {
+					
+					// the first section that handles this kind of marker wins
+					showPropertiesView();
+					// get real viewer, Tab and ISection objects since we are probably using fake ones
+					viewer = currentPropertySheetPage.getTabbedPropertyViewer();
+					viewer.setSelection(new StructuredSelection(descriptor));
+					tab = currentPropertySheetPage.getCurrentTab();
+					section = (BPELPropertySection)tab.getSectionAtIndex(i);
+					section.gotoMarker(marker);
+					return; // ignore other sections and tabs
+					
+				}
+			}					
+		}
+	}
+	
+	protected void showPropertiesView() {
+		IWorkbench workbench = PlatformUI.getWorkbench();
+		IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
+		try {
+			page.showView(IBPELUIConstants.PROPERTY_VIEW_ID);
+		} catch (PartInitException e) {
+			BPELUIPlugin.log(e);
+		}
+	}
+
 	/*
 	 * (non-Javadoc)
 	 * 

Back to the top