Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Text Editor - How it works
Text Editor - How it works [message #50391] Thu, 05 June 2003 10:25 Go to next message
Eclipse UserFriend
Hi,

I need to know how the text editor plug-in is able to act as default editor
for the file that has no editor associated with it.
We can open any file with the text editor using "open with" options in the
popup menu but the text editor won't be the default editor for the files
that has some other editor assigned as default editor.
What is the technical procedure that goes with text editor. If text editor
plug-in is able to it then what is the secret formula that they are
following to do this.
Please explain in details.

MorPheus
Re: Text Editor - How it works [message #51563 is a reply to message #50391] Fri, 06 June 2003 08:11 Go to previous messageGo to next message
Eclipse UserFriend
MorPheus wrote:

> What is the technical procedure that goes with text editor. If text editor
> plug-in is able to it then what is the secret formula that they are
> following to do this.
> Please explain in details.

For the editor I wrote, the magic was in the plugin.xml:

<extension point="org.eclipse.ui.editors">
<editor
name="Wiki Editor"
default="true"
icon="icons/eclipse.gif"
extensions="wiki"

contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor "
class="com.teaminabox.eclipse.wiki.editors.WikiEditor"
id="com.teaminabox.eclipse.wiki.editors.WikiEditor">
</editor>
</extension>

The extensions attribute did the business.

Channing
Re: Text Editor - How it works [message #52364 is a reply to message #51563] Sat, 07 June 2003 10:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
well hope u misunderstand my problem (may be I didn't put in correct
way).I need my editor to act like default editor for all the files
irrespective of file extensions, provided, if that file doesn't have any
editor associated with it.Say for example text editor .Text editor will be a
default editor for all the files that don't have editor associated with
it.If the some other editor is associated for a particular file,then the
file can be still opened using text editor by using open with menu.How to
achieve this kind of functionality.

MorPheus.

"Channing Walton" <channingwalton@mac.com> wrote in message
news:bbq0cr$dg$1@rogue.oti.com...
> MorPheus wrote:
>
> > What is the technical procedure that goes with text editor. If text
editor
> > plug-in is able to it then what is the secret formula that they are
> > following to do this.
> > Please explain in details.
>
> For the editor I wrote, the magic was in the plugin.xml:
>
> <extension point="org.eclipse.ui.editors">
> <editor
> name="Wiki Editor"
> default="true"
> icon="icons/eclipse.gif"
> extensions="wiki"
>
>
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor
"
> class="com.teaminabox.eclipse.wiki.editors.WikiEditor"
> id="com.teaminabox.eclipse.wiki.editors.WikiEditor">
> </editor>
> </extension>
>
> The extensions attribute did the business.
>
> Channing
>
>
>
Re: Text Editor - How it works [message #52727 is a reply to message #52364] Sun, 08 June 2003 12:08 Go to previous messageGo to next message
Eclipse UserFriend
MorPheus wrote:

> Hi,
> well hope u misunderstand my problem (may be I didn't put in correct
> way).I need my editor to act like default editor for all the files
> irrespective of file extensions, provided, if that file doesn't have any
> editor associated with it.Say for example text editor .Text editor will be a
> default editor for all the files that don't have editor associated with
> it.If the some other editor is associated for a particular file,then the
> file can be still opened using text editor by using open with menu.How to
> achieve this kind of functionality.

Sorry Morpheus, I did misunderstand - no idea how to do this.

Channing
Re: Text Editor - How it works [message #52916 is a reply to message #52364] Mon, 09 June 2003 00:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

"MorPheus" <rgurupackiam@selectica.com> wrote in message
news:bbstpe$nmr$1@rogue.oti.com...
> Hi,
> well hope u misunderstand my problem (may be I didn't put in correct
> way).I need my editor to act like default editor for all the files
> irrespective of file extensions, provided, if that file doesn't have any
> editor associated with it.Say for example text editor .Text editor will be
a
> default editor for all the files that don't have editor associated with
> it.If the some other editor is associated for a particular file,then the
> file can be still opened using text editor by using open with menu.How to
> achieve this kind of functionality.

You can't do this reliably. Even if you specify extension as *.* (if this
even works), whenever there are two editors that want to be the default
editor for the same extension, Eclipse arbitrarily picks one. No way I know
of to make sure you're the one.

(If there were a way to do this, I wouldn't install your plugin. Is it just
an ego thing, or what? ;-)

Bob
Re: Text Editor - How it works [message #53146 is a reply to message #52916] Mon, 09 June 2003 07:34 Go to previous messageGo to next message
Eclipse UserFriend
Then How does the text editor achieve this functionality?

Morpheus
"Bob Foster" <bob@objfac.com> wrote in message
news:bc126o$m0d$1@rogue.oti.com...
> "MorPheus" <rgurupackiam@selectica.com> wrote in message
> news:bbstpe$nmr$1@rogue.oti.com...
> > Hi,
> > well hope u misunderstand my problem (may be I didn't put in correct
> > way).I need my editor to act like default editor for all the files
> > irrespective of file extensions, provided, if that file doesn't have any
> > editor associated with it.Say for example text editor .Text editor will
be
> a
> > default editor for all the files that don't have editor associated with
> > it.If the some other editor is associated for a particular file,then the
> > file can be still opened using text editor by using open with menu.How
to
> > achieve this kind of functionality.
>
> You can't do this reliably. Even if you specify extension as *.* (if this
> even works), whenever there are two editors that want to be the default
> editor for the same extension, Eclipse arbitrarily picks one. No way I
know
> of to make sure you're the one.
>
> (If there were a way to do this, I wouldn't install your plugin. Is it
just
> an ego thing, or what? ;-)
>
> Bob
>
>
Re: Text Editor - How it works [message #54086 is a reply to message #53146] Wed, 11 June 2003 03:34 Go to previous message
Eclipse UserFriend
Originally posted by: bob.objfac.com

"MorPheus" <rgurupackiam@selectica.com> wrote in message
news:bc1rb7$4lv$1@rogue.oti.com...
> Then How does the text editor achieve this functionality?

It is hard-coded in EditorRegistry getDefaultEditor() to
IWorkbenchConstants.DEFAULT_EDITOR_ID which is set to
"org.eclipse.ui.DefaultTextEditor" which is registered by the org.eclipse.ui
plugin.

(I had to read the source to get this answer. I highly recommend learning
how to do this for yourself.)

Bob

> Morpheus
> "Bob Foster" <bob@objfac.com> wrote in message
> news:bc126o$m0d$1@rogue.oti.com...
> > "MorPheus" <rgurupackiam@selectica.com> wrote in message
> > news:bbstpe$nmr$1@rogue.oti.com...
> > > Hi,
> > > well hope u misunderstand my problem (may be I didn't put in
correct
> > > way).I need my editor to act like default editor for all the files
> > > irrespective of file extensions, provided, if that file doesn't have
any
> > > editor associated with it.Say for example text editor .Text editor
will
> be
> > a
> > > default editor for all the files that don't have editor associated
with
> > > it.If the some other editor is associated for a particular file,then
the
> > > file can be still opened using text editor by using open with menu.How
> to
> > > achieve this kind of functionality.
> >
> > You can't do this reliably. Even if you specify extension as *.* (if
this
> > even works), whenever there are two editors that want to be the default
> > editor for the same extension, Eclipse arbitrarily picks one. No way I
> know
> > of to make sure you're the one.
> >
> > (If there were a way to do this, I wouldn't install your plugin. Is it
> just
> > an ego thing, or what? ;-)
> >
> > Bob
> >
> >
>
>
Previous Topic:Problem with Eclipse, Tomcat Plug and Apache Commons Logging w/ Log4J
Next Topic:JBuilder to Eclipse migration
Goto Forum:
  


Current Time: Sat Jun 07 20:01:56 EDT 2025

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

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

Back to the top