Community
Participate
Working Groups
One of the things that we do quite a bit is browse the project for a file, so that any file references when we deploy are all relative. And I found your example that mentions the @EclipseWorkspacePath annotation in the Browsing section of the Sapphire Help, which is great if you're dealing with Workspace-relative paths, but not specific enough for Project-relative paths. That led me to poke around with creating a custom class extending BasePathsProviderImpl... but then I stumbled upon ProjectRootBasePathsProvider. Is there a reason this is internal? I know I could simply make a copy of the class and stash it in my own project, but that kind of defeats the purpose.
I will take care of this together with Bug 342099 as all of the code with dependencies on workspace APIs will need to move.
Rather than exposing ProjectRootBasePathsProvider class, I have paralleled the way relative workspace paths are supported with @ProjectRelativePath annotation (org.eclipse.sapphire.workspace plugin). Use this annotation like this: @Type( base = IPath.class ) @ProjectRelativePath @MustExist ValueProperty PROP_PROJECT_RELATIVE_PATH = new ValueProperty( TYPE, "ProjectRelativePath" ); Value<IPath> getProjectRelativePath(); void setProjectRelativePath( String value ); void setProjectRelativePath( IPath value ); For this to work, the model must be based on a resource located in a project, such as when a Sapphire editor is opened on a file in a project. Using @ProjectRelativePath annotation together with @MustExist, @ValidFileSystemResourceType and @ValidFileExtension, gives you validation, browse dialog and jump action (ctrl+click on path to open file). Added an example to gallery sample. Added content to the what's new document in the developer guide. Added TestWorkspace0001 unit test to cover validation. Once you had a chance to move to the newest build and play around with this feature, please make a note of that here so that we can consider this verified and close the bug.
Brian, Could you verify this enhancement? Thanks!
I can look at verifying this when I get back from vacation the middle of next week...
Brian, Will you be able to verify this before our ship date on 6/22?
Yes, I can look at this on Monday and get back to you... (Scribbling it in my list of things to do now...)
(In reply to comment #6) > Yes, I can look at this on Monday and get back to you... (Scribbling it in my > list of things to do now...) Ok... I've added some additional annotations, but am unsure quite how to test this bugger. I'm not seeing any sort of browse dialog show up. My annotations look like this... Have I messed something up? // *** smooks:config *** @XmlBinding( path = "smooks:config" ) @Label( standard = "&Smooks Config" ) @Type( base = IPath.class ) @ProjectRelativePath @Required @ValidFileSystemResourceType( FileSystemResourceType.FILE ) @ValidFileExtensions( "xml" ) @MustExist ValueProperty PROP_TRANSFORM_SMOOKS_CONFIG = new ValueProperty( TYPE, "TransformSmooksConfig" ); Value<IPath> getTransformSmooksConfig(); void setTransformSmooksConfig( String value ); void setTransformSmooksConfig( IPath value );
I'm seeing this in the console: ERROR : Could not find serializer for org.eclipse.core.runtime.IPath. Type is used in org.jboss.tools.esb.switchyard.ITransformSmooks.TransformSmooksConfig.
In 0.3, the use of org.eclipse.core.runtime.IPath in the framework has been replaced with built-in org.eclipse.sapphire.modeling.Path class to break the dependency on Eclipse in core bundles.
(In reply to comment #9) > In 0.3, the use of org.eclipse.core.runtime.IPath in the framework has been > replaced with built-in org.eclipse.sapphire.modeling.Path class to break the > dependency on Eclipse in core bundles. And there is much rejoicing!! Consider this one licked. Thanks for the assistance Konstantin!
Closing as resolved. Thanks for the verification, Brian.