| Summary: | Support project relative paths | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Brian Fitzpatrick <bfitzpat> |
| Component: | Sapphire | Assignee: | Konstantin Komissarchik <konstantin> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | konstantin |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | plan | ||
|
Description
Brian Fitzpatrick
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. |