Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » What is a content type??
What is a content type?? [message #326506] Fri, 21 March 2008 08:08 Go to next message
No real name is currently offline No real nameFriend
Messages: 64
Registered: July 2009
Member
hi all?

I have lot of difficul to understand what is a content type?

http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. jdt.doc.isv/reference/api/org/eclipse/jdt/ui/text/JavaSource ViewerConfiguration.html

the sourceviewer use it but what is it? when use it that? it s may be
cause my english is not good but if someone can me explain that simply
(or show me a site), it's will be cool.

thanks

a++
Re: What is a content type?? [message #326511 is a reply to message #326506] Fri, 21 March 2008 08:31 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060803060206060108070800
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Julien,

Content-types are a way for Eclipse to define what a given file contains
: build.properties defines which files must be built along with your
plug-in, *.xml may contain models ...

I don't really know if the Eclipse wiki contains some information about
content-type, but http://www.developer.com/java/data/article.php/3648736
may help even if it mainly describes how to define a new content-type.

Cheers,
Laurent

julien a
Re: What is a content type?? [message #326538 is a reply to message #326506] Sun, 23 March 2008 15:52 Go to previous messageGo to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
julien wrote:
> hi all?
>
> I have lot of difficul to understand what is a content type?
>
> http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. jdt.doc.isv/reference/api/org/eclipse/jdt/ui/text/JavaSource ViewerConfiguration.html
>
>
> the sourceviewer use it but what is it? when use it that? it s may be
> cause my english is not good but if someone can me explain that simply
> (or show me a site), it's will be cool.
>
> thanks
>
> a++

In the text editing world of Eclipse, there are content types
(synonymously as partitions) and then there are partitionings.

A content type or a partition is basically a special region in the text
that an editor deals with. For example the comment text in C/C++ or
Java is a content type, thus having different coloring, usually light
green. By defining a content type (special regions of text), you can do
special things for each of the content type. Another example, content
assist is activated when the content type is not comments in the code.
With content types (or partition types, if you will) can you working
each region of the text accordingly, formatting, coloring, text
hovering, etc.

Partitioning is basically a collection of content types. An editor's
model, the IDocument, is associated to a partitioning. Usually, the
partitioning id is basically the IDocument.DEFAULT_PARTITIONING that is
used to reference the set of partitions or content types that you
registered in the source viewer. You can define your partitioning, thus
providing a specific partition scanner, etc.

See AbstractedDocument class and read about the text framework. That
should clear up some questions.
Re: What is a content type?? [message #326558 is a reply to message #326511] Tue, 25 March 2008 10:49 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
laurent Goubet wrote:
> Julien,
>
> Content-types are a way for Eclipse to define what a given file
> contains : build.properties defines which files must be built along
> with your plug-in, *.xml may contain models ...
This is not related. The text framework has its own content types. See
AL's post.

Dani
>
> I don't really know if the Eclipse wiki contains some information
> about content-type, but
> http://www.developer.com/java/data/article.php/3648736 may help even
> if it mainly describes how to define a new content-type.
>
> Cheers,
> Laurent
>
> julien a écrit :
>> hi all?
>>
>> I have lot of difficul to understand what is a content type?
>>
>> http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. jdt.doc.isv/reference/api/org/eclipse/jdt/ui/text/JavaSource ViewerConfiguration.html
>>
>>
>> the sourceviewer use it but what is it? when use it that? it s may be
>> cause my english is not good but if someone can me explain that
>> simply (or show me a site), it's will be cool.
>>
>> thanks
>>
>> a++
>
Re: What is a content type?? [message #326602 is a reply to message #326558] Wed, 26 March 2008 09:00 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020005010808070505090005
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Daniel,

Sorry, didn't know there was two things going by nearly the same name (bow).

Laurent Goubet
Obeo

Daniel Megert a
Previous Topic:IFile to String and back to IFile
Next Topic:External Tool Builders isn't executed "During manual builds and auto build
Goto Forum:
  


Current Time: Thu Dec 26 17:42:43 GMT 2024

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

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

Back to the top