Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sapphire-dev] browse for file relative to file being editied

> Perhaps we could add a new class called @PathProvider that would delegate the

> "resolution" of the path.  And the browse action handler would just open the

> absolute file dialog and simply pass the selected file into the PathProvider to

> build the correct path.  Then any custom rules like the one that I have in my

> current requirement could be made.

 

Something like this...

 

RelativePathService

{

      String convertToRelative( Path path );

      Path convertFromRelative( String path );

}


That looks good to me and it would certainly do the trick.
 

 

> Ok, if you don't think that extending existing path provider services to include

> this new method is the right way to go, I'm totally file using a handler + validation

> service to get this functionality.

 

Not saying that I am not interested in extending the out-of-box capabilities. I am always interested. Just wanted you to know that there is a way to do this right now so that you don’t get blocked. Go ahead an open an enhancement request and let’s continue this discussion there.


Oh I didn't think you weren't interested, I was just trying to couch my request with a caveat so you didn't think I was trying to be demanding :) I appreciate your team being very considerate of adopter's needs thus far.
 

 

- Konstantin

 

 

 

From: sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On Behalf Of Greg Amerson
Sent: Friday, May 13, 2011 10:47 AM
To: Sapphire project
Subject: Re: [sapphire-dev] browse for file relative to file being editied

 

This is currently not possible with @BasePathsProvider. This feature assumes that the selected path will be contained by one of the base paths. This assumption is most evident in the nature of the browse dialog that you get. We probably should support both behaviors. Maybe a flag on @BasePathProvider? If parent navigation is allowed, then I guess we would use native browse dialogs instead of the constrained relative path dialogs that we currently use with this feature.

 

Perhaps we could add a new class called @PathProvider that would delegate the "resolution" of the path.  And the browse action handler would just open the absolute file dialog and simply pass the selected file into the PathProvider to build the correct path.  Then any custom rules like the one that I have in my current requirement could be made.

 

 

Some other questions to consider…

 

1. Is this actually a scenario where an absolute path or a relative path would be ok? Think of the case where otherfile.xml is on a different drive letter and there is no way to write a relative path from the current location.

 

In my case only a relative path that can be properly appended to the value of the current parent directory of the XML file being edited makes sense.  So something spanning two different drives would not work.

 

 

2. Does there need to be a limit of how far parent navigation can traverse? Numeric limit? Semantic limit (ie, can only go as far as project root)?

 

No limit as long as it doesn't go past the current filesystem root, i.e. spanning drives on windows would not make sense.

 

 

Note that you can implement your own browse action handler and validation service to solve this within the scope of current capabilities.

 

Ok, if you don't think that extending existing path provider services to include this new method is the right way to go, I'm totally file using a handler + validation service to get this functionality.

 

 

- Konstantin

 

 

From: sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On Behalf Of Greg Amerson
Sent: Friday, May 13, 2011 8:28 AM
To: Sapphire project
Subject: [sapphire-dev] browse for file relative to file being editied

 

Hey,

 

Lets say I have a property where I want to specify a Path that will be relative to the current file being edited.  So if the other file is in the same directory it would be resolve "otherfile.xml" and if the other file is in a parent directory it would resolve to "../otherfile.xml" and if its in a sibling directory it would resolve "../otherdir/otherfile.xml".   Is this possible using the @BasePathProvider?

--
Greg Amerson
Liferay, Inc.


_______________________________________________
sapphire-dev mailing list
sapphire-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/sapphire-dev




--
Greg Amerson
Liferay, Inc.


_______________________________________________
sapphire-dev mailing list
sapphire-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/sapphire-dev




--
Greg Amerson
Liferay, Inc.

Back to the top