Skip to main content



      Home
Home » Newcomers » Newcomers » Created editor plugin; Eclipse does not see it
Created editor plugin; Eclipse does not see it [message #526460] Sun, 11 April 2010 09:32 Go to next message
Eclipse UserFriend
Going through textbooks and tutorials to set up an editor for my own mini-language. The plugin.xml file looks good and indicates that the "x" file extension is there. Used "Plug-in with an editor" to generate the code, then added code as directed by my sources.

Shut down Eclipse (3.5.2), re-started it, but if I start editing a new file and give it the name foo.x, Eclipse pulls up NotePad instead of my editor.

My plugin files got put in the MyDocuments/..../workspace directory tree on this Windows XP machine. Copying that directory to the eclipse/plugins tree makes no difference.

Any ideas are appreciated.
Re: Created editor plugin; Eclipse does not see it [message #526505 is a reply to message #526460] Sun, 11 April 2010 20:56 Go to previous messageGo to next message
Eclipse UserFriend
Clark wrote:
> Going through textbooks and tutorials to set up an editor for my own
> mini-language. The plugin.xml file looks good and indicates that the "x"
> file extension is there. Used "Plug-in with an editor" to generate the
> code, then added code as directed by my sources.
>
> Shut down Eclipse (3.5.2), re-started it, but if I start editing a new
> file and give it the name foo.x, Eclipse pulls up NotePad instead of my
> editor.
>
> My plugin files got put in the MyDocuments/..../workspace directory tree
> on this Windows XP machine. Copying that directory to the
> eclipse/plugins tree makes no difference.
>
> Any ideas are appreciated.
>

There are two things you might need to do.

First, for Eclipse 3.4 and later, you can't just put a plugin into the
eclipse/plugins tree; to "drop in" a plugin like this, you need to put it into
eclipse/dropins. The preferred way is to install the plugin using the software
update manager; to do this you need to create a repository (which is just a
location somewhere that contains your plugin and an XML file that describes it),
and then plugins installed that way will automatically go into eclipse/plugins.
You shouldn't ever put something into eclipse/plugins manually. Again, that's
a change from previous versions of Eclipse, so it's possible that the textbooks
and tutorials you're using haven't caught up.

While you're just debugging your plugin, though, you shouldn't need to copy it
anywhere at all. Rather, you would launch a second 'target' instance of
Eclipse, using Run As... or Debug As... Eclipse Application. That target
instance will load the plugin from your host workspace. That way you can test
and debug the plugin without risking unexpected effects on your host workspace
and Eclipse instance. (Imagine, for instance, that you made a mistake in your
plugin that caused Eclipse to not be able to edit Java code. If you'd deployed
the plugin to your host instance, how would you then fix it?) Only install the
plugin in your host instance when you're sure it's working and you're ready to
be a user rather than a developer.

And by the way, if you do install a plugin by whatever means, and you then edit
and re-deploy the plugin without changing its version number, you should run
"eclipse -clean" to get rid of any cached copies of the plugin's contents.
Otherwise you might be running old code, which can be very confusing.

Second, you might need to change your file associations in Window -> Preferences
-> General -> File Associations (I think that's the right spot, you can just
type "file associations" into the search field to find it), to direct the 'x'
extension to your new plugin. I know that step is necessary if the file
extension is already claimed by another plugin; I don't know if it's needed for
a new file extension such as yours.
Re: Created editor plugin; Eclipse does not see it [message #527300 is a reply to message #526505] Wed, 14 April 2010 13:53 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the helpful info. A few followup?

1) I cannot do the file associations step until the plugin is deployed, or so it seems. If I try, the plugin is not in the list of available plugins to associate with the file type.

2) The "ec;lipse -clean" looks like a Linux command. I am running Eclipse on WIndows XP. Is there something similar to do under Windows?

Thanks for the input. The textbook I have says it was updated for Eclipse 3.4, but not enough. Some of the code does not work. For example, they advise the same source code for the editor init() method as you can see in this online tutorial:

http://www.eclipsepluginsite.com/editors.html

Namely:

public void init(IEditorSite site, IEditorInput editorInput)
throws PartInitException {
if (!(editorInput instanceof IFileEditorInput))
throw new PartInitException("Invalid Input: Must be IFileEditorInput");
super.init(site, editorInput);
}

However, when I create a fubar.x file, run my editor as an Eclipse application, and use Open File to open it. I get the "Invalid Input: Must be IFileEditorInput" error message. I would think that a disk file would come in as an instance of IFileEditorInput, right? Or has this changed in Eclipse 3.5.2?

Thanks for any help.
Re: Created editor plugin; Eclipse does not see it [message #529333 is a reply to message #526505] Fri, 23 April 2010 16:41 Go to previous message
Eclipse UserFriend
The reference book I am using seems to recommend deploying plugins by using link files. (Clayberg and Rubel, Eclipse Plugins, 3rd edition, page 111). Is this outdated in any way?

Previous Topic:Eclipse Galileo plugins not loading
Next Topic:How to invoke a specific method only (solved)
Goto Forum:
  


Current Time: Sun Oct 19 17:25:36 EDT 2025

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

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

Back to the top