| Assign ".a.b" extention  to my editor? [message #335538] | 
Tue, 14 April 2009 04:20   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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--
 |  
 |  
  | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
| Re: Assign ".a.b" extention  to my editor? [message #335634 is a reply to message #335632] | 
Fri, 17 April 2009 01:53   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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--
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.06116 seconds