Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 71211 - Resource stings not resolved after update.
Summary: Resource stings not resolved after update.
Status: RESOLVED DUPLICATE of bug 70176
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Update-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-01 21:41 EDT by d CLA
Modified: 2004-08-01 23:32 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description d CLA 2004-08-01 21:41:30 EDT
Have plugin action like so -
<action label="%foo.label"
  class="mycorp.FooAction"
  menubarPath="mycorp.menu1/group1"
  enablesFor="1"
  id="mycorp.restartContainerAction">
</action>
And of course plugin.properties has the string -
  foo.label=Label for Foo action.

Now at runtime I have reason to swith the text of the action between
above text and 'Label Foo sometimes has.'

To accomplish this so that
a.) label is correct before my logic runs
b.) I don't have redundant resource defs in my code.

I use the the normal mechanism for labeling the menu ( what was shown above )
and in conjunction with a method like so -
private void changeLabel()  {
  final String lbl;
  if ( operations[ 0 ].container.isStarted() ) {
    lbl = MyPlugin.getResourceString( "sometimes.foo.label" );
  } else {
lbl = MyPlugin.getPluginResourceString( "%foo.label" );
  }
  this.action.setText( lbl );
  this.action.setEnabled( true );
}
where getPluginResourceString uses Platform.getResourceString( Bundle, String )
to resolve the string and MyPlugin.getResourceStrings resolves the resource 
using the normal Java mechanisms for resolving the resource.

Now the problem, if I use the update mechanism to update an install of my
feature and then shutdown eclipse one of the following symptoms become visible
on restart :
o  foo.label does not resolve ( I see %foo.label in the menu )
o  foo.label resolves but the feature name, feature provider, plugin name, and
   plugin provider fields in the about box are blank for my feature and my 
   plugin.

A couple of final details.
o  My project is a '3.0 only' plugin project.  It did not have a META-INF dir.
   When I added a META-INF\MANIFEST.MF and moved what data I could from
   plugin.xml to MANIFEST.MF the problem went away.  

   I added the MANIFEST.MF because some what I saw during debugging 
   made me think that it might make my problem go away.

o  My project was created with some build that was between m5 and 3.0 final.
   ( Mention this in case projects are always supposed to have MANIFEST.MF. )

And now given all the above, I would say that either
o MANIFEST.MF is required and I should have received some error that it was
  missing, or
o I shouldn't have had any problems at all.
Comment 1 Dorian Birsan CLA 2004-08-01 23:32:24 EDT
It looks like a dup of bug 70176.
I am waiting for some comments from Pascal (who may be on vacation now).

*** This bug has been marked as a duplicate of 70176 ***