Class RelativePathFileFormat
- java.lang.Object
-
- java.text.Format
-
- io.github.jonestimd.swing.component.RelativePathFileFormat
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class RelativePathFileFormat extends java.text.FormatDisplays the trailing portion of a file's path relative to a base path. The base path is represented by a substitution string.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RelativePathFileFormat(java.io.File basePath)Create a new format using"..."as the replacement forbasePath.RelativePathFileFormat(java.io.File basePath, java.lang.String basePathSubstitute)Create a new format.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBufferformat(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)java.io.FilegetBasePath()java.lang.ObjectparseObject(java.lang.String source, java.text.ParsePosition pos)voidsetBasePath(java.io.File basePath)
-
-
-
Constructor Detail
-
RelativePathFileFormat
public RelativePathFileFormat(java.io.File basePath)
Create a new format using"..."as the replacement forbasePath.- Parameters:
basePath- the path to replace in the output format
-
RelativePathFileFormat
public RelativePathFileFormat(java.io.File basePath, java.lang.String basePathSubstitute)Create a new format.- Parameters:
basePath- the path to replace in the output formatbasePathSubstitute- the string to use as a replacement forbasePath
-
-
Method Detail
-
getBasePath
public java.io.File getBasePath()
-
setBasePath
public void setBasePath(java.io.File basePath)
-
format
public java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)- Specified by:
formatin classjava.text.Format
-
parseObject
public java.lang.Object parseObject(java.lang.String source, java.text.ParsePosition pos)- Specified by:
parseObjectin classjava.text.Format
-
-