Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Is there a way to override an existing adapterfactory / avoid it from adapting (ApapterFactory PropertyPage)
Is there a way to override an existing adapterfactory / avoid it from adapting [message #553004] Mon, 16 August 2010 02:33 Go to next message
abalest lanclot is currently offline abalest lanclotFriend
Messages: 6
Registered: December 2009
Junior Member
Hi there,

Currectly, I'm adding an commercial eclipse plugin(ClearCase from ibm rational, We rely on it for the project source management.) into our RCP product. However, after importing this plugin, I found it failed my property sheet page. When selecting an item in my graphical editor, the property sheet page says "Property Sheet is not available".

I checked the newly imported plugin's configuration file(plugin.xml) and found something which I think may lead to this problem.

There's an AdapterFacotry defined as follows,

<extension
point="org.eclipse.core.runtime.adapters">
<factory
adaptableType=" org.eclipse.ui.part.EditorPart "
class="com.ibm.rational.XXX.adapterfactory">
<adapter
type="IPropertySheetPage">
</adapter>
</factory>
</extension>

I debuged and found that when selectionchanged event is happened while select an item on my graphical editor(an multi-page editor), it eventually entered into com.ibm.rational.XXX.adapterfactory, as this adapterfactory works for any type of " org.eclipse.ui.part.EditorPart ". As an graphical editor is typically an editorpart, it works everytime.
Then for adapter type "IPropertySheetPage", it builds its own PropertySheetPage instead of my propertypage. While with my model, of which it can not deal with, finally show the "Property sheet is not available".

I'm wondering if there's a method to override this adapterfactory. I've tried to add a new adapterfactory with a more specific adapter type, hoping to interpert com.ibm.rational.XXX.adapterfactory to take effect, but failed to see any effect.



If I just want to deactivated the adapter factroy or have it disabled when dealing with my own editor(a multipage editor), is there a way to do this?
If an adapter factroy has been defined to adapter a certain kind of class, is it possible to defined another adapter factroy to deal with the same class?
Or I just have to leave this ClearCase plugin from intergrating into our own product?


Can anyone give me some advice so that I could get my own PropertySheet function right?

Thanks for your nice help in advance .

Re: Is there a way to override an existing adapterfactory / avoid it from adapting [message #553149 is a reply to message #553004] Mon, 16 August 2010 14:54 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

It looks like the AdapterManager takes the first factory for that type
(although I'm not really sure, the code is complicated).

Your best bet is probably to open a bug against RT / Equinox / Framework
or Eclipse / Platform / Runtime and explain the situation (CC adapts
EditorPart to "IPropertySheetPage" but you don't want that).

You could also look into TabbedPropertySheets to see if that can handle
more complex properties.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:run.director fails in eclipse SDK source build
Next Topic:Test for file extension in the active editor via expression definition in plugin.xml
Goto Forum:
  


Current Time: Fri Apr 19 22:39:09 GMT 2024

Powered by FUDForum. Page generated in 0.02842 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top