You should override RelativePathService.convertToRelative() method to prefix the leading slash.
- Konstantin
From: sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On Behalf Of Shenxue Zhou
Sent: Tuesday, July 12, 2011 3:43 PM
To: Sapphire project
Subject: Re: [sapphire-dev] Error with ProjectRelativePath
Now that I've got this working, after the "browse" dlg was dismissed, the value of my "Page" property was written as "foo.jsff". But I want the value to be "/foo.jsff", what would be the best way to achieve that? Listener on the property?
Thanks!
Shenxue
From: Konstantin Komissarchik
Sent: Tuesday, July 12, 2011 2:45 PM
To: Sapphire project
Subject: Re: [sapphire-dev] Error with ProjectRelativePath
Common problem. You have to use Sapphire’s version of Path class for the property type, not the one from org.eclipse.core.runtime package.
- Konstantin
From: sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On Behalf Of Shenxue Zhou
Sent: Tuesday, July 12, 2011 1:38 PM
To: Sapphire project
Subject: [sapphire-dev] Error with ProjectRelativePath
I'm trying to use @ProjectRelativePath in order to bring up a file browse dlg for a property. Here is my "Page" property:
// *** Page ***
@Type( base = Path.class )
@XmlBinding( path = "page")
@Label(standard = "page")
@ProjectRelativePath
@ValidFileSystemResourceType( FileSystemResourceType.FILE )
@Services
(
{
@Service( impl = ViewPageValidator.class ),
@Service( impl = PageRelativePathService.class )
}
)
@ValidFileExtensions( "jsff" )
ValueProperty PROP_PAGE = new ValueProperty( TYPE, "Page" );
Value<Path> getPage();
void setPage(String value);
void setPage(Path value);
After I started the debugger, I'm seeing the following error in my console:
ERROR : Could not find serializer for org.eclipse.core.runtime.Path. Type is used in oracle.eclipse.tools.adf.controller.model.IADFView.Page.
And I don't see "browse" button next to the Page property.
Is there anything wrong with the way I used the ProjectRelativePath?