public abstract class AbstractDocumentHandler extends AbstractPathHandler
Path
-based DocumentHandler
s.DataCapabilityProvider
s and adds the found data capabilities to it's local context.PATH_PROPERTY_NAME
Constructor and Description |
---|
AbstractDocumentHandler(String defaultFileExtenion)
Creates a new instance of this class with an unkown (null) document path.
|
AbstractDocumentHandler(String defaultFileExtenion,
Path path)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
String |
getDefaultFileExtenion()
Gets the default file extension for the document type.
|
void |
save()
Saves the content to the file.
|
void |
saveNew(Path newPath)
Saves the content to a file and updates the path property.
|
protected abstract void |
writeContent()
Writes the content to the file.
|
getPath, getTitle, getTooltipText, getUniqueKey, setPath, setUniqueKey
addCloseEventListener, addPropertyChangeListener, close, doClose, fireCloseEvent, getContextContent, getLocalContext, getPropertyChangeSupport, isDirty, isInitialized, markClean, markDirty, removeCloseEventListener, removePropertyChangeListener, setInitialized, toString
public AbstractDocumentHandler(String defaultFileExtenion)
defaultFileExtenion
- the default file extension for the document typepublic String getDefaultFileExtenion()
public void save() throws IOException
IOException
saveNew(java.nio.file.Path)
public void saveNew(Path newPath) throws IOException
newPath
- the new document pathIOException
save()
protected abstract void writeContent() throws IOException
IOException
Copyright © 2012–2019 Drombler. All rights reserved.