Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » getDictionaryLocation
getDictionaryLocation [message #212628] Mon, 15 August 2005 19:21 Go to next message
Eclipse UserFriend
Originally posted by: ppagee.yahoo.com

Hi!

Can anybody tell me what would this method return on standard Eclipse
3.1 setup:

public static URL getDictionaryLocation() throws MalformedURLException {
final JavaPlugin plugin= JavaPlugin.getDefault();
if (plugin != null)
return plugin.getBundle().getEntry("/" +
DICTIONARY_LOCATION); //$NON-NLS-1$

return null;
}

Where DICTIONARY_LOCATION is "dictionaries/".


Mike
Re: getDictionaryLocation [message #212652 is a reply to message #212628] Tue, 16 August 2005 04:31 Go to previous messageGo to next message
Eclipse UserFriend
That depends on whether you have imported the JDT UI plugin into your
workspace and are running in self-hosting mode.
If you have just installed Eclipse and are calling this method from one of
your plugins, this method returns a URL to a JAR entry (the JDT UI plugin is
a single JAR). If you have imported JDT UI into your workspace and are
running an Eclipse Application, this will give you a file URL to the
"dictionaries" directory in the org.eclipse.jdt.ui plugin project.

Cheers

Tobias

"Mike Mimic" <ppagee@yahoo.com> wrote in message
news:ddr855$mvm$1@news.eclipse.org...
> Hi!
>
> Can anybody tell me what would this method return on standard Eclipse
> 3.1 setup:
>
> public static URL getDictionaryLocation() throws MalformedURLException {
> final JavaPlugin plugin= JavaPlugin.getDefault();
> if (plugin != null)
> return plugin.getBundle().getEntry("/" +
> DICTIONARY_LOCATION); //$NON-NLS-1$
>
> return null;
> }
>
> Where DICTIONARY_LOCATION is "dictionaries/".
>
>
> Mike
Re: getDictionaryLocation [message #212659 is a reply to message #212652] Tue, 16 August 2005 07:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ppagee.yahoo.com

Hi!

Tobias Widmer wrote:
> That depends on whether you have imported the JDT UI plugin into your
> workspace and are running in self-hosting mode.
> If you have just installed Eclipse and are calling this method from one of
> your plugins, this method returns a URL to a JAR entry (the JDT UI plugin is
> a single JAR). If you have imported JDT UI into your workspace and are
> running an Eclipse Application, this will give you a file URL to the
> "dictionaries" directory in the org.eclipse.jdt.ui plugin project.

Thanks for the reply.

This method is called from Eclipse JDT itself (or I at least think so).

I would like to discover where does Eclipse spelling looks for the
dictionaries. So I looked into the source code and found in:

org.eclipse.jdt.internal.ui.text.spelling.SpellCheckEngine

class that it looks into the directory returned by getDictionaryLocation
for them.

So then it is returning the URL to a JAR? But where does
DICTIONARY_LOCATION then come into account?


Mike
Re: getDictionaryLocation [message #212807 is a reply to message #212659] Thu, 18 August 2005 07:12 Go to previous messageGo to next message
Eclipse UserFriend
I have to correct myself. Obviously the method does not return a URL to a
JAR entry, but to the directory where the JAR'ed plugin is located. So the
same is true as with the self-hosting case: Just put your dictionary into a
subdirectory "dictionaries" of the plugin directory. Remember to use the
correct format for the dictionary name (language_COUNTRY.dictionary)

Cheers

Tobias

"Mike Mimic" <ppagee@yahoo.com> wrote in message
news:ddshbd$ud2$1@news.eclipse.org...
> Hi!
>
> Tobias Widmer wrote:
>> That depends on whether you have imported the JDT UI plugin into your
>> workspace and are running in self-hosting mode.
>> If you have just installed Eclipse and are calling this method from one
>> of your plugins, this method returns a URL to a JAR entry (the JDT UI
>> plugin is a single JAR). If you have imported JDT UI into your workspace
>> and are running an Eclipse Application, this will give you a file URL to
>> the "dictionaries" directory in the org.eclipse.jdt.ui plugin project.
>
> Thanks for the reply.
>
> This method is called from Eclipse JDT itself (or I at least think so).
>
> I would like to discover where does Eclipse spelling looks for the
> dictionaries. So I looked into the source code and found in:
>
> org.eclipse.jdt.internal.ui.text.spelling.SpellCheckEngine
>
> class that it looks into the directory returned by getDictionaryLocation
> for them.
>
> So then it is returning the URL to a JAR? But where does
> DICTIONARY_LOCATION then come into account?
>
>
> Mike
Re: getDictionaryLocation [message #212897 is a reply to message #212807] Thu, 18 August 2005 19:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ppagee.yahoo.com

Hi!

Tobias Widmer wrote:
> I have to correct myself. Obviously the method does not return a URL to a
> JAR entry, but to the directory where the JAR'ed plugin is located. So the
> same is true as with the self-hosting case: Just put your dictionary into a
> subdirectory "dictionaries" of the plugin directory. Remember to use the
> correct format for the dictionary name (language_COUNTRY.dictionary)

I have tried but it does not work. I have created "dictionaries"
directory in the "plugins" directory. And there I created a list of
words with "en_UK.dictionary" filename. Eclipse just does not recognize
it.


Mike
Re: getDictionaryLocation [message #212951 is a reply to message #212897] Fri, 19 August 2005 09:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Mike Mimic wrote:

> Hi!
>
> Tobias Widmer wrote:
>
>> I have to correct myself. Obviously the method does not return a URL
>> to a JAR entry, but to the directory where the JAR'ed plugin is
>> located. So the same is true as with the self-hosting case: Just put
>> your dictionary into a subdirectory "dictionaries" of the plugin
>> directory. Remember to use the correct format for the dictionary name
>> (language_COUNTRY.dictionary)
>
>
> I have tried but it does not work. I have created "dictionaries"
> directory in the "plugins" directory. And there I created a list of
> words with "en_UK.dictionary" filename. Eclipse just does not recognize
> it.

You must not add it to the plug-ins directory but to the
'org.eclipse.jdt.ui' plug-in because that's the one who contributes the
spelling engine (Eclipse allows more than one engine).

HTH
Dani

>
>
> Mike
Re: getDictionaryLocation [message #213016 is a reply to message #212951] Sun, 21 August 2005 12:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ppagee.yahoo.com

Hi!

Daniel Megert wrote:
> You must not add it to the plug-ins directory but to the
> 'org.eclipse.jdt.ui' plug-in because that's the one who contributes the
> spelling engine (Eclipse allows more than one engine).

I have added the "dictionaries" directory to the jar and it still does
not find it. I tryed with creating "org.eclipse.jdt.ui_3.1.0" directory
in "plugins" and put it there but with no luck.

I will probably wait until Eclipse ships the dictionary by itself.


Mike
Re: getDictionaryLocation [message #213069 is a reply to message #213016] Mon, 22 August 2005 09:57 Go to previous message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Mike Mimic wrote:

> Hi!
>
> Daniel Megert wrote:
>
>> You must not add it to the plug-ins directory but to the
>> 'org.eclipse.jdt.ui' plug-in because that's the one who contributes
>> the spelling engine (Eclipse allows more than one engine).
>
>
> I have added the "dictionaries" directory to the jar and it still does
> not find it. I tryed with creating "org.eclipse.jdt.ui_3.1.0"
> directory in "plugins" and put it there but with no luck.

This works for me using R3.1. Make sure you use all lower case for the
file, e.g. dictionaries/de_ch.dictionary.
Note: The easiest for you is to simply assign your dictionary as user
dictionary.

Dani

>
> I will probably wait until Eclipse ships the dictionary by itself.
>
>
> Mike
Previous Topic:Installing platform dictionary
Next Topic:How to obtain source folders for a project
Goto Forum:
  


Current Time: Mon Jul 14 09:24:24 EDT 2025

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

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

Back to the top