PropertyChangeListener
, VetoableChangeListener
, Serializable
, EventListener
, org.openide.text.CloneableEditorSupport.Env
, org.openide.windows.CloneableOpenSupport.Env
public 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.
|
String |
getMimeType() |
Mime type of the document.
|
Date |
getTime() |
The time when the data has been modified
|
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.
|
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, removeVetoableChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addVetoableChangeListener, findCloneableOpenSupport, firePropertyChange, fireVetoableChange, getDataObject, isModified, isValid, propertyChange, removePropertyChangeListener, removeVetoableChangeListener, toString, vetoableChange
public Env(DataObject obj)
obj
- this support should be associated withprotected abstract org.openide.filesystems.FileObject getFile()
protected abstract org.openide.filesystems.FileLock takeLock() throws IOException
IOException
- if the file cannot be lockedprotected final void changeFile()
public InputStream inputStream() throws IOException
inputStream
in interface org.openide.text.CloneableEditorSupport.Env
IOException
- if an I/O error occurspublic OutputStream outputStream() throws IOException
outputStream
in interface org.openide.text.CloneableEditorSupport.Env
IOException
- if an I/O error occurspublic Date getTime()
getTime
in interface org.openide.text.CloneableEditorSupport.Env
public String getMimeType()
getMimeType
in interface org.openide.text.CloneableEditorSupport.Env
public void markModified() throws 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.Env
markModified
in class OpenSupport.Env
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.Env
unmarkModified
in class OpenSupport.Env
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.