Bug 114738 - [Model API] Accomodate models localized to files
Summary: [Model API] Accomodate models localized to files
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-11-02 06:19 EST by Michael Valenta CLA
Modified: 2019-09-06 16:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2005-11-02 06:19:30 EST
Some models, such as *.properties (and perhaps *.settings files), are localized
to the file that contains them. What this means is that these models can exist
in any higher-level container structure (Resource folder structure or Java
packages structure) and only really care about the contents of the file. as
such, they really don't want to be a full blown model provider but instead want
to provide model support only at the file level (i.e. content type or file
association). 

Eclipse already supports this for the most part but we will want to make sure
the support is complete and documented. Here's some exisiting support I can
think of, off the top of my head.

  - auto-merge: IStreamMerger
  - manual-merge: IContentViewer
  - model rendering: IWorkbenchAdapter

The last point is interesting. Currentlu, it uses the content type to get an
appropriate icon. It could also yield a set of children that could be displayed
in any view. This would have implications on performance and also on consistency
That is, you could expand a properties file in the navigator but not files from
higher level models (i.e. perhaps a Java file would only be expandable in Java
views). This may be acceptable but if it wasn't, the ability to expand the
contents could exist but not be used by the Resource Navigator. This would still
allow higher level models such as Java to expand *.properties files in their views.

We should work out some scenarios for this to see what makes sense.
Comment 1 Michael Valenta CLA 2005-11-03 08:19:45 EST
Dirk, do you have any ideas about this? Also, I'm curious to know if JDT has 
any API related to properties files. Does JDT and PDE share a model now the 
PDE supports NLSing?
Comment 2 Dirk Baeumer CLA 2005-11-03 12:52:29 EST
Michael, I second the idea of having "content type models". We have requests
especially for JDT to be able to show the content of ANT files inside the
package explorer. 

I discussed this with Michael Elder on the last Common Navigator call and he
said that should be doable inside the Common Navigator framework. However have
this more general in the workbench will make sure that views not "reusing" parts
of the common navigator can profit from this as well.

I already do something similar in LTK to provide the preview for refactorings.
The upper tree of the preview page contains language specific nodes (for example
if you change a compilation unit you see types and methods as sub nodes). This
is open to other languages. The can provide their own tree nodes depending on
the language they are changing.

Regarding properties: JDT/UI has a model, but it is not API. It lives in core
refactoring (PropertyFileDocumentModel). We don't share this code with PDE right
now.
Comment 3 Michael Valenta CLA 2005-11-03 12:57:59 EST
Nick, do you have any thoughts on this?
Comment 4 Nick Edgar CLA 2005-11-04 10:27:00 EST
I think this is a reasonable scenario.  

Although I know you just used the *.properties files as an example, I've asked
Steve Wasleski for more details on how the translators actually work, and
whether special handling of *.properties files would be desired.  E.g. if I
change Fred.properties and commit it, the user should be warned if there are
also changes to a Fred.properties_Fr_fr file.  The logical model element
"Fred.properties and its translations" is 1:N and open-ended.

If we match model providers on criteria other than project nature, though, it
does imply that if we do an operation on a project or folder, we need to walk
the tree and search for all matching model providers.
Comment 5 Michael Valenta CLA 2006-01-31 08:51:24 EST
No time left in 3.2 to look at this.
Comment 6 Eclipse Webmaster CLA 2019-09-06 16:04:54 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.