Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 87669 - operations framework shouldn't depend on IAdaptable
Summary: operations framework shouldn't depend on IAdaptable
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-10 11:50 EST by Susan McCourt CLA
Modified: 2005-03-21 15:56 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2005-03-10 11:50:41 EST
The undo, redo, and execute methods supply ui-related info in a parameter that 
is currently typed as IAdaptable.  To avoid introducing more dependencies on 
the runtime, this should be typed as an Object, similar to the strategy used 
for IWorkspace>validateEdit.  The only flexibility offered by IAdaptable is 
that we could provide more than one piece of information using that parameter 
and adapting to multiple types, but the only documented use right now is 
Shell.  The value of having multiple parameters does not seem to be worth 
introducing this dependency.
Comment 1 Susan McCourt CLA 2005-03-13 14:38:33 EST
See also bug #49497.

Will be submitted for I20050315 with the old methods left deprecated.
Comment 2 Susan McCourt CLA 2005-03-13 16:21:48 EST
The new methods have been introduced and old ones deprecated, but this will 
break clients who do not implement the new methods. Awaiting instructions for 
the best way to release this code...
Comment 3 Dirk Baeumer CLA 2005-03-14 05:32:25 EST
Susan,

can you please provide a preview for the new methods. As we have discussed
somewhen in the past I am using the IAdaptable to tunnel instances of
IValidationCheckResultQuery through the operation history (you remember ;-)). I
first want to check that I can do this using the new API.

In general I am not convienced that we can't use IAdaptable in the interface.
When we wrote an article last summer it turned out that you can't use JFace
without runtime anyway. 
Comment 4 Susan McCourt CLA 2005-03-14 13:42:08 EST
I remember the discussion of IValidationCheckResultQuery and the 
IOperationApprover but I didn't remember that was how it was being passed.  
I've just sent some patches and await your reply.  

As for JFace always needing the runtime...I'm cc'ing Nick because I think he 
still plans to work on bug #49497 and that there are clients trying to do this.
Comment 5 Nick Edgar CLA 2005-03-14 15:00:02 EST
Yes, I'm still planning on getting to bug 49497 for M6.
If necessary, we can include IAdaptable in the utility jar, but I'd prefer not
to if it can be avoided.  Even if we include that, I would not want to include
the adapter manager mechanism.
Comment 6 Susan McCourt CLA 2005-03-14 15:19:49 EST
The adapter manager won't be needed.  This parameter is just a "pass through" 
from the action that invokes the operation history, to the operation that runs, 
and then back to the specific implementation.  The framework itself just hands 
it along, so it does not matter to me which we do.  

If it makes a big difference to Dirk, then I think we should keep it, but I'd 
rather not include it if possible.  Dirk - since the action handler is usually 
invoking the method and providing the adapter, where are you sneaking in the 
IValidationCheckResultQuery?  
Comment 7 Dirk Baeumer CLA 2005-03-15 05:00:50 EST
I can hack around it if you don't want to include IAdaptable. However, compared
to the larger plug-ins JFace, JFace/Text and command plug-in IAdaptable sound
like an ignorable class footprint wise.

Additionally IAdaptable is a nice way to have extensible API since you can
easily add additional arguments without changing signatures. So having it in a
"small runtime" is a win as well.

Let me know what you decide regarding IAdaptable. As said I can remove the
references.
Comment 8 Susan McCourt CLA 2005-03-15 11:03:24 EST
Nick - what do you think?  It really makes no difference to me at this point.  
Comment 9 Nick Edgar CLA 2005-03-15 12:16:53 EST
Let's leave it as-is for now.  I'll consider adding IAdaptable to the utility
jar when I get to bug 49497.
Comment 10 Susan McCourt CLA 2005-03-15 14:21:03 EST
Okay - no change for now.  Dani - are you ok with this conclusion?

I've annotated #49497 to point to this bug so that we are notified if there is 
some unforeseen reason IAdaptable can't go in the JAR.
Comment 11 Dirk Baeumer CLA 2005-03-16 04:07:12 EST
Sorry for more confusion here but Kai pointed out that clients might assume that
if they have IAdaptable that there is an IAdapterFactory and IAdapterFactory as
well. There are references in the documentation to these classes in IAdaptable.

So if we move this into the small runtime Jar then we should make a statement
that the Jar doesn't contain any adpater factory or manager implementation.
Comment 12 Nick Edgar CLA 2005-03-17 16:49:58 EST
In that case I'd prefer not to include IAdaptable in the utility jar.
How bad a hack do you have to do if we don't include it?
Comment 13 Dirk Baeumer CLA 2005-03-18 04:58:35 EST
Have to add a factory and some additional methods to pass an
IValidationCheckResultQuery through the call chain. Currently I am using
IAdaptable to pass the object.
Comment 14 Nick Edgar CLA 2005-03-20 22:15:51 EST
I'm including IAdaptable in the utility jar anyway.  It's small and powerful.
Comment 15 Susan McCourt CLA 2005-03-21 15:56:54 EST
Closing this bug.  
IAdaptable will remain in the interface as it is now in the utility jar 
and "on the list" of acceptable classes, and it helps the refactoring 
integration.  Dani has documented its use as permissible in the 
DefaultUndoManager.