Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adapter mechanism
Adapter mechanism [message #467250] Wed, 02 May 2007 06:21 Go to next message
Eclipse UserFriend
Originally posted by: qsi.nerotech.ch

Hello everyone.

I got a little problem here. I'm using the rcp Adapter-Mechanism to view objects of the model in the views. Now I have two viewers they show the same type of model object but should have different labels-etc.
On my viewer I set WorkbenchTreeTableLabelProvider as LabelProvider. This provider gets the right WorkbenchAdapter for every type of ModelObject I previously registered a Adapter for. This happens with the Line: Platform.getAdapterManager().registerAdapters(myFactory,adap table.class);

Everything well till now: I want to register a different factory in a different viewer for the same Adaptable class. Like this:

Platform.getAdapterManager().registerAdapters(myFactory2,ada ptable.class);

Since the Adapters are registered on the platform, my second viewer still adapts the ModelOpjects with the old adapter.

So my question is how can I let the viewer use the new adapter?

Thanks a lot for your help and information. I'm sure you can help me ;)

Markus
Re: Adapter mechanism [message #467256 is a reply to message #467250] Wed, 02 May 2007 07:26 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
You obviously can't use two different adapters for the same class/class pair :-)

However, there's no reason why you have to do that either. You can instead provide your own LabelProvider for the two different views that do different things. The Adapter mechanism merely provides a way of allowing views to be used without custom label providers etc.

Alex.
Re: Adapter mechanism [message #467275 is a reply to message #467256] Wed, 02 May 2007 09:59 Go to previous message
Eclipse UserFriend
Originally posted by: qsi.nerotech.ch

O thanks for your hint. I think I was just a little bit too fixed on the adapters ;). So I write my own provider and everything should be alright... Thanks anyway. Sometimes it's hard to follow the concepts of RCP...
Previous Topic:RCP app hangs after EXIT_RELAUNCH
Next Topic:OpenNewJavaProjectWizardAction
Goto Forum:
  


Current Time: Thu Apr 25 18:01:30 GMT 2024

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

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

Back to the top