Assign ".a.b" extention to my editor? [message #335538] |
Tue, 14 April 2009 08:20 |
|
This is a multi-part message in MIME format.
--------------080902000204070301020906
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
For some reason, my client wants to make the *.ui.xml files to open with
a custom editor. But I found that it's no use to config it in the
org.eclipse.ui.editors extention.
I noticed the bug22905's status is still "new". Is there some other way
to achieve what I want?
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=22905>
--
*/Dollyn/*
--------------080902000204070301020906
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
For some reason, my client wants to make the *.ui.xml files to open
with a custom editor. But I found that it's no use to config it in the
org.eclipse.ui.editors extention.<br>
<br>
I noticed the bug22905's status is still "new". Is there some other way
to achieve what I want?<a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=22905"></a>
<div class="moz-signature">-- <br>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; ">
<title>Dollyn</title>
<p><b><i><font color="#0000ff" face="Courier New">Dollyn</font></i></b></p>
</div>
</body>
</html>
--------------080902000204070301020906--
Dollyn
|
|
|
|
Re: Assign ".a.b" extention to my editor? [message #335561 is a reply to message #335542] |
Wed, 15 April 2009 01:35 |
|
This is a multi-part message in MIME format.
--------------000401090705040009020407
Content-Type: text/plain; charset=gb18030; format=flowed
Content-Transfer-Encoding: 7bit
But how? A content type can only define file-extensions and file-names,
but it seems no use to give it "double-extension"(like filenames xx.a.b).
Daniel Megert wrote:
> Dollyn wrote:
>> For some reason, my client wants to make the *.ui.xml files to open
>> with a custom editor. But I found that it's no use to config it in
>> the org.eclipse.ui.editors extention.
>>
>> I noticed the bug22905's status is still "new". Is there some other
>> way to achieve what I want?
> You could define a new content type and hook up your editor to it.
>
> Dani
>> --
>>
>> */Dollyn/*
>>
--
*/Dollyn/*
--------------000401090705040009020407
Content-Type: text/html; charset=gb18030
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=gb18030" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
But how? A content type can only define file-extensions and file-names,
but it seems no use to give it "double-extension"(like filenames
xx.a.b). <br>
<br>
Daniel Megert wrote:
<blockquote cite="mid:gs1lvc$r7v$1@build.eclipse.org" type="cite">Dollyn
wrote:
<br>
<blockquote type="cite">For some reason, my client wants to make the
*.ui.xml files to open with a custom editor. But I found that it's no
use to config it in the org.eclipse.ui.editors extention.
<br>
<br>
I noticed the bug22905's status is still "new". Is there some other way
to achieve what I want?
<br>
</blockquote>
You could define a new content type and hook up your editor to it.
<br>
<br>
Dani
<br>
<blockquote type="cite">--
Dollyn
|
|
|
|
Re: Assign ".a.b" extention to my editor? [message #335615 is a reply to message #335562] |
Thu, 16 April 2009 13:10 |
|
The describer can only get the inputstream, but my files are the same
with normal xml-files, except the file-name.
Daniel Megert 写道:
> Dollyn wrote:
>> But how? A content type can only define file-extensions and
>> file-names, but it seems no use to give it "double-extension"(like
>> filenames xx.a.b).
> Read the extension point doc again with focus on content describer.
>
> Dani
>>
>>
>> Daniel Megert wrote:
>>> Dollyn wrote:
>>>> For some reason, my client wants to make the *.ui.xml files to open
>>>> with a custom editor. But I found that it's no use to config it in
>>>> the org.eclipse.ui.editors extention.
>>>>
>>>> I noticed the bug22905's status is still "new". Is there some other
>>>> way to achieve what I want?
>>> You could define a new content type and hook up your editor to it.
>>>
>>> Dani
>>>> --
>>>>
>>>> */Dollyn/*
>>>>
>>
>> --
>>
>> */Dollyn/*
>>
Dollyn
|
|
|
|
|
|
Re: Assign ".a.b" extention to my editor? [message #335634 is a reply to message #335632] |
Fri, 17 April 2009 05:53 |
|
This is a multi-part message in MIME format.
--------------030700010009020609020407
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Well, this seems not what I want...
Our XML's have nothing in common, no common root's, no common schema...
But thank you all the same. Maybe we can persuade our clients to create
a common schema
for the XML...
Prakash G.R. wrote:
>> What I want is: all and only the files that have the name like *.a.b will
>> be opened with my editor. Is that possible?
>>
>
>
> AFAIK, that is not possible. However, as Dani said, you can use the
> contentTypes extension point. Since your files are XML, you can set the
> content type with the root element of your XML:
>
> <extension
> point="org.eclipse.core.contenttype.contentTypes">
> <content-type
> id="yourXmlTypeId"
> name="Some Name"
> priority="normal">
> <describer
> class=" org.eclipse.core.runtime.content.XMLRootElementContentDescri ber ">
> <parameter
> name="element"
> value="your_root_element">
> </parameter>
> </describer>
> </content-type>
> </extension>
>
>
> Now you can associate this content type with your editor. HTH
>
> - Prakash
>
>
--
*/Dollyn/*
--------------030700010009020609020407
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Well, this seems not what I want...<br>
<br>
Our XML's have nothing in common, no common root's, no common schema...<br>
<br>
But thank you all the same. Maybe we can persuade our clients to create
a common schema<br>
for the XML...<br>
<br>
Prakash G.R. wrote:
<blockquote cite="mid:gs93fi$es6$1@build.eclipse.org" type="cite">
<blockquote type="cite">
<pre wrap="">What I want is: all and only the files that have the name like *.a.b will
be opened with my editor. Is that possible?
</pre>
</blockquote>
<pre wrap=""><!---->
AFAIK, that is not possible. However, as Dani said, you can use the
contentTypes extension point. Since your files are XML, you can set the
content type with the root element of your XML:
<extension
point="org.eclipse.core.contenttype.contentTypes">
<content-type
id="yourXmlTypeId"
name="Some Name"
priority="normal">
<describer
class=" org.eclipse.core.runtime.content.XMLRootElementContentDescri ber ">
<parameter
name="element"
value="your_root_element">
</parameter>
</describer>
</content-type>
</extension>
Now you can associate this content type with your editor. HTH
- Prakash
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; ">
<title>Dollyn</title>
<p><b><i><font color="#0000ff" face="Courier New">Dollyn</font></i></b></p>
</div>
</body>
</html>
--------------030700010009020609020407--
Dollyn
|
|
|
Powered by
FUDForum. Page generated in 0.04257 seconds