ResourceBundle / Completion kills editor [message #211065] |
Mon, 15 March 2004 00:11  |
Eclipse User |
|
|
|
Originally posted by: kylemitchell.txucom.net
Firstly, the whole of my plugin is based on
org.eclipse.ui.examples.javaeditor_3.0.0 on Eclipse 3M7.
The problem lies in the JavaEditorMessages class which i have hacked
only in name for my purposes:
public class XMLEditorMessages
private static ResourceBundle fgResourceBundle = ResourceBundle
..getBundle("XMLTestPlugin.editors.XMLEditorMessages");
....etc...
no matter which way i try to get around it... the bundle is always
null, and crashes the editor.
this is from plugin.xml:
<extension point="org.eclipse.ui.editors">
<editor
name="Test XML Editor"
icon="icons/sample.gif"
extensions="test"
contributorClass="XMLTestPlugin.editors.XMLActionContributor "
class="LearningPlugin.editors.XMLEditor"
id="LearningPlugin.editors.XMLEditor">
</editor>
</extension>
the error triggers:
java.lang.ExceptionInInitializerError at
LearningPlugin.editors.XMLActionContributor.<init>(XMLActionContributor.java:20)
which is the first call to XMLEditorMessages.getResourceBundle():
public XMLActionContributor() {
super();
contentAssistProposal = new RetargetTextEditorAction(XMLEditorMessages
.getResourceBundle(), "ContentAssistProposal.");
the only other class accessing the ResourceBundle in XMLEditorMessages
is the CompletionProcessor for CodeCompletion, and it never gets the chance.
i apologize if this question is misdirected, but my searches haven't
yielded any good information.
All help most appreciated...
|
|
|
Re: ResourceBundle / Completion kills editor [message #212878 is a reply to message #211065] |
Thu, 18 March 2004 09:10  |
Eclipse User |
|
|
|
Originally posted by: ralph.roscrow.net
I have found that the '.property' files must be in the correct place in
the 'jar' file.
How to -
1/ Using the Package Explorer pane, Create a sub-directory in your project
called the first part of your Resource Bundle. In this case two levels of
subdirectory will be required "XMLTestPlugin/editors". This is due to the
"." being replaced as a directory symbol.
2/ Again using the Package Explorer, Create a file within the new
directory called the second part of your Resource Bundle with '.property'
appended to the end. In this case "XMLEditorMessages.property" will need
to go into the "editors" directory. Obviously at some point you will need
to populate the file.
3/ Also from the Package Explorer, Export a Jar file. It should be done
by default but check that the new Folder(s) and File is included in the
Jar.
4/ Deploy the Plugin as usual, by creating a subdirectory for the plugin
in the Eclipse plugin directory and put the Jar and plugin.xml files into
it.
5/ Close down and restart Eclipse.
Limitations -
1/ You cannot use 'Run As -> Run-time Workbench' to test the plugin.
Thanks to Colin Cooper for helping me solve essentially the same problem.
------------------------------------------------------------ ------------
Kyle Mitchell wrote:
> Firstly, the whole of my plugin is based on
> org.eclipse.ui.examples.javaeditor_3.0.0 on Eclipse 3M7.
> The problem lies in the JavaEditorMessages class which i have hacked
> only in name for my purposes:
> public class XMLEditorMessages
> private static ResourceBundle fgResourceBundle = ResourceBundle
> ..getBundle("XMLTestPlugin.editors.XMLEditorMessages");
> ....etc...
> no matter which way i try to get around it... the bundle is always
> null, and crashes the editor.
> this is from plugin.xml:
> <extension point="org.eclipse.ui.editors">
> <editor
> name="Test XML Editor"
> icon="icons/sample.gif"
> extensions="test"
> contributorClass="XMLTestPlugin.editors.XMLActionContributor "
> class="LearningPlugin.editors.XMLEditor"
> id="LearningPlugin.editors.XMLEditor">
> </editor>
> </extension>
> the error triggers:
> java.lang.ExceptionInInitializerError at
>
LearningPlugin.editors.XMLActionContributor.<init>(XMLActionContributor.java:20)
> which is the first call to XMLEditorMessages.getResourceBundle():
> public XMLActionContributor() {
> super();
> contentAssistProposal = new RetargetTextEditorAction(XMLEditorMessages
> .getResourceBundle(), "ContentAssistProposal.");
> the only other class accessing the ResourceBundle in XMLEditorMessages
> is the CompletionProcessor for CodeCompletion, and it never gets the chance.
> i apologize if this question is misdirected, but my searches haven't
> yielded any good information.
> All help most appreciated...
|
|
|
Powered by
FUDForum. Page generated in 0.03033 seconds