Setting content types on a per-project basis [message #329400] |
Mon, 23 June 2008 12:19 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #329402 is a reply to message #329400] |
Mon, 23 June 2008 12:41 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: merks.ca.ibm.com
Sampsa,
I don't think this is possible. The describe method isn't passed the
full path and you can only register against extensions or names, not paths.
Sampsa Toivanen 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.
>
> 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 14:00 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
David Williams![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=david_williams%40acm.org) Messages: 722 Registered: July 2009 |
Senior Member |
|
|
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 08:47 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Prakash G.R.![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=grprakash%40gmail.com) Messages: 621 Registered: July 2009 |
Senior Member |
|
|
> 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.02845 seconds