Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Wrong editor selected as default (problem with editor or content type definition?)
Wrong editor selected as default (problem with editor or content type definition?) [message #250364] Thu, 27 December 2007 11:44 Go to next message
Eclipse UserFriend
Originally posted by: myawn.ebay.com

I've written my own editor that is intended to be used for a subset of
Java files. I've written a describer class (extends
ITextContentDescriber) that selects only those Java files which extend a
particular base class.

What's happening now is that ALL java files are being opened by my
customized editor, unless specifically overridden by using the Open With
menu item. Furthermore, if I set breakpoints or put logging in my
content describer class, it isn't even being consulted. (More
correctly, it is sometimes invoked for files I haven't attempted to
open, and rarely consulted for files I am attempting to edit, so I
really don't understand the invocation flow of this at all)

I just tried setting 'default="false"' on my editor, but that didn't
change the situation.

Not sure what I'm missing here. My editor is described as:

<extension point="org.eclipse.ui.editors">
<editor class=
" com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor "
contributorClass=
" com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor Contributor "
default="false"
extensions="java"
icon="icons/vcm_persp.gif"
id=
" com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor "

matchingStrategy=" com.ebay.kernel.ede.dal.codegen.plugin.editors.MatchDALGener ated "
name="DAL Generated Code Editor">
<contentTypeBinding
contentTypeId="com.ebay.kernel.ede.dal.codegen.plugin.dalGeneratedJava " />
</editor>
</extension>


and my content type is described as

<extension point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.jdt.core.javaSource"

describer=" com.ebay.kernel.ede.dal.codegen.plugin.contenttypes.Generate dDAOSourceDescriber "
file-extensions="java"
id="com.ebay.kernel.ede.dal.codegen.plugin.dalGeneratedJava "
name="DAO Wizard generated source"
priority="normal"/>
</extension>


Why does the editor get invoked for files that don't match the content type?

Thanks,
Mike
Re: Wrong editor selected as default (problem with editor or content type definition?) [message #250370 is a reply to message #250364] Thu, 27 December 2007 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myawn.ebay.com

Mike Yawn wrote:
> I've written my own editor that is intended to be used for a subset of
> Java files. I've written a describer class (extends
> ITextContentDescriber) that selects only those Java files which extend a
> particular base class.
>
> What's happening now is that ALL java files are being opened by my
> customized editor, unless specifically overridden by using the Open With
> menu item. Furthermore, if I set breakpoints or put logging in my
> content describer class, it isn't even being consulted. (More
> correctly, it is sometimes invoked for files I haven't attempted to
> open, and rarely consulted for files I am attempting to edit, so I
> really don't understand the invocation flow of this at all)
>
> I just tried setting 'default="false"' on my editor, but that didn't
> change the situation.
>
> Not sure what I'm missing here. My editor is described as:
>
> <extension point="org.eclipse.ui.editors">
> <editor class=
> " com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor "
> contributorClass=
> " com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor Contributor "
> default="false"
> extensions="java"
> icon="icons/vcm_persp.gif"
> id=
> " com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor "
>
> matchingStrategy=" com.ebay.kernel.ede.dal.codegen.plugin.editors.MatchDALGener ated "
>
> name="DAL Generated Code Editor">
> <contentTypeBinding
> contentTypeId="com.ebay.kernel.ede.dal.codegen.plugin.dalGeneratedJava " />
> </editor>
> </extension>
>
>
> and my content type is described as
>
> <extension point="org.eclipse.core.contenttype.contentTypes">
> <content-type
> base-type="org.eclipse.jdt.core.javaSource"
>
> describer=" com.ebay.kernel.ede.dal.codegen.plugin.contenttypes.Generate dDAOSourceDescriber "
>
> file-extensions="java"
> id="com.ebay.kernel.ede.dal.codegen.plugin.dalGeneratedJava "
> name="DAO Wizard generated source"
> priority="normal"/>
> </extension>
>
>
> Why does the editor get invoked for files that don't match the content
> type?
>
> Thanks,
> Mike

A few additions/corrections/questions:

- I should have said my class 'implements ITextContentDescriber', not
extends it.
- This is all actually working the way I want when I run in the
runtime workbench. It is only when I package the plugin and install it
in my 'primary' workbench that I see the behavior of using the new
editor for all Java files.
- should this have been posted to platform rather than JDT group?
Re: Wrong editor selected as default (problem with editor or content type definition?) [message #250378 is a reply to message #250370] Thu, 27 December 2007 13:36 Go to previous message
Eclipse UserFriend
Originally posted by: myawn.ebay.com

Fixed this now -- changing the 'default' setting to false was the right
fix. However, I was doing this without incrementing the version number
of the plugin, and did not start with the -clean option, so the change
wasn't taking effect. I didn't realize this until I finally starting
digging through the plug-in registry to see that the settings weren't
the way I expected them to be.

Mike


Mike Yawn wrote:
> Mike Yawn wrote:
>> I've written my own editor that is intended to be used for a subset of
>> Java files. I've written a describer class (extends
>> ITextContentDescriber) that selects only those Java files which extend
>> a particular base class.
>>
>> What's happening now is that ALL java files are being opened by my
>> customized editor, unless specifically overridden by using the Open
>> With menu item. Furthermore, if I set breakpoints or put logging in
>> my content describer class, it isn't even being consulted. (More
>> correctly, it is sometimes invoked for files I haven't attempted to
>> open, and rarely consulted for files I am attempting to edit, so I
>> really don't understand the invocation flow of this at all)
>>
>> I just tried setting 'default="false"' on my editor, but that didn't
>> change the situation.
>>
>> Not sure what I'm missing here. My editor is described as:
>>
>> <extension point="org.eclipse.ui.editors">
>> <editor class=
>> " com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor "
>> contributorClass=
>> " com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor Contributor "
>> default="false"
>> extensions="java"
>> icon="icons/vcm_persp.gif"
>> id=
>> " com.ebay.kernel.ede.dal.codegen.plugin.editors.CodeGenEditor "
>>
>> matchingStrategy=" com.ebay.kernel.ede.dal.codegen.plugin.editors.MatchDALGener ated "
>>
>> name="DAL Generated Code Editor">
>> <contentTypeBinding
>> contentTypeId="com.ebay.kernel.ede.dal.codegen.plugin.dalGeneratedJava "
>> />
>> </editor>
>> </extension>
>>
>>
>> and my content type is described as
>>
>> <extension point="org.eclipse.core.contenttype.contentTypes">
>> <content-type
>> base-type="org.eclipse.jdt.core.javaSource"
>>
>> describer=" com.ebay.kernel.ede.dal.codegen.plugin.contenttypes.Generate dDAOSourceDescriber "
>>
>> file-extensions="java"
>> id="com.ebay.kernel.ede.dal.codegen.plugin.dalGeneratedJava "
>> name="DAO Wizard generated source"
>> priority="normal"/>
>> </extension>
>>
>>
>> Why does the editor get invoked for files that don't match the content
>> type?
>>
>> Thanks,
>> Mike
>
> A few additions/corrections/questions:
>
> - I should have said my class 'implements ITextContentDescriber', not
> extends it.
> - This is all actually working the way I want when I run in the
> runtime workbench. It is only when I package the plugin and install it
> in my 'primary' workbench that I see the behavior of using the new
> editor for all Java files.
> - should this have been posted to platform rather than JDT group?
Previous Topic:APT: Accessing generetad files
Next Topic:Unused dependencies
Goto Forum:
  


Current Time: Wed May 07 08:42:38 EDT 2025

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

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

Back to the top