Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » enabledWhen: Compare File Name to stored Value
enabledWhen: Compare File Name to stored Value [message #335196] Wed, 25 March 2009 15:32 Go to next message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
Hello,

I have several files of a custom content type residing within a project.
The project-relative path to one of these files is stored as a
persistentProperty on the project.
I also have a PropertyPage and several command handlers that are enabled
when the user selects a project. I'd also like to have these enabled
when the file whose name was stored on the project is selected.

Is there a way to achieve this declaratively? So far I found no mention
on how to compare two such values in the plugin.xml.

Regards,
Damian
Re: enabledWhen: Compare File Name to stored Value [message #335303 is a reply to message #335196] Tue, 31 March 2009 15:59 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There is a property tester for project persistent properties,
org.eclipse.core.resources.projectPersistentProperty. But it can check
for a constant value, not parameterized or work with the current selection.

You would probably have to write your own property tester that looked up
the IResource's projectPersistentProperty and compared it to the
IResource name.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:How to make page closable
Next Topic:Update/Install feature from command line
Goto Forum:
  


Current Time: Thu Jun 27 20:16:40 GMT 2024

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

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

Back to the top