Setting content types on a per-project basis [message #329400] |
Mon, 23 June 2008 08:19  |
Eclipse User |
|
|
|
Originally posted by: sampsa.toivanen.hiq.fi
Hi,
in Eclipse 3.3.0, is there a way to specify content type preferences
(Preferences / General / Content Types) independently for each project in
the same workspace? We need to specify character encoding for files
depending on both their file name suffix and the project they belong to.
Setting text file encoding in project properties (Project / Properties /
Resource) is not enough because we need to set the encoding separately for
each file name suffix.
With best regards,
Sampsa Toivanen
|
|
|
|
Re: Setting content types on a per-project basis [message #329410 is a reply to message #329400] |
Mon, 23 June 2008 10:00   |
Eclipse User |
|
|
|
On Mon, 23 Jun 2008 08:19:05 -0400, Sampsa Toivanen <sampsa.toivanen@hiq.fi> wrote:
> Hi,
>
> in Eclipse 3.3.0, is there a way to specify content type preferences
> (Preferences / General / Content Types) independently for each project in
> the same workspace? We need to specify character encoding for files
> depending on both their file name suffix and the project they belong to.
>
......
I'm not sure this does exactly what you want, but you might be able to re-think
your situation with this info ...
In help, under Project Natures of all places! :)
<quote>
Starting with release 3.1, natures can declare affinity with arbitrary content types, affecting the way content type determination happens for files in the workspace. In case of conflicts (two or more content types deemed equally suitable for a given file), the content type having affinity with any of the natures configured for the corresponding project will be chosen.
</quote>
In other words, the project nature can be used as "hint" as to which content type get's "picked" by the content type manager.
There is also a way (somewhere, I forget where) where a content type can be associcated with an exact filename, if that helps (I think that's done for "build.xml", assuming it's always an ant content type).
|
|
|
Re: Setting content types on a per-project basis [message #329434 is a reply to message #329410] |
Tue, 24 June 2008 04:47  |
Eclipse User |
|
|
|
> There is also a way (somewhere, I forget where) where a content type
can be associcated with an exact filename, if that helps (I think that's
done for "build.xml", assuming it's always an ant content type)
Its available in the contentType extension itself - the file-names
attribute. Alternatively the file-association extension point can be
used to bind a content type with a file name/extension
> In other words, the project nature can be used as "hint" as to which
content type get's "picked" by the content type manager.
This sounds interesting. I was under the assumption that content-type
is generic(not tied to workspace resources) and applied to any stream.
Can you explain how this hint thing works?
- Prakash
www.eclipse-tips.com
David Williams wrote:
> On Mon, 23 Jun 2008 08:19:05 -0400, Sampsa Toivanen <sampsa.toivanen@hiq.fi> wrote:
>
>> Hi,
>>
>> in Eclipse 3.3.0, is there a way to specify content type preferences
>> (Preferences / General / Content Types) independently for each project in
>> the same workspace? We need to specify character encoding for files
>> depending on both their file name suffix and the project they belong to.
>>
> ......
>
> I'm not sure this does exactly what you want, but you might be able to re-think
> your situation with this info ...
>
> In help, under Project Natures of all places! :)
> <quote>
> Starting with release 3.1, natures can declare affinity with arbitrary content types, affecting the way content type determination happens for files in the workspace. In case of conflicts (two or more content types deemed equally suitable for a given file), the content type having affinity with any of the natures configured for the corresponding project will be chosen.
> </quote>
>
> In other words, the project nature can be used as "hint" as to which content type get's "picked" by the content type manager.
>
> There is also a way (somewhere, I forget where) where a content type can be associcated with an exact filename, if that helps (I think that's done for "build.xml", assuming it's always an ant content type).
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02446 seconds