Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » PartDescriptors and Parts: dublicate data problem(Same data should be filled in PartDescriptor and in concrete Part)
PartDescriptors and Parts: dublicate data problem [message #989879] Sun, 09 December 2012 08:29 Go to next message
Rushan Gilmullin is currently offline Rushan GilmullinFriend
Messages: 61
Registered: June 2011
Member
Suppose that we specify PartDescriptor with id=package_explorer and fill it with data. So user can open it in any perspective using ShowViewHandler (selecting part descriptor from Show View dialog). Now we want place this view (package_explorer) in initail layout of some perspective (for example, java perspective) - we should create MPart with id=package_explorer in shared area or in given perspective and fill it with the same data as correspondence descriptor. This is not very comfortable. So some way allowing avoid this dublicated is needed. I think there are two ways to implement this:

1. Suppose now that we have some object MDescriptorInstance with one parameter - reference to MPartDescriptor. We can use it instead of describing part, for example, having MDescriptorInstance with reference on descriptor with id = package_explorer.
2. Empty part. If there are part descriptor with identifier match to given part id, this descriptor field is copied to part fields.

What you think about this idea?
Re: PartDescriptors and Parts: dublicate data problem [message #989983 is a reply to message #989879] Mon, 10 December 2012 10:40 Go to previous messageGo to next message
Eclipse UserFriend
Adding the MDescriptorInstance means extending the model and in this case the MDI is not a real UI application element, nor different from the existing ones in terms of UI.

Can't you add a processor to add to the partstack using partService.createPart() ?
Re: PartDescriptors and Parts: dublicate data problem [message #990090 is a reply to message #989879] Mon, 10 December 2012 20:25 Go to previous message
Rushan Gilmullin is currently offline Rushan GilmullinFriend
Messages: 61
Registered: June 2011
Member
Yes, you are right, but MDescriptorInstance can be replaced on MPart instance after model loading. So using it similar specifying factory for part creating (descriptor - is factory or, more right, template).

But second option look more suitable - if part is binded to given descriptor forexample by id, then this parts can initialized from its descriptor. Unspecified fields of part will filled from descriptor ones, specified fields of part will rewrite descriptor values (so descriptor is playing its mission - it is a template for parts).
Previous Topic:Strange behaviour with SelectionService
Next Topic:HandledMenuItem/Handled Tool Item with parameter disables KeyBindings
Goto Forum:
  


Current Time: Fri Apr 19 09:46:01 GMT 2024

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

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

Back to the top