Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Determining editor file content
Determining editor file content [message #239837] Wed, 17 January 2007 11:23 Go to next message
Eclipse UserFriend
Originally posted by: barrys.aciworldwide.com

I have written a custom editor plugin as an extension to
org.eclipse.ui.editors for a proprietary script language so that I can
colourise the code. This works OK provided that the source files I am
editing have a file extension and I add this file extension to the
'extensions' property of my editor extension. Then any files with this
extension display my custom icon in the Navigator and when I right click
on such a file, my new editor appears as an option under the list
displayed by Open With - exactly as I would expect.

The problem I have is that I also require to be able to use this editor
with a set of existing files which do not have a file extension and it is
not possible for me to change the file names. Eclipse books that I have
read suggest that I could solve this either by specifying a
matchingStrategy class that implements IEditorMatchingStrategy or by
adding contentTypeBinding subelements pointing to my own content types and
implement an ITextContentDescriber class. I have attempted to do both of
these things but without success and trawling the Internet I have been
unable to find any examples of how to do this or any further information
other than that contained in the Javadoc.

Can anyone help by providing me some examples of either technique please?
Re: Determining editor file content [message #239870 is a reply to message #239837] Thu, 18 January 2007 04:49 Go to previous messageGo to next message
Eclipse UserFriend
Stuart Barry wrote:

> I have written a custom editor plugin as an extension to
> org.eclipse.ui.editors for a proprietary script language so that I can
> colourise the code. This works OK provided that the source files I am
> editing have a file extension and I add this file extension to the
> 'extensions' property of my editor extension. Then any files with this
> extension display my custom icon in the Navigator and when I right
> click on such a file, my new editor appears as an option under the
> list displayed by Open With - exactly as I would expect.
>
> The problem I have is that I also require to be able to use this
> editor with a set of existing files which do not have a file extension
> and it is not possible for me to change the file names. Eclipse books
> that I have read suggest that I could solve this either by specifying
> a matchingStrategy class that implements IEditorMatchingStrategy or by
> adding contentTypeBinding subelements pointing to my own content types
> and implement an ITextContentDescriber class. I have attempted to do
> both of these things but without success and trawling the Internet I
> have been unable to find any examples of how to do this or any further
> information other than that contained in the Javadoc.
>
> Can anyone help by providing me some examples of either technique please?
>
Maybe you find some hints in the corresponding bug report:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=46297

Dani
Re: Determining editor file content [message #239896 is a reply to message #239870] Fri, 19 January 2007 03:56 Go to previous message
Eclipse UserFriend
Originally posted by: barrys.aciworldwide.com

Thanks for the suggestion but unfortunately this did not help. From this
bug report it looks as though it might still be an outstanding bug. Anyone
else got any ideas?
Previous Topic:Eclipse Standalone Formatter
Next Topic:Bundling jar files into an app jar
Goto Forum:
  


Current Time: Thu May 01 06:37:49 EDT 2025

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

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

Back to the top