java.io.Serializable, org.openide.text.CloneableEditorSupport.Env, org.openide.windows.CloneableOpenSupport.Envpublic abstract static class DataEditorSupport.Env extends OpenSupport.Env implements org.openide.text.CloneableEditorSupport.Env
| Constructor | Description |
|---|---|
Env(DataObject obj) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
changeFile() |
Method that allows subclasses to notify this environment that
the file associated with this support has changed and that
the environment should listen on modifications of different
file object.
|
protected abstract org.openide.filesystems.FileObject |
getFile() |
Getter for file associated with this environment.
|
java.lang.String |
getMimeType() |
Mime type of the document.
|
java.util.Date |
getTime() |
The time when the data has been modified
|
java.io.InputStream |
inputStream() |
Obtains the input stream.
|
void |
markModified() |
First of all tries to lock the primary file and
if it succeeds it marks the data object modified.
|
java.io.OutputStream |
outputStream() |
Obtains the output stream.
|
protected abstract org.openide.filesystems.FileLock |
takeLock() |
Locks the file.
|
void |
unmarkModified() |
Reverse method that can be called to make the environment
unmodified.
|
addPropertyChangeListener, addVetoableChangeListener, findCloneableOpenSupport, isModified, isValid, removePropertyChangeListener, removeVetoableChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addVetoableChangeListener, findCloneableOpenSupport, firePropertyChange, fireVetoableChange, getDataObject, isModified, isValid, propertyChange, removePropertyChangeListener, removeVetoableChangeListener, toString, vetoableChangepublic Env(DataObject obj)
obj - this support should be associated withprotected abstract org.openide.filesystems.FileObject getFile()
protected abstract org.openide.filesystems.FileLock takeLock()
throws java.io.IOException
java.io.IOException - if the file cannot be lockedprotected final void changeFile()
public java.io.InputStream inputStream()
throws java.io.IOException
inputStream in interface org.openide.text.CloneableEditorSupport.Envjava.io.IOException - if an I/O error occurspublic java.io.OutputStream outputStream()
throws java.io.IOException
outputStream in interface org.openide.text.CloneableEditorSupport.Envjava.io.IOException - if an I/O error occurspublic java.util.Date getTime()
getTime in interface org.openide.text.CloneableEditorSupport.Envpublic java.lang.String getMimeType()
getMimeType in interface org.openide.text.CloneableEditorSupport.Envpublic void markModified()
throws java.io.IOException
Note: There is a contract (better saying a curse)
that this method has to call takeLock() method
in order to keep working some special filesystem's feature.
See issue #28212.
markModified in interface org.openide.windows.CloneableOpenSupport.EnvmarkModified in class OpenSupport.Envjava.io.IOException - if the environment cannot be marked modified
(for example when the file is readonly), when such exception
is the support should discard all previous changesFileObject.isReadOnly()public void unmarkModified()
unmarkModified in interface org.openide.windows.CloneableOpenSupport.EnvunmarkModified in class OpenSupport.EnvBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.