Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Creating an editor for certain types of xml files(Need to know how to open specific kinds of xml from our own editor as a default behavior)
Creating an editor for certain types of xml files [message #489493] Sun, 04 October 2009 05:26 Go to next message
Saminda Wijeratne is currently offline Saminda WijeratneFriend
Messages: 16
Registered: July 2009
Junior Member
Hi all,

I want to create an formeditor for an xml file which corresponds to a certain schema. And I want it to be the default editor for such files. So far I noticed you can only specify the extension or the filenames of the files that support the editor. since the extension of the file which i want to open from my editor is "xml" and the name of the file can be any valid filesystem name my scenario it seems cannot be handled by normal api.

However I've noticed that files like plugin.xml, feature.xml open in their respective editors regardless their names. for example the feature.xml file if i change it to foobar.xml its default editor is still feature editor. on the other hand if i change the xml content which is not suitable for a feature.xml (change xml tags to different tags), then the default editor bcomes the xml editor. Thus the behavior I want in for my editor also.

Any idea how to do this?

Thanks in advance,
Saminda
Re: Creating an editor for certain types of xml files [message #489575 is a reply to message #489493] Mon, 05 October 2009 05:36 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Saminda Wijeratne wrote:
> I want to create an formeditor for an xml file which corresponds to a
> certain schema.

See org.eclipse.core.contentTypes extension point. You can associate an
editor with the contentType thru the contentTypeBinding in the
o.e.ui.editors extension point.

- Prakash

Platform UI Team, IBM
http://blog.eclipse-tips.com
Re: Creating an editor for certain types of xml files [message #489807 is a reply to message #489493] Tue, 06 October 2009 05:22 Go to previous message
Saminda Wijeratne is currently offline Saminda WijeratneFriend
Messages: 16
Registered: July 2009
Junior Member
Thanx Prakash, It seems to work perfectly. I had missed the describer attribute earlier when I had looked at the extension point.

Thanks again.
Saminda
Previous Topic:Startup Plugin
Next Topic:Creating an editor for certain types of xml files
Goto Forum:
  


Current Time: Fri Mar 29 01:13:53 GMT 2024

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

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

Back to the top